- Added "Save and Commit" option for environments where the appearance of

workflow is unwanted.
This commit is contained in:
JT Smith 2006-07-25 21:11:14 +00:00
parent f1159269a0
commit 09af3e8785
6 changed files with 44 additions and 3 deletions

View file

@ -53,6 +53,8 @@
than the array() method.
- Added more tests to the test suite.
- fix: Search Feature Select Box Not Working
- Added "Save and Commit" option for environments where the appearance of
workflow is unwanted.
7.0.2

View file

@ -22,10 +22,17 @@ sleep(1); # todd prevent duplicate timestamps
my $session = start(); # this line required
deleteTemplate();
addConfigOption();
finish($session); # this line required
#-------------------------------------------------
sub addConfigOption {
print "\tAdding save and commit option.\n" unless ($quiet);
$session->config->set("enableSaveAndCommit", 0);
}
#-------------------------------------------------
sub deleteTemplate {
print "\tDeleting a template that was accidentally added.\n" unless ($quiet);

View file

@ -214,6 +214,11 @@
# "WebGUI:::Asset::Template" : 4
# },
# Optionally add a "Save and Commit" button to assets so that you
# don't have to hit "Commit My Changes" seperately.
"enableSaveAndCommit" : 0,
# Optionally override the default UI Level of any asset. This
# determines whether the current user has the appropriate UI Level
# to add assets of that type.
@ -355,14 +360,15 @@
"WebGUI::Image::Graph::XYGraph::Line"
],
#Optional script to run upon successful login. The script can contain macros
# Optional script to run upon successful login. The script can contain macros
# ex: /data/WebGUI/sbin/doLogin.pl --configFile=dev.localhost.localdomain.conf --loginPage=^PageUrl();
"runOnLogin" : "",
#Optional script to run upon successful logout. The script can contain macros
# ex: /data/WebGUI/sbin/doLogout.pl --configFile=dev.localhost.localdomain.conf --logoutPage=^PageUrl();
# Optional script to run upon successful logout. The script can contain macros
# Example: /data/WebGUI/sbin/doLogout.pl --configFile=dev.localhost.localdomain.conf --logoutPage=^PageUrl();
"runOnLogout" : ""
}

View file

@ -603,6 +603,9 @@ sub getEditForm {
my $uiLevelOverride = $self->get("className");
$uiLevelOverride =~ s/\:\:/_/g;
my $tabform = WebGUI::TabForm->new($self->session,undef,undef,$self->getUrl(),$uiLevelOverride);
if ($self->session->config->get("enableSaveAndCommit")) {
$tabform->submitAppend(WebGUI::Form::submit($self->session, {name=>"saveAndCommit", value=>$i18n->get("save and commit")}));
}
$tabform->hidden({
name=>"func",
value=>"editSave"
@ -1963,6 +1966,10 @@ sub www_editSave {
}
$object->updateHistory("edited");
if ($self->session->form->process("saveAndCommit") ne "") {
$self->session->http->setRedirect($self->getUrl("op=commitVersionTag;tagId=".WebGUI::VersionTag->getWorking($self->session)->getId));
return "1";
}
if ($self->session->form->process("proceed") eq "manageAssets") {
$self->session->asset($object->getParent);
return $self->session->asset->www_manageAssets;

View file

@ -280,6 +280,19 @@ sub submit {
$self->{_submit} = WebGUI::Form::Submit($self->session,$submit);
}
#-------------------------------------------------------------------
=head2 submitAppend ( html )
Appends some HTML to the submit button.
=cut
sub submitAppend {
my $self = shift;
my $html = shift;
$self->{_submit} .= $html;
}
1;

View file

@ -1,6 +1,12 @@
package WebGUI::i18n::English::Asset;
our $I18N = {
'save and commit' => {
message => q|save & commit|,
lastUpdated => 0,
context => q|A button added to all asset properties pages when save and commit mode is enabled.|
},
'add the missing page' => {
message => q|Add the missing page.|,
lastUpdated => 0,