From 173d3cbb2d836069e6ecaa7263da380ee90a00aa Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 10 Feb 2011 23:52:26 -0500 Subject: [PATCH] Follow-up fix for Bug 2170 - Adding 'edititems' user-permission Save button and duplicate confirmation redirects must respect the edititems permission: Users without permission to edit items should not be redirected to the edit items screen. Signed-off-by: Nicole Engard Signed-off-by: Chris Cormack --- cataloguing/addbiblio.pl | 3 +- .../prog/en/css/staff-global.css | 4 ++ .../en/modules/cataloguing/addbiblio.tmpl | 47 +++++++++++-------- 3 files changed, 33 insertions(+), 21 deletions(-) diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index 2c0c63d1c7..f07b6c9833 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -932,8 +932,7 @@ if ( $op eq "addbiblio" ) { else { ( $biblionumber, $oldbibitemnum ) = AddBiblio( $record, $frameworkcode ); } - - if (($mode ne "popup" && !$is_a_modif) || $redirect eq "items"){ + if ($mode ne "popup" && !$is_a_modif && $redirect eq "items"){ print $input->redirect( "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=$biblionumber&frameworkcode=$frameworkcode" ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css index 3f43f61a70..22abc7591f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -1119,6 +1119,10 @@ div.first fieldset { margin : .4em; padding : .4em .4em .4em 25px; } + + .dialog input[type="submit"] { + background : #FFF none; + } .dialog input.approve, td input.approve { background : #FFF url(../../img/approve.gif) no-repeat 4px center; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl index 0fa4dc1aa0..6cc6678768 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl @@ -30,18 +30,17 @@ $('#header_search > ul').tabs().bind('show.ui-tabs', function(e, ui) { $('#header_search > div:not(.ui-tabs-hide)').find('input').eq(0).focus(); }); -function confirmnotdup(){ +function confirmnotdup(redirect){ $("#confirm_not_duplicate").attr("value","1"); - // alert(_("Not a duplicate confirmed. Please click on Add biblio to save the record")); - var checkform = $("#f"); - Check(checkform); + $("#redirect").attr("value",redirect); + Check(); } /** * * */ -function Check(dest){ +function Check(){ var StrAlert = AreMandatoriesNotOk(); if( ! StrAlert ){ document.f.submit(); @@ -656,12 +655,15 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ?

Duplicate Record suspected

Is this a duplicate of " onclick="openWindow('../MARCdetail.pl?biblionumber=&popup=1', 'Duplicate biblio'; return false;)">?

-
- " /> - -
+
+ " /> + +
+ " /> + +
- +
@@ -675,7 +677,7 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
- + viewitems" id="redirect" name="redirect" /> @@ -692,26 +694,25 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ? yuiToolbar(); }); - var onOption = function () { - return Check(); - } - function redirect(dest){ $("#redirect").attr("value",dest); return Check(); } + + var onOption = function () { + return Check(); + } var savemenu = [ { text: _("Save and view record"), value: 1, onclick: {fn:function(){redirect("view");}} }, { text: _("Save and edit items"), value: 2, onclick: {fn:function(){redirect("items");}} } ]; - + // YUI Toolbar Functions function yuiToolbar() { - // new YAHOO.widget.Button("addbiblio"); - + var savesplitmenu = new YAHOO.widget.Button({ type: "split", label: _("Save"), @@ -722,7 +723,15 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ? }); savesplitmenu.on("click", onOption); - + + new YAHOO.widget.Button({ + id: "addbiblio", + type: "button", + label: _("Save"), + container: "savebutton", + onclick: {fn:function(){redirect("view");}} + }); + new YAHOO.widget.Button({ id: "z3950search", type: "button", -- 2.39.5