koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha/C4 SearchMarc.pm [rel_2_2]


From: paul poulain
Subject: [Koha-cvs] koha/C4 SearchMarc.pm [rel_2_2]
Date: Fri, 01 Sep 2006 09:44:10 +0000

CVSROOT:        /cvsroot/koha
Module name:    koha
Branch:         rel_2_2
Changes by:     paul poulain <tipaul>   06/09/01 09:44:10

Modified files:
        C4             : SearchMarc.pm 

Log message:
        better behaviour of hidelostitems systempref.
        if it is set, items are no more hidden in librarian interface if the 
user has superlibrarian or editcatalogue permissions

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/SearchMarc.pm?cvsroot=koha&only_with_tag=rel_2_2&r1=1.36.2.33&r2=1.36.2.34

Patches:
Index: SearchMarc.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Attic/SearchMarc.pm,v
retrieving revision 1.36.2.33
retrieving revision 1.36.2.34
diff -u -b -r1.36.2.33 -r1.36.2.34
--- SearchMarc.pm       3 Aug 2006 10:24:09 -0000       1.36.2.33
+++ SearchMarc.pm       1 Sep 2006 09:44:10 -0000       1.36.2.34
@@ -392,18 +392,26 @@
        my $oldline;
        my ($oldbibid, $oldauthor, $oldtitle);
        my $sth_itemCN;
-       if (C4::Context->preference('hidelostitems')) {
+       my $userenv=C4::Context->userenv;
+#      warn "FLAGS : ".($userenv->{flags} & 2**9);
+    # hide lost items if :
+    # - the preference hidelostitems is set
+    # - the user not logged in, or is not a superlibrarian or a librarian with 
cataloguing permissions
+    # otherwise, show everything
+       if (!C4::Context->preference('hidelostitems') or ($userenv && 
($userenv->{'flags'} eq 1 or ($userenv->{'flags'} & 2**9)) )) {
+       # show everything
                $sth_itemCN = $dbh->prepare("
   SELECT items.holdingbranch, items.location, items.itemcallnumber, count(*) 
AS cnt, items.itemnumber, items.notforloan
   FROM items 
-  WHERE biblionumber=? AND (itemlost = 0 OR itemlost IS NULL)
+  WHERE biblionumber=? 
   GROUP BY items.holdingbranch, items.location, items.itemcallnumber
   ORDER BY homebranch");
        } else {
+       # hide lost items
                $sth_itemCN = $dbh->prepare("
   SELECT items.holdingbranch, items.location, items.itemcallnumber, count(*) 
AS cnt, items.itemnumber, items.notforloan
   FROM items 
-  WHERE biblionumber=? 
+  WHERE biblionumber=? AND (itemlost = 0 OR itemlost IS NULL)
   GROUP BY items.holdingbranch, items.location, items.itemcallnumber 
   ORDER BY homebranch");
        }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]