From 631d463408fd9b9d9e88a9c530d23275d04c5256 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 4 Feb 2011 11:51:36 -0500 Subject: [PATCH] Follow-up fix for Bug 2170 - Adding 'edititems' user-permission Content-Type: text/plain; charset="utf-8" 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. --- cataloguing/addbiblio.pl | 3 +- .../intranet-tmpl/prog/en/css/staff-global.css | 4 ++ .../prog/en/modules/cataloguing/addbiblio.tmpl | 47 ++++++++++++-------- 3 files changed, 33 insertions(+), 21 deletions(-) diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index d332e11..da58166 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -933,8 +933,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 b6d439d..8780c1f 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 b33f897..01785d6 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", -- 1.7.3