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

@ -33,6 +33,9 @@
- fix: Creating a new account when purchasing something properly redirects users to the checkout page
- fix: Group expiration dates on subscriptions are now correct
- fix: Rating numbers drop after rating asset (perlDreamer Consulting, LLC)
- fix: EMS: blank lines appearing in registrants. Note - this fix requires
the use of new template variables in the EMS checkout template. See
gotchas.txt for details.
7.3.8
- Fixed a template variable rewriting problem with HTML::Template::Expr

View file

@ -7,6 +7,14 @@ upgrading from one version to the next, or even between multiple
versions. Be sure to heed the warnings contained herein as they will
save you many hours of grief.
7.3.9
--------------------------------------------------------------------
* If you're using the Events Management System and have a custom
checkout template, you will need to use the following template
variables to implement the fix: isError, errorLoop, error.
Documentation on their use is in the online help and you can also
look at the default template for an example use.
7.3.8
--------------------------------------------------------------------
* For those who upgraded to 7.3.7, any EventsCalendars (with their

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,
},
};