Updating Gallery for Moose.
This commit is contained in:
parent
dc2d086b2a
commit
44f03502b6
2 changed files with 542 additions and 537 deletions
|
|
@ -15,7 +15,134 @@ package WebGUI::Asset::Wobject::EventManagementSystem;
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use base 'WebGUI::Asset::Wobject';
|
use WebGUI::Definition::Asset;
|
||||||
|
extends 'WebGUI::Asset::Wobject';
|
||||||
|
aspect assetName => ['assetName', 'Asset_EventManagementSystem'];
|
||||||
|
aspect icon => 'ems.gif';
|
||||||
|
aspect tableName => 'EventManagementSystem';
|
||||||
|
property timezone => (
|
||||||
|
fieldType => 'TimeZone',
|
||||||
|
default => 'America/Chicago',
|
||||||
|
tab => 'properties',
|
||||||
|
label => ['time zone', 'Asset_EventManagementSystem'],
|
||||||
|
hoverHelp => ['time zone help', 'Asset_EventManagementSystem'],
|
||||||
|
);
|
||||||
|
property templateId => (
|
||||||
|
fieldType => 'template',
|
||||||
|
default => '2rC4ErZ3c77OJzJm7O5s3w',
|
||||||
|
tab => 'display',
|
||||||
|
label => ['main template', 'Asset_EventManagementSystem'],
|
||||||
|
hoverHelp => ['main template help', 'Asset_EventManagementSystem'],
|
||||||
|
namespace => 'EMS',
|
||||||
|
);
|
||||||
|
property scheduleTemplateId => (
|
||||||
|
fieldType => 'template',
|
||||||
|
default => 'S2_LsvVa95OSqc66ITAoig',
|
||||||
|
tab => 'display',
|
||||||
|
label => ['schedule template', 'Asset_EventManagementSystem'],
|
||||||
|
hoverHelp => ['schedule template help', 'Asset_EventManagementSystem'],
|
||||||
|
namespace => 'EMS',
|
||||||
|
);
|
||||||
|
property scheduleColumnsPerPage => (
|
||||||
|
fieldType => 'Integer',
|
||||||
|
default => '5',
|
||||||
|
tab => 'display',
|
||||||
|
label => ['schedule number of columns', 'Asset_EventManagementSystem'],
|
||||||
|
hoverHelp => ['schedule number of columns help', 'Asset_EventManagementSystem'],
|
||||||
|
);
|
||||||
|
property badgeBuilderTemplateId => (
|
||||||
|
fieldType => 'template',
|
||||||
|
default => 'BMybD3cEnmXVk2wQ_qEsRQ',
|
||||||
|
tab => 'display',
|
||||||
|
label => ['badge builder template', 'Asset_EventManagementSystem'],
|
||||||
|
hoverHelp => ['badge builder template help', 'Asset_EventManagementSystem'],
|
||||||
|
namespace => 'EMS/BadgeBuilder',
|
||||||
|
);
|
||||||
|
property lookupRegistrantTemplateId => (
|
||||||
|
fieldType => 'template',
|
||||||
|
default => 'OOyMH33plAy6oCj_QWrxtg',
|
||||||
|
tab => 'display',
|
||||||
|
label => ['lookup registrant template', 'Asset_EventManagementSystem'],
|
||||||
|
hoverHelp => ['lookup registrant template help', 'Asset_EventManagementSystem'],
|
||||||
|
namespace => 'EMS/LookupRegistrant',
|
||||||
|
);
|
||||||
|
property printBadgeTemplateId => (
|
||||||
|
fieldType => 'template',
|
||||||
|
default => 'PsFn7dJt4wMwBa8hiE3hOA',
|
||||||
|
tab => 'display',
|
||||||
|
label => ['print badge template', 'Asset_EventManagementSystem'],
|
||||||
|
hoverHelp => ['print badge template help', 'Asset_EventManagementSystem'],
|
||||||
|
namespace => 'EMS/PrintBadge',
|
||||||
|
);
|
||||||
|
property printTicketTemplateId => (
|
||||||
|
fieldType => 'template',
|
||||||
|
default => 'yBwydfooiLvhEFawJb0VTQ',
|
||||||
|
tab => 'display',
|
||||||
|
label => ['print ticket template', 'Asset_EventManagementSystem'],
|
||||||
|
hoverHelp => ['print ticket template help', 'Asset_EventManagementSystem'],
|
||||||
|
namespace => 'EMS/PrintTicket',
|
||||||
|
);
|
||||||
|
property badgeInstructions => (
|
||||||
|
fieldType => 'HTMLArea',
|
||||||
|
builder => '_badgeInstructions_builder',
|
||||||
|
lazy => 1,
|
||||||
|
tab => 'properties',
|
||||||
|
label => ['badge instructions', 'Asset_EventManagementSystem'],
|
||||||
|
hoverHelp => ['badge instructions help', 'Asset_EventManagementSystem'],
|
||||||
|
);
|
||||||
|
sub _badgeInstructions_builder {
|
||||||
|
my $session = shift->session;
|
||||||
|
my $i18n = WebGUI::International->new($session, 'Asset_EventMangementSystem');
|
||||||
|
return $i18n->get('default badge instructions');
|
||||||
|
}
|
||||||
|
property ticketInstructions => (
|
||||||
|
fieldType => 'HTMLArea',
|
||||||
|
builder => '_ticketInstructions_builder',
|
||||||
|
lazy => 1,
|
||||||
|
tab => 'properties',
|
||||||
|
label => ['ticket instructions', 'Asset_EventManagementSystem'],
|
||||||
|
hoverHelp => ['ticket instructions help', 'Asset_EventManagementSystem'],
|
||||||
|
);
|
||||||
|
sub _ticketInstructions_builder {
|
||||||
|
my $session = shift->session;
|
||||||
|
my $i18n = WebGUI::International->new($session, 'Asset_EventMangementSystem');
|
||||||
|
return $i18n->get('default ticket instructions');
|
||||||
|
}
|
||||||
|
property ribbonInstructions => (
|
||||||
|
fieldType => 'HTMLArea',
|
||||||
|
builder => '_ribbonInstructions_builder',
|
||||||
|
lazy => 1,
|
||||||
|
tab => 'properties',
|
||||||
|
label => ['ribbon instructions', 'Asset_EventManagementSystem'],
|
||||||
|
hoverHelp => ['ribbon instructions help', 'Asset_EventManagementSystem'],
|
||||||
|
);
|
||||||
|
sub _ribbonInstructions_builder {
|
||||||
|
my $session = shift->session;
|
||||||
|
my $i18n = WebGUI::International->new($session, 'Asset_EventMangementSystem');
|
||||||
|
return $i18n->get('default ribbon instructions');
|
||||||
|
}
|
||||||
|
property tokenInstructions => (
|
||||||
|
fieldType => 'HTMLArea',
|
||||||
|
builder => '_tokenInstructions_builder',
|
||||||
|
lazy => 1,
|
||||||
|
tab => 'properties',
|
||||||
|
label => ['token instructions', 'Asset_EventManagementSystem'],
|
||||||
|
hoverHelp => ['token instructions help', 'Asset_EventManagementSystem'],
|
||||||
|
);
|
||||||
|
sub _tokenInstructions_builder {
|
||||||
|
my $session = shift->session;
|
||||||
|
my $i18n = WebGUI::International->new($session, 'Asset_EventMangementSystem');
|
||||||
|
return $i18n->get('default token instructions');
|
||||||
|
}
|
||||||
|
property registrationStaffGroupId => (
|
||||||
|
fieldType => 'group',
|
||||||
|
default => 3,
|
||||||
|
tab => 'security',
|
||||||
|
label => ['registration staff group', 'Asset_EventManagementSystem'],
|
||||||
|
hoverHelp => ['registration staff group help', 'Asset_EventManagementSystem'],
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
use Digest::MD5;
|
use Digest::MD5;
|
||||||
use JSON;
|
use JSON;
|
||||||
use Text::CSV_XS;
|
use Text::CSV_XS;
|
||||||
|
|
@ -31,128 +158,9 @@ use WebGUI::HTMLForm;
|
||||||
use WebGUI::International;
|
use WebGUI::International;
|
||||||
use WebGUI::Utility;
|
use WebGUI::Utility;
|
||||||
use WebGUI::Workflow::Instance;
|
use WebGUI::Workflow::Instance;
|
||||||
use Tie::IxHash;
|
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
|
||||||
sub definition {
|
|
||||||
my $class = shift;
|
|
||||||
my $session = shift;
|
|
||||||
my $definition = shift;
|
|
||||||
my %properties;
|
|
||||||
tie %properties, 'Tie::IxHash';
|
|
||||||
my $i18n = WebGUI::International->new($session,'Asset_EventManagementSystem');
|
|
||||||
%properties = (
|
|
||||||
timezone => {
|
|
||||||
fieldType => 'TimeZone',
|
|
||||||
defaultValue => 'America/Chicago',
|
|
||||||
tab => 'properties',
|
|
||||||
label => $i18n->get('time zone'),
|
|
||||||
hoverHelp => $i18n->get('time zone help'),
|
|
||||||
},
|
|
||||||
templateId => {
|
|
||||||
fieldType => 'template',
|
|
||||||
defaultValue => '2rC4ErZ3c77OJzJm7O5s3w',
|
|
||||||
tab => 'display',
|
|
||||||
label => $i18n->get('main template'),
|
|
||||||
hoverHelp => $i18n->get('main template help'),
|
|
||||||
namespace => 'EMS',
|
|
||||||
},
|
|
||||||
scheduleTemplateId => {
|
|
||||||
fieldType => 'template',
|
|
||||||
defaultValue => 'S2_LsvVa95OSqc66ITAoig',
|
|
||||||
tab => 'display',
|
|
||||||
label => $i18n->get('schedule template'),
|
|
||||||
hoverHelp => $i18n->get('schedule template help'),
|
|
||||||
namespace => 'EMS',
|
|
||||||
},
|
|
||||||
scheduleColumnsPerPage => {
|
|
||||||
fieldType => 'Integer',
|
|
||||||
defaultValue => '5',
|
|
||||||
tab => 'display',
|
|
||||||
label => $i18n->get('schedule number of columns'),
|
|
||||||
hoverHelp => $i18n->get('schedule number of columns help'),
|
|
||||||
},
|
|
||||||
badgeBuilderTemplateId => {
|
|
||||||
fieldType => 'template',
|
|
||||||
defaultValue => 'BMybD3cEnmXVk2wQ_qEsRQ',
|
|
||||||
tab => 'display',
|
|
||||||
label => $i18n->get('badge builder template'),
|
|
||||||
hoverHelp => $i18n->get('badge builder template help'),
|
|
||||||
namespace => 'EMS/BadgeBuilder',
|
|
||||||
},
|
|
||||||
lookupRegistrantTemplateId => {
|
|
||||||
fieldType => 'template',
|
|
||||||
defaultValue => 'OOyMH33plAy6oCj_QWrxtg',
|
|
||||||
tab => 'display',
|
|
||||||
label => $i18n->get('lookup registrant template'),
|
|
||||||
hoverHelp => $i18n->get('lookup registrant template help'),
|
|
||||||
namespace => 'EMS/LookupRegistrant',
|
|
||||||
},
|
|
||||||
printBadgeTemplateId => {
|
|
||||||
fieldType => 'template',
|
|
||||||
defaultValue => 'PsFn7dJt4wMwBa8hiE3hOA',
|
|
||||||
tab => 'display',
|
|
||||||
label => $i18n->get('print badge template'),
|
|
||||||
hoverHelp => $i18n->get('print badge template help'),
|
|
||||||
namespace => 'EMS/PrintBadge',
|
|
||||||
},
|
|
||||||
printTicketTemplateId => {
|
|
||||||
fieldType => 'template',
|
|
||||||
defaultValue => 'yBwydfooiLvhEFawJb0VTQ',
|
|
||||||
tab => 'display',
|
|
||||||
label => $i18n->get('print ticket template'),
|
|
||||||
hoverHelp => $i18n->get('print ticket template help'),
|
|
||||||
namespace => 'EMS/PrintTicket',
|
|
||||||
},
|
|
||||||
badgeInstructions => {
|
|
||||||
fieldType => 'HTMLArea',
|
|
||||||
defaultValue => $i18n->get('default badge instructions'),
|
|
||||||
tab => 'properties',
|
|
||||||
label => $i18n->get('badge instructions'),
|
|
||||||
hoverHelp => $i18n->get('badge instructions help'),
|
|
||||||
},
|
|
||||||
ticketInstructions => {
|
|
||||||
fieldType => 'HTMLArea',
|
|
||||||
defaultValue => $i18n->get('default ticket instructions'),
|
|
||||||
tab => 'properties',
|
|
||||||
label => $i18n->get('ticket instructions'),
|
|
||||||
hoverHelp => $i18n->get('ticket instructions help'),
|
|
||||||
},
|
|
||||||
ribbonInstructions => {
|
|
||||||
fieldType => 'HTMLArea',
|
|
||||||
defaultValue => $i18n->get('default ribbon instructions'),
|
|
||||||
tab => 'properties',
|
|
||||||
label => $i18n->get('ribbon instructions'),
|
|
||||||
hoverHelp => $i18n->get('ribbon instructions help'),
|
|
||||||
},
|
|
||||||
tokenInstructions => {
|
|
||||||
fieldType => 'HTMLArea',
|
|
||||||
defaultValue => $i18n->get('default token instructions'),
|
|
||||||
tab => 'properties',
|
|
||||||
label => $i18n->get('token instructions'),
|
|
||||||
hoverHelp => $i18n->get('token instructions help'),
|
|
||||||
},
|
|
||||||
registrationStaffGroupId => {
|
|
||||||
fieldType => 'group',
|
|
||||||
defaultValue => [3],
|
|
||||||
tab => 'security',
|
|
||||||
label => $i18n->get('registration staff group'),
|
|
||||||
hoverHelp => $i18n->get('registration staff group help'),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
push(@{$definition}, {
|
|
||||||
assetName=>$i18n->get('assetName'),
|
|
||||||
icon=>'ems.gif',
|
|
||||||
autoGenerateForms=>1,
|
|
||||||
tableName=>'EventManagementSystem',
|
|
||||||
className=>'WebGUI::Asset::Wobject::EventManagementSystem',
|
|
||||||
properties=>\%properties
|
|
||||||
});
|
|
||||||
return $class->SUPER::definition($session,$definition);
|
|
||||||
}
|
|
||||||
|
|
||||||
#------------------------------------------------------------------
|
#------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 deleteEventMetaField ( id )
|
=head2 deleteEventMetaField ( id )
|
||||||
|
|
@ -289,8 +297,8 @@ sub getLocations {
|
||||||
my %hashDate;
|
my %hashDate;
|
||||||
my $tickets = $self->getTickets;
|
my $tickets = $self->getTickets;
|
||||||
for my $ticket ( @$tickets ) {
|
for my $ticket ( @$tickets ) {
|
||||||
my $name = $ticket->get('location');
|
my $name = $ticket->location;
|
||||||
my $date = $ticket->get('startDate');
|
my $date = $ticket->startDate;
|
||||||
$hash{$name} = 1 if defined $name;
|
$hash{$name} = 1 if defined $name;
|
||||||
# cut off the time from the startDate.
|
# cut off the time from the startDate.
|
||||||
$date =~ s/\s*\d+:\d+(:\d+)?// if defined $date;
|
$date =~ s/\s*\d+:\d+(:\d+)?// if defined $date;
|
||||||
|
|
@ -388,7 +396,7 @@ A WebGUI::User object. Defaults to $session->user.
|
||||||
sub isRegistrationStaff {
|
sub isRegistrationStaff {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $user = shift || $self->session->user;
|
my $user = shift || $self->session->user;
|
||||||
$user->isInGroup($self->get('registrationStaffGroupId'));
|
$user->isInGroup($self->registrationStaffGroupId);
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -402,11 +410,11 @@ See WebGUI::Asset::prepareView() for details.
|
||||||
sub prepareView {
|
sub prepareView {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
$self->SUPER::prepareView();
|
$self->SUPER::prepareView();
|
||||||
my $template = WebGUI::Asset::Template->new($self->session, $self->get("templateId"));
|
my $template = WebGUI::Asset::Template->new($self->session, $self->templateId);
|
||||||
if (!$template) {
|
if (!$template) {
|
||||||
WebGUI::Error::ObjectNotFound::Template->throw(
|
WebGUI::Error::ObjectNotFound::Template->throw(
|
||||||
error => qq{Template not found},
|
error => qq{Template not found},
|
||||||
templateId => $self->get("templateId"),
|
templateId => $self->templateId,
|
||||||
assetId => $self->getId,
|
assetId => $self->getId,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -592,7 +600,7 @@ sub www_buildBadge {
|
||||||
$var{otherBadgesInCart} = \@otherBadges;
|
$var{otherBadgesInCart} = \@otherBadges;
|
||||||
|
|
||||||
# render
|
# render
|
||||||
return $self->processStyle($self->processTemplate(\%var,$self->get('badgeBuilderTemplateId')));
|
return $self->processStyle($self->processTemplate(\%var,$self->badgeBuilderTemplateId));
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -894,7 +902,7 @@ sub www_getBadgesAsJson {
|
||||||
next BADGE unless $badge->canView;
|
next BADGE unless $badge->canView;
|
||||||
push(@{$results{records}}, {
|
push(@{$results{records}}, {
|
||||||
title => $badge->getTitle,
|
title => $badge->getTitle,
|
||||||
description => $badge->get('description'),
|
description => $badge->description,
|
||||||
price => $badge->getPrice+0,
|
price => $badge->getPrice+0,
|
||||||
quantityAvailable => $badge->getQuantityAvailable,
|
quantityAvailable => $badge->getQuantityAvailable,
|
||||||
url => $badge->getUrl,
|
url => $badge->getUrl,
|
||||||
|
|
@ -935,7 +943,7 @@ sub www_getRegistrantAsJson {
|
||||||
return "{}" unless (exists $badgeInfo->{badgeAssetId});
|
return "{}" unless (exists $badgeInfo->{badgeAssetId});
|
||||||
my $badge = WebGUI::Asset::Sku::EMSBadge->new($session, $badgeInfo->{badgeAssetId});
|
my $badge = WebGUI::Asset::Sku::EMSBadge->new($session, $badgeInfo->{badgeAssetId});
|
||||||
$badgeInfo->{title} = $badge->getTitle;
|
$badgeInfo->{title} = $badge->getTitle;
|
||||||
$badgeInfo->{sku} = $badge->get('sku');
|
$badgeInfo->{sku} = $badge->sku;
|
||||||
$badgeInfo->{assetId} = $badge->getId;
|
$badgeInfo->{assetId} = $badge->getId;
|
||||||
$badgeInfo->{hasPurchased} = ($badgeInfo->{purchaseComplete}) ? 1 : 0;
|
$badgeInfo->{hasPurchased} = ($badgeInfo->{purchaseComplete}) ? 1 : 0;
|
||||||
|
|
||||||
|
|
@ -943,16 +951,16 @@ sub www_getRegistrantAsJson {
|
||||||
my $existingTickets = $db->read("select ticketAssetId from EMSRegistrantTicket where badgeId=? and purchaseComplete=1",[$badgeId]);
|
my $existingTickets = $db->read("select ticketAssetId from EMSRegistrantTicket where badgeId=? and purchaseComplete=1",[$badgeId]);
|
||||||
while (my ($id) = $existingTickets->array) {
|
while (my ($id) = $existingTickets->array) {
|
||||||
my $ticket = WebGUI::Asset::Sku::EMSTicket->new($session, $id);
|
my $ticket = WebGUI::Asset::Sku::EMSTicket->new($session, $id);
|
||||||
my $startTime = WebGUI::DateTime->new($ticket->get('startDate'))->set_time_zone($self->get('timezone'));
|
my $startTime = WebGUI::DateTime->new($ticket->startDate)->set_time_zone($self->timezone);
|
||||||
push(@tickets, {
|
push(@tickets, {
|
||||||
title => $ticket->getTitle,
|
title => $ticket->getTitle,
|
||||||
eventNumber => $ticket->get('eventNumber'),
|
eventNumber => $ticket->eventNumber,
|
||||||
hasPurchased => 1,
|
hasPurchased => 1,
|
||||||
startDate => $startTime->toMysqlTime,
|
startDate => $startTime->toMysqlTime,
|
||||||
endDate => $ticket->get('endDate'),
|
endDate => $ticket->endDate,
|
||||||
location => $ticket->get('location'),
|
location => $ticket->location,
|
||||||
assetId => $ticket->getId,
|
assetId => $ticket->getId,
|
||||||
sku => $ticket->get('sku'),
|
sku => $ticket->sku,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -964,7 +972,7 @@ sub www_getRegistrantAsJson {
|
||||||
title => $ribbon->getTitle,
|
title => $ribbon->getTitle,
|
||||||
hasPurchased => 1,
|
hasPurchased => 1,
|
||||||
assetId => $ribbon->getId,
|
assetId => $ribbon->getId,
|
||||||
sku => $ribbon->get('sku'),
|
sku => $ribbon->sku,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -977,7 +985,7 @@ sub www_getRegistrantAsJson {
|
||||||
hasPurchased => 1,
|
hasPurchased => 1,
|
||||||
quantity => $quantity,
|
quantity => $quantity,
|
||||||
assetId => $token->getId,
|
assetId => $token->getId,
|
||||||
sku => $token->get('sku'),
|
sku => $token->sku,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -990,16 +998,16 @@ sub www_getRegistrantAsJson {
|
||||||
my $sku = $item->getSku;
|
my $sku = $item->getSku;
|
||||||
# it's a ticket
|
# it's a ticket
|
||||||
if ($sku->isa('WebGUI::Asset::Sku::EMSTicket')) {
|
if ($sku->isa('WebGUI::Asset::Sku::EMSTicket')) {
|
||||||
my $startTime = WebGUI::DateTime->new($sku->get('startDate'))->set_time_zone($self->get('timezone'));
|
my $startTime = WebGUI::DateTime->new($sku->startDate)->set_time_zone($self->timezone);
|
||||||
push(@tickets, {
|
push(@tickets, {
|
||||||
title => $sku->getTitle,
|
title => $sku->getTitle,
|
||||||
eventNumber => $sku->get('eventNumber'),
|
eventNumber => $sku->eventNumber,
|
||||||
itemId => $item->getId,
|
itemId => $item->getId,
|
||||||
startDate => $startTime->toMysqlTime,
|
startDate => $startTime->toMysqlTime,
|
||||||
endDate => $sku->get('endDate'),
|
endDate => $sku->endDate,
|
||||||
location => $sku->get('location'),
|
location => $sku->location,
|
||||||
assetId => $sku->getId,
|
assetId => $sku->getId,
|
||||||
sku => $sku->get('sku'),
|
sku => $sku->sku,
|
||||||
hasPurchased => 0,
|
hasPurchased => 0,
|
||||||
price => $sku->getPrice+0,
|
price => $sku->getPrice+0,
|
||||||
});
|
});
|
||||||
|
|
@ -1009,10 +1017,10 @@ sub www_getRegistrantAsJson {
|
||||||
push(@tokens, {
|
push(@tokens, {
|
||||||
title => $sku->getTitle,
|
title => $sku->getTitle,
|
||||||
itemId => $item->getId,
|
itemId => $item->getId,
|
||||||
quantity => $item->get('quantity'),
|
quantity => $item->quantity,
|
||||||
assetId => $sku->getId,
|
assetId => $sku->getId,
|
||||||
hasPurchased => 0,
|
hasPurchased => 0,
|
||||||
sku => $sku->get('sku'),
|
sku => $sku->sku,
|
||||||
price => $sku->getPrice+0 * $item->get('quantity'),
|
price => $sku->getPrice+0 * $item->get('quantity'),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -1024,7 +1032,7 @@ sub www_getRegistrantAsJson {
|
||||||
itemId => $item->getId,
|
itemId => $item->getId,
|
||||||
assetId => $sku->getId,
|
assetId => $sku->getId,
|
||||||
hasPurchased => 0,
|
hasPurchased => 0,
|
||||||
sku => $sku->get('sku'),
|
sku => $sku->sku,
|
||||||
price => $sku->getPrice+0,
|
price => $sku->getPrice+0,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -1091,7 +1099,7 @@ sub www_getRegistrantsAsJson {
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
$badgeInfo->{title} = $badge->getTitle;
|
$badgeInfo->{title} = $badge->getTitle;
|
||||||
$badgeInfo->{sku} = $badge->get('sku');
|
$badgeInfo->{sku} = $badge->sku;
|
||||||
$badgeInfo->{assetId} = $badge->getId;
|
$badgeInfo->{assetId} = $badge->getId;
|
||||||
$badgeInfo->{manageUrl} = $self->getUrl('func=manageRegistrant;badgeId='.$badgeInfo->{badgeId});
|
$badgeInfo->{manageUrl} = $self->getUrl('func=manageRegistrant;badgeId='.$badgeInfo->{badgeId});
|
||||||
$badgeInfo->{buildBadgeUrl} = $self->getUrl('func=buildBadge;badgeId='.$badgeInfo->{badgeId});
|
$badgeInfo->{buildBadgeUrl} = $self->getUrl('func=buildBadge;badgeId='.$badgeInfo->{badgeId});
|
||||||
|
|
@ -1126,7 +1134,7 @@ sub www_getRibbonsAsJson {
|
||||||
foreach my $ribbon (@{$self->getRibbons}) {
|
foreach my $ribbon (@{$self->getRibbons}) {
|
||||||
push(@{$results{records}}, {
|
push(@{$results{records}}, {
|
||||||
title => $ribbon->getTitle,
|
title => $ribbon->getTitle,
|
||||||
description => $ribbon->get('description'),
|
description => $ribbon->description,
|
||||||
price => $ribbon->getPrice+0,
|
price => $ribbon->getPrice+0,
|
||||||
url => $ribbon->getUrl,
|
url => $ribbon->getUrl,
|
||||||
editUrl => $ribbon->getUrl('func=edit'),
|
editUrl => $ribbon->getUrl('func=edit'),
|
||||||
|
|
@ -1163,7 +1171,7 @@ sub www_getScheduleDataJSON {
|
||||||
});
|
});
|
||||||
return $emptyRecord unless $self->canView;
|
return $emptyRecord unless $self->canView;
|
||||||
# the following two are expected to be configurable...
|
# the following two are expected to be configurable...
|
||||||
my $locationsPerPage = $self->get('scheduleColumnsPerPage');
|
my $locationsPerPage = $self->scheduleColumnsPerPage;
|
||||||
|
|
||||||
my ($db, $form) = $session->quick(qw(db form));
|
my ($db, $form) = $session->quick(qw(db form));
|
||||||
my $locationPageNumber = $form->get('locationPage') || 1;
|
my $locationPageNumber = $form->get('locationPage') || 1;
|
||||||
|
|
@ -1282,7 +1290,7 @@ sub www_getTicketsAsJson {
|
||||||
elsif ($keywords ne "") {
|
elsif ($keywords ne "") {
|
||||||
@ids = @{WebGUI::Search->new($session)->search({
|
@ids = @{WebGUI::Search->new($session)->search({
|
||||||
keywords => $keywords,
|
keywords => $keywords,
|
||||||
lineage => [$self->get('lineage')],
|
lineage => [$self->lineage],
|
||||||
classes => ['WebGUI::Asset::Sku::EMSTicket'],
|
classes => ['WebGUI::Asset::Sku::EMSTicket'],
|
||||||
})->getAssetIds};
|
})->getAssetIds};
|
||||||
}
|
}
|
||||||
|
|
@ -1299,7 +1307,7 @@ className='WebGUI::Asset::Sku::EMSTicket' and state='published' and revisionDate
|
||||||
if (defined $badgeId) {
|
if (defined $badgeId) {
|
||||||
my $assetId = $db->quickScalar("select badgeAssetId from EMSRegistrant where badgeId=?",[$badgeId]);
|
my $assetId = $db->quickScalar("select badgeAssetId from EMSRegistrant where badgeId=?",[$badgeId]);
|
||||||
my $badge = WebGUI::Asset->new($session, $assetId, 'WebGUI::Asset::Sku::EMSBadge');
|
my $badge = WebGUI::Asset->new($session, $assetId, 'WebGUI::Asset::Sku::EMSBadge');
|
||||||
@badgeGroups = split("\n",$badge->get('relatedBadgeGroups')) if (defined $badge);
|
@badgeGroups = split("\n",$badge->relatedBadgeGroups) if (defined $badge);
|
||||||
}
|
}
|
||||||
|
|
||||||
# get a list of tickets already associated with the badge
|
# get a list of tickets already associated with the badge
|
||||||
|
|
@ -1333,8 +1341,8 @@ className='WebGUI::Asset::Sku::EMSTicket' and state='published' and revisionDate
|
||||||
}
|
}
|
||||||
|
|
||||||
# skip tickets not in our badge's badge groups
|
# skip tickets not in our badge's badge groups
|
||||||
if ($badgeId ne "" && scalar(@badgeGroups) > 0 && $ticket->get('relatedBadgeGroups') ne '') { # skip check if it has no badge groups
|
if ($badgeId ne "" && scalar(@badgeGroups) > 0 && $ticket->relatedBadgeGroups ne '') { # skip check if it has no badge groups
|
||||||
my @groups = split("\n",$ticket->get('relatedBadgeGroups'));
|
my @groups = split("\n",$ticket->relatedBadgeGroups);
|
||||||
my $found = 0;
|
my $found = 0;
|
||||||
BADGE: {
|
BADGE: {
|
||||||
foreach my $a (@badgeGroups) {
|
foreach my $a (@badgeGroups) {
|
||||||
|
|
@ -1357,8 +1365,8 @@ className='WebGUI::Asset::Sku::EMSTicket' and state='published' and revisionDate
|
||||||
next unless ($counter >= ($startIndex * $numberOfResults));
|
next unless ($counter >= ($startIndex * $numberOfResults));
|
||||||
|
|
||||||
# publish the data for this ticket
|
# publish the data for this ticket
|
||||||
my $description = $ticket->get('description');
|
my $description = $ticket->description;
|
||||||
my $data = $ticket->get('eventMetaData');
|
my $data = $ticket->eventMetaData;
|
||||||
$data = '{}' if ($data eq "");
|
$data = '{}' if ($data eq "");
|
||||||
my $meta = JSON->new->decode($data);
|
my $meta = JSON->new->decode($data);
|
||||||
foreach my $field (@{$self->getEventMetaFields}) {
|
foreach my $field (@{$self->getEventMetaFields}) {
|
||||||
|
|
@ -1367,8 +1375,8 @@ className='WebGUI::Asset::Sku::EMSTicket' and state='published' and revisionDate
|
||||||
$description .= '<p><b>'.$label.'</b>: '.$meta->{$label}.'</p>';
|
$description .= '<p><b>'.$label.'</b>: '.$meta->{$label}.'</p>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
my $date = WebGUI::DateTime->new($session, mysql => $ticket->get('startDate'))
|
my $date = WebGUI::DateTime->new($session, mysql => $ticket->startDate)
|
||||||
->set_time_zone($self->get("timezone"))
|
->set_time_zone($self->timezone)
|
||||||
->webguiDate("%W %z %Z");
|
->webguiDate("%W %z %Z");
|
||||||
push(@records, {
|
push(@records, {
|
||||||
title => $ticket->getTitle,
|
title => $ticket->getTitle,
|
||||||
|
|
@ -1379,10 +1387,10 @@ className='WebGUI::Asset::Sku::EMSTicket' and state='published' and revisionDate
|
||||||
editUrl => $ticket->getUrl('func=edit'),
|
editUrl => $ticket->getUrl('func=edit'),
|
||||||
deleteUrl => $ticket->getUrl('func=delete'),
|
deleteUrl => $ticket->getUrl('func=delete'),
|
||||||
assetId => $ticket->getId,
|
assetId => $ticket->getId,
|
||||||
eventNumber => $ticket->get('eventNumber'),
|
eventNumber => $ticket->eventNumber,
|
||||||
location => $ticket->get('location'),
|
location => $ticket->location,
|
||||||
startDate => $date,
|
startDate => $date,
|
||||||
duration => $ticket->get('duration'),
|
duration => $ticket->duration,
|
||||||
});
|
});
|
||||||
last unless (scalar(@records) < $numberOfResults);
|
last unless (scalar(@records) < $numberOfResults);
|
||||||
}
|
}
|
||||||
|
|
@ -1426,7 +1434,7 @@ sub www_getTokensAsJson {
|
||||||
foreach my $token (@{$self->getTokens}) {
|
foreach my $token (@{$self->getTokens}) {
|
||||||
push(@{$results{records}}, {
|
push(@{$results{records}}, {
|
||||||
title => $token->getTitle,
|
title => $token->getTitle,
|
||||||
description => $token->get('description'),
|
description => $token->description,
|
||||||
price => $token->getPrice+0,
|
price => $token->getPrice+0,
|
||||||
url => $token->getUrl,
|
url => $token->getUrl,
|
||||||
editUrl => $token->getUrl('func=edit'),
|
editUrl => $token->getUrl('func=edit'),
|
||||||
|
|
@ -1608,7 +1616,7 @@ $|=1;
|
||||||
}
|
}
|
||||||
$out->print("\tUpdating properties\n",1);
|
$out->print("\tUpdating properties\n",1);
|
||||||
$properties{menuTitle} = $properties{title};
|
$properties{menuTitle} = $properties{title};
|
||||||
$properties{url} = $self->get("url")."/".$properties{title};
|
$properties{url} = $self->url."/".$properties{title};
|
||||||
$event->update(\%properties);
|
$event->update(\%properties);
|
||||||
$out->print("\tUpdating meta data\n",1);
|
$out->print("\tUpdating meta data\n",1);
|
||||||
$event->setEventMetaData($metadata);
|
$event->setEventMetaData($metadata);
|
||||||
|
|
@ -1654,7 +1662,7 @@ sub www_lookupRegistrant {
|
||||||
);
|
);
|
||||||
|
|
||||||
# render the page
|
# render the page
|
||||||
return $self->processStyle($self->processTemplate(\%var, $self->get('lookupRegistrantTemplateId')));
|
return $self->processStyle($self->processTemplate(\%var, $self->lookupRegistrantTemplateId));
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -1710,10 +1718,10 @@ sub www_manageEventMetaFields {
|
||||||
my %row = %{$row1};
|
my %row = %{$row1};
|
||||||
$count++;
|
$count++;
|
||||||
$output .= "<div>".
|
$output .= "<div>".
|
||||||
$self->session->icon->delete('func=deleteEventMetaField;fieldId='.$row{fieldId},$self->get('url'),$i18n->get('confirm delete event metadata')).
|
$self->session->icon->delete('func=deleteEventMetaField;fieldId='.$row{fieldId},$self->url,$i18n->get('confirm delete event metadata')).
|
||||||
$self->session->icon->edit('func=editEventMetaField;fieldId='.$row{fieldId}, $self->get('url')).
|
$self->session->icon->edit('func=editEventMetaField;fieldId='.$row{fieldId}, $self->url).
|
||||||
$self->session->icon->moveUp('func=moveEventMetaFieldUp;fieldId='.$row{fieldId}, $self->get('url'),($count == 1)?1:0);
|
$self->session->icon->moveUp('func=moveEventMetaFieldUp;fieldId='.$row{fieldId}, $self->url,($count == 1)?1:0);
|
||||||
$output .= $self->session->icon->moveDown('func=moveEventMetaFieldDown;fieldId='.$row{fieldId}, $self->get('url'),($count == $number)?1:0).
|
$output .= $self->session->icon->moveDown('func=moveEventMetaFieldDown;fieldId='.$row{fieldId}, $self->url,($count == $number)?1:0).
|
||||||
" ".$row{label}."</div>";
|
" ".$row{label}."</div>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1955,7 +1963,7 @@ sub www_printBadge {
|
||||||
my $registrant = $self->getRegistrant($form->get('badgeId'));
|
my $registrant = $self->getRegistrant($form->get('badgeId'));
|
||||||
my $badge = WebGUI::Asset::Sku::EMSBadge->new($session, $registrant->{badgeAssetId});
|
my $badge = WebGUI::Asset::Sku::EMSBadge->new($session, $registrant->{badgeAssetId});
|
||||||
$registrant->{badgeTitle} = $badge->getTitle;
|
$registrant->{badgeTitle} = $badge->getTitle;
|
||||||
return $self->processTemplate($registrant,$self->get('printBadgeTemplateId'));
|
return $self->processTemplate($registrant,$self->printBadgeTemplateId);
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -1974,12 +1982,12 @@ sub www_printTicket {
|
||||||
my $registrant = $self->getRegistrant($form->get('badgeId'));
|
my $registrant = $self->getRegistrant($form->get('badgeId'));
|
||||||
my $ticket = WebGUI::Asset::Sku::EMSTicket->new($session, $form->get('ticketAssetId'));
|
my $ticket = WebGUI::Asset::Sku::EMSTicket->new($session, $form->get('ticketAssetId'));
|
||||||
$registrant->{ticketTitle} = $ticket->getTitle;
|
$registrant->{ticketTitle} = $ticket->getTitle;
|
||||||
my $startTime = WebGUI::DateTime->new($ticket->get('startDate'))->set_time_zone($self->get('timezone'));
|
my $startTime = WebGUI::DateTime->new($ticket->startDate)->set_time_zone($self->timezone);
|
||||||
$registrant->{ticketStart} = $startTime->strftime('%F %R');
|
$registrant->{ticketStart} = $startTime->strftime('%F %R');
|
||||||
$registrant->{ticketDuration} = $ticket->get('duration');
|
$registrant->{ticketDuration} = $ticket->duration;
|
||||||
$registrant->{ticketLocation} = $ticket->get('location');
|
$registrant->{ticketLocation} = $ticket->location;
|
||||||
$registrant->{ticketEventNumber} = $ticket->get('eventNumber');
|
$registrant->{ticketEventNumber} = $ticket->eventNumber;
|
||||||
return $self->processTemplate($registrant,$self->get('printTicketTemplateId'));
|
return $self->processTemplate($registrant,$self->printTicketTemplateId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -2063,7 +2071,7 @@ sub www_viewSchedule {
|
||||||
return $self->session->privilege->insufficient() unless $self->canView;
|
return $self->session->privilege->insufficient() unless $self->canView;
|
||||||
my $db = $self->session->db;
|
my $db = $self->session->db;
|
||||||
my $rowsPerPage = 25;
|
my $rowsPerPage = 25;
|
||||||
my $locationsPerPage = $self->get('scheduleColumnsPerPage');
|
my $locationsPerPage = $self->scheduleColumnsPerPage;
|
||||||
|
|
||||||
my @columnNames = map { "'col" . $_ . "'" } ( 1..$locationsPerPage );
|
my @columnNames = map { "'col" . $_ . "'" } ( 1..$locationsPerPage );
|
||||||
my $fieldList = join ',', @columnNames;
|
my $fieldList = join ',', @columnNames;
|
||||||
|
|
@ -2078,7 +2086,7 @@ sub www_viewSchedule {
|
||||||
dataColumns => $dataColumns,
|
dataColumns => $dataColumns,
|
||||||
fieldList => $fieldList,
|
fieldList => $fieldList,
|
||||||
dataSourceUrl => $self->getUrl('func=getScheduleDataJSON'),
|
dataSourceUrl => $self->getUrl('func=getScheduleDataJSON'),
|
||||||
},$self->get('scheduleTemplateId')));
|
},$self->scheduleTemplateId));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,319 @@ package WebGUI::Asset::Wobject::Gallery;
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use Class::C3;
|
#use Class::C3;
|
||||||
use base qw(WebGUI::AssetAspect::RssFeed WebGUI::Asset::Wobject);
|
#use base qw(WebGUI::AssetAspect::RssFeed WebGUI::Asset::Wobject);
|
||||||
|
use WebGUI::Definition::Asset;
|
||||||
|
extends 'WebGUI::Asset::Wobject';
|
||||||
|
aspect assetName => ['assetName', 'Asset_Gallery'];
|
||||||
|
aspect icon => 'photoGallery.gif';
|
||||||
|
aspect tableName => 'Gallery',
|
||||||
|
property groupIdAddComment => (
|
||||||
|
tab => "security",
|
||||||
|
fieldType => "group",
|
||||||
|
default => 2, # Registered Users
|
||||||
|
label => ["groupIdAddComment label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["groupIdAddComment description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
property groupIdAddFile => (
|
||||||
|
tab => "security",
|
||||||
|
fieldType => "group",
|
||||||
|
default => 2, # Registered Users
|
||||||
|
label => ["groupIdAddFile label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["groupIdAddFile description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
property imageResolutions => (
|
||||||
|
tab => "properties",
|
||||||
|
fieldType => "checkList",
|
||||||
|
builder => '_imageResolutions_builder',
|
||||||
|
lazy => 1,
|
||||||
|
options => \&_imageResolutions_options,
|
||||||
|
label => ["imageResolutions label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["imageResolutions description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
sub _imageResolutions_builder {
|
||||||
|
return join("\n", '800', '1024', '1200', '1600', '2880');
|
||||||
|
}
|
||||||
|
sub _imageResolutions_options {
|
||||||
|
tie my %imageResolutionOptions, 'Tie::IxHash', map { $_ => $_ } qw(600 800 1024 1260 1440 1600 2880);
|
||||||
|
return \%imageResolutionOptions;
|
||||||
|
}
|
||||||
|
property imageViewSize => (
|
||||||
|
tab => "properties",
|
||||||
|
fieldType => "integer",
|
||||||
|
default => 700,
|
||||||
|
label => ["imageViewSize label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["imageViewSize description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
property imageThumbnailSize => (
|
||||||
|
tab => "properties",
|
||||||
|
fieldType => "integer",
|
||||||
|
default => 300,
|
||||||
|
label => ["imageThumbnailSize label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["imageThumbnailSize description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
property imageDensity => (
|
||||||
|
tab => "properties",
|
||||||
|
fieldType => "selectBox",
|
||||||
|
options => \&_imageDensity_options,
|
||||||
|
default => 72,
|
||||||
|
label => [ "imageDensity label" , 'Asset_Gallery'],
|
||||||
|
hoverHelp => [ "imageDensity description" , 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
sub _imageDensity_options {
|
||||||
|
my $session = shift->session;
|
||||||
|
my $i18n = WebGUI::International->new($session, 'Asset_Gallery');
|
||||||
|
|
||||||
|
tie my %imageDensityOptions, 'Tie::IxHash', (
|
||||||
|
72 => $i18n->get( "imageDensity option web" ),
|
||||||
|
300 => $i18n->get( "imageDensity option print" ),
|
||||||
|
);
|
||||||
|
return \%imageDensityOptions;
|
||||||
|
}
|
||||||
|
property maxSpacePerUser => (
|
||||||
|
tab => "properties",
|
||||||
|
fieldType => "integer",
|
||||||
|
default => 0,
|
||||||
|
label => ["maxSpacePerUser label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["maxSpacePerUser description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
property richEditIdAlbum => (
|
||||||
|
tab => "properties",
|
||||||
|
fieldType => "selectRichEditor",
|
||||||
|
default => "PBrichedit000000000001", # Content Managers editor
|
||||||
|
label => ["richEditIdAlbum label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["richEditIdAlbum description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
property richEditIdFile => (
|
||||||
|
tab => "properties",
|
||||||
|
fieldType => "selectRichEditor",
|
||||||
|
default => "PBrichedit000000000002", # Forum Rich editor
|
||||||
|
label => ["richEditIdFile label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["richEditIdFile description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
property richEditIdComment => (
|
||||||
|
tab => "properties",
|
||||||
|
fieldType => "selectRichEditor",
|
||||||
|
default => "PBrichedit000000000002", # Forum Rich Editor
|
||||||
|
label => ["richEditIdFileComment label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["richEditIdFileComment description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
property templateIdAddArchive => (
|
||||||
|
tab => "display",
|
||||||
|
fieldType => "template",
|
||||||
|
default => "i0X4Q3tBWUb_thsVbsYz9xQ",
|
||||||
|
namespace => "GalleryAlbum/AddArchive",
|
||||||
|
label => ["templateIdAddArchive label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["templateIdAddArchive description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
property templateIdDeleteAlbum => (
|
||||||
|
tab => "display",
|
||||||
|
fieldType => "template",
|
||||||
|
default => "UTNFeV7B_aSCRmmaFCq4Vw",
|
||||||
|
namespace => "GalleryAlbum/Delete",
|
||||||
|
label => ["templateIdDeleteAlbum label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["templateIdDeleteAlbum description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
property templateIdDeleteFile => (
|
||||||
|
tab => "display",
|
||||||
|
fieldType => "template",
|
||||||
|
default => "zcX-wIUct0S_np14xxOA-A",
|
||||||
|
namespace => "GalleryFile/Delete",
|
||||||
|
label => ["templateIdDeleteFile label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["templateIdDeleteFile description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
property templateIdEditAlbum => (
|
||||||
|
tab => "display",
|
||||||
|
fieldType => "template",
|
||||||
|
default => "6X-7Twabn5KKO_AbgK3PEw",
|
||||||
|
namespace => "GalleryAlbum/Edit",
|
||||||
|
label => ["templateIdEditAlbum label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["templateIdEditAlbum description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
property templateIdEditComment => (
|
||||||
|
tab => "display",
|
||||||
|
fieldType => "template",
|
||||||
|
default => "OxJWQgnGsgyGohP2L3zJPQ",
|
||||||
|
namespace => "GalleryFile/EditComment",
|
||||||
|
label => ["templateIdEditComment label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["templateIdEditComment description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
property templateIdEditFile => (
|
||||||
|
tab => "display",
|
||||||
|
fieldType => "template",
|
||||||
|
default => "7JCTAiu1U_bT9ldr655Blw",
|
||||||
|
namespace => "GalleryFile/Edit",
|
||||||
|
label => ["templateIdEditFile label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["templateIdEditFile description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
property templateIdListAlbums => (
|
||||||
|
tab => "display",
|
||||||
|
fieldType => "template",
|
||||||
|
default => "azCqD0IjdQSlM3ar29k5Sg",
|
||||||
|
namespace => "Gallery/ListAlbums",
|
||||||
|
label => ["templateIdListAlbums label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["templateIdListAlbums description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
property templateIdListAlbumsRss => (
|
||||||
|
tab => "display",
|
||||||
|
fieldType => "template",
|
||||||
|
default => "ilu5BrM-VGaOsec9Lm7M6Q",
|
||||||
|
namespace => "Gallery/ListAlbumsRss",
|
||||||
|
label => ["templateIdListAlbumsRss label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["templateIdListAlbumsRss description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
property templateIdListFilesForUser => (
|
||||||
|
tab => "display",
|
||||||
|
fieldType => "template",
|
||||||
|
default => "OkphOEdaSGTXnFGhK4GT5A",
|
||||||
|
namespace => "Gallery/ListFilesForUser",
|
||||||
|
label => ["templateIdListFilesForUser label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["templateIdListFilesForUser description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
property templateIdListFilesForUserRss => (
|
||||||
|
tab => "display",
|
||||||
|
fieldType => "template",
|
||||||
|
default => "-ANLpoTEP-n4POAdRxCzRw",
|
||||||
|
namespace => "Gallery/ListFilesForUserRss",
|
||||||
|
label => ["templateIdListFilesForUserRss label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["templateIdListFilesForUserRss description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
property templateIdMakeShortcut => (
|
||||||
|
tab => "display",
|
||||||
|
fieldType => "template",
|
||||||
|
default => "m3IbBavqzuKDd2PGGhKPlA",
|
||||||
|
namespace => "GalleryFile/MakeShortcut",
|
||||||
|
label => ["templateIdMakeShortcut label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["templateIdMakeShortcut description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
property templateIdSearch => (
|
||||||
|
tab => "display",
|
||||||
|
fieldType => "template",
|
||||||
|
default => "jME5BEDYVDlBZ8jIQA9-jQ",
|
||||||
|
namespace => "Gallery/Search",
|
||||||
|
label => ["templateIdSearch label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["templateIdSearch description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
property templateIdViewSlideshow => (
|
||||||
|
tab => "display",
|
||||||
|
fieldType => "template",
|
||||||
|
default => "KAMdiUdJykjN02CPHpyZOw",
|
||||||
|
namespace => "GalleryAlbum/ViewSlideshow",
|
||||||
|
label => ["templateIdViewSlideshow label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["templateIdViewSlideshow description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
property templateIdViewThumbnails => (
|
||||||
|
tab => "display",
|
||||||
|
fieldType => "template",
|
||||||
|
default => "q5O62aH4pjUXsrQR3Pq4lw",
|
||||||
|
namespace => "GalleryAlbum/ViewThumbnails",
|
||||||
|
label => ["templateIdViewThumbnails label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["templateIdViewThumbnails description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
property templateIdViewAlbum => (
|
||||||
|
tab => "display",
|
||||||
|
fieldType => "template",
|
||||||
|
default => "05FpjceLYhq4csF1Kww1KQ",
|
||||||
|
namespace => "GalleryAlbum/View",
|
||||||
|
label => ["templateIdViewAlbum label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["templateIdViewAlbum description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
property templateIdViewAlbumRss => (
|
||||||
|
tab => "display",
|
||||||
|
fieldType => "template",
|
||||||
|
default => "mM3bjP_iG9sv5nQb4S17tQ",
|
||||||
|
namespace => "GalleryAlbum/ViewRss",
|
||||||
|
label => ["templateIdViewAlbumRss label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["templateIdViewAlbumRss description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
property templateIdViewFile => (
|
||||||
|
tab => "display",
|
||||||
|
fieldType => "template",
|
||||||
|
default => "TEId5V-jEvUULsZA0wuRuA",
|
||||||
|
namespace => "GalleryFile/View",
|
||||||
|
label => ["templateIdViewFile label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["templateIdViewFile description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
property viewDefault => (
|
||||||
|
tab => "display",
|
||||||
|
fieldType => "selectBox",
|
||||||
|
default => "list",
|
||||||
|
options => \&_viewDefault_options,
|
||||||
|
label => ["viewDefault label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["viewDefault description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
sub _viewDefault_options {
|
||||||
|
my $session = shift->session;
|
||||||
|
my $i18n = WebGUI::International->new($session, 'Asset_Gallery');
|
||||||
|
tie my %viewDefaultOptions, 'Tie::IxHash', (
|
||||||
|
list => $i18n->get("viewDefault option list"),
|
||||||
|
album => $i18n->get("viewDefault option album"),
|
||||||
|
);
|
||||||
|
return \%viewDefaultOptions;
|
||||||
|
}
|
||||||
|
property viewAlbumAssetId => (
|
||||||
|
tab => "display",
|
||||||
|
fieldType => "asset",
|
||||||
|
class => "WebGUI::Asset::Wobject::GalleryAlbum",
|
||||||
|
label => ["viewAlbumAssetId label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["viewAlbumAssetId description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
property viewListOrderBy => (
|
||||||
|
tab => "display",
|
||||||
|
fieldType => "selectBox",
|
||||||
|
default => "lineage", # "Sequence Number"
|
||||||
|
options => \&_viewListOrderBy_options,
|
||||||
|
label => ["viewListOrderBy label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["viewListOrderBy description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
sub _viewListOrderBy_options {
|
||||||
|
my $session = shift->session;
|
||||||
|
my $i18n = WebGUI::International->new($session, 'Asset_Gallery');
|
||||||
|
|
||||||
|
tie my %viewListOrderByOptions, 'Tie::IxHash', (
|
||||||
|
creationDate => $i18n->get("viewListOrderBy option creationDate"),
|
||||||
|
lineage => $i18n->get("viewListOrderBy option lineage"),
|
||||||
|
revisionDate => $i18n->get("viewListOrderBy option revisionDate"),
|
||||||
|
title => $i18n->get("viewListOrderBy option title"),
|
||||||
|
);
|
||||||
|
return \%viewListOrderByOptions;
|
||||||
|
|
||||||
|
}
|
||||||
|
property viewListOrderDirection => (
|
||||||
|
tab => "display",
|
||||||
|
fieldType => "selectBox",
|
||||||
|
default => "ASC",
|
||||||
|
options => \&_viewListOrderDirection_options,
|
||||||
|
label => ["viewListOrderDirection label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["viewListOrderDirection description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
sub _viewListOrderDirection_options {
|
||||||
|
my $session = shift->session;
|
||||||
|
my $i18n = WebGUI::International->new($session, 'Asset_Gallery');
|
||||||
|
tie my %viewListOrderDirectionOptions, 'Tie::IxHash', (
|
||||||
|
ASC => $i18n->get("viewListOrderDirection option asc"),
|
||||||
|
DESC => $i18n->get("viewListOrderDirection option desc"),
|
||||||
|
);
|
||||||
|
return \%viewListOrderDirectionOptions;
|
||||||
|
}
|
||||||
|
property workflowIdCommit => (
|
||||||
|
tab => "security",
|
||||||
|
fieldType => "workflow",
|
||||||
|
default => "pbworkflow000000000003", # Commit without approval
|
||||||
|
type => 'WebGUI::VersionTag',
|
||||||
|
label => ["workflowIdCommit label", 'Asset_Gallery'],
|
||||||
|
hoverHelp => ["workflowIdCommit description", 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
property defaultFilesPerPage => (
|
||||||
|
tab => 'display',
|
||||||
|
fieldType => 'integer',
|
||||||
|
default => 24,
|
||||||
|
label => [ 'defaultFilesPerPage label' , 'Asset_Gallery'],
|
||||||
|
hoverHelp => [ 'defaultFilesPerPage description' , 'Asset_Gallery'],
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
use JSON;
|
use JSON;
|
||||||
use Tie::IxHash;
|
use Tie::IxHash;
|
||||||
use WebGUI::International;
|
use WebGUI::International;
|
||||||
|
|
@ -30,319 +341,6 @@ use WebGUI::HTML;
|
||||||
|
|
||||||
=head1 METHODS
|
=head1 METHODS
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
|
||||||
|
|
||||||
=head2 definition ( )
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
sub definition {
|
|
||||||
my $class = shift;
|
|
||||||
my $session = shift;
|
|
||||||
my $definition = shift;
|
|
||||||
my $i18n = WebGUI::International->new($session, 'Asset_Gallery');
|
|
||||||
|
|
||||||
tie my %imageResolutionOptions, 'Tie::IxHash', (
|
|
||||||
'640' => '640',
|
|
||||||
'800' => '800',
|
|
||||||
'1024' => '1024',
|
|
||||||
'1260' => '1260',
|
|
||||||
'1440' => '1440',
|
|
||||||
'1600' => '1600',
|
|
||||||
'2880' => '2880',
|
|
||||||
);
|
|
||||||
|
|
||||||
tie my %viewDefaultOptions, 'Tie::IxHash', (
|
|
||||||
list => $i18n->get("viewDefault option list"),
|
|
||||||
album => $i18n->get("viewDefault option album"),
|
|
||||||
);
|
|
||||||
|
|
||||||
tie my %viewListOrderByOptions, 'Tie::IxHash', (
|
|
||||||
creationDate => $i18n->get("viewListOrderBy option creationDate"),
|
|
||||||
lineage => $i18n->get("viewListOrderBy option lineage"),
|
|
||||||
revisionDate => $i18n->get("viewListOrderBy option revisionDate"),
|
|
||||||
title => $i18n->get("viewListOrderBy option title"),
|
|
||||||
);
|
|
||||||
|
|
||||||
tie my %viewListOrderDirectionOptions, 'Tie::IxHash', (
|
|
||||||
ASC => $i18n->get("viewListOrderDirection option asc"),
|
|
||||||
DESC => $i18n->get("viewListOrderDirection option desc"),
|
|
||||||
);
|
|
||||||
|
|
||||||
tie my %imageDensityOptions, 'Tie::IxHash', (
|
|
||||||
72 => $i18n->get( "imageDensity option web" ),
|
|
||||||
300 => $i18n->get( "imageDensity option print" ),
|
|
||||||
);
|
|
||||||
|
|
||||||
tie my %properties, 'Tie::IxHash', (
|
|
||||||
groupIdAddComment => {
|
|
||||||
tab => "security",
|
|
||||||
fieldType => "group",
|
|
||||||
defaultValue => 2, # Registered Users
|
|
||||||
label => $i18n->get("groupIdAddComment label"),
|
|
||||||
hoverHelp => $i18n->get("groupIdAddComment description"),
|
|
||||||
},
|
|
||||||
groupIdAddFile => {
|
|
||||||
tab => "security",
|
|
||||||
fieldType => "group",
|
|
||||||
defaultValue => 2, # Registered Users
|
|
||||||
label => $i18n->get("groupIdAddFile label"),
|
|
||||||
hoverHelp => $i18n->get("groupIdAddFile description"),
|
|
||||||
},
|
|
||||||
imageResolutions => {
|
|
||||||
tab => "properties",
|
|
||||||
fieldType => "checkList",
|
|
||||||
defaultValue => join("\n", '800', '1024', '1200', '1600', '2880'),
|
|
||||||
options => \%imageResolutionOptions,
|
|
||||||
label => $i18n->get("imageResolutions label"),
|
|
||||||
hoverHelp => $i18n->get("imageResolutions description"),
|
|
||||||
},
|
|
||||||
imageViewSize => {
|
|
||||||
tab => "properties",
|
|
||||||
fieldType => "integer",
|
|
||||||
defaultValue => 700,
|
|
||||||
label => $i18n->get("imageViewSize label"),
|
|
||||||
hoverHelp => $i18n->get("imageViewSize description"),
|
|
||||||
},
|
|
||||||
imageThumbnailSize => {
|
|
||||||
tab => "properties",
|
|
||||||
fieldType => "integer",
|
|
||||||
defaultValue => 300,
|
|
||||||
label => $i18n->get("imageThumbnailSize label"),
|
|
||||||
hoverHelp => $i18n->get("imageThumbnailSize description"),
|
|
||||||
},
|
|
||||||
imageDensity => {
|
|
||||||
tab => "properties",
|
|
||||||
fieldType => "selectBox",
|
|
||||||
options => \%imageDensityOptions,
|
|
||||||
defaultValue => 72,
|
|
||||||
label => $i18n->get( "imageDensity label" ),
|
|
||||||
hoverHelp => $i18n->get( "imageDensity description" ),
|
|
||||||
},
|
|
||||||
maxSpacePerUser => {
|
|
||||||
tab => "properties",
|
|
||||||
fieldType => "integer",
|
|
||||||
defaultValue => 0,
|
|
||||||
label => $i18n->get("maxSpacePerUser label"),
|
|
||||||
hoverHelp => $i18n->get("maxSpacePerUser description"),
|
|
||||||
},
|
|
||||||
richEditIdAlbum => {
|
|
||||||
tab => "properties",
|
|
||||||
fieldType => "selectRichEditor",
|
|
||||||
defaultValue => "PBrichedit000000000001", # Content Managers editor
|
|
||||||
label => $i18n->get("richEditIdAlbum label"),
|
|
||||||
hoverHelp => $i18n->get("richEditIdAlbum description"),
|
|
||||||
},
|
|
||||||
richEditIdFile => {
|
|
||||||
tab => "properties",
|
|
||||||
fieldType => "selectRichEditor",
|
|
||||||
defaultValue => "PBrichedit000000000002", # Forum Rich editor
|
|
||||||
label => $i18n->get("richEditIdFile label"),
|
|
||||||
hoverHelp => $i18n->get("richEditIdFile description"),
|
|
||||||
},
|
|
||||||
richEditIdComment => {
|
|
||||||
tab => "properties",
|
|
||||||
fieldType => "selectRichEditor",
|
|
||||||
defaultValue => "PBrichedit000000000002", # Forum Rich Editor
|
|
||||||
label => $i18n->get("richEditIdFileComment label"),
|
|
||||||
hoverHelp => $i18n->get("richEditIdFileComment description"),
|
|
||||||
},
|
|
||||||
templateIdAddArchive => {
|
|
||||||
tab => "display",
|
|
||||||
fieldType => "template",
|
|
||||||
defaultValue => "i0X4Q3tBWUb_thsVbsYz9xQ",
|
|
||||||
namespace => "GalleryAlbum/AddArchive",
|
|
||||||
label => $i18n->get("templateIdAddArchive label"),
|
|
||||||
hoverHelp => $i18n->get("templateIdAddArchive description"),
|
|
||||||
},
|
|
||||||
templateIdDeleteAlbum => {
|
|
||||||
tab => "display",
|
|
||||||
fieldType => "template",
|
|
||||||
defaultValue => "UTNFeV7B_aSCRmmaFCq4Vw",
|
|
||||||
namespace => "GalleryAlbum/Delete",
|
|
||||||
label => $i18n->get("templateIdDeleteAlbum label"),
|
|
||||||
hoverHelp => $i18n->get("templateIdDeleteAlbum description"),
|
|
||||||
},
|
|
||||||
templateIdDeleteFile => {
|
|
||||||
tab => "display",
|
|
||||||
fieldType => "template",
|
|
||||||
defaultValue => "zcX-wIUct0S_np14xxOA-A",
|
|
||||||
namespace => "GalleryFile/Delete",
|
|
||||||
label => $i18n->get("templateIdDeleteFile label"),
|
|
||||||
hoverHelp => $i18n->get("templateIdDeleteFile description"),
|
|
||||||
},
|
|
||||||
templateIdEditAlbum => {
|
|
||||||
tab => "display",
|
|
||||||
fieldType => "template",
|
|
||||||
defaultValue => "6X-7Twabn5KKO_AbgK3PEw",
|
|
||||||
namespace => "GalleryAlbum/Edit",
|
|
||||||
label => $i18n->get("templateIdEditAlbum label"),
|
|
||||||
hoverHelp => $i18n->get("templateIdEditAlbum description"),
|
|
||||||
},
|
|
||||||
templateIdEditComment => {
|
|
||||||
tab => "display",
|
|
||||||
fieldType => "template",
|
|
||||||
defaultValue => "OxJWQgnGsgyGohP2L3zJPQ",
|
|
||||||
namespace => "GalleryFile/EditComment",
|
|
||||||
label => $i18n->get("templateIdEditComment label"),
|
|
||||||
hoverHelp => $i18n->get("templateIdEditComment description"),
|
|
||||||
},
|
|
||||||
templateIdEditFile => {
|
|
||||||
tab => "display",
|
|
||||||
fieldType => "template",
|
|
||||||
defaultValue => "7JCTAiu1U_bT9ldr655Blw",
|
|
||||||
namespace => "GalleryFile/Edit",
|
|
||||||
label => $i18n->get("templateIdEditFile label"),
|
|
||||||
hoverHelp => $i18n->get("templateIdEditFile description"),
|
|
||||||
},
|
|
||||||
templateIdListAlbums => {
|
|
||||||
tab => "display",
|
|
||||||
fieldType => "template",
|
|
||||||
defaultValue => "azCqD0IjdQSlM3ar29k5Sg",
|
|
||||||
namespace => "Gallery/ListAlbums",
|
|
||||||
label => $i18n->get("templateIdListAlbums label"),
|
|
||||||
hoverHelp => $i18n->get("templateIdListAlbums description"),
|
|
||||||
},
|
|
||||||
templateIdListAlbumsRss => {
|
|
||||||
tab => "display",
|
|
||||||
fieldType => "template",
|
|
||||||
defaultValue => "ilu5BrM-VGaOsec9Lm7M6Q",
|
|
||||||
namespace => "Gallery/ListAlbumsRss",
|
|
||||||
label => $i18n->get("templateIdListAlbumsRss label"),
|
|
||||||
hoverHelp => $i18n->get("templateIdListAlbumsRss description"),
|
|
||||||
},
|
|
||||||
templateIdListFilesForUser => {
|
|
||||||
tab => "display",
|
|
||||||
fieldType => "template",
|
|
||||||
defaultValue => "OkphOEdaSGTXnFGhK4GT5A",
|
|
||||||
namespace => "Gallery/ListFilesForUser",
|
|
||||||
label => $i18n->get("templateIdListFilesForUser label"),
|
|
||||||
hoverHelp => $i18n->get("templateIdListFilesForUser description"),
|
|
||||||
},
|
|
||||||
templateIdListFilesForUserRss => {
|
|
||||||
tab => "display",
|
|
||||||
fieldType => "template",
|
|
||||||
defaultValue => "-ANLpoTEP-n4POAdRxCzRw",
|
|
||||||
namespace => "Gallery/ListFilesForUserRss",
|
|
||||||
label => $i18n->get("templateIdListFilesForUserRss label"),
|
|
||||||
hoverHelp => $i18n->get("templateIdListFilesForUserRss description"),
|
|
||||||
},
|
|
||||||
templateIdMakeShortcut => {
|
|
||||||
tab => "display",
|
|
||||||
fieldType => "template",
|
|
||||||
defaultValue => "m3IbBavqzuKDd2PGGhKPlA",
|
|
||||||
namespace => "GalleryFile/MakeShortcut",
|
|
||||||
label => $i18n->get("templateIdMakeShortcut label"),
|
|
||||||
hoverHelp => $i18n->get("templateIdMakeShortcut description"),
|
|
||||||
},
|
|
||||||
templateIdSearch => {
|
|
||||||
tab => "display",
|
|
||||||
fieldType => "template",
|
|
||||||
defaultValue => "jME5BEDYVDlBZ8jIQA9-jQ",
|
|
||||||
namespace => "Gallery/Search",
|
|
||||||
label => $i18n->get("templateIdSearch label"),
|
|
||||||
hoverHelp => $i18n->get("templateIdSearch description"),
|
|
||||||
},
|
|
||||||
templateIdViewSlideshow => {
|
|
||||||
tab => "display",
|
|
||||||
fieldType => "template",
|
|
||||||
defaultValue => "KAMdiUdJykjN02CPHpyZOw",
|
|
||||||
namespace => "GalleryAlbum/ViewSlideshow",
|
|
||||||
label => $i18n->get("templateIdViewSlideshow label"),
|
|
||||||
hoverHelp => $i18n->get("templateIdViewSlideshow description"),
|
|
||||||
},
|
|
||||||
templateIdViewThumbnails => {
|
|
||||||
tab => "display",
|
|
||||||
fieldType => "template",
|
|
||||||
defaultValue => "q5O62aH4pjUXsrQR3Pq4lw",
|
|
||||||
namespace => "GalleryAlbum/ViewThumbnails",
|
|
||||||
label => $i18n->get("templateIdViewThumbnails label"),
|
|
||||||
hoverHelp => $i18n->get("templateIdViewThumbnails description"),
|
|
||||||
},
|
|
||||||
templateIdViewAlbum => {
|
|
||||||
tab => "display",
|
|
||||||
fieldType => "template",
|
|
||||||
defaultValue => "05FpjceLYhq4csF1Kww1KQ",
|
|
||||||
namespace => "GalleryAlbum/View",
|
|
||||||
label => $i18n->get("templateIdViewAlbum label"),
|
|
||||||
hoverHelp => $i18n->get("templateIdViewAlbum description"),
|
|
||||||
},
|
|
||||||
templateIdViewAlbumRss => {
|
|
||||||
tab => "display",
|
|
||||||
fieldType => "template",
|
|
||||||
defaultValue => "mM3bjP_iG9sv5nQb4S17tQ",
|
|
||||||
namespace => "GalleryAlbum/ViewRss",
|
|
||||||
label => $i18n->get("templateIdViewAlbumRss label"),
|
|
||||||
hoverHelp => $i18n->get("templateIdViewAlbumRss description"),
|
|
||||||
},
|
|
||||||
templateIdViewFile => {
|
|
||||||
tab => "display",
|
|
||||||
fieldType => "template",
|
|
||||||
defaultValue => "TEId5V-jEvUULsZA0wuRuA",
|
|
||||||
namespace => "GalleryFile/View",
|
|
||||||
label => $i18n->get("templateIdViewFile label"),
|
|
||||||
hoverHelp => $i18n->get("templateIdViewFile description"),
|
|
||||||
},
|
|
||||||
viewDefault => {
|
|
||||||
tab => "display",
|
|
||||||
fieldType => "selectBox",
|
|
||||||
defaultValue => "list",
|
|
||||||
options => \%viewDefaultOptions,
|
|
||||||
label => $i18n->get("viewDefault label"),
|
|
||||||
hoverHelp => $i18n->get("viewDefault description"),
|
|
||||||
},
|
|
||||||
viewAlbumAssetId => {
|
|
||||||
tab => "display",
|
|
||||||
fieldType => "asset",
|
|
||||||
class => "WebGUI::Asset::Wobject::GalleryAlbum",
|
|
||||||
label => $i18n->get("viewAlbumAssetId label"),
|
|
||||||
hoverHelp => $i18n->get("viewAlbumAssetId description"),
|
|
||||||
},
|
|
||||||
viewListOrderBy => {
|
|
||||||
tab => "display",
|
|
||||||
fieldType => "selectBox",
|
|
||||||
defaultValue => "lineage", # "Sequence Number"
|
|
||||||
options => \%viewListOrderByOptions,
|
|
||||||
label => $i18n->get("viewListOrderBy label"),
|
|
||||||
hoverHelp => $i18n->get("viewListOrderBy description"),
|
|
||||||
},
|
|
||||||
viewListOrderDirection => {
|
|
||||||
tab => "display",
|
|
||||||
fieldType => "selectBox",
|
|
||||||
defaultValue => "ASC",
|
|
||||||
options => \%viewListOrderDirectionOptions,
|
|
||||||
label => $i18n->get("viewListOrderDirection label"),
|
|
||||||
hoverHelp => $i18n->get("viewListOrderDirection description"),
|
|
||||||
},
|
|
||||||
workflowIdCommit => {
|
|
||||||
tab => "security",
|
|
||||||
fieldType => "workflow",
|
|
||||||
defaultValue => "pbworkflow000000000003", # Commit without approval
|
|
||||||
type => 'WebGUI::VersionTag',
|
|
||||||
label => $i18n->get("workflowIdCommit label"),
|
|
||||||
hoverHelp => $i18n->get("workflowIdCommit description"),
|
|
||||||
},
|
|
||||||
defaultFilesPerPage => {
|
|
||||||
tab => 'display',
|
|
||||||
fieldType => 'integer',
|
|
||||||
defaultValue => 24,
|
|
||||||
label => $i18n->get( 'defaultFilesPerPage label' ),
|
|
||||||
hoverHelp => $i18n->get( 'defaultFilesPerPage description' ),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
push @{$definition}, {
|
|
||||||
assetName => $i18n->get('assetName'),
|
|
||||||
icon => 'photoGallery.gif',
|
|
||||||
autoGenerateForms => 1,
|
|
||||||
tableName => 'Gallery',
|
|
||||||
className => __PACKAGE__,
|
|
||||||
properties => \%properties,
|
|
||||||
};
|
|
||||||
|
|
||||||
return $class->next::method($session, $definition);
|
|
||||||
}
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 addChild ( properties, [...] )
|
=head2 addChild ( properties, [...] )
|
||||||
|
|
@ -363,7 +361,7 @@ sub addChild {
|
||||||
|
|
||||||
if ( !$properties->{className}->isa( $albumClass ) ) {
|
if ( !$properties->{className}->isa( $albumClass ) ) {
|
||||||
$self->session->errorHandler->security(
|
$self->session->errorHandler->security(
|
||||||
"add a ".$properties->{className}." to a ".$self->get("className")
|
"add a ".$properties->{className}." to a ".$self->className
|
||||||
);
|
);
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
@ -476,7 +474,7 @@ sub canAddFile {
|
||||||
: $self->session->user
|
: $self->session->user
|
||||||
;
|
;
|
||||||
|
|
||||||
return $user->isInGroup( $self->get("groupIdAddFile") );
|
return $user->isInGroup( $self->groupIdAddFile );
|
||||||
}
|
}
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
@ -500,7 +498,7 @@ sub canComment {
|
||||||
: $self->session->user
|
: $self->session->user
|
||||||
;
|
;
|
||||||
|
|
||||||
return $user->isInGroup( $self->get("groupIdAddComment") );
|
return $user->isInGroup( $self->groupIdAddComment );
|
||||||
}
|
}
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
@ -535,7 +533,7 @@ sub canEdit {
|
||||||
: $self->session->user
|
: $self->session->user
|
||||||
;
|
;
|
||||||
|
|
||||||
return $user->isInGroup( $self->get("groupIdEdit") );
|
return $user->isInGroup( $self->groupIdEdit );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -559,7 +557,7 @@ sub canView {
|
||||||
: $self->session->user
|
: $self->session->user
|
||||||
;
|
;
|
||||||
|
|
||||||
return $user->isInGroup( $self->get("groupIdView") );
|
return $user->isInGroup( $self->groupIdView );
|
||||||
}
|
}
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
@ -581,8 +579,8 @@ sub getAlbumIds {
|
||||||
|
|
||||||
my $orderBy = $options->{ orderBy }
|
my $orderBy = $options->{ orderBy }
|
||||||
? $options->{ orderBy }
|
? $options->{ orderBy }
|
||||||
: $self->get( 'viewListOrderBy' )
|
: $self->viewListOrderBy
|
||||||
? join( " ", $self->get( 'viewListOrderBy' ), $self->get( 'viewListOrderDirection' ) )
|
? join( " ", $self->getviewListOrderBy, $self->viewListOrderDirection )
|
||||||
: "lineage ASC"
|
: "lineage ASC"
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
@ -687,7 +685,7 @@ assets in this gallery.
|
||||||
|
|
||||||
sub getImageResolutions {
|
sub getImageResolutions {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
return [ split /\n/, $self->get("imageResolutions") ];
|
return [ split /\n/, $self->imageResolutions ];
|
||||||
}
|
}
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
@ -758,7 +756,7 @@ sub getRssFeedItems {
|
||||||
|
|
||||||
my $p
|
my $p
|
||||||
= $self->getAlbumPaginator( {
|
= $self->getAlbumPaginator( {
|
||||||
perpage => $self->get('itemsPerFeed'),
|
perpage => $self->itemsPerFeed,
|
||||||
} );
|
} );
|
||||||
|
|
||||||
my $var = [];
|
my $var = [];
|
||||||
|
|
@ -794,7 +792,7 @@ sub getSearchPaginator {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $rules = shift;
|
my $rules = shift;
|
||||||
|
|
||||||
$rules->{ lineage } = [ $self->get("lineage") ];
|
$rules->{ lineage } = [ $self->lineage ];
|
||||||
|
|
||||||
my $search = WebGUI::Search->new( $self->session );
|
my $search = WebGUI::Search->new( $self->session );
|
||||||
$search->search( $rules );
|
$search->search( $rules );
|
||||||
|
|
@ -816,7 +814,7 @@ classes of files inside of a Gallery.
|
||||||
|
|
||||||
sub getTemplateIdEditFile {
|
sub getTemplateIdEditFile {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
return $self->get("templateIdEditFile");
|
return $self->templateIdEditFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
@ -936,12 +934,12 @@ sub hasSpaceAvailable {
|
||||||
my $userId = shift || $self->session->user->userId;
|
my $userId = shift || $self->session->user->userId;
|
||||||
|
|
||||||
# If we don't care, just return
|
# If we don't care, just return
|
||||||
return 1 if ( $self->get( "maxSpacePerUser" ) == 0 );
|
return 1 if ( $self->maxSpacePerUser == 0 );
|
||||||
|
|
||||||
my $db = $self->session->db;
|
my $db = $self->session->db;
|
||||||
|
|
||||||
# Compile the amount of disk space used
|
# Compile the amount of disk space used
|
||||||
my $maxSpace = $self->get( "maxSpacePerUser" ) * ( 1_024 ** 2 ); # maxSpacePerUser is in MB
|
my $maxSpace = $self->maxSpacePerUser * ( 1_024 ** 2 ); # maxSpacePerUser is in MB
|
||||||
my $spaceUsed = 0;
|
my $spaceUsed = 0;
|
||||||
my $fileIds
|
my $fileIds
|
||||||
= $self->getLineage( [ 'descendants' ], {
|
= $self->getLineage( [ 'descendants' ], {
|
||||||
|
|
@ -952,7 +950,7 @@ sub hasSpaceAvailable {
|
||||||
for my $assetId ( @{ $fileIds } ) {
|
for my $assetId ( @{ $fileIds } ) {
|
||||||
my $asset = WebGUI::Asset->newById( $self->session, $assetId );
|
my $asset = WebGUI::Asset->newById( $self->session, $assetId );
|
||||||
next unless $asset;
|
next unless $asset;
|
||||||
$spaceUsed += $asset->get( 'assetSize' );
|
$spaceUsed += $asset->assetSize;
|
||||||
|
|
||||||
return 0 if ( $spaceUsed + $spaceWanted >= $maxSpace );
|
return 0 if ( $spaceUsed + $spaceWanted >= $maxSpace );
|
||||||
}
|
}
|
||||||
|
|
@ -973,10 +971,9 @@ sub prepareView {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
$self->next::method();
|
$self->next::method();
|
||||||
|
|
||||||
if ( $self->get("viewDefault") eq "album" && $self->get("viewAlbumAssetId") && $self->get("viewAlbumAssetId")
|
if ( $self->viewDefault eq "album" && $self->viewAlbumAssetId && $self->viewAlbumAssetId ne 'PBasset000000000000001') {
|
||||||
ne 'PBasset000000000000001') {
|
|
||||||
my $asset
|
my $asset
|
||||||
= WebGUI::Asset->newById( $self->session, $self->get("viewAlbumAssetId") );
|
= WebGUI::Asset->newById( $self->session, $self->viewAlbumAssetId );
|
||||||
if ($asset) {
|
if ($asset) {
|
||||||
$asset->prepareView;
|
$asset->prepareView;
|
||||||
$self->{_viewAsset} = $asset;
|
$self->{_viewAsset} = $asset;
|
||||||
|
|
@ -1001,11 +998,11 @@ Prepare the template for listing multiple albums.
|
||||||
sub prepareViewListAlbums {
|
sub prepareViewListAlbums {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $template
|
my $template
|
||||||
= WebGUI::Asset::Template->new($self->session, $self->get("templateIdListAlbums"));
|
= WebGUI::Asset::Template->new($self->session, $self->templateIdListAlbums);
|
||||||
if (!$template) {
|
if (!$template) {
|
||||||
WebGUI::Error::ObjectNotFound::Template->throw(
|
WebGUI::Error::ObjectNotFound::Template->throw(
|
||||||
error => qq{Template not found},
|
error => qq{Template not found},
|
||||||
templateId => $self->get("templateIdListAlbums"),
|
templateId => $self->templateIdListAlbums,
|
||||||
assetId => $self->getId,
|
assetId => $self->getId,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -1026,7 +1023,7 @@ sub view {
|
||||||
my $session = $self->session;
|
my $session = $self->session;
|
||||||
my $var = $self->get;
|
my $var = $self->get;
|
||||||
|
|
||||||
if ( $self->get("viewDefault") eq "album" && $self->{_viewAsset}) {
|
if ( $self->viewDefault eq "album" && $self->{_viewAsset}) {
|
||||||
return $self->{_viewAsset}->view;
|
return $self->{_viewAsset}->view;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -1161,8 +1158,8 @@ sub www_addAlbumService {
|
||||||
canAddFiles => $album->canAddFile,
|
canAddFiles => $album->canAddFile,
|
||||||
title => $album->getTitle,
|
title => $album->getTitle,
|
||||||
url => $siteUrl.$album->getUrl,
|
url => $siteUrl.$album->getUrl,
|
||||||
dateCreated => $date->epochToHuman($album->get('creationDate'), '%y-%m-%d %j:%n:%s'),
|
dateCreated => $date->epochToHuman($album->creationDate, '%y-%m-%d %j:%n:%s'),
|
||||||
lastUpdated => $date->epochToHuman($album->get('revisionDate'), '%y-%m-%d %j:%n:%s'),
|
lastUpdated => $date->epochToHuman($album->revisionDate, '%y-%m-%d %j:%n:%s'),
|
||||||
};
|
};
|
||||||
if ($as eq "xml") {
|
if ($as eq "xml") {
|
||||||
$session->http->setMimeType('text/xml');
|
$session->http->setMimeType('text/xml');
|
||||||
|
|
@ -1227,7 +1224,7 @@ sub www_listAlbumsRss {
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->session->http->setMimeType('text/xml');
|
$self->session->http->setMimeType('text/xml');
|
||||||
return $self->processTemplate( $var, $self->get("templateIdListAlbumsRss") );
|
return $self->processTemplate( $var, $self->templateIdListAlbumsRss );
|
||||||
}
|
}
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
@ -1340,8 +1337,8 @@ sub www_listAlbumsService {
|
||||||
push @assets, {
|
push @assets, {
|
||||||
title => $asset->getTitle,
|
title => $asset->getTitle,
|
||||||
url => $siteUrl.$asset->getUrl,
|
url => $siteUrl.$asset->getUrl,
|
||||||
dateCreated => $date->epochToHuman($asset->get('creationDate'), '%y-%m-%d %j:%n:%s'),
|
dateCreated => $date->epochToHuman($asset->creationDate, '%y-%m-%d %j:%n:%s'),
|
||||||
lastUpdated => $date->epochToHuman($asset->get('revisionDate'), '%y-%m-%d %j:%n:%s'),
|
lastUpdated => $date->epochToHuman($asset->revisionDate, '%y-%m-%d %j:%n:%s'),
|
||||||
thumbnailUrl => $siteUrl.$asset->getThumbnailUrl,
|
thumbnailUrl => $siteUrl.$asset->getThumbnailUrl,
|
||||||
canAddFiles => $asset->canAddFile,
|
canAddFiles => $asset->canAddFile,
|
||||||
};
|
};
|
||||||
|
|
@ -1355,11 +1352,11 @@ sub www_listAlbumsService {
|
||||||
gallery => {
|
gallery => {
|
||||||
canAddAlbums => $self->canAddFile,
|
canAddAlbums => $self->canAddFile,
|
||||||
title => $self->getTitle,
|
title => $self->getTitle,
|
||||||
menuTitle => $self->get('menuTitle'),
|
menuTitle => $self->menuTitle,
|
||||||
synopsis => $self->get('synopsis'),
|
synopsis => $self->synopsis,
|
||||||
url => $siteUrl.$self->getUrl,
|
url => $siteUrl.$self->getUrl,
|
||||||
dateCreated => $date->epochToHuman($self->get('creationDate'), '%y-%m-%d %j:%n:%s'),
|
dateCreated => $date->epochToHuman($self->creationDate, '%y-%m-%d %j:%n:%s'),
|
||||||
lastUpdated => $date->epochToHuman($self->get('revisionDate'), '%y-%m-%d %j:%n:%s'),
|
lastUpdated => $date->epochToHuman($self->revisionDate, '%y-%m-%d %j:%n:%s'),
|
||||||
},
|
},
|
||||||
albums => \@assets
|
albums => \@assets
|
||||||
};
|
};
|
||||||
|
|
@ -1487,7 +1484,7 @@ sub www_search {
|
||||||
}
|
}
|
||||||
|
|
||||||
return $self->processStyle(
|
return $self->processStyle(
|
||||||
$self->processTemplate( $var, $self->get("templateIdSearch") )
|
$self->processTemplate( $var, $self->templateIdSearch )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1532,7 +1529,7 @@ sub www_listFilesForUser {
|
||||||
}
|
}
|
||||||
|
|
||||||
return $self->processStyle(
|
return $self->processStyle(
|
||||||
$self->processTemplate( $var, $self->get("templateIdListFilesForUser") )
|
$self->processTemplate( $var, $self->templateIdListFilesForUser )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1580,7 +1577,7 @@ sub www_listFilesForUserRss {
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->session->http->setMimeType('text/xml');
|
$self->session->http->setMimeType('text/xml');
|
||||||
return $self->processTemplate( $var, $self->get("templateIdListFilesForUserRss") );
|
return $self->processTemplate( $var, $self->templateIdListFilesForUserRss );
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue