Bugzilla – Attachment 3126 Details for
Bug 2170
Adding 'edititems' user-permission
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Follow-up fix
0001-Follow-up-fix-for-Bug-2170-Adding-edititems-user-per.patch (text/plain), 7.21 KB, created by
Owen Leonard
on 2011-02-10 21:23:19 UTC
(
hide
)
Description:
Follow-up fix
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2011-02-10 21:23:19 UTC
Size:
7.21 KB
patch
obsolete
>From 631d463408fd9b9d9e88a9c530d23275d04c5256 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >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 ? > <div class="dialog alert"> > <h4>Duplicate Record suspected</h4> > <p>Is this a duplicate of <a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=<!-- TMPL_VAR name="duplicatebiblionumber" -->" onclick="openWindow('../MARCdetail.pl?biblionumber=<!-- TMPL_VAR name="duplicatebiblionumber" -->&popup=1', 'Duplicate biblio'; return false;)"><!-- TMPL_VAR name="duplicatetitle" --></a>?</p> >- <form action="/cgi-bin/koha/cataloguing/additem.pl" method="get"> >- <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR name="duplicatebiblionumber" -->" /> >- <input type="submit" class="edit" value="Yes: Edit existing items" /> >- </form> >+ <!-- TMPL_IF NAME="CAN_user_editcatalogue_edit_items" --><form action="/cgi-bin/koha/cataloguing/additem.pl" method="get"> >+ <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR name="duplicatebiblionumber" -->" /> >+ <input type="submit" class="edit" value="Yes: Edit existing items" /> >+ </form><!-- TMPL_ELSE --><form action="/cgi-bin/koha/catalogue/detail.pl" method="get"> >+ <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR name="duplicatebiblionumber" -->" /> >+ <input type="submit" value="Yes: View existing items" /> >+ </form><!-- /TMPL_IF --> > <form action="/cgi-bin/koha/cataloguing/addbiblio.pl" method="get"> >- <input type="submit" class="save" onclick="confirmnotdup(); return false;" value="No: Save as New Record" /> >+ <!-- TMPL_IF NAME="CAN_user_editcatalogue_edit_items" --><input type="button" class="save" onclick="confirmnotdup('items'); return false;" value="No: Save as New Record" /><!-- TMPL_ELSE --><input type="button" class="save" onclick="confirmnotdup('view'); return false;" value="No: Save as New Record" /><!-- /TMPL_IF --> > </form> > </div> > <!-- /TMPL_IF --> >@@ -675,7 +677,7 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ? > </script> > <!--TMPL_ELSE--> > <form method="post" name="f" id="f" action="/cgi-bin/koha/cataloguing/addbiblio.pl" onsubmit="return Check();"> >- <input type="hidden" value="" id="redirect" name="redirect" /> >+ <input type="hidden" value="<!-- tmpl_if name="biblionumber" -->view<!-- tmpl_else -->items<!-- /tmpl_if -->" id="redirect" name="redirect" /> > <input type="hidden" value="0" id="confirm_not_duplicate" name="confirm_not_duplicate" /> > <!-- /TMPL_IF --> > >@@ -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(); > } >+<!-- TMPL_IF NAME="CAN_user_editcatalogue_edit_items" --> >+ 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");}} } > ]; >- >+<!-- /TMPL_IF --> > > // YUI Toolbar Functions > > function yuiToolbar() { >- // new YAHOO.widget.Button("addbiblio"); >- >+<!-- TMPL_IF NAME="CAN_user_editcatalogue_edit_items" --> > 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); >- >+<!-- TMPL_ELSE --> >+ new YAHOO.widget.Button({ >+ id: "addbiblio", >+ type: "button", >+ label: _("Save"), >+ container: "savebutton", >+ onclick: {fn:function(){redirect("view");}} >+ }); >+<!-- /TMPL_IF --> > new YAHOO.widget.Button({ > id: "z3950search", > type: "button", >-- >1.7.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 2170
:
524
|
525
|
526
|
527
|
528
|
2413
|
2837
| 3126