fix - EMS: blank lines appearing in registrants

This commit is contained in:
Roy Johnson 2007-02-01 17:31:07 +00:00
parent fe39696e79
commit c5b47acfe8
5 changed files with 97 additions and 1 deletions

View file

@ -901,6 +901,7 @@ sub getRequiredEventNames {
#------------------------------------------------------------------
sub getRegistrationInfo {
my $self = shift;
my $error = shift || [];
my %var;
my $i18n = WebGUI::International->new($self->session, 'Asset_EventManagementSystem');
$var{'form.header'} = WebGUI::Form::formHeader($self->session,{action=>$self->getUrl,method=>'GET'})
@ -932,7 +933,10 @@ sub getRegistrationInfo {
$var{'form.email'} = WebGUI::Form::Email($self->session,{name=>'email'});
$var{'registration'} = 1;
$var{'cancelRegistration.url'} = $self->getUrl('func=resetScratchCart');
$var{'cancelRegistration.url.label'} = $i18n->get('cancel registration');
$var{'cancelRegistration.url.label'} = $i18n->get('cancel registration');
$var{'isError'} = ($error) ? 1 : 0;
$var{'errorLoop'} = $error;
return \%var;
}
@ -2652,6 +2656,25 @@ sub www_saveRegistrantInfo {
my $phoneNumber = $self->session->form->get("phone", "phone");
my $email = $self->session->form->get("email", "email");
my $addingNew = ($badgeId eq 'new') ? 1 : 0;
# Check required fields
my @error_loop;
my $i18n = WebGUI::International->new($self->session,'Asset_EventManagementSystem');
my $requiredFieldRef = { 'first name' => $firstName, 'last name' => $lastName, 'email address' => $email };
foreach my $requiredField (keys %{$requiredFieldRef} ) {
my $fieldValue = $requiredFieldRef->{$requiredField};
# generate i18n error message for a null field that tells the user which field is null using the i18n label for that field
if ($fieldValue eq "") {
push(@error_loop, {
error => sprintf($i18n->get('null field error'), lc($i18n->get($requiredField))),
});
}
}
return $self->processStyle($self->processTemplate($self->getRegistrationInfo(\@error_loop),$self->getValue("checkoutTemplateId")))
if ( scalar(@error_loop) > 0 );
my $details = {
badgeId => $badgeId, # if this is "new", setCollateral will return the new one.
firstName => $firstName,

View file

@ -516,6 +516,40 @@ our $HELP = {
],
},
'ems checkout template' => {
source => 'sub getRegistrationInfo',
title => 'checkout template help title',
body => 'checkout template help body',
variables => [
{
'name' => 'isError',
'description' => 'tmplVar isError',
},
{
'name' => 'errorLoop',
'description' => 'tmplLoop errorLoop',
'variables' => [
{
'name' => 'error',
'description' => 'tmplVar error'
},
]
},
],
fields => [
],
related => [
{
tag => 'event management system add/edit',
namespace => 'Asset_EventManagementSystem',
},
{
tag => 'template language',
namespace => 'Asset_Template',
},
],
},
'ems view purchase template' => {
source => 'sub www_viewPurchases',
title => 'view purchase template help title',

View file

@ -1501,6 +1501,34 @@ added to the user's cart and would be discounted if the Attend All Sessions even
message => q|Are you sure you want to delete this item from your cart? Any changes you have made to the current badge you are editing will also be lost.|,
lastUpdated => 1147108858,
},
'checkout template help title' => {
message => q|EMS Checkout Template|,
lastUpdated => 0,
},
'checkout template help body' => {
message => q|<p>The checkout template controls the display elements rendered during the Event Management Systems checkout process. Note that this should not be confused with the Commerce portion of the checkout process when the user begins to enter payment details. This template handles gathering registration information from users for the events, conflict resolution when a user has created an event schedule that overlaps, and prerequisite resolution when a user has events assigned to a badge that require subsequent events not selected by the user.
|,
lastUpdated => 0,
},
'tmplVar isError' => {
message => q|This template variable is used inside of a tmpl_if statement and returns true if there is a processing error with a badge holders registration information. This variable is only checked when the <b>registration</b> template variable is true.
|,
lastUpdated => 0,
},
'tmplVar error' => {
message => q|Contains an internationalized error message informing the user that certain fields cannot be blank. The field name returned inside this error message is the internationalized label for the field that was left blank.
|,
lastUpdated => 0,
},
'tmplLoop errorLoop' => {
message => q|A loop that returns error messages related to the completion of the user registration form for each badge. This loop only contains messages when <b>isError</b> is true.|,
lastUpdated => 0,
},
};