[Koha-cvs] koha/bookshelves shelves.pl [rel_3_0]

Antoine Farnault antoine at koha-fr.org
Fri Dec 15 18:36:57 CET 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch:		rel_3_0
Changes by:	Antoine Farnault <toins>	06/12/15 17:36:57

Modified files:
	bookshelves    : shelves.pl 

Log message:
	- some change on the html param.
	- Writing directly the code of a sub called only once.
	- adding syspref: BiblioDefaultView.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/bookshelves/shelves.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.9.2.7&r2=1.9.2.8

Patches:
Index: shelves.pl
===================================================================
RCS file: /sources/koha/koha/bookshelves/shelves.pl,v
retrieving revision 1.9.2.7
retrieving revision 1.9.2.8
diff -u -b -r1.9.2.7 -r1.9.2.8
--- shelves.pl	14 Dec 2006 17:22:55 -0000	1.9.2.7
+++ shelves.pl	15 Dec 2006 17:36:57 -0000	1.9.2.8
@@ -84,7 +84,7 @@
 );
 
 if ( $query->param('modifyshelfcontents') ) {
-    my $shelfnumber = $query->param('shelfnumber');
+    my $shelfnumber = $query->param('viewshelf');
     my $barcode     = $query->param('addbarcode');
     my ($item) = getiteminformation( 0, $barcode );
     if ( ShelfPossibleAction( $loggedinuser, $shelfnumber, 'manage' ) ) {
@@ -125,7 +125,18 @@
         last SWITCH;
     }
     if ( $query->param('viewshelf') ) {
-        DisplayShelf( $query->param('viewshelf'),$shelflist,$query,$template,$loggedinuser );
+        #check that the user can view the shelf
+        my $shelfnumber = $query->param('viewshelf');
+        if ( ShelfPossibleAction( $loggedinuser, $shelfnumber, 'view' ) ) {
+            my $items = GetShelfContents($shelfnumber);
+            $template->param(
+                shelfname   => $shelflist->{$shelfnumber}->{'shelfname'},
+                shelfnumber => $shelfnumber,
+                viewshelf   => $query->param('viewshelf'),
+                manageshelf => &ShelfPossibleAction( $loggedinuser, $shelfnumber, 'manage' ),
+                itemsloop   => $items,
+            );
+        }
         last SWITCH;
     }
     if ( $query->param('shelves') ) {
@@ -203,7 +214,7 @@
     $line{'surname'} = $shelflist->{$element}->{'surname'}
       unless $shelflist->{$element}->{'owner'} eq $loggedinuser;
     push( @shelvesloop, \%line );
-}
+    }
 
 $template->param(
     shelvesloop             => \@shelvesloop,
@@ -211,6 +222,7 @@
       C4::Context->preference("intranetcolorstylesheet"),
     intranetstylesheet => C4::Context->preference("intranetstylesheet"),
     IntranetNav        => C4::Context->preference("IntranetNav"),
+    "BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1,
 );
 
 output_html_with_http_headers $query, $cookie, $template->output;
@@ -269,6 +281,11 @@
 
 #
 # $Log: shelves.pl,v $
+# Revision 1.9.2.8  2006/12/15 17:36:57  toins
+# - some change on the html param.
+# - Writing directly the code of a sub called only once.
+# - adding syspref: BiblioDefaultView.
+#
 # Revision 1.9.2.7  2006/12/14 17:22:55  toins
 # bookshelves work perfectly with mod_perl and are cleaned.
 #





More information about the Koha-cvs mailing list