added print remaining tickets feature to EMS
This commit is contained in:
parent
aafb5b0c26
commit
17145cf082
4 changed files with 538 additions and 11 deletions
|
|
@ -107,6 +107,14 @@ sub definition {
|
|||
hoverHelp => $i18n->get('print ticket template help'),
|
||||
namespace => 'EMS/PrintTicket',
|
||||
},
|
||||
printRemainingTicketsTemplateId => {
|
||||
fieldType => 'template',
|
||||
defaultValue => 'hreA_bgxiTX-EzWCSZCZJw',
|
||||
tab => 'display',
|
||||
label => $i18n->get('print remaining ticket template'),
|
||||
hoverHelp => $i18n->get('print remaining ticket template help'),
|
||||
namespace => 'EMS/PrintRemainingTickets',
|
||||
},
|
||||
badgeInstructions => {
|
||||
fieldType => 'HTMLArea',
|
||||
defaultValue => $i18n->get('default badge instructions'),
|
||||
|
|
@ -553,6 +561,7 @@ sub www_buildBadge {
|
|||
importTicketsUrl => $self->getUrl('func=importEvents'),
|
||||
exportTicketsUrl => $self->getUrl('func=exportEvents'),
|
||||
getTicketsUrl => $self->getUrl('func=getTicketsAsJson;badgeId='.$badgeId),
|
||||
printRemainingTicketsUrl => $self->getUrl('func=printRemainingTickets'),
|
||||
canEdit => $self->canEdit,
|
||||
hasBadge => ($badgeId ne ""),
|
||||
badgeId => $badgeId,
|
||||
|
|
@ -1957,6 +1966,62 @@ sub www_printBadge {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_printRemainingTickets ()
|
||||
|
||||
Displays all of the remaining tickets for this EMS
|
||||
|
||||
=cut
|
||||
|
||||
sub www_printRemainingTickets {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
return $session->privilege->insufficient() unless ($self->isRegistrationStaff);
|
||||
|
||||
my $var = $self->get;
|
||||
my $sth = $session->db->read(qq{
|
||||
SELECT
|
||||
asset.creationDate,
|
||||
assetData.*,
|
||||
assetData.title as ticketTitle,
|
||||
EMSTicket.price,
|
||||
EMSTicket.seatsAvailable,
|
||||
EMSTicket.startDate as ticketStart,
|
||||
EMSTicket.duration as ticketDuration,
|
||||
EMSTicket.eventNumber as ticketEventNumber,
|
||||
EMSTicket.location as ticketLocation,
|
||||
EMSTicket.relatedBadgeGroups,
|
||||
EMSTicket.relatedRibbons,
|
||||
EMSTicket.eventMetaData,
|
||||
(seatsAvailable - (select count(*) from EMSRegistrantTicket where ticketAssetId = asset.assetId)) as seatsRemaining
|
||||
FROM
|
||||
asset
|
||||
join assetData using (assetId)
|
||||
left join EMSTicket using (assetId)
|
||||
WHERE
|
||||
parentId=?
|
||||
and className='WebGUI::Asset::Sku::EMSTicket'
|
||||
and state='published'
|
||||
and EMSTicket.revisionDate=(select max(revisionDate) from EMSTicket where assetId=asset.assetId)
|
||||
and (seatsAvailable - (select count(*) from EMSRegistrantTicket where ticketAssetId = asset.assetId)) > 0
|
||||
GROUP BY
|
||||
asset.assetId
|
||||
ORDER BY
|
||||
title desc
|
||||
},[$self->getId]);
|
||||
|
||||
$var->{'tickets_loop'} = [];
|
||||
while (my $hash = $sth->hashRef) {
|
||||
my $seatsRemaining = $hash->{seatsRemaining};
|
||||
for (my $i = 0; $i < $seatsRemaining; $i++ ) {
|
||||
push(@{$var->{'tickets_loop'}},$hash);
|
||||
}
|
||||
}
|
||||
|
||||
return $self->processTemplate($var,$self->get('printRemainingTicketsTemplateId'));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_printTicket ( )
|
||||
|
||||
Prints a ticket using a template.
|
||||
|
|
@ -2037,7 +2102,7 @@ Toggles the registrant checked in flag.
|
|||
|
||||
sub www_toggleRegistrantCheckedIn {
|
||||
my $self = shift;
|
||||
return $self->session->privilege->insfufficient() unless ($self->isRegistrationStaff);
|
||||
return $self->session->privilege->insufficient() unless ($self->isRegistrationStaff);
|
||||
my $db = $self->session->db;
|
||||
my $badgeId = $self->session->form->param('badgeId');
|
||||
my $flag = $db->quickScalar("select hasCheckedIn from EMSRegistrant where badgeId=?",[$badgeId]);
|
||||
|
|
@ -2046,7 +2111,6 @@ sub www_toggleRegistrantCheckedIn {
|
|||
return $self->www_manageRegistrant;
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_viewSchedule ()
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ our $HELP = {
|
|||
{ 'name' => 'addTokenUrl'},
|
||||
{ 'name' => 'importTicketsUrl'},
|
||||
{ 'name' => 'exportTicketsUrl'},
|
||||
{ 'name' => 'printRemainingTicketsUrl'},
|
||||
{ 'name' => 'canEdit'},
|
||||
{ 'name' => 'hasBadge'},
|
||||
{ 'name' => 'badgeId'},
|
||||
|
|
@ -226,6 +227,67 @@ our $HELP = {
|
|||
related => [],
|
||||
},
|
||||
|
||||
'ems print remaining ticket template' => {
|
||||
source => 'sub www_printRemainingTickets',
|
||||
title => 'print remaining ticket template help',
|
||||
body => '',
|
||||
variables => [
|
||||
{ 'name' => 'tickets_loop',
|
||||
'variables' => [
|
||||
{ 'name' => 'ticketTitle'},
|
||||
{ 'name' => 'ticketStart'},
|
||||
{ 'name' => 'ticketDuration'},
|
||||
{ 'name' => 'ticketLocation'},
|
||||
{ 'name' => 'ticketEventNumber'},
|
||||
{ 'name' => 'seatsRemaining'},
|
||||
{ 'name' => 'seatsAvailable'},
|
||||
{ 'name' => 'price'},
|
||||
{ 'name' => 'relatedRibbons'},
|
||||
{ 'name' => 'relatedBadgeGroups'},
|
||||
{ 'name' => 'eventMetaData'},
|
||||
{ 'name' => 'title'},
|
||||
{ 'name' => 'menuTitle'},
|
||||
{ 'name' => 'url'},
|
||||
{ 'name' => 'synopsis'},
|
||||
{ 'name' => 'assetId'},
|
||||
{ 'name' => 'assetSize'},
|
||||
{ 'name' => 'creationDate'},
|
||||
{ 'name' => 'encryptPage'},
|
||||
{ 'name' => 'extraHeadTags'},
|
||||
{ 'name' => 'extraHeadTagsPacked'},
|
||||
{ 'name' => 'groupIdEdit'},
|
||||
{ 'name' => 'groupIdView'},
|
||||
{ 'name' => 'inheritUrlFromParent'},
|
||||
{ 'name' => 'isExportable'},
|
||||
{ 'name' => 'isHidden'},
|
||||
{ 'name' => 'isPrototype'},
|
||||
{ 'name' => 'isPackage'},
|
||||
{ 'name' => 'lastModified'},
|
||||
{ 'name' => 'newWindow'},
|
||||
{ 'name' => 'ownerUserId'},
|
||||
{ 'name' => 'revisedBy'},
|
||||
{ 'name' => 'revisionDate'},
|
||||
{ 'name' => 'skipNotification'},
|
||||
{ 'name' => 'tagId'},
|
||||
{ 'name' => 'usePackedHeadTags'},
|
||||
],
|
||||
},
|
||||
],
|
||||
isa => [
|
||||
{ namespace => "Asset_EventManagementSystem",
|
||||
tag => "ems asset template variables"
|
||||
},
|
||||
{ namespace => "Asset_Template",
|
||||
tag => "template variables"
|
||||
},
|
||||
{ namespace => "Asset_Wobject",
|
||||
tag => "wobject template variables"
|
||||
},
|
||||
],
|
||||
fields => [],
|
||||
related => [],
|
||||
},
|
||||
|
||||
'ems asset template variables' => {
|
||||
source => 'sub definition',
|
||||
title => 'ems asset template variables',
|
||||
|
|
|
|||
|
|
@ -560,6 +560,25 @@ our $I18N = {
|
|||
context => q|help for a property label|,
|
||||
},
|
||||
|
||||
|
||||
'print remaining ticket template' => {
|
||||
message => q|Print Remaining Tickets Template|,
|
||||
lastUpdated => 0,
|
||||
context => q|a property label|,
|
||||
},
|
||||
|
||||
'print remaining ticket template help' => {
|
||||
message => q|Which template would you like to use for printing remaining tickets?|,
|
||||
lastUpdated => 0,
|
||||
context => q|help for a property label|,
|
||||
},
|
||||
|
||||
'print remaining tickets' => {
|
||||
message => q|Print Remaining Tickets|,
|
||||
lastUpdated => 0,
|
||||
context => q|a link label on the builder page|,
|
||||
},
|
||||
|
||||
'badge builder template' => {
|
||||
message => q|Badge Builder Template|,
|
||||
lastUpdated => 0,
|
||||
|
|
@ -1878,6 +1897,195 @@ normal templates.|,
|
|||
context => q|help text for the columns per page field|,
|
||||
},
|
||||
|
||||
|
||||
'print remaining ticket template help' => {
|
||||
message => q|EMS Print Remaining Ticket Template|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'tickets_loop' => {
|
||||
message => q|A loop containing all of the remaining tickets and their associated data|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'seatsRemaining' => {
|
||||
message => q|Total number of seats remaining for the ticket|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'seatsAvailable' => {
|
||||
message => q|Total number of seats available for the ticket|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'relatedRibbons' => {
|
||||
message => q|Ribbons related to the ticket|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'relatedBadgeGroups' => {
|
||||
message => q|Badge groups related to the ticket|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'title' => {
|
||||
message => q|The title of the ticket to be printed.|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'menuTitle' => {
|
||||
message => q|The title of the ticket to be displayed in the menu.|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'synopsis' => {
|
||||
message => q|Synopsis of the description for the ticket.|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'assetId' => {
|
||||
message => q|Asset Id of the ticket.|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'assetSize' => {
|
||||
message => q|Size of this ticket asset|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'creationDate' => {
|
||||
message => q|Epoch value date for when the asset was created|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'encryptPage' => {
|
||||
message => q|Whether or not to encrypt the page that the ticket is dipslayed on|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'extraHeadTags' => {
|
||||
message => q|Extra tags that should be displayed in the header that this ticket is displayed on|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'extraHeadTagsPacked' => {
|
||||
message => q|Extra tags that should be displayed in the header that this tikcet is displayed on minimized so no whitespace exists|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'groupIdEdit' => {
|
||||
message => q|The id of the group that can edit this ticket.|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'groupIdView' => {
|
||||
message => q|The id of the group that can view this ticket.|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'inheritUrlFromParent' => {
|
||||
message => q|Whether or not to inherit the url from the parent|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'isExportable' => {
|
||||
message => q|Whether or not this ticket is exportable|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'isHidden' => {
|
||||
message => q|Whether or not this ticket should be hidden from the menu.|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'isPrototype' => {
|
||||
message => q|Whether or not this ticket asset is a prototype|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'isPackage' => {
|
||||
message => q|Whether or not this ticket asset is a package|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'lastModified' => {
|
||||
message => q|Epoch date for when this ticket was last modified|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'newWindow' => {
|
||||
message => q|Whether this ticket should be displayed in a new window|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'ownerUserId' => {
|
||||
message => q|User Id of the owner of this ticket|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'revisedBy' => {
|
||||
message => q|Id of the user who last modified this ticket|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'revisionDate' => {
|
||||
message => q|Epoch date for when this ticket was last revised|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'skipNotification' => {
|
||||
message => q|Whether or not notifications for this ticket should be skipped.|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'tagId' => {
|
||||
message => q|Tag Id for this asset|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'usePackedHeadTags' => {
|
||||
message => q|Whether or not packed head tags should be used for this ticket|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|help text label|,
|
||||
},
|
||||
|
||||
'printRemainingTicketsUrl' => {
|
||||
message => q|URL to the print remaining tickets page|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|Field Label|,
|
||||
},
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue