Updated to work with getEditForm.

This commit is contained in:
Colin Kuskie 2011-09-30 15:14:13 -07:00
parent e6a7982111
commit cea9786d98
2 changed files with 15 additions and 68 deletions

View file

@ -93,6 +93,20 @@ sub getConfiguredTitle {
#-------------------------------------------------------------------
=head2 getEditForm
Extend the base class so that the user is returned to the viewAll screen after adding/editing
a ribbon.
=cut
override getEditForm => sub {
my $form = super();
$form->addField('hidden', name => 'proceed', value => 'viewAll',);
};
#-------------------------------------------------------------------
=head2 getMaxAllowedInCart
Return 1;
@ -239,40 +253,6 @@ sub www_delete {
}
#-------------------------------------------------------------------
=head2 www_edit ()
Displays the edit form.
=cut
sub www_edit {
my ($self) = @_;
return $self->session->privilege->insufficient() unless $self->canEdit;
return $self->session->privilege->locked() unless $self->canEditIfLocked;
$self->session->style->setRawHeadTags(q|
<style type="text/css">
.forwardButton {
background-color: green;
color: white;
font-weight: bold;
padding: 3px;
}
.backwardButton {
background-color: red;
color: white;
font-weight: bold;
padding: 3px;
}
</style>
|);
my $i18n = WebGUI::International->new($self->session, "Asset_EventManagementSystem");
my $form = $self->getEditForm;
$form->addField( "hidden", name=>'proceed', value=>'viewAll', );
return $self->processStyle('<h1>'.$i18n->get('ems ribbon').'</h1>'.$form->toHtml);
}
#-------------------------------------------------------------------
=head2 www_viewAll ()

View file

@ -275,6 +275,7 @@ override getEditForm => sub {
defaultValue => $date->toDatabase,
value => $self->startDate,
);
$form->addField('hidden', name => 'proceed', value => 'viewAll',);
return $form;
};
@ -545,40 +546,6 @@ sub www_delete {
}
#-------------------------------------------------------------------
=head2 www_edit ()
Displays the edit form.
=cut
sub www_edit {
my ($self) = @_;
return $self->session->privilege->insufficient() unless $self->canEdit;
return $self->session->privilege->locked() unless $self->canEditIfLocked;
$self->session->style->setRawHeadTags(q|
<style type="text/css">
.forwardButton {
background-color: green;
color: white;
font-weight: bold;
padding: 3px;
}
.backwardButton {
background-color: red;
color: white;
font-weight: bold;
padding: 3px;
}
</style>
|);
my $i18n = WebGUI::International->new($self->session, "Asset_EventManagementSystem");
my $form = $self->getEditForm;
$form->addField( "hidden", name=>'proceed', value=>'viewAll');
return $self->processStyle('<h1>'.$i18n->get('ems ticket').'</h1>'.$form->toHtml);
}
#-------------------------------------------------------------------
=head2 www_viewAll ()