rather a lot of debugging in the EMS Submission system
This commit is contained in:
parent
c089da4c4f
commit
7f6c24e7e0
10 changed files with 82 additions and 49 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -50,6 +50,21 @@ These methods are available from this class:
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 addComment ( comment [, rating, user ] )
|
||||||
|
|
||||||
|
send email when a comment is added
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub addComment {
|
||||||
|
my $self = shift;
|
||||||
|
$self->next::method(@_);
|
||||||
|
$self->sendEmailUpdate;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 addRevision
|
=head2 addRevision
|
||||||
|
|
@ -341,7 +356,7 @@ sub sendEmailUpdate {
|
||||||
my $session = $self->session;
|
my $session = $self->session;
|
||||||
my $i18n = WebGUI::International->new( $session, "Asset_EMSSubmission" );
|
my $i18n = WebGUI::International->new( $session, "Asset_EMSSubmission" );
|
||||||
if( $self->get('sendEmailOnChange') ) {
|
if( $self->get('sendEmailOnChange') ) {
|
||||||
WebGUI::Inbox->new($session)->addMessage( $session,{
|
WebGUI::Inbox->new($session)->addMessage( {
|
||||||
status => 'unread',
|
status => 'unread',
|
||||||
message => $i18n->get('your submission has been updated') . "\n\n" .
|
message => $i18n->get('your submission has been updated') . "\n\n" .
|
||||||
$self->get('title'),
|
$self->get('title'),
|
||||||
|
|
@ -367,7 +382,6 @@ parameters for the submission
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
||||||
sub www_editSubmission {
|
sub www_editSubmission {
|
||||||
my $this = shift;
|
my $this = shift;
|
||||||
my $self;
|
my $self;
|
||||||
|
|
@ -396,11 +410,11 @@ sub www_editSubmission {
|
||||||
$newform->hidden(name => 'assetId', value => $assetId);
|
$newform->hidden(name => 'assetId', value => $assetId);
|
||||||
my $formDescription = $parent->getFormDescription;
|
my $formDescription = $parent->getFormDescription;
|
||||||
my @defs = reverse @{__PACKAGE__->definition($session)};
|
my @defs = reverse @{__PACKAGE__->definition($session)};
|
||||||
my @fieldNames = qw/title submissionStatus startDate duration seatsAvailable location description/;
|
my @fieldNames = qw/title submissionStatus sendEmailOnChange startDate duration seatsAvailable location description/;
|
||||||
my $fields;
|
my $fields;
|
||||||
for my $def ( @defs ) {
|
for my $def ( @defs ) {
|
||||||
my $properties = $def->{properties};
|
my $properties = $def->{properties};
|
||||||
for my $fieldName ( %$properties ) {
|
for my $fieldName ( keys %$properties ) {
|
||||||
if( defined $formDescription->{$fieldName} ) {
|
if( defined $formDescription->{$fieldName} ) {
|
||||||
$fields->{$fieldName} = { %{$properties->{$fieldName}} }; # a simple first level copy
|
$fields->{$fieldName} = { %{$properties->{$fieldName}} }; # a simple first level copy
|
||||||
if( $fieldName eq 'description' ) {
|
if( $fieldName eq 'description' ) {
|
||||||
|
|
@ -448,10 +462,11 @@ sub www_editSubmission {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$newform->submit;
|
$newform->submit;
|
||||||
my $title = $assetId eq 'new' ? $i18n_WG->get(99) : $asset->get('title');
|
my $title = $assetId eq 'new' ? $i18n->get('new submission') : $asset->get('title');
|
||||||
my $content =
|
my $content =
|
||||||
$asset->processTemplate({
|
$asset->processTemplate({
|
||||||
errors => $params->{errors} || [],
|
errors => $params->{errors} || [],
|
||||||
|
isDynamic => $session->form->get('asJson') || 0,
|
||||||
backUrl => $parent->getUrl,
|
backUrl => $parent->getUrl,
|
||||||
pageTitle => $title,
|
pageTitle => $title,
|
||||||
pageForm => $newform->print,
|
pageForm => $newform->print,
|
||||||
|
|
@ -517,10 +532,10 @@ sub getEditForm {
|
||||||
|
|
||||||
my $tabform = $self->SUPER::getEditForm;
|
my $tabform = $self->SUPER::getEditForm;
|
||||||
|
|
||||||
my $comments = $tabform->getTab( 'comments' );
|
|
||||||
|
|
||||||
#add the comments...
|
|
||||||
# TODO once comments can be submitted using AJAX this will work...
|
# TODO once comments can be submitted using AJAX this will work...
|
||||||
|
# be sure to uncomment the tab in the next function also...
|
||||||
|
#my $comments = $tabform->getTab( 'comments' );
|
||||||
|
|
||||||
# $comments->div({name => 'comments',
|
# $comments->div({name => 'comments',
|
||||||
# contentCallback => sub { $self->getFormattedComments },
|
# contentCallback => sub { $self->getFormattedComments },
|
||||||
# });
|
# });
|
||||||
|
|
@ -543,7 +558,10 @@ sub getEditTabs {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $i18n = WebGUI::International->new($self->session,"Asset_EMSSubmission");
|
my $i18n = WebGUI::International->new($self->session,"Asset_EMSSubmission");
|
||||||
my $sku_i18n = WebGUI::International->new($self->session,"Asset_Sku");
|
my $sku_i18n = WebGUI::International->new($self->session,"Asset_Sku");
|
||||||
return ($self->SUPER::getEditTabs(), ['shop', $sku_i18n->get('shop'), 9], ['comments', $i18n->get('comments'), 9]);
|
return ($self->SUPER::getEditTabs(), ['shop', $sku_i18n->get('shop'), 9],
|
||||||
|
# The comment tab is not available because comments are not AJAX yet...
|
||||||
|
# ['comments', $i18n->get('comments'), 9]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,7 @@ sub definition {
|
||||||
submissionDeadline => {
|
submissionDeadline => {
|
||||||
tab => "properties",
|
tab => "properties",
|
||||||
fieldType => "Date",
|
fieldType => "Date",
|
||||||
defaultValue => time , # + ( 30 * 24 * 60 * 60 ) , # 30 days
|
defaultValue => time + ( 30 * 24 * 60 * 60 ) , # 30 days
|
||||||
label => $i18n->get("submission deadline label"),
|
label => $i18n->get("submission deadline label"),
|
||||||
hoverHelp => $i18n->get("submission deadline label help")
|
hoverHelp => $i18n->get("submission deadline label help")
|
||||||
},
|
},
|
||||||
|
|
@ -308,7 +308,7 @@ sub www_editSubmissionForm {
|
||||||
|
|
||||||
my $formDescription = $params->{formDescription} || $self ? $self->getFormDescription : { };
|
my $formDescription = $params->{formDescription} || $self ? $self->getFormDescription : { };
|
||||||
for my $fieldId ( @fieldNames ) {
|
for my $fieldId ( @fieldNames ) {
|
||||||
next if $fieldId eq 'submissionStatus';
|
next if $fieldId =~ /^(submissionStatus|sendEmailOnChange)$/;
|
||||||
my $field = $fields->{$fieldId};
|
my $field = $fields->{$fieldId};
|
||||||
$newform->yesNo(
|
$newform->yesNo(
|
||||||
label => $field->{label},
|
label => $field->{label},
|
||||||
|
|
@ -328,6 +328,7 @@ sub www_editSubmissionForm {
|
||||||
}
|
}
|
||||||
my $content = $asset->processTemplate({
|
my $content = $asset->processTemplate({
|
||||||
errors => $params->{errors} || [],
|
errors => $params->{errors} || [],
|
||||||
|
isDynamic => $session->form->get('asJson') || 0,
|
||||||
backUrl => $parent->getUrl,
|
backUrl => $parent->getUrl,
|
||||||
pageTitle => $title,
|
pageTitle => $title,
|
||||||
pageForm => $newform->print,
|
pageForm => $newform->print,
|
||||||
|
|
@ -599,8 +600,9 @@ sub processForm {
|
||||||
}
|
}
|
||||||
my @fieldNames = split( ' ', $form->get('fieldNames') );
|
my @fieldNames = split( ' ', $form->get('fieldNames') );
|
||||||
$params->{formDescription} = { map { $_ => $form->get($_ . '_yesNo') } ( @fieldNames ) };
|
$params->{formDescription} = { map { $_ => $form->get($_ . '_yesNo') } ( @fieldNames ) };
|
||||||
$params->{formDescription}{_fieldList} = [ map { $params->{formDescription}{$_} ? $_ : () } ( @fieldNames ) ];
|
|
||||||
$params->{formDescription}{submissionStatus} = 0;
|
$params->{formDescription}{submissionStatus} = 0;
|
||||||
|
$params->{formDescription}{sendEmailOnChange} = 1;
|
||||||
|
$params->{formDescription}{_fieldList} = [ map { $params->{formDescription}{$_} ? $_ : () } ( @fieldNames ) ];
|
||||||
if( scalar( @{$params->{formDescription}{_fieldList}} ) == 0 ) {
|
if( scalar( @{$params->{formDescription}{_fieldList}} ) == 0 ) {
|
||||||
$params->{_isValid} = 0;
|
$params->{_isValid} = 0;
|
||||||
my $i18n = WebGUI::International->new( $session, "Asset_EMSSubmissionForm" );
|
my $i18n = WebGUI::International->new( $session, "Asset_EMSSubmissionForm" );
|
||||||
|
|
|
||||||
|
|
@ -259,7 +259,7 @@ sub definition {
|
||||||
hoverHelp => $i18n->get('registration staff group help'),
|
hoverHelp => $i18n->get('registration staff group help'),
|
||||||
},
|
},
|
||||||
submittedLocationsList => {
|
submittedLocationsList => {
|
||||||
fieldType => 'text',
|
fieldType => 'textarea',
|
||||||
tab => 'properties',
|
tab => 'properties',
|
||||||
defaultValue => '',
|
defaultValue => '',
|
||||||
label => $i18n->get('submitted location list label'),
|
label => $i18n->get('submitted location list label'),
|
||||||
|
|
@ -499,7 +499,7 @@ sub getSubmissionLocations {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $text = $self->get('submittedLocationsList');
|
my $text = $self->get('submittedLocationsList');
|
||||||
return undef if $text eq '';
|
return undef if $text eq '';
|
||||||
return [ split( /\s+/, $text ) ];
|
return [ split( /[\s\n]+/, $text ) ];
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -659,7 +659,7 @@ A WebGUI::User object. Defaults to $session->user.
|
||||||
sub isRegistrationStaff {
|
sub isRegistrationStaff {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $user = shift || $self->session->user;
|
my $user = shift || $self->session->user;
|
||||||
$user->isInGroup($self->get('registrationStaffGroupId'));
|
$user->isInGroup($self->get('registrationStaffGroupId')) || $self->canEdit;
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -739,9 +739,11 @@ sub view {
|
||||||
addBadgeUrl => $self->getUrl('func=add;class=WebGUI::Asset::Sku::EMSBadge'),
|
addBadgeUrl => $self->getUrl('func=add;class=WebGUI::Asset::Sku::EMSBadge'),
|
||||||
buildBadgeUrl => $self->getUrl('func=buildBadge'),
|
buildBadgeUrl => $self->getUrl('func=buildBadge'),
|
||||||
viewScheduleUrl => $self->getUrl('func=viewSchedule'),
|
viewScheduleUrl => $self->getUrl('func=viewSchedule'),
|
||||||
addSubmissionUrl => $self->getUrl('func=viewSubmissionQueue#addSubmission'),
|
addSubmissionUrl => $self->getUrl('func=viewSubmissionQueue'),
|
||||||
|
# addSubmissionUrl => $self->getUrl('func=viewSubmissionQueue#addSubmission'),
|
||||||
viewSubmissionQueueUrl => $self->getUrl('func=viewSubmissionQueue'),
|
viewSubmissionQueueUrl => $self->getUrl('func=viewSubmissionQueue'),
|
||||||
addSubmissionFormUrl => $self->getUrl('func=viewSubmissionQueue#addSubmissionForm'),
|
addSubmissionFormUrl => $self->getUrl('func=viewSubmissionQueue'),
|
||||||
|
# addSubmissionFormUrl => $self->getUrl('func=viewSubmissionQueue#addSubmissionForm'),
|
||||||
manageBadgeGroupsUrl=> $self->getUrl('func=manageBadgeGroups'),
|
manageBadgeGroupsUrl=> $self->getUrl('func=manageBadgeGroups'),
|
||||||
getBadgesUrl => $self->getUrl('func=getBadgesAsJson'),
|
getBadgesUrl => $self->getUrl('func=getBadgesAsJson'),
|
||||||
isRegistrationStaff => $self->isRegistrationStaff,
|
isRegistrationStaff => $self->isRegistrationStaff,
|
||||||
|
|
@ -842,8 +844,9 @@ call www_editSubmissionForm with assetId == new
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub www_addSubmissionForm {
|
sub www_addSubmissionForm {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
$self->www_editSubmissionForm( { assetId => 'new' } );
|
my $params = shift || { };
|
||||||
|
$self->www_editSubmissionForm( { assetId => 'new', %$params } );
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -1068,7 +1071,7 @@ test and save data posted from editSubmissionForm...
|
||||||
|
|
||||||
sub www_editSubmissionFormSave {
|
sub www_editSubmissionFormSave {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
return $self->session->privilege->insufficient() unless $self->isRegistrationStaff;
|
return $self->session->privilege->insufficient() unless $self->isRegistrationStaff || $self->canEdit;
|
||||||
my $formParams = WebGUI::Asset::EMSSubmissionForm->processForm($self);
|
my $formParams = WebGUI::Asset::EMSSubmissionForm->processForm($self);
|
||||||
if( $formParams->{_isValid} ) {
|
if( $formParams->{_isValid} ) {
|
||||||
delete $formParams->{_isValid};
|
delete $formParams->{_isValid};
|
||||||
|
|
@ -2734,7 +2737,12 @@ sub www_viewSubmissionQueue {
|
||||||
for my $tabSource ( @{$self->getSubmissionForms} ) {
|
for my $tabSource ( @{$self->getSubmissionForms} ) {
|
||||||
push @{$params->{tabs}}, $tabSource->www_editSubmissionForm( { asHashRef => 1 } );
|
push @{$params->{tabs}}, $tabSource->www_editSubmissionForm( { asHashRef => 1 } );
|
||||||
}
|
}
|
||||||
$params->{tabs}[0]{selected} = 1; # the submission queue tab
|
if( scalar( @{$params->{tabs}} ) == 1 ) { # there were no existing forms
|
||||||
|
push @{$params->{tabs}}, $self->www_addSubmissionForm( { asHashRef => 1 } );
|
||||||
|
$params->{tabs}[1]{selected} = 1; # the new submission form tab
|
||||||
|
} else {
|
||||||
|
$params->{tabs}[0]{selected} = 1; # the submission queue tab
|
||||||
|
}
|
||||||
}
|
}
|
||||||
elsif( $canSubmit ) {
|
elsif( $canSubmit ) {
|
||||||
for my $tabSource ( @{$self->getSubmissionForms} ) {
|
for my $tabSource ( @{$self->getSubmissionForms} ) {
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ our $I18N = { ##hashref of hashes
|
||||||
'send email label' => {
|
'send email label' => {
|
||||||
message => q|Send Email when Submission Editted|,
|
message => q|Send Email when Submission Editted|,
|
||||||
lastUpdated => 1131394072,
|
lastUpdated => 1131394072,
|
||||||
context => q|This is the lable for the flag for setting the option to send email to the owner when the submission is eddited.|
|
context => q|This is the lable for the flag for setting the option to send email to the owner when the submission is edited.|
|
||||||
},
|
},
|
||||||
'send email label help' => {
|
'send email label help' => {
|
||||||
message => q|Check this box if you would like to recieve email for all changes made to your submission|,
|
message => q|Check this box if you would like to recieve email for all changes made to your submission|,
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ use lib "$FindBin::Bin/../lib";
|
||||||
use Test::More;
|
use Test::More;
|
||||||
use Test::Deep;
|
use Test::Deep;
|
||||||
use Test::Warn;
|
use Test::Warn;
|
||||||
|
use HTML::Form;
|
||||||
use JSON;
|
use JSON;
|
||||||
use WebGUI::Test; # Must use this before any other WebGUI modules
|
use WebGUI::Test; # Must use this before any other WebGUI modules
|
||||||
use WebGUI::Test::Activity;
|
use WebGUI::Test::Activity;
|
||||||
|
|
@ -96,7 +97,7 @@ my $ems = $node->addChild({
|
||||||
});
|
});
|
||||||
# I scooped this out ot WG::Asset::Wobject::EventManagementSystem
|
# I scooped this out ot WG::Asset::Wobject::EventManagementSystem
|
||||||
# its not pretty, but there is no other way to add a meta field
|
# its not pretty, but there is no other way to add a meta field
|
||||||
$ems->setCollateral("EMSEventMetaField", "fieldId",{
|
my $mf1Id = $ems->setCollateral("EMSEventMetaField", "fieldId",{
|
||||||
fieldId=> 'new',
|
fieldId=> 'new',
|
||||||
label => 'mfRequiredUrl',
|
label => 'mfRequiredUrl',
|
||||||
dataType => 'url',
|
dataType => 'url',
|
||||||
|
|
@ -106,7 +107,7 @@ my $ems = $node->addChild({
|
||||||
defaultValues => '',
|
defaultValues => '',
|
||||||
},1,1);
|
},1,1);
|
||||||
|
|
||||||
$ems->setCollateral("EMSEventMetaField", "fieldId",{
|
my $mf2Id = $ems->setCollateral("EMSEventMetaField", "fieldId",{
|
||||||
fieldId=> 'new',
|
fieldId=> 'new',
|
||||||
label => 'mfDate',
|
label => 'mfDate',
|
||||||
dataType => 'date',
|
dataType => 'date',
|
||||||
|
|
@ -243,10 +244,10 @@ cmp_deeply( from_json($ems->www_getAllSubmissions), {
|
||||||
records => [
|
records => [
|
||||||
{
|
{
|
||||||
lastReplyDate => '',
|
lastReplyDate => '',
|
||||||
submissionId => '3',
|
submissionId => $sub1->get('submissionId'),
|
||||||
creationDate => ignore(),
|
creationDate => ignore(),
|
||||||
createdBy => 'userA',
|
createdBy => 'userA',
|
||||||
url => '/test-ems?func=viewSubmissionQueue#3',
|
url => ignore(),
|
||||||
submissionStatus => $i18n->get('pending'),
|
submissionStatus => $i18n->get('pending'),
|
||||||
title => 'my favorite thing to talk about',
|
title => 'my favorite thing to talk about',
|
||||||
lastReplyBy => ''
|
lastReplyBy => ''
|
||||||
|
|
@ -257,10 +258,10 @@ cmp_deeply( from_json($ems->www_getAllSubmissions), {
|
||||||
dir => 'DESC',
|
dir => 'DESC',
|
||||||
}, 'test getAllSubmissions for UserA' );
|
}, 'test getAllSubmissions for UserA' );
|
||||||
|
|
||||||
$session->request->setup_body({submissionId => 3});
|
$session->request->setup_body({submissionId => $sub1->get('submissionId')});
|
||||||
cmp_deeply( from_json($ems->www_getSubmissionById), {
|
cmp_deeply( from_json($ems->www_getSubmissionById), {
|
||||||
title => 3,
|
title => $sub1->get('submissionId'),
|
||||||
id => 3,
|
id => $sub1->get('submissionId'),
|
||||||
text => ignore(),
|
text => ignore(),
|
||||||
}, 'test getSubmissionById');
|
}, 'test getSubmissionById');
|
||||||
|
|
||||||
|
|
@ -283,20 +284,20 @@ cmp_deeply( from_json($ems->www_getAllSubmissions), {
|
||||||
records => [
|
records => [
|
||||||
{
|
{
|
||||||
lastReplyDate => '',
|
lastReplyDate => '',
|
||||||
submissionId => '4',
|
submissionId => $sub2->get('submissionId'),
|
||||||
creationDate => ignore(),
|
creationDate => ignore(),
|
||||||
createdBy => 'userB',
|
createdBy => 'userB',
|
||||||
url => '/test-ems?func=viewSubmissionQueue#4',
|
url => ignore(),
|
||||||
submissionStatus => $i18n->get('pending'),
|
submissionStatus => $i18n->get('pending'),
|
||||||
title => 'why i like to be important',
|
title => 'why i like to be important',
|
||||||
lastReplyBy => ''
|
lastReplyBy => ''
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
lastReplyDate => '',
|
lastReplyDate => '',
|
||||||
submissionId => '3',
|
submissionId => $sub1->get('submissionId'),
|
||||||
creationDate => ignore(),
|
creationDate => ignore(),
|
||||||
createdBy => 'userA',
|
createdBy => 'userA',
|
||||||
url => '/test-ems?func=viewSubmissionQueue#3',
|
url => ignore(),
|
||||||
submissionStatus => $i18n->get('pending'),
|
submissionStatus => $i18n->get('pending'),
|
||||||
title => 'my favorite thing to talk about',
|
title => 'my favorite thing to talk about',
|
||||||
lastReplyBy => ''
|
lastReplyBy => ''
|
||||||
|
|
@ -380,13 +381,12 @@ is( $sub2, undef, 'submission deleted');
|
||||||
|
|
||||||
$versionTag->commit;
|
$versionTag->commit;
|
||||||
|
|
||||||
SKIP: { skip 'requires HTML::Form', 2 unless use_ok 'HTML::Form';
|
# this is not the greatest test but it does run through the basic create submissionForm code.
|
||||||
# this is not the greatest testm but it does run through the basic create submissionForm code.
|
|
||||||
loginRgstr;
|
loginRgstr;
|
||||||
|
|
||||||
my %settings = (
|
my %settings = (
|
||||||
assetId => 'new',
|
assetId => 'new',
|
||||||
fieldNames => 'title description startDate duration seatsAvailable location nzymEeuHPQIsgXY0hZxDxA xlvMNwFi1FWwP0PrUAnxSQ',
|
fieldNames => "title description startDate duration seatsAvailable location $mf1Id $mf2Id",
|
||||||
title => 'Untitled',
|
title => 'Untitled',
|
||||||
menuTitle => 'Untitled',
|
menuTitle => 'Untitled',
|
||||||
url => '',
|
url => '',
|
||||||
|
|
@ -401,17 +401,18 @@ my %settings = (
|
||||||
duration_yesNo => 1,
|
duration_yesNo => 1,
|
||||||
seatsAvailable_yesNo => 1,
|
seatsAvailable_yesNo => 1,
|
||||||
location_yesNo => 1,
|
location_yesNo => 1,
|
||||||
nzymEeuHPQIsgXY0hZxDxA_yesNo => 1,
|
$mf1Id . '_yesNo' => 1,
|
||||||
xlvMNwFi1FWwP0PrUAnxSQ_yesNo => 1,
|
$mf2Id . '_yesNo' => 1,
|
||||||
);
|
);
|
||||||
|
|
||||||
my $expected = {
|
my $expected = {
|
||||||
'submissionDeadline' => '1991-06-21',
|
'submissionDeadline' => '1991-06-21',
|
||||||
'menuTitle' => 'Untitled',
|
'menuTitle' => 'Untitled',
|
||||||
'pastDeadlineMessage' => 'The deadline for this submission is past, no more submissions will be taken at this time.',
|
'pastDeadlineMessage' => $settings{pastDeadlineMessage},
|
||||||
'formDescription' => {
|
'formDescription' => {
|
||||||
'location' => '1',
|
'location' => '1',
|
||||||
'nzymEeuHPQIsgXY0hZxDxA' => 'xlvMNwFi1FWwP0PrUAnxSQ',
|
$mf1Id => 1,
|
||||||
|
$mf2Id => 1,
|
||||||
'seatsAvailable' => '1',
|
'seatsAvailable' => '1',
|
||||||
'duration' => '1',
|
'duration' => '1',
|
||||||
'title' => '1',
|
'title' => '1',
|
||||||
|
|
@ -425,7 +426,8 @@ my $expected = {
|
||||||
'duration',
|
'duration',
|
||||||
'seatsAvailable',
|
'seatsAvailable',
|
||||||
'location',
|
'location',
|
||||||
'nzymEeuHPQIsgXY0hZxDxA'
|
$mf1Id,
|
||||||
|
$mf2Id,
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
'description' => undef,
|
'description' => undef,
|
||||||
|
|
@ -440,12 +442,16 @@ my $expected = {
|
||||||
|
|
||||||
my $htmlText = $ems->www_addSubmissionForm;
|
my $htmlText = $ems->www_addSubmissionForm;
|
||||||
my $form = HTML::Form->parse($htmlText,'http://localhost/');
|
my $form = HTML::Form->parse($htmlText,'http://localhost/');
|
||||||
for my $input ( $form->inputs ) {
|
isnt( $form, undef, 'form created successfully' );
|
||||||
$input->value($settings{$input->name})if exists $settings{$input->name};
|
my $result;
|
||||||
|
SKIP: { skip 'failed to create form', 1 unless $form;
|
||||||
|
for my $input ( $form->inputs ) {
|
||||||
|
$input->value($settings{$input->name})if exists $settings{$input->name};
|
||||||
|
}
|
||||||
|
$session->request->setup_body( { $form->form } );
|
||||||
|
$result = WebGUI::Asset::EMSSubmissionForm->processForm($ems);
|
||||||
|
cmp_deeply( $result, $expected , 'test process form -- with data' );
|
||||||
}
|
}
|
||||||
$session->request->setup_body( { $form->form } );
|
|
||||||
my $result = WebGUI::Asset::EMSSubmissionForm->processForm($ems);
|
|
||||||
cmp_deeply( $result, $expected , 'test process form' );
|
|
||||||
$expected = {
|
$expected = {
|
||||||
'errors' => [
|
'errors' => [
|
||||||
{
|
{
|
||||||
|
|
@ -470,8 +476,7 @@ $expected = {
|
||||||
};
|
};
|
||||||
$session->request->setup_body( { } );
|
$session->request->setup_body( { } );
|
||||||
$result = WebGUI::Asset::EMSSubmissionForm->processForm($ems);
|
$result = WebGUI::Asset::EMSSubmissionForm->processForm($ems);
|
||||||
cmp_deeply( $result, $expected , 'test process form' );
|
cmp_deeply( $result, $expected , 'test process form -- no data' );
|
||||||
} # end of skip HTML::Form
|
|
||||||
|
|
||||||
# these run code to see that it runs, but do not check for correctness
|
# these run code to see that it runs, but do not check for correctness
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -182,7 +182,7 @@ WebGUI.EMS = function (configs) {
|
||||||
WebGUI.EMS.i18n.get('Asset_EventManagementSystem','close tab') + '" /></span>',
|
WebGUI.EMS.i18n.get('Asset_EventManagementSystem','close tab') + '" /></span>',
|
||||||
contentEl: myContent
|
contentEl: myContent
|
||||||
});
|
});
|
||||||
initHoverHelp( myTab );
|
// initHoverHelp( myTab );
|
||||||
WebGUI.EMS.tabs.addTab( myTab );
|
WebGUI.EMS.tabs.addTab( myTab );
|
||||||
var index = WebGUI.EMS.tabs.getTabIndex(myTab);
|
var index = WebGUI.EMS.tabs.getTabIndex(myTab);
|
||||||
YAHOO.util.Event.on(myTab.getElementsByClassName('close')[0], 'click', WebGUI.EMS.closeTab , myTab);
|
YAHOO.util.Event.on(myTab.getElementsByClassName('close')[0], 'click', WebGUI.EMS.closeTab , myTab);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue