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
|
||||
|
||||
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 JSON;
|
||||
use Text::CSV_XS;
|
||||
|
|
@ -31,128 +158,9 @@ use WebGUI::HTMLForm;
|
|||
use WebGUI::International;
|
||||
use WebGUI::Utility;
|
||||
use WebGUI::Workflow::Instance;
|
||||
use Tie::IxHash;
|
||||
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 )
|
||||
|
|
@ -289,8 +297,8 @@ sub getLocations {
|
|||
my %hashDate;
|
||||
my $tickets = $self->getTickets;
|
||||
for my $ticket ( @$tickets ) {
|
||||
my $name = $ticket->get('location');
|
||||
my $date = $ticket->get('startDate');
|
||||
my $name = $ticket->location;
|
||||
my $date = $ticket->startDate;
|
||||
$hash{$name} = 1 if defined $name;
|
||||
# cut off the time from the startDate.
|
||||
$date =~ s/\s*\d+:\d+(:\d+)?// if defined $date;
|
||||
|
|
@ -388,7 +396,7 @@ A WebGUI::User object. Defaults to $session->user.
|
|||
sub isRegistrationStaff {
|
||||
my $self = shift;
|
||||
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 {
|
||||
my $self = shift;
|
||||
$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) {
|
||||
WebGUI::Error::ObjectNotFound::Template->throw(
|
||||
error => qq{Template not found},
|
||||
templateId => $self->get("templateId"),
|
||||
templateId => $self->templateId,
|
||||
assetId => $self->getId,
|
||||
);
|
||||
}
|
||||
|
|
@ -592,7 +600,7 @@ sub www_buildBadge {
|
|||
$var{otherBadgesInCart} = \@otherBadges;
|
||||
|
||||
# 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;
|
||||
push(@{$results{records}}, {
|
||||
title => $badge->getTitle,
|
||||
description => $badge->get('description'),
|
||||
description => $badge->description,
|
||||
price => $badge->getPrice+0,
|
||||
quantityAvailable => $badge->getQuantityAvailable,
|
||||
url => $badge->getUrl,
|
||||
|
|
@ -935,7 +943,7 @@ sub www_getRegistrantAsJson {
|
|||
return "{}" unless (exists $badgeInfo->{badgeAssetId});
|
||||
my $badge = WebGUI::Asset::Sku::EMSBadge->new($session, $badgeInfo->{badgeAssetId});
|
||||
$badgeInfo->{title} = $badge->getTitle;
|
||||
$badgeInfo->{sku} = $badge->get('sku');
|
||||
$badgeInfo->{sku} = $badge->sku;
|
||||
$badgeInfo->{assetId} = $badge->getId;
|
||||
$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]);
|
||||
while (my ($id) = $existingTickets->array) {
|
||||
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, {
|
||||
title => $ticket->getTitle,
|
||||
eventNumber => $ticket->get('eventNumber'),
|
||||
eventNumber => $ticket->eventNumber,
|
||||
hasPurchased => 1,
|
||||
startDate => $startTime->toMysqlTime,
|
||||
endDate => $ticket->get('endDate'),
|
||||
location => $ticket->get('location'),
|
||||
endDate => $ticket->endDate,
|
||||
location => $ticket->location,
|
||||
assetId => $ticket->getId,
|
||||
sku => $ticket->get('sku'),
|
||||
sku => $ticket->sku,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -964,7 +972,7 @@ sub www_getRegistrantAsJson {
|
|||
title => $ribbon->getTitle,
|
||||
hasPurchased => 1,
|
||||
assetId => $ribbon->getId,
|
||||
sku => $ribbon->get('sku'),
|
||||
sku => $ribbon->sku,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -977,7 +985,7 @@ sub www_getRegistrantAsJson {
|
|||
hasPurchased => 1,
|
||||
quantity => $quantity,
|
||||
assetId => $token->getId,
|
||||
sku => $token->get('sku'),
|
||||
sku => $token->sku,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -990,16 +998,16 @@ sub www_getRegistrantAsJson {
|
|||
my $sku = $item->getSku;
|
||||
# it's a ticket
|
||||
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, {
|
||||
title => $sku->getTitle,
|
||||
eventNumber => $sku->get('eventNumber'),
|
||||
eventNumber => $sku->eventNumber,
|
||||
itemId => $item->getId,
|
||||
startDate => $startTime->toMysqlTime,
|
||||
endDate => $sku->get('endDate'),
|
||||
location => $sku->get('location'),
|
||||
endDate => $sku->endDate,
|
||||
location => $sku->location,
|
||||
assetId => $sku->getId,
|
||||
sku => $sku->get('sku'),
|
||||
sku => $sku->sku,
|
||||
hasPurchased => 0,
|
||||
price => $sku->getPrice+0,
|
||||
});
|
||||
|
|
@ -1009,10 +1017,10 @@ sub www_getRegistrantAsJson {
|
|||
push(@tokens, {
|
||||
title => $sku->getTitle,
|
||||
itemId => $item->getId,
|
||||
quantity => $item->get('quantity'),
|
||||
quantity => $item->quantity,
|
||||
assetId => $sku->getId,
|
||||
hasPurchased => 0,
|
||||
sku => $sku->get('sku'),
|
||||
sku => $sku->sku,
|
||||
price => $sku->getPrice+0 * $item->get('quantity'),
|
||||
});
|
||||
}
|
||||
|
|
@ -1024,7 +1032,7 @@ sub www_getRegistrantAsJson {
|
|||
itemId => $item->getId,
|
||||
assetId => $sku->getId,
|
||||
hasPurchased => 0,
|
||||
sku => $sku->get('sku'),
|
||||
sku => $sku->sku,
|
||||
price => $sku->getPrice+0,
|
||||
});
|
||||
}
|
||||
|
|
@ -1091,7 +1099,7 @@ sub www_getRegistrantsAsJson {
|
|||
next;
|
||||
}
|
||||
$badgeInfo->{title} = $badge->getTitle;
|
||||
$badgeInfo->{sku} = $badge->get('sku');
|
||||
$badgeInfo->{sku} = $badge->sku;
|
||||
$badgeInfo->{assetId} = $badge->getId;
|
||||
$badgeInfo->{manageUrl} = $self->getUrl('func=manageRegistrant;badgeId='.$badgeInfo->{badgeId});
|
||||
$badgeInfo->{buildBadgeUrl} = $self->getUrl('func=buildBadge;badgeId='.$badgeInfo->{badgeId});
|
||||
|
|
@ -1126,7 +1134,7 @@ sub www_getRibbonsAsJson {
|
|||
foreach my $ribbon (@{$self->getRibbons}) {
|
||||
push(@{$results{records}}, {
|
||||
title => $ribbon->getTitle,
|
||||
description => $ribbon->get('description'),
|
||||
description => $ribbon->description,
|
||||
price => $ribbon->getPrice+0,
|
||||
url => $ribbon->getUrl,
|
||||
editUrl => $ribbon->getUrl('func=edit'),
|
||||
|
|
@ -1163,7 +1171,7 @@ sub www_getScheduleDataJSON {
|
|||
});
|
||||
return $emptyRecord unless $self->canView;
|
||||
# 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 $locationPageNumber = $form->get('locationPage') || 1;
|
||||
|
|
@ -1282,7 +1290,7 @@ sub www_getTicketsAsJson {
|
|||
elsif ($keywords ne "") {
|
||||
@ids = @{WebGUI::Search->new($session)->search({
|
||||
keywords => $keywords,
|
||||
lineage => [$self->get('lineage')],
|
||||
lineage => [$self->lineage],
|
||||
classes => ['WebGUI::Asset::Sku::EMSTicket'],
|
||||
})->getAssetIds};
|
||||
}
|
||||
|
|
@ -1299,7 +1307,7 @@ className='WebGUI::Asset::Sku::EMSTicket' and state='published' and revisionDate
|
|||
if (defined $badgeId) {
|
||||
my $assetId = $db->quickScalar("select badgeAssetId from EMSRegistrant where badgeId=?",[$badgeId]);
|
||||
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
|
||||
|
|
@ -1333,8 +1341,8 @@ className='WebGUI::Asset::Sku::EMSTicket' and state='published' and revisionDate
|
|||
}
|
||||
|
||||
# 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
|
||||
my @groups = split("\n",$ticket->get('relatedBadgeGroups'));
|
||||
if ($badgeId ne "" && scalar(@badgeGroups) > 0 && $ticket->relatedBadgeGroups ne '') { # skip check if it has no badge groups
|
||||
my @groups = split("\n",$ticket->relatedBadgeGroups);
|
||||
my $found = 0;
|
||||
BADGE: {
|
||||
foreach my $a (@badgeGroups) {
|
||||
|
|
@ -1357,8 +1365,8 @@ className='WebGUI::Asset::Sku::EMSTicket' and state='published' and revisionDate
|
|||
next unless ($counter >= ($startIndex * $numberOfResults));
|
||||
|
||||
# publish the data for this ticket
|
||||
my $description = $ticket->get('description');
|
||||
my $data = $ticket->get('eventMetaData');
|
||||
my $description = $ticket->description;
|
||||
my $data = $ticket->eventMetaData;
|
||||
$data = '{}' if ($data eq "");
|
||||
my $meta = JSON->new->decode($data);
|
||||
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>';
|
||||
}
|
||||
}
|
||||
my $date = WebGUI::DateTime->new($session, mysql => $ticket->get('startDate'))
|
||||
->set_time_zone($self->get("timezone"))
|
||||
my $date = WebGUI::DateTime->new($session, mysql => $ticket->startDate)
|
||||
->set_time_zone($self->timezone)
|
||||
->webguiDate("%W %z %Z");
|
||||
push(@records, {
|
||||
title => $ticket->getTitle,
|
||||
|
|
@ -1379,10 +1387,10 @@ className='WebGUI::Asset::Sku::EMSTicket' and state='published' and revisionDate
|
|||
editUrl => $ticket->getUrl('func=edit'),
|
||||
deleteUrl => $ticket->getUrl('func=delete'),
|
||||
assetId => $ticket->getId,
|
||||
eventNumber => $ticket->get('eventNumber'),
|
||||
location => $ticket->get('location'),
|
||||
eventNumber => $ticket->eventNumber,
|
||||
location => $ticket->location,
|
||||
startDate => $date,
|
||||
duration => $ticket->get('duration'),
|
||||
duration => $ticket->duration,
|
||||
});
|
||||
last unless (scalar(@records) < $numberOfResults);
|
||||
}
|
||||
|
|
@ -1426,7 +1434,7 @@ sub www_getTokensAsJson {
|
|||
foreach my $token (@{$self->getTokens}) {
|
||||
push(@{$results{records}}, {
|
||||
title => $token->getTitle,
|
||||
description => $token->get('description'),
|
||||
description => $token->description,
|
||||
price => $token->getPrice+0,
|
||||
url => $token->getUrl,
|
||||
editUrl => $token->getUrl('func=edit'),
|
||||
|
|
@ -1608,7 +1616,7 @@ $|=1;
|
|||
}
|
||||
$out->print("\tUpdating properties\n",1);
|
||||
$properties{menuTitle} = $properties{title};
|
||||
$properties{url} = $self->get("url")."/".$properties{title};
|
||||
$properties{url} = $self->url."/".$properties{title};
|
||||
$event->update(\%properties);
|
||||
$out->print("\tUpdating meta data\n",1);
|
||||
$event->setEventMetaData($metadata);
|
||||
|
|
@ -1654,7 +1662,7 @@ sub www_lookupRegistrant {
|
|||
);
|
||||
|
||||
# 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};
|
||||
$count++;
|
||||
$output .= "<div>".
|
||||
$self->session->icon->delete('func=deleteEventMetaField;fieldId='.$row{fieldId},$self->get('url'),$i18n->get('confirm delete event metadata')).
|
||||
$self->session->icon->edit('func=editEventMetaField;fieldId='.$row{fieldId}, $self->get('url')).
|
||||
$self->session->icon->moveUp('func=moveEventMetaFieldUp;fieldId='.$row{fieldId}, $self->get('url'),($count == 1)?1:0);
|
||||
$output .= $self->session->icon->moveDown('func=moveEventMetaFieldDown;fieldId='.$row{fieldId}, $self->get('url'),($count == $number)?1:0).
|
||||
$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->url).
|
||||
$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->url,($count == $number)?1:0).
|
||||
" ".$row{label}."</div>";
|
||||
}
|
||||
}
|
||||
|
|
@ -1955,7 +1963,7 @@ sub www_printBadge {
|
|||
my $registrant = $self->getRegistrant($form->get('badgeId'));
|
||||
my $badge = WebGUI::Asset::Sku::EMSBadge->new($session, $registrant->{badgeAssetId});
|
||||
$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 $ticket = WebGUI::Asset::Sku::EMSTicket->new($session, $form->get('ticketAssetId'));
|
||||
$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->{ticketDuration} = $ticket->get('duration');
|
||||
$registrant->{ticketLocation} = $ticket->get('location');
|
||||
$registrant->{ticketEventNumber} = $ticket->get('eventNumber');
|
||||
return $self->processTemplate($registrant,$self->get('printTicketTemplateId'));
|
||||
$registrant->{ticketDuration} = $ticket->duration;
|
||||
$registrant->{ticketLocation} = $ticket->location;
|
||||
$registrant->{ticketEventNumber} = $ticket->eventNumber;
|
||||
return $self->processTemplate($registrant,$self->printTicketTemplateId);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -2063,7 +2071,7 @@ sub www_viewSchedule {
|
|||
return $self->session->privilege->insufficient() unless $self->canView;
|
||||
my $db = $self->session->db;
|
||||
my $rowsPerPage = 25;
|
||||
my $locationsPerPage = $self->get('scheduleColumnsPerPage');
|
||||
my $locationsPerPage = $self->scheduleColumnsPerPage;
|
||||
|
||||
my @columnNames = map { "'col" . $_ . "'" } ( 1..$locationsPerPage );
|
||||
my $fieldList = join ',', @columnNames;
|
||||
|
|
@ -2078,7 +2086,7 @@ sub www_viewSchedule {
|
|||
dataColumns => $dataColumns,
|
||||
fieldList => $fieldList,
|
||||
dataSourceUrl => $self->getUrl('func=getScheduleDataJSON'),
|
||||
},$self->get('scheduleTemplateId')));
|
||||
},$self->scheduleTemplateId));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,8 +11,319 @@ package WebGUI::Asset::Wobject::Gallery;
|
|||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use Class::C3;
|
||||
use base qw(WebGUI::AssetAspect::RssFeed WebGUI::Asset::Wobject);
|
||||
#use Class::C3;
|
||||
#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 Tie::IxHash;
|
||||
use WebGUI::International;
|
||||
|
|
@ -30,319 +341,6 @@ use WebGUI::HTML;
|
|||
|
||||
=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, [...] )
|
||||
|
|
@ -363,7 +361,7 @@ sub addChild {
|
|||
|
||||
if ( !$properties->{className}->isa( $albumClass ) ) {
|
||||
$self->session->errorHandler->security(
|
||||
"add a ".$properties->{className}." to a ".$self->get("className")
|
||||
"add a ".$properties->{className}." to a ".$self->className
|
||||
);
|
||||
return undef;
|
||||
}
|
||||
|
|
@ -476,7 +474,7 @@ sub canAddFile {
|
|||
: $self->session->user
|
||||
;
|
||||
|
||||
return $user->isInGroup( $self->get("groupIdAddFile") );
|
||||
return $user->isInGroup( $self->groupIdAddFile );
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
|
@ -500,7 +498,7 @@ sub canComment {
|
|||
: $self->session->user
|
||||
;
|
||||
|
||||
return $user->isInGroup( $self->get("groupIdAddComment") );
|
||||
return $user->isInGroup( $self->groupIdAddComment );
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
|
@ -534,8 +532,8 @@ sub canEdit {
|
|||
? WebGUI::User->new( $self->session, $userId )
|
||||
: $self->session->user
|
||||
;
|
||||
|
||||
return $user->isInGroup( $self->get("groupIdEdit") );
|
||||
|
||||
return $user->isInGroup( $self->groupIdEdit );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -559,7 +557,7 @@ sub canView {
|
|||
: $self->session->user
|
||||
;
|
||||
|
||||
return $user->isInGroup( $self->get("groupIdView") );
|
||||
return $user->isInGroup( $self->groupIdView );
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
|
@ -578,11 +576,11 @@ is a hash reference with the following keys.
|
|||
sub getAlbumIds {
|
||||
my $self = shift;
|
||||
my $options = shift;
|
||||
|
||||
|
||||
my $orderBy = $options->{ orderBy }
|
||||
? $options->{ orderBy }
|
||||
: $self->get( 'viewListOrderBy' )
|
||||
? join( " ", $self->get( 'viewListOrderBy' ), $self->get( 'viewListOrderDirection' ) )
|
||||
: $self->viewListOrderBy
|
||||
? join( " ", $self->getviewListOrderBy, $self->viewListOrderDirection )
|
||||
: "lineage ASC"
|
||||
;
|
||||
|
||||
|
|
@ -599,7 +597,7 @@ sub getAlbumIds {
|
|||
)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
my $assets
|
||||
= $self->getLineage(['descendants'], {
|
||||
includeOnlyClasses => ['WebGUI::Asset::Wobject::GalleryAlbum'],
|
||||
|
|
@ -626,7 +624,7 @@ For more C<options>, see L</getAlbumIds>.
|
|||
sub getAlbumPaginator {
|
||||
my $self = shift;
|
||||
my $options = shift;
|
||||
|
||||
|
||||
my $perpage = $options->{ perpage } || 20;
|
||||
delete $options->{ perpage };
|
||||
|
||||
|
|
@ -687,7 +685,7 @@ assets in this gallery.
|
|||
|
||||
sub getImageResolutions {
|
||||
my $self = shift;
|
||||
return [ split /\n/, $self->get("imageResolutions") ];
|
||||
return [ split /\n/, $self->imageResolutions ];
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
|
@ -758,9 +756,9 @@ sub getRssFeedItems {
|
|||
|
||||
my $p
|
||||
= $self->getAlbumPaginator( {
|
||||
perpage => $self->get('itemsPerFeed'),
|
||||
perpage => $self->itemsPerFeed,
|
||||
} );
|
||||
|
||||
|
||||
my $var = [];
|
||||
for my $assetId ( @{ $p->getPageData } ) {
|
||||
my $asset = WebGUI::Asset::Wobject::GalleryAlbum->newPending( $self->session, $assetId );
|
||||
|
|
@ -773,7 +771,7 @@ sub getRssFeedItems {
|
|||
'author' => WebGUI::User->new($self->session, $asset->{_properties}->{ 'ownerUserId' })->username
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
return $var;
|
||||
}
|
||||
|
||||
|
|
@ -794,7 +792,7 @@ sub getSearchPaginator {
|
|||
my $self = shift;
|
||||
my $rules = shift;
|
||||
|
||||
$rules->{ lineage } = [ $self->get("lineage") ];
|
||||
$rules->{ lineage } = [ $self->lineage ];
|
||||
|
||||
my $search = WebGUI::Search->new( $self->session );
|
||||
$search->search( $rules );
|
||||
|
|
@ -816,7 +814,7 @@ classes of files inside of a Gallery.
|
|||
|
||||
sub getTemplateIdEditFile {
|
||||
my $self = shift;
|
||||
return $self->get("templateIdEditFile");
|
||||
return $self->templateIdEditFile;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
|
@ -830,7 +828,7 @@ Gets a hash reference of vars common to all templates.
|
|||
sub getTemplateVars {
|
||||
my $self = shift;
|
||||
my $var = $self->get;
|
||||
|
||||
|
||||
# Add the search form variables
|
||||
$self->appendTemplateVarsSearchForm( $var );
|
||||
|
||||
|
|
@ -934,14 +932,14 @@ sub hasSpaceAvailable {
|
|||
my $self = shift;
|
||||
my $spaceWanted = shift;
|
||||
my $userId = shift || $self->session->user->userId;
|
||||
|
||||
|
||||
# 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;
|
||||
|
||||
# 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 $fileIds
|
||||
= $self->getLineage( [ 'descendants' ], {
|
||||
|
|
@ -952,7 +950,7 @@ sub hasSpaceAvailable {
|
|||
for my $assetId ( @{ $fileIds } ) {
|
||||
my $asset = WebGUI::Asset->newById( $self->session, $assetId );
|
||||
next unless $asset;
|
||||
$spaceUsed += $asset->get( 'assetSize' );
|
||||
$spaceUsed += $asset->assetSize;
|
||||
|
||||
return 0 if ( $spaceUsed + $spaceWanted >= $maxSpace );
|
||||
}
|
||||
|
|
@ -973,10 +971,9 @@ sub prepareView {
|
|||
my $self = shift;
|
||||
$self->next::method();
|
||||
|
||||
if ( $self->get("viewDefault") eq "album" && $self->get("viewAlbumAssetId") && $self->get("viewAlbumAssetId")
|
||||
ne 'PBasset000000000000001') {
|
||||
if ( $self->viewDefault eq "album" && $self->viewAlbumAssetId && $self->viewAlbumAssetId ne 'PBasset000000000000001') {
|
||||
my $asset
|
||||
= WebGUI::Asset->newById( $self->session, $self->get("viewAlbumAssetId") );
|
||||
= WebGUI::Asset->newById( $self->session, $self->viewAlbumAssetId );
|
||||
if ($asset) {
|
||||
$asset->prepareView;
|
||||
$self->{_viewAsset} = $asset;
|
||||
|
|
@ -1001,11 +998,11 @@ Prepare the template for listing multiple albums.
|
|||
sub prepareViewListAlbums {
|
||||
my $self = shift;
|
||||
my $template
|
||||
= WebGUI::Asset::Template->new($self->session, $self->get("templateIdListAlbums"));
|
||||
= WebGUI::Asset::Template->new($self->session, $self->templateIdListAlbums);
|
||||
if (!$template) {
|
||||
WebGUI::Error::ObjectNotFound::Template->throw(
|
||||
error => qq{Template not found},
|
||||
templateId => $self->get("templateIdListAlbums"),
|
||||
templateId => $self->templateIdListAlbums,
|
||||
assetId => $self->getId,
|
||||
);
|
||||
}
|
||||
|
|
@ -1026,7 +1023,7 @@ sub view {
|
|||
my $session = $self->session;
|
||||
my $var = $self->get;
|
||||
|
||||
if ( $self->get("viewDefault") eq "album" && $self->{_viewAsset}) {
|
||||
if ( $self->viewDefault eq "album" && $self->{_viewAsset}) {
|
||||
return $self->{_viewAsset}->view;
|
||||
}
|
||||
else {
|
||||
|
|
@ -1059,7 +1056,7 @@ sub view_listAlbums {
|
|||
my $asset = WebGUI::Asset::Wobject::GalleryAlbum->newPending( $session, $assetId );
|
||||
push @{ $var->{albums} }, $asset->getTemplateVars;
|
||||
}
|
||||
|
||||
|
||||
return $self->processTemplate( $var, undef, $self->{_viewTemplate} );
|
||||
}
|
||||
|
||||
|
|
@ -1080,7 +1077,7 @@ instead of having to block things from being added.
|
|||
|
||||
sub www_add {
|
||||
my $self = shift;
|
||||
|
||||
|
||||
unless ( $self->hasBeenCommitted ) {
|
||||
my $i18n = WebGUI::International->new($self->session, 'Asset_Gallery');
|
||||
return $self->processStyle($i18n->get("error add uncommitted"));
|
||||
|
|
@ -1138,10 +1135,10 @@ A 1 or a 0 depending on whether you want other people to be able to add images t
|
|||
sub www_addAlbumService {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
|
||||
|
||||
return $session->privilege->insufficient unless ($self->canAddFile);
|
||||
my $form = $session->form;
|
||||
|
||||
|
||||
my $album = $self->addChild({
|
||||
className => "WebGUI::Asset::Wobject::GalleryAlbum",
|
||||
title => $form->get('title','text'),
|
||||
|
|
@ -1150,7 +1147,7 @@ sub www_addAlbumService {
|
|||
othersCanAdd => $form->get('othersCanAdd','yesNo'),
|
||||
ownerUserId => $session->user->userId,
|
||||
});
|
||||
|
||||
|
||||
$album->requestAutoCommit;
|
||||
|
||||
my $siteUrl = $session->url->getSiteURL;
|
||||
|
|
@ -1161,8 +1158,8 @@ sub www_addAlbumService {
|
|||
canAddFiles => $album->canAddFile,
|
||||
title => $album->getTitle,
|
||||
url => $siteUrl.$album->getUrl,
|
||||
dateCreated => $date->epochToHuman($album->get('creationDate'), '%y-%m-%d %j:%n:%s'),
|
||||
lastUpdated => $date->epochToHuman($album->get('revisionDate'), '%y-%m-%d %j:%n:%s'),
|
||||
dateCreated => $date->epochToHuman($album->creationDate, '%y-%m-%d %j:%n:%s'),
|
||||
lastUpdated => $date->epochToHuman($album->revisionDate, '%y-%m-%d %j:%n:%s'),
|
||||
};
|
||||
if ($as eq "xml") {
|
||||
$session->http->setMimeType('text/xml');
|
||||
|
|
@ -1183,7 +1180,7 @@ Show a paginated list of the albums in this gallery.
|
|||
|
||||
sub www_listAlbums {
|
||||
my $self = shift;
|
||||
|
||||
|
||||
# Perform the prepareView ourselves
|
||||
$self->prepareViewListAlbums;
|
||||
|
||||
|
|
@ -1227,7 +1224,7 @@ sub www_listAlbumsRss {
|
|||
}
|
||||
|
||||
$self->session->http->setMimeType('text/xml');
|
||||
return $self->processTemplate( $var, $self->get("templateIdListAlbumsRss") );
|
||||
return $self->processTemplate( $var, $self->templateIdListAlbumsRss );
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
|
@ -1315,9 +1312,9 @@ Defaults to 1. This represents the page number. It will return up to 100 albums
|
|||
sub www_listAlbumsService {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
|
||||
|
||||
return $session->privilege->insufficient unless ($self->canView);
|
||||
|
||||
|
||||
my $siteUrl = $session->url->getSiteURL;
|
||||
my @assets;
|
||||
my $date = $session->datetime;
|
||||
|
|
@ -1340,8 +1337,8 @@ sub www_listAlbumsService {
|
|||
push @assets, {
|
||||
title => $asset->getTitle,
|
||||
url => $siteUrl.$asset->getUrl,
|
||||
dateCreated => $date->epochToHuman($asset->get('creationDate'), '%y-%m-%d %j:%n:%s'),
|
||||
lastUpdated => $date->epochToHuman($asset->get('revisionDate'), '%y-%m-%d %j:%n:%s'),
|
||||
dateCreated => $date->epochToHuman($asset->creationDate, '%y-%m-%d %j:%n:%s'),
|
||||
lastUpdated => $date->epochToHuman($asset->revisionDate, '%y-%m-%d %j:%n:%s'),
|
||||
thumbnailUrl => $siteUrl.$asset->getThumbnailUrl,
|
||||
canAddFiles => $asset->canAddFile,
|
||||
};
|
||||
|
|
@ -1355,11 +1352,11 @@ sub www_listAlbumsService {
|
|||
gallery => {
|
||||
canAddAlbums => $self->canAddFile,
|
||||
title => $self->getTitle,
|
||||
menuTitle => $self->get('menuTitle'),
|
||||
synopsis => $self->get('synopsis'),
|
||||
menuTitle => $self->menuTitle,
|
||||
synopsis => $self->synopsis,
|
||||
url => $siteUrl.$self->getUrl,
|
||||
dateCreated => $date->epochToHuman($self->get('creationDate'), '%y-%m-%d %j:%n:%s'),
|
||||
lastUpdated => $date->epochToHuman($self->get('revisionDate'), '%y-%m-%d %j:%n:%s'),
|
||||
dateCreated => $date->epochToHuman($self->creationDate, '%y-%m-%d %j:%n:%s'),
|
||||
lastUpdated => $date->epochToHuman($self->revisionDate, '%y-%m-%d %j:%n:%s'),
|
||||
},
|
||||
albums => \@assets
|
||||
};
|
||||
|
|
@ -1447,7 +1444,7 @@ sub www_search {
|
|||
$joinClass = [ $form->get('className') ];
|
||||
}
|
||||
$where .= q{ AND assetIndex.className IN ( } . $db->quoteAndJoin( $joinClass ) . q{ ) };
|
||||
|
||||
|
||||
|
||||
# Build a URL for the pagination
|
||||
my $url
|
||||
|
|
@ -1473,7 +1470,7 @@ sub www_search {
|
|||
joinClass => $joinClass,
|
||||
creationDate => $creationDate,
|
||||
} );
|
||||
|
||||
|
||||
$var->{ keywords } = $keywords;
|
||||
|
||||
$p->appendTemplateVars( $var );
|
||||
|
|
@ -1487,7 +1484,7 @@ sub www_search {
|
|||
}
|
||||
|
||||
return $self->processStyle(
|
||||
$self->processTemplate( $var, $self->get("templateIdSearch") )
|
||||
$self->processTemplate( $var, $self->templateIdSearch )
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -1532,7 +1529,7 @@ sub www_listFilesForUser {
|
|||
}
|
||||
|
||||
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');
|
||||
return $self->processTemplate( $var, $self->get("templateIdListFilesForUserRss") );
|
||||
return $self->processTemplate( $var, $self->templateIdListFilesForUserRss );
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue