lots of new stuff
This commit is contained in:
parent
c891d5aab5
commit
f263c2032c
6 changed files with 178 additions and 58 deletions
|
|
@ -93,6 +93,13 @@ sub definition {
|
|||
fieldType => "hidden",
|
||||
defaultValue => undef,
|
||||
},
|
||||
submissionStatus => {
|
||||
fieldType =>"selectList",
|
||||
defaultValue => 'pending',
|
||||
customDrawMethod=> 'drawStatusField',
|
||||
label => $i18n->get("submission status"),
|
||||
hoverHelp => $i18n->get("submission status help")
|
||||
},
|
||||
description => {
|
||||
tab => "properties",
|
||||
fieldType => "HTMLArea",
|
||||
|
|
@ -219,14 +226,13 @@ Draws the field for the location property.
|
|||
|
||||
sub drawLocationField {
|
||||
my ($self, $params) = @_;
|
||||
my $options = $self->session->db->buildHashRef("select distinct(location) from EMSTicket left join asset using (assetId)
|
||||
where parentId=? order by location",[$self->get('parentId')]);
|
||||
# TODO get additional params from the EMS location list
|
||||
my $ems = $self->ems;
|
||||
my $options = { map { $_ => $_ } ( @{ $ems->getSubmissionLocations || [ $ems->getLocations ] } ) } ;
|
||||
return WebGUI::Form::combo($self->session, {
|
||||
name => 'location',
|
||||
value => $self->get('location'),
|
||||
options => $options,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -269,6 +275,22 @@ sub drawRelatedRibbonsField {
|
|||
});
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 drawStatusField
|
||||
|
||||
=cut
|
||||
|
||||
sub drawStatusField {
|
||||
my ($self, $params) = @_;
|
||||
return WebGUI::Form::SelectBox($self->session, {
|
||||
name => 'location',
|
||||
value => $self->get('submissionStatus'),
|
||||
options => $self->ems->getStatus,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 duplicate
|
||||
|
|
@ -287,6 +309,16 @@ whenever a copy action is executed
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 ems
|
||||
|
||||
returns the ems ansestor of this asset
|
||||
|
||||
=cut
|
||||
|
||||
sub ems { $_[0]->getParent->getParent }
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_editSubmission ( parent, params )
|
||||
|
||||
edit a submission
|
||||
|
|
@ -358,12 +390,21 @@ dav::log 'EMSSubmission::www_editSubmission: asseId ne new';
|
|||
# for each field
|
||||
for my $field ( values %$fields ) {
|
||||
if( $formDescription->{$field->{fieldId}} ) {
|
||||
dav::dump 'drawing fields:', $field;
|
||||
if( $field->{fieldId} eq 'submissionStatus' ) {
|
||||
$field->{options} = $parent->getParent->getStatus;
|
||||
dav::log 'set options for status';
|
||||
}
|
||||
if( $field->{fieldId} eq 'location' ) {
|
||||
$field->{options} = [ split( /\s*/, $parent->getParent->getLocations ) ];
|
||||
delete $field->{options} if scalar( @{$field->{options}} ) == 0 ;
|
||||
}
|
||||
$newform->dynamicField(%$field);
|
||||
} else {
|
||||
# TODO see that the data gets formatted
|
||||
$newform->readOnly(
|
||||
label => $field->{label},
|
||||
value => $field->{value},
|
||||
value => $field->{value} || '[ ]',
|
||||
fieldId => $field->{fieldId},
|
||||
);
|
||||
}
|
||||
|
|
@ -399,6 +440,16 @@ sub www_editSubmissionSave {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_view
|
||||
|
||||
calles ems->view
|
||||
|
||||
=cut
|
||||
|
||||
sub www_view { $_[0]->ems->www_view }
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getEditForm ( )
|
||||
|
||||
Extends the base class to add Tax information for the Sku, in a new tab.
|
||||
|
|
@ -464,10 +515,11 @@ See WebGUI::Asset::prepareView() for details.
|
|||
|
||||
sub prepareView {
|
||||
my $self = shift;
|
||||
$self->next::method();
|
||||
my $template = WebGUI::Asset::Template->new( $self->session, $self->get("templateId") );
|
||||
$template->prepare($self->getMetaDataAsTemplateVariables);
|
||||
$self->{_viewTemplate} = $template;
|
||||
$self->ems->prepareView;
|
||||
#$self->next::method();
|
||||
#my $template = WebGUI::Asset::Template->new( $self->session, $self->get("templateId") );
|
||||
#$template->prepare($self->getMetaDataAsTemplateVariables);
|
||||
#$self->{_viewTemplate} = $template;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------
|
||||
|
|
@ -556,9 +608,10 @@ method called by the container www_view method.
|
|||
|
||||
sub view {
|
||||
my $self = shift;
|
||||
my $var = $self->get; # $var is a hash reference.
|
||||
$var->{controls} = $self->getToolbar;
|
||||
return $self->processTemplate( $var, undef, $self->{_viewTemplate} );
|
||||
return $self->ems->view;
|
||||
#my $var = $self->get; # $var is a hash reference.
|
||||
#$var->{controls} = $self->getToolbar;
|
||||
#return $self->processTemplate( $var, undef, $self->{_viewTemplate} );
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ sub addSubmission {
|
|||
$newParams->{$field} = $form->get($field);
|
||||
}
|
||||
$newParams->{className} = 'WebGUI::Asset::EMSSubmission';
|
||||
$newParams->{status} = 'pending';
|
||||
$newParams->{submissionStatus} = 'pending';
|
||||
$newParams->{submissionId} = $self->get('nextSubmissionId');
|
||||
$self->update({nextSubmissionId => $newParams->{submissionId}+1 });
|
||||
$self->addChild($newParams);
|
||||
|
|
@ -208,6 +208,16 @@ whenever a copy action is executed
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 ems
|
||||
|
||||
returns the ems ansestor of this asset
|
||||
|
||||
=cut
|
||||
|
||||
sub ems { $_[0]->getParent }
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_editSubmissionForm ( [ parent, ] [ params ] )
|
||||
|
||||
create an html form for user to enter params for a new submissionForm asset
|
||||
|
|
@ -346,6 +356,17 @@ sub www_editSubmissionFormSave {
|
|||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_view
|
||||
|
||||
calles ems->view
|
||||
|
||||
=cut
|
||||
|
||||
sub www_view { $_[0]->ems->www_view }
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getFormDescription
|
||||
|
|
@ -383,10 +404,11 @@ See WebGUI::Asset::prepareView() for details.
|
|||
|
||||
sub prepareView {
|
||||
my $self = shift;
|
||||
$self->SUPER::prepareView();
|
||||
my $template = WebGUI::Asset::Template->new( $self->session, $self->get("templateId") );
|
||||
$template->prepare($self->getMetaDataAsTemplateVariables);
|
||||
$self->{_viewTemplate} = $template;
|
||||
$self->ems->prepareView;
|
||||
#$self->SUPER::prepareView();
|
||||
#my $template = WebGUI::Asset::Template->new( $self->session, $self->get("templateId") );
|
||||
#$template->prepare($self->getMetaDataAsTemplateVariables);
|
||||
#$self->{_viewTemplate} = $template;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -426,11 +448,9 @@ asset instances, you will need to purge them here.
|
|||
=head2 purgeRevision ( )
|
||||
|
||||
This method is called when data is purged by the system.
|
||||
|
||||
=cut
|
||||
|
||||
#sub purgeRevision {
|
||||
# my $self = shift;
|
||||
#sub purgeRevision { # my $self = shift;
|
||||
# return $self->SUPER::purgeRevision;
|
||||
#}
|
||||
|
||||
|
|
@ -444,9 +464,10 @@ method called by the container www_view method.
|
|||
|
||||
sub view {
|
||||
my $self = shift;
|
||||
my $var = $self->get; # $var is a hash reference.
|
||||
$var->{controls} = $self->getToolbar;
|
||||
return $self->processTemplate( $var, undef, $self->{_viewTemplate} );
|
||||
return $self->ems->view;
|
||||
#my $var = $self->get; # $var is a hash reference.
|
||||
#$var->{controls} = $self->getToolbar;
|
||||
#return $self->processTemplate( $var, undef, $self->{_viewTemplate} );
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -492,7 +513,7 @@ calls WebGUI::Asset::EMSSubmission->editSubmission
|
|||
=cut
|
||||
|
||||
sub www_editSubmission {
|
||||
dav::log __PACKAGE__ . '::www_addSubmission';
|
||||
dav::log __PACKAGE__ . '::www_editSubmission';
|
||||
my $self = shift;
|
||||
return $self->session->privilege->insufficient() unless $self->canEdit;
|
||||
return WebGUI::Asset::EMSSubmission->www_editSubmission($self,shift);
|
||||
|
|
|
|||
|
|
@ -243,6 +243,13 @@ sub definition {
|
|||
label => $i18n->get('registration staff group'),
|
||||
hoverHelp => $i18n->get('registration staff group help'),
|
||||
},
|
||||
submittedLocationsList => {
|
||||
fieldType => 'text',
|
||||
tab => 'properties',
|
||||
defaultValue => $i18n->get('default submitted location list'),
|
||||
label => $i18n->get('submitted location list label'),
|
||||
hoverHelp => $i18n->get('submitted location list help'),
|
||||
},
|
||||
eventSubmissionGroups => {
|
||||
fieldType => 'hidden',
|
||||
defaultValue => '',
|
||||
|
|
@ -391,7 +398,7 @@ may be SQL optimized for quick access
|
|||
|
||||
sub getLocations {
|
||||
my $self = shift;
|
||||
my $dateRef = shift || [ ];
|
||||
my $dateRef = shift;
|
||||
|
||||
my %hash;
|
||||
my %hashDate;
|
||||
|
|
@ -400,7 +407,9 @@ sub getLocations {
|
|||
# this is a really compact 'uniq' operation
|
||||
my @locations = map { $h{$_}++ == 0 ? $_ : () } ( map { $_->get('location') } ( @$tickets ) );
|
||||
# the dates have the time data removed with a pattern substitution
|
||||
push @$dateRef, map { s/\s*\d+:\d+(:\d+)?//; $h{$_}++ == 0 ? $_ : () } ( map { $_->get('startDate') } ( @$tickets ) );
|
||||
if( $dateRef ) {
|
||||
push @$dateRef, map { s/\s*\d+:\d+(:\d+)?//; $h{$_}++ == 0 ? $_ : () } ( map { $_->get('startDate') } ( @$tickets ) );
|
||||
}
|
||||
|
||||
return @locations;
|
||||
}
|
||||
|
|
@ -435,6 +444,21 @@ sub getRibbons {
|
|||
return $self->getLineage(['children'],{returnObjects=>1, includeOnlyClasses=>['WebGUI::Asset::Sku::EMSRibbon']});
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getSubmissionLocations
|
||||
|
||||
retuns an arrayref of the locations found in the submission location list
|
||||
|
||||
=cut
|
||||
|
||||
sub getSubmissionLocations {
|
||||
my $self = shift;
|
||||
my $text = $self->get('submittedLocationsList');
|
||||
dav::log 'getSubmissionLocations:"', $text, '"';
|
||||
return undef if $text eq '';
|
||||
return [ split( /\s+/, $text ) ];
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub getStatus {
|
||||
my $self = shift;
|
||||
|
|
@ -1037,7 +1061,7 @@ sub www_editEventMetaField {
|
|||
);
|
||||
$f->textarea(
|
||||
-name => "helpText",
|
||||
-label => $i18n2->get('meta field help text),
|
||||
-label => $i18n2->get('meta field help text'),
|
||||
-hoverHelp => $i18n2->get('meta field help text description'),
|
||||
-value => $data->{helpText},
|
||||
);
|
||||
|
|
@ -1197,7 +1221,6 @@ sub www_getAllSubmissions {
|
|||
|
||||
$sql = $self->getLineageSql(['descendants'], $rules);
|
||||
|
||||
print $sql , "\n";
|
||||
my $startIndex = $form->get( 'startIndex' ) || 1;
|
||||
my $rowsPerPage = $form->get( 'rowsPerPage' ) || 25;
|
||||
my $currentPage = int ( $startIndex / $rowsPerPage ) + 1;
|
||||
|
|
@ -1232,9 +1255,9 @@ print $sql , "\n";
|
|||
title => $asset->get( "title" ),
|
||||
createdBy => WebGUI::User->new($session,$asset->get( "createdBy" ))->username,
|
||||
creationDate => $datetime->epochToSet($asset->get( "creationDate" )),
|
||||
status => $self->getStatus($asset->get( "submissionStatus" )),
|
||||
lastReplyDate => $lastReplyDate,
|
||||
lastReplyBy => $lastReplyBy,
|
||||
submissionStatus => $self->getStatus($asset->get( "submissionStatus" ) || 'pending' ),
|
||||
lastReplyDate => $lastReplyDate || '',
|
||||
lastReplyBy => $lastReplyBy || '',
|
||||
);
|
||||
|
||||
push @{ $tableInfo->{ records } }, \%fields;
|
||||
|
|
@ -1624,19 +1647,6 @@ sub www_getScheduleDataJSON {
|
|||
return JSON->new->encode(\%results);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 www_getSubmissionQueueData
|
||||
|
||||
returns JSON data to fill a YUI table.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_getSubmissionQueueData {
|
||||
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_getTicketsAsJson ()
|
||||
|
|
@ -2483,7 +2493,7 @@ sub www_viewSubmissionQueue {
|
|||
canEdit => $self->canEdit,
|
||||
canSubmit => $self->canSubmit,
|
||||
hasSubmissionForms => $self->hasSubmissionForms,
|
||||
getSubmissionQueueDateUrl => $self->getUrl('func=getSubmissionQueueData'),
|
||||
getSubmissionQueueDateUrl => $self->getUrl('func=getAllSubmissions'),
|
||||
addSubmissionFormUrl => $self->getUrl('func=addSubmissionForm'),
|
||||
editSubmissionFormUrl => $self->getUrl('func=editSubmissionForm'),
|
||||
addSubmissionUrl => $self->getUrl('func=addSubmission'),
|
||||
|
|
|
|||
|
|
@ -26,6 +26,18 @@ our $I18N = { ##hashref of hashes
|
|||
context => q|Label for the comments tab.|
|
||||
},
|
||||
|
||||
'submission status' => {
|
||||
message => q|Submission Status|,
|
||||
lastUpdated => 1131394072,
|
||||
context => q|Label for the submission status field.|
|
||||
},
|
||||
|
||||
'submission status help' => {
|
||||
message => q|The status of the submission: pending is waiting for the registrar; feedback is waiting for the owner; denied is denied; approved is waiting to create a ticket; created means the ticket is created successfully, failed means ticket creation was not successfull.|,
|
||||
lastUpdated => 1131394072,
|
||||
context => q|Help text for the submission status field.|
|
||||
},
|
||||
|
||||
# 'TODO' => {
|
||||
# message => q|TODO|,
|
||||
# lastUpdated => 1131394072,
|
||||
|
|
|
|||
|
|
@ -1932,16 +1932,16 @@ normal templates.|,
|
|||
context => q|Help text for the Event SUbmission Queue Template.|
|
||||
},
|
||||
|
||||
'event submission form template' => {
|
||||
message => q|Event Submission Form Template|,
|
||||
'event submission main template' => {
|
||||
message => q|Event Submission Main Template|,
|
||||
lastUpdated => 1131394072,
|
||||
context => q|Label for the event submission form template.|
|
||||
context => q|Label for the event submission main template.|
|
||||
},
|
||||
|
||||
'event submission form template help' => {
|
||||
message => q|This template is used to describe the event submission form which will be used by submitters to entger their information. This template consists of a few standard fields and a list of optional fields which are turned on by selecting them from the list.|,
|
||||
'event submission main template help' => {
|
||||
message => q|This template is used to describe main page of the submission module. It has a dynamic tabset on it which is used to hold one or more pieces of the submission interface.|,
|
||||
lastUpdated => 1131394072,
|
||||
context => q|Help text for the event submission form template.|
|
||||
context => q|Help text for the event submission main template.|
|
||||
},
|
||||
|
||||
'select form to edit' => {
|
||||
|
|
@ -1956,12 +1956,6 @@ normal templates.|,
|
|||
context => q|Label for list of submission forms; user must choose one to proceed to a submission form.|,
|
||||
},
|
||||
|
||||
'main tab label' => {
|
||||
message => q|Main|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|This is the label for te main tab in the edit submissionnForm form|,
|
||||
},
|
||||
|
||||
'pending' => {
|
||||
message => q|Pending|,
|
||||
lastUpdated => 1147050475,
|
||||
|
|
@ -1998,6 +1992,36 @@ normal templates.|,
|
|||
context => q|Label indicating ticket creation failed for submission.|,
|
||||
},
|
||||
|
||||
'meta field help text' => {
|
||||
message => q|Help Text|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|The label for the meta field help text field.|,
|
||||
},
|
||||
|
||||
'meta field help text description' => {
|
||||
message => q|This help text will be provided in the event submission interface.|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|Describes the help text that is attached to meta fields.|,
|
||||
},
|
||||
|
||||
'default submitted location list' => {
|
||||
message => q||,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|This is the default value for the list of locations for event submission.|,
|
||||
},
|
||||
|
||||
'submitted location list label' => {
|
||||
message => q|Locations Available for Event Submissions|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|Label for the submitted location list|,
|
||||
},
|
||||
|
||||
'submitted location list help' => {
|
||||
message => q|Enter a listy of location names here, one name on a line. This list will be available on the event submission form in the location select box. If this field is filled in then only these locations will be available.|,
|
||||
lastUpdated => 1147050475,
|
||||
context => q|This is help text for the submitted location list field.|,
|
||||
},
|
||||
|
||||
# 'TODO' => {
|
||||
# message => q|TODO|,
|
||||
# lastUpdated => 1147050475,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/*** The WebGUI Help Desk
|
||||
/*** The WebGUI EMS Submission system
|
||||
* Requires: YAHOO, Dom, Event, DataSource, DataTable, Paginator, Container
|
||||
*
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue