diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 113d8cc02..40263f5bb 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -14,6 +14,7 @@ - fixed #11510: Scratch variables for sort direction and key can break the CS - fixed #11511: Approval Notifications: URL in mails only plain text - fixed #11513: white text, broken account mgmt + - fixed #11514: Added JS-type cancel button to edit view of WebGUI::Asset::Post 7.9.1 - fixed #11464: blank page after setting posts per page in Collaboration System to 0 (zero) diff --git a/docs/upgrades/packages-7.9.2/root_import_collaboration.wgpkg b/docs/upgrades/packages-7.9.2/root_import_collaboration.wgpkg new file mode 100644 index 000000000..1fa092478 Binary files /dev/null and b/docs/upgrades/packages-7.9.2/root_import_collaboration.wgpkg differ diff --git a/lib/WebGUI/Asset/Post.pm b/lib/WebGUI/Asset/Post.pm index 1c8b8ebb0..d9896238a 100644 --- a/lib/WebGUI/Asset/Post.pm +++ b/lib/WebGUI/Asset/Post.pm @@ -1480,16 +1480,15 @@ Renders a template form for adding and editing posts. =cut sub www_edit { - my $self = shift; + my $self = shift; my $session = $self->session; my $form = $session->form; my $privilege = $session->privilege; my $user = $session->user; my $func = $form->process("func"); - my (%var, $content, $title, $synopsis); - my $i18n = WebGUI::International->new($session); - + my (%var, $content, $title, $synopsis); + my $i18n = WebGUI::International->new($session); my $className = $form->process("class","className") || $self->get('className'); if ($func eq "add" || ($func eq "editSave" && $form->process("assetId") eq "new")) { # new post @@ -1695,7 +1694,12 @@ sub www_edit { }); } $var{'form.submit'} = WebGUI::Form::submit($session, { - extras=>"onclick=\"this.value='".$i18n->get(452)."'; this.form.func.value='editSave';return true;\"" + extras=>"onclick=\"this.value='".$i18n->get(452)."'; this.form.func.value='editSave';return true;\"" + }); + $var{'form.cancel'} = WebGUI::Form::button( $session, { + name => "cancel", + value => $i18n->get("cancel"), + extras => 'onclick="history.go(-1)"', }); $var{'karmaScale.form'} = WebGUI::Form::integer($session, { name=>"karmaScale", @@ -1704,7 +1708,7 @@ sub www_edit { }); $var{karmaIsEnabled} = $session->setting->get("useKarma"); $var{'form.preview'} = WebGUI::Form::submit($session, { - value=>$i18n->get("preview","Asset_Collaboration") + value=>$i18n->get("preview","Asset_Collaboration") }); my $numberOfAttachments = $self->getThread->getParent->getValue("attachmentsPerPost"); $var{'attachment.form'} = WebGUI::Form::image($session, { diff --git a/lib/WebGUI/Help/Asset_Post.pm b/lib/WebGUI/Help/Asset_Post.pm index 016c5eb68..da15b68f8 100644 --- a/lib/WebGUI/Help/Asset_Post.pm +++ b/lib/WebGUI/Help/Asset_Post.pm @@ -58,6 +58,7 @@ our $HELP = { { 'name' => 'content.form' }, { 'name' => 'skipNotification.form' }, { 'name' => 'form.submit' }, + { 'name' => 'form.cancel' }, { 'name' => 'karmaScale.form' }, { 'name' => 'karmaIsEnabled' }, { 'name' => 'meta_loop', diff --git a/lib/WebGUI/i18n/English/Asset_Post.pm b/lib/WebGUI/i18n/English/Asset_Post.pm index c7846fb58..05d331502 100644 --- a/lib/WebGUI/i18n/English/Asset_Post.pm +++ b/lib/WebGUI/i18n/English/Asset_Post.pm @@ -192,7 +192,11 @@ will be a plain text area.|, message => q|A button to submit the post.|, lastUpdated => 1149829706, }, - + + 'form.cancel' => { + message => q|A button to cancel the post.|, + lastUpdated => 1270240208, + }, 'karmaScale.form' => { message => q|A form element that allows moderators to set the scale of an individual thread. This is only available for threads.|, lastUpdated => 1149829706,