[Koha-patches] [PATCH] BUGFIX (bloquing) moredetail & item edition

paul.poulain at biblibre.com paul.poulain at biblibre.com
Wed May 7 19:15:53 CEST 2008


From: Paul POULAIN <paul.poulain at biblibre.com>

this patch introduce the same behaviour as for additem.pl, ie : edit only own homebranch items, except for superlibrarians
---
 catalogue/moredetail.pl                            |    8 ++++++++
 .../prog/en/modules/catalogue/moredetail.tmpl      |    2 +-
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl
index 8d30c76..4736ded 100755
--- a/catalogue/moredetail.pl
+++ b/catalogue/moredetail.pl
@@ -94,6 +94,14 @@ foreach my $item (@items){
     $item->{'datelastseen'} = format_date($item->{'datelastseen'});
     $item->{'ordernumber'} = $ordernum;
     $item->{'booksellerinvoicenumber'} = $order->{'booksellerinvoicenumber'};
+
+    if (C4::Context->preference("IndependantBranches")) {
+        #verifying rights
+        my $userenv = C4::Context->userenv();
+        unless (($userenv->{'flags'} == 1) or ($userenv->{'branch'} eq $item->{'homebranch'})) {
+                $item->{'nomod'}=1;
+        }
+    }
     $item->{'homebranchname'} = GetBranchName($item->{'homebranch'});
     $item->{'holdingbranchname'} = GetBranchName($item->{'holdingbranch'});
     if ($item->{'onloan'} eq ''){
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl
index 562cdb7..3149559 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl
@@ -41,7 +41,7 @@
     <!-- TMPL_LOOP NAME="ITEM_DATA" -->
     <div class="yui-g">
         <h3 id="item<!-- TMPL_VAR NAME="itemnumber" -->">Barcode <!-- TMPL_VAR NAME="barcode" -->  <!-- TMPL_IF name="notforloantext" --><!-- TMPL_VAR name="notforloantext" --> <!-- /TMPL_IF --></h3>
-        <div class="listgroup"><h4>Item Information <!-- TMPL_IF NAME="CAN_user_editcatalogue" --><a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber"-->&amp;itemnumber=<!-- TMPL_VAR NAME="itemnumber" -->">[Edit Items]</a><!-- /TMPL_IF --></h4>
+        <div class="listgroup"><h4>Item Information <!-- TMPL_IF NAME="CAN_user_editcatalogue" --><!-- TMPL_UNLESS name="nomod" --><a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber"-->&amp;itemnumber=<!-- TMPL_VAR NAME="itemnumber" -->">[Edit Items]</a><!-- /TMPL_IF --><!-- /TMPL_UNLESS --></h4>
             <ol class="bibliodetails">
             <li><span class="label">Home Library:</span> <!-- TMPL_VAR NAME="homebranchname" -->&nbsp;</li>
 	    <!-- TMPL_IF NAME="item-level_itypes" -->
-- 
1.5.3.2




More information about the Koha-patches mailing list