tabs mostly working
This commit is contained in:
parent
5f8888fcc9
commit
55ae893c93
4 changed files with 127 additions and 72 deletions
|
|
@ -228,11 +228,19 @@ sub drawLocationField {
|
|||
my ($self, $params) = @_;
|
||||
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,
|
||||
});
|
||||
if( $ems->isRegistrationStaff ) {
|
||||
return WebGUI::Form::combo($self->session, {
|
||||
name => 'location',
|
||||
value => $self->get('location'),
|
||||
options => $options,
|
||||
});
|
||||
} else {
|
||||
return WebGUI::Form::selectBox($self->session, {
|
||||
name => 'location',
|
||||
value => $self->get('location'),
|
||||
options => $options,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -492,13 +500,13 @@ sub getEditTabs {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getUrl
|
||||
=head2 getQueueUrl
|
||||
|
||||
returns the URL for the submission queue page with the submisison id in the hash part
|
||||
|
||||
=cut
|
||||
|
||||
sub getUrl {
|
||||
sub getQueueUrl {
|
||||
my $self = shift;
|
||||
return $self->ems->getUrl('func=viewSubmissionQueue#' . $self->get('submissionId') );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ sub definition {
|
|||
nextSubmissionId => {
|
||||
tab => "properties",
|
||||
fieldType => "integer",
|
||||
defaultValue => 0,
|
||||
defaultValue => 1,
|
||||
label => $i18n->get("next submission id label"),
|
||||
hoverHelp => $i18n->get("next submission id label help")
|
||||
},
|
||||
|
|
@ -1275,7 +1275,7 @@ sub www_getAllSubmissions {
|
|||
|
||||
my %fields = (
|
||||
submissionId => $asset->get("submissionId"),
|
||||
url => $asset->getUrl,
|
||||
url => $asset->getQueueUrl,
|
||||
title => $asset->get( "title" ),
|
||||
createdBy => WebGUI::User->new($session,$asset->get( "createdBy" ))->username,
|
||||
creationDate => $datetime->epochToSet($asset->get( "creationDate" )),
|
||||
|
|
@ -1329,6 +1329,35 @@ sub www_getBadgesAsJson {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_getSubmissionById
|
||||
|
||||
returns a JSON dataset with info about the requested submission
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
sub www_getSubmissionById {
|
||||
my $self = shift;
|
||||
my $submissionId = $self->session->form->get('submissionId');
|
||||
my $result;
|
||||
my $res = $self->getLineage(['descendants'],{ limit => 1, returnObjects=>1,
|
||||
includeOnlyClasses => ['WebGUI::Asset::EMSSubmission'],
|
||||
joinClass => "WebGUI::Asset::EMSSubmission",
|
||||
whereClause => q{submissionId='} . $submissionId . q/'/,
|
||||
} );
|
||||
if( scalar(@$res) == 0 ) {
|
||||
$result->{hasError} = 1;
|
||||
$result->{errors} = [ 'failed to load submission' ];
|
||||
} else {
|
||||
$result->{itemText} = $res->[0]->www_editSubmission;
|
||||
$result->{submissionId} = $submissionId;
|
||||
}
|
||||
$self->session->http->setMimeType('application/json');
|
||||
return JSON->new->encode($result);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_getRegistrantAsJson ( )
|
||||
|
||||
Retrieves the properties of a specific badge and the items attached to it. Expects badgeId to be one of the form params.
|
||||
|
|
@ -2519,7 +2548,8 @@ sub www_viewSubmissionQueue {
|
|||
$self->processTemplate({
|
||||
backUrl => $self->getUrl,
|
||||
isRegistrationStaff => $isRegistrationStaff,
|
||||
canEdit => $canEdit,
|
||||
canEdit => $canEdit,
|
||||
mainUrl => $self->getUrl,
|
||||
canSubmit => $canSubmit,
|
||||
hasSubmissionForms => $self->hasSubmissionForms,
|
||||
getSubmissionQueueDataUrl => $self->getUrl('func=getAllSubmissions'),
|
||||
|
|
@ -2528,8 +2558,8 @@ sub www_viewSubmissionQueue {
|
|||
addSubmissionUrl => $self->getUrl('func=addSubmission'),
|
||||
},$self->get('eventSubmissionQueueTemplateId'));
|
||||
|
||||
return $self->processStyle(
|
||||
$self->processTemplate({
|
||||
return $self->processStyle(
|
||||
$self->processTemplate({
|
||||
queueTabTitle => $isRegistrationStaff ? $i18n->get('submission queue') : $i18n->get('my submissions'),
|
||||
queueTabData => $QueueTabData,
|
||||
backUrl => $self->getUrl,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue