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 ()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue