new virtual shelves changes, keyed by biblionumber -- approved
authorJoshua Ferraro <jmf@liblime.com>
Thu, 9 Aug 2007 14:22:17 +0000 (09:22 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Thu, 9 Aug 2007 14:22:17 +0000 (09:22 -0500)
32 files changed:
C4/Auth.pm
C4/BookShelves.pm [moved from C4/VirtualShelves.pm with 58% similarity]
C4/Branch.pm
Makefile.PL
bookshelves/addbookbybiblionumber.pl [moved from virtualshelves/addbybiblionumber.pl with 60% similarity]
bookshelves/shelves.pl [moved from virtualshelves/shelves.pl with 75% similarity]
help.pl
installer/kohastructure.sql
koha-tmpl/intranet-tmpl/prog/en/about.tmpl
koha-tmpl/intranet-tmpl/prog/en/auth.tmpl
koha-tmpl/intranet-tmpl/prog/en/bookshelves/addbookbybiblionumber.tmpl [moved from koha-tmpl/intranet-tmpl/prog/en/virtualshelves/addbybiblionumber.tmpl with 71% similarity]
koha-tmpl/intranet-tmpl/prog/en/bookshelves/shelves.tmpl [moved from koha-tmpl/intranet-tmpl/prog/en/virtualshelves/shelves.tmpl with 74% similarity]
koha-tmpl/intranet-tmpl/prog/en/help/admin/systempreferences.tmpl
koha-tmpl/intranet-tmpl/prog/en/help/nohelp.tmpl
koha-tmpl/intranet-tmpl/prog/en/includes/action-catalogue.inc
koha-tmpl/intranet-tmpl/prog/en/includes/error-top.inc
koha-tmpl/intranet-tmpl/prog/en/includes/menu-bookshelves.inc [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/includes/menu-virtualshelves.inc [deleted file]
koha-tmpl/intranet-tmpl/prog/en/includes/menus.inc
koha-tmpl/intranet-tmpl/prog/en/tools/export.tmpl
koha-tmpl/opac-tmpl/prog/en/includes/basket.js
koha-tmpl/opac-tmpl/prog/en/opac-ISBDdetail.tmpl
koha-tmpl/opac-tmpl/prog/en/opac-MARCdetail.tmpl
koha-tmpl/opac-tmpl/prog/en/opac-addbookbybiblionumber.tmpl [moved from koha-tmpl/opac-tmpl/prog/en/opac-addbybiblionumber.tmpl with 73% similarity]
koha-tmpl/opac-tmpl/prog/en/opac-detail.tmpl
koha-tmpl/opac-tmpl/prog/en/opac-shelves.tmpl
opac/opac-addbookbybiblionumber.pl [moved from opac/opac-addbybiblionumber.pl with 87% similarity]
opac/opac-main.pl
opac/opac-shelves.pl
t/BookShelves.t [moved from t/VirtualShelves.t with 91% similarity]
tools/export.pl
updater/updatedatabase

index 9a349b5..14ae8da 100644 (file)
@@ -223,17 +223,18 @@ sub get_template_and_user {
     if ( $in->{'type'} eq "intranet" ) {
         $template->param(
             intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
-            intranetstylesheet => C4::Context->preference("intranetstylesheet"),
-            IntranetNav        => C4::Context->preference("IntranetNav"),
-            intranetuserjs     => C4::Context->preference("intranetuserjs"),
-            TemplateEncoding   => C4::Context->preference("TemplateEncoding"),
-            AmazonContent      => C4::Context->preference("AmazonContent"),
-            LibraryName        => C4::Context->preference("LibraryName"),
-            LoginBranchcode    => (C4::Context->userenv?C4::Context->userenv->{"branch"}:"insecure"),
-            LoginBranchname    => (C4::Context->userenv?C4::Context->userenv->{"branchname"}:"insecure"),
-            AutoLocation       => C4::Context->preference("AutoLocation"),
-            hide_marc          => C4::Context->preference("hide_marc"),
-            patronimages       => C4::Context->preference("patronimages"),
+            intranetstylesheet      => C4::Context->preference("intranetstylesheet"),
+            IntranetNav             => C4::Context->preference("IntranetNav"),
+            intranetuserjs          => C4::Context->preference("intranetuserjs"),
+            TemplateEncoding        => C4::Context->preference("TemplateEncoding"),
+            AmazonContent           => C4::Context->preference("AmazonContent"),
+            LibraryName             => C4::Context->preference("LibraryName"),
+            LoginBranchcode         => (C4::Context->userenv?C4::Context->userenv->{"branch"}:"insecure"),
+            LoginBranchname         => (C4::Context->userenv?C4::Context->userenv->{"branchname"}:"insecure"),
+            LoginBranchnameShort    => substr((C4::Context->userenv?C4::Context->userenv->{"branchname"}:"insecure"),0,10),
+            AutoLocation            => C4::Context->preference("AutoLocation"),
+            hide_marc               => C4::Context->preference("hide_marc"),
+            patronimages            => C4::Context->preference("patronimages"),
             "BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1,
             advancedMARCEditor      => C4::Context->preference("advancedMARCEditor"),
             suggestion              => C4::Context->preference("suggestion"),
@@ -345,7 +346,7 @@ has authenticated.
 
 sub checkauth {
     my $query = shift;
-       # warn "Checking Auth";
+
 # $authnotrequired will be set for scripts which will run without authentication
     my $authnotrequired = shift;
     my $flagsrequired   = shift;
@@ -388,7 +389,7 @@ sub checkauth {
     # state variables
     my $loggedin = 0;
     my %info;
-    my ( $userid, $cookie, $sessionID, $flags );
+    my ( $userid, $cookie, $sessionID, $flags, $envcookie );
     my $logout = $query->param('logout.x');
     if ( $userid = $ENV{'REMOTE_USER'} ) {
 
@@ -430,7 +431,7 @@ sub checkauth {
             close L;
         }
         if ($userid) {
-                       # warn "here $userid";
+                       warn "here $userid";
             if ( $lasttime < time() - $timeout ) {
 
                 # timed logout
@@ -550,14 +551,10 @@ sub checkauth {
 #  new op dev :
 # launch a sequence to check if we have a ip for the branch, if we have one we replace the branchcode of the userenv by the branch bound in the ip.
                 my $ip       = $ENV{'REMOTE_ADDR'};
-                               # if they specify at login, use that
-                               if ($query->param('branch')) {
-                               $branchcode  = $query->param('branch');
-                               $branchname = GetBranchName($branchcode);
-                               }
                 my $branches = GetBranches();
                 my @branchesloop;
                 foreach my $br ( keys %$branches ) {
+
                     #          now we work with the treatment of ip
                     my $domain = $branches->{$br}->{'branchip'};
                     if ( $domain && $ip =~ /^$domain/ ) {
@@ -596,17 +593,7 @@ sub checkauth {
                 $session->param('ip',$session->remote_addr());
                                $session->param('lasttime',time());
                        }
-                       if ($session){
-               C4::Context::set_userenv(
-                $session->param('number'),       $session->param('id'),
-                $session->param('cardnumber'),   $session->param('firstname'),
-                $session->param('surname'),      $session->param('branch'),
-                $session->param('branchname'),   $session->param('flags'),
-                $session->param('emailaddress'), $session->param('branchprinter')
-               );
-               }               
         }
-
         else {
             if ($userid) {
                 $info{'invalid_username_or_password'} = 1;
@@ -636,16 +623,8 @@ sub checkauth {
         my $value = $query->param($name);
         push @inputs, { name => $name, value => $value };
     }
-    # get the branchloop, which we need for authetication
-       use C4::Branch;
-    my $branches = GetBranches();
-    my @branch_loop;
-    for my $branch_hash (keys %$branches) {
-                push @branch_loop, {branchcode => "$branch_hash", branchname => $branches->{$branch_hash}->{'branchname'}, };
-    }
 
     my $template = gettemplate( $template_name, $type, $query );
-    $template->param(branchloop => \@branch_loop,);
     $template->param(
         INPUTS               => \@inputs,
         suggestion           => C4::Context->preference("suggestion"),
similarity index 58%
rename from C4/VirtualShelves.pm
rename to C4/BookShelves.pm
index 06bddb1..ce8810c 100755 (executable)
@@ -1,7 +1,7 @@
 # -*- tab-width: 8 -*-
 # Please use 8-character tabs for this file (indents are every 4 characters)
 
-package C4::VirtualShelves;
+package C4::BookShelves;
 
 # $Id$
 
@@ -33,17 +33,17 @@ $VERSION = do { my @v = '$Revision$' =~ /\d+/g; shift(@v) . "." . join( "_", map
 
 =head1 NAME
 
-C4::VirtualShelves - Functions for manipulating Koha virtual virtualshelves
+C4::BookShelves - Functions for manipulating Koha virtual bookshelves
 
 =head1 SYNOPSIS
 
-  use C4::VirtualShelves;
+  use C4::BookShelves;
 
 =head1 DESCRIPTION
 
-This module provides functions for manipulating virtual virtualshelves,
-including creating and deleting virtualshelves, and adding and removing
-items to and from virtualshelves.
+This module provides functions for manipulating virtual bookshelves,
+including creating and deleting bookshelves, and adding and removing
+items to and from bookshelves.
 
 =head1 FUNCTIONS
 
@@ -69,13 +69,13 @@ my $dbh = C4::Context->dbh;
   $shelflist = &GetShelves($owner, $mincategory);
   ($shelfnumber, $shelfhash) = each %{$shelflist};
 
-Looks up the virtual virtualshelves, and returns a summary. C<$shelflist>
-is a reference-to-hash. The keys are the virtualshelves numbers
+Looks up the virtual bookshelves, and returns a summary. C<$shelflist>
+is a reference-to-hash. The keys are the bookshelf numbers
 (C<$shelfnumber>, above), and the values (C<$shelfhash>, above) are
 themselves references-to-hash, with the following keys:
 
-C<mincategory> : 2 if the list is for "look". 3 if the list is for "Select virtualshelves for adding a virtual".
-virtualshelves of the owner are always selected, whatever the category
+C<mincategory> : 2 if the list is for "look". 3 if the list is for "Select bookshelf for adding a book".
+bookshelves of the owner are always selected, whatever the category
 
 =over 4
 
@@ -85,7 +85,7 @@ A string. The name of the shelf.
 
 =item C<$shelfhash-E<gt>{count}>
 
-The number of virtuals on that virtualshelves.
+The number of books on that bookshelf.
 
 =back
 
@@ -100,14 +100,14 @@ sub GetShelves {
     my ( $owner, $mincategory ) = @_;
 
     my $query = qq(
-        SELECT virtualshelves.shelfnumber, virtualshelves.shelfname,owner,surname,firstname,virtualshelves.category,
-               count(virtualshelfcontents.biblionumber) as count
-        FROM   virtualshelves
-            LEFT JOIN   virtualshelfcontents ON virtualshelves.shelfnumber = virtualshelfcontents.shelfnumber
-            LEFT JOIN   borrowers ON virtualshelves.owner = borrowers.borrowernumber
+        SELECT bookshelf.shelfnumber, bookshelf.shelfname,owner,surname,firstname,bookshelf.category,
+               count(shelfcontents.itemnumber) as count
+        FROM   bookshelf
+            LEFT JOIN   shelfcontents ON bookshelf.shelfnumber = shelfcontents.shelfnumber
+            LEFT JOIN   borrowers ON bookshelf.owner = borrowers.borrowernumber
         WHERE  owner=? OR category>=?
-        GROUP BY virtualshelves.shelfnumber
-        ORDER BY virtualshelves.category, virtualshelves.shelfname, borrowers.firstname, borrowers.surname
+        GROUP BY bookshelf.shelfnumber
+        ORDER BY bookshelf.category, bookshelf.shelfname, borrowers.firstname, borrowers.surname
     );
     my $sth = $dbh->prepare($query);
     $sth->execute( $owner, $mincategory );
@@ -134,10 +134,10 @@ sub GetShelves {
 
   (shelfnumber,shelfname,owner,category) = &GetShelf($shelfnumber);
 
-Looks up information about the contents of virtual virtualshelves number
+Looks up information about the contents of virtual bookshelf number
 C<$shelfnumber>
 
-Returns the database's information on 'virtualshelves' table.
+Returns the database's information on 'bookshelf' table.
 
 =cut
 
@@ -145,7 +145,7 @@ sub GetShelf {
     my ($shelfnumber) = @_;
     my $query = qq(
         SELECT shelfnumber,shelfname,owner,category
-        FROM   virtualshelves
+        FROM   bookshelf
         WHERE  shelfnumber=?
     );
     my $sth = $dbh->prepare($query);
@@ -157,7 +157,7 @@ sub GetShelf {
 
   $itemlist = &GetShelfContents($shelfnumber);
 
-Looks up information about the contents of virtual virtualshelves number
+Looks up information about the contents of virtual bookshelf number
 C<$shelfnumber>.
 
 Returns a reference-to-array, whose elements are references-to-hash,
@@ -170,22 +170,23 @@ sub GetShelfContents {
     my ( $shelfnumber ) = @_;
     my @itemlist;
     my $query =
-       " SELECT biblionumber
-         FROM   virtualshelfcontents
+       " SELECT itemnumber
+         FROM   shelfcontents
          WHERE  shelfnumber=?
-         ORDER BY biblionumber
+         ORDER BY itemnumber
        ";
     my $sth = $dbh->prepare($query);
     $sth->execute($shelfnumber);
     my $sth2 = $dbh->prepare("
-        SELECT biblio.*,biblioitems.* FROM biblio
-            LEFT JOIN biblioitems on biblio.biblionumber=biblioitems.biblionumber
-        WHERE biblio.biblionumber=?"
+        SELECT biblio.*,biblioitems.* FROM items 
+            LEFT JOIN biblio on items.biblionumber=biblio.biblionumber
+            LEFT JOIN biblioitems on items.biblionumber=biblioitems.biblionumber
+        WHERE items.itemnumber=?"
     );
-    while ( my ($biblionumber) = $sth->fetchrow ) {
-        $sth2->execute($biblionumber);
+    while ( my ($itemnumber) = $sth->fetchrow ) {
+        $sth2->execute($itemnumber);
         my $item = $sth2->fetchrow_hashref;
-        $item->{'biblionumber'}=$biblionumber;
+        $item->{'itemnumber'}=$itemnumber;
         push( @itemlist, $item );
     }
     return ( \@itemlist );
@@ -195,11 +196,11 @@ sub GetShelfContents {
 
   $shelfnumber = &AddShelf( $shelfname, $owner, $category);
 
-Creates a new virtual virtualshelves with name C<$shelfname>, owner C<$owner> and category
+Creates a new virtual bookshelf with name C<$shelfname>, owner C<$owner> and category
 C<$category>.
 
 Returns a code to know what's happen.
-    * -1 : if this virtualshelves already exist.
+    * -1 : if this bookshelf already exist.
     * $shelfnumber : if success.
 
 =cut
@@ -208,7 +209,7 @@ sub AddShelf {
     my ( $shelfname, $owner, $category ) = @_;
     my $query = qq(
         SELECT *
-        FROM   virtualshelves
+        FROM   bookshelf
         WHERE  shelfname=? AND owner=?
     );
     my $sth = $dbh->prepare($query);
@@ -218,7 +219,7 @@ sub AddShelf {
     }
     else {
         my $query = qq(
-            INSERT INTO virtualshelves
+            INSERT INTO bookshelf
                 (shelfname,owner,category)
             VALUES (?,?,?)
         );
@@ -231,35 +232,35 @@ sub AddShelf {
 
 =item AddToShelf
 
-  &AddToShelf($biblionumber, $shelfnumber);
+  &AddToShelf($itemnumber, $shelfnumber);
 
-Adds item number C<$biblionumber> to virtual virtualshelves number
+Adds item number C<$itemnumber> to virtual bookshelf number
 C<$shelfnumber>, unless that item is already on that shelf.
 
 =cut
 
 #'
 sub AddToShelf {
-    my ( $biblionumber, $shelfnumber ) = @_;
-    return unless $biblionumber;
+    my ( $itemnumber, $shelfnumber ) = @_;
+    return unless $itemnumber;
     my $query = qq(
         SELECT *
-        FROM   virtualshelfcontents
-        WHERE  shelfnumber=? AND biblionumber=?
+        FROM   shelfcontents
+        WHERE  shelfnumber=? AND itemnumber=?
     );
     my $sth = $dbh->prepare($query);
 
-    $sth->execute( $shelfnumber, $biblionumber );
+    $sth->execute( $shelfnumber, $itemnumber );
     unless ( $sth->rows ) {
         # already on shelf
         my $query = qq(
-            INSERT INTO virtualshelfcontents
-                (shelfnumber, biblionumber, flags)
+            INSERT INTO shelfcontents
+                (shelfnumber, itemnumber, flags)
             VALUES
                 (?, ?, 0)
         );
         $sth = $dbh->prepare($query);
-        $sth->execute( $shelfnumber, $biblionumber );
+        $sth->execute( $shelfnumber, $itemnumber );
     }
 }
 
@@ -267,7 +268,7 @@ sub AddToShelf {
  
     &AddToShelfFromBiblio($biblionumber, $shelfnumber)
 
-    this function allow to add a virtual into the shelf number $shelfnumber
+    this function allow to add a book into the shelf number $shelfnumber
     from biblionumber.
 
 =cut
@@ -276,21 +277,30 @@ sub AddToShelfFromBiblio {
     my ( $biblionumber, $shelfnumber ) = @_;
     return unless $biblionumber;
     my $query = qq(
-        SELECT *
-        FROM   virtualshelfcontents
-        WHERE  shelfnumber=? AND biblionumber=?
+        SELECT itemnumber
+        FROM   items
+        WHERE  biblionumber=?
     );
     my $sth = $dbh->prepare($query);
-    $sth->execute( $shelfnumber, $biblionumber );
+    $sth->execute($biblionumber);
+    my ($itemnumber) = $sth->fetchrow;
+    $query = qq(
+        SELECT *
+        FROM   shelfcontents
+        WHERE  shelfnumber=? AND itemnumber=?
+    );
+    $sth = $dbh->prepare($query);
+    $sth->execute( $shelfnumber, $itemnumber );
     unless ( $sth->rows ) {
+        # "already on shelf";
         my $query =qq(
-            INSERT INTO virtualshelfcontents
-                (shelfnumber, biblionumber, flags)
+            INSERT INTO shelfcontents
+                (shelfnumber, itemnumber, flags)
             VALUES
                 (?, ?, 0)
         );
         $sth = $dbh->prepare($query);
-        $sth->execute( $shelfnumber, $biblionumber );
+        $sth->execute( $shelfnumber, $itemnumber );
     }
 }
 
@@ -298,14 +308,14 @@ sub AddToShelfFromBiblio {
 
 ModShelf($shelfnumber, $shelfname, $owner, $category )
 
-Modify the value into virtualshelves table with values given on input arg.
+Modify the value into bookshelf table with values given on input arg.
 
 =cut
 
 sub ModShelf {
     my ( $shelfnumber, $shelfname, $owner, $category ) = @_;
     my $query = qq(
-        UPDATE virtualshelves
+        UPDATE bookshelf
         SET    shelfname=?,owner=?,category=?
         WHERE  shelfnumber=?
     );
@@ -317,7 +327,7 @@ sub ModShelf {
 
   ($status) = &DelShelf($shelfnumber);
 
-Deletes virtual virtualshelves number C<$shelfnumber>. The virtualshelves must
+Deletes virtual bookshelf number C<$shelfnumber>. The bookshelf must
 be empty.
 
 Returns a two-element array, where C<$status> is 0 if the operation
@@ -344,7 +354,7 @@ sub ShelfPossibleAction {
     my ( $user, $shelfnumber, $action ) = @_;
     my $query = qq(
         SELECT owner,category
-        FROM   virtualshelves
+        FROM   bookshelf
         WHERE  shelfnumber=?
     );
     my $sth = $dbh->prepare($query);
@@ -357,23 +367,23 @@ sub ShelfPossibleAction {
 
 =item DelFromShelf
 
-  &DelFromShelf( $biblionumber, $shelfnumber);
+  &DelFromShelf( $itemnumber, $shelfnumber);
 
-Removes item number C<$biblionumber> from virtual virtualshelves number
-C<$shelfnumber>. If the item wasn't on that virtualshelves to begin with,
+Removes item number C<$itemnumber> from virtual bookshelf number
+C<$shelfnumber>. If the item wasn't on that bookshelf to begin with,
 nothing happens.
 
 =cut
 
 #'
 sub DelFromShelf {
-    my ( $biblionumber, $shelfnumber ) = @_;
+    my ( $itemnumber, $shelfnumber ) = @_;
     my $query = qq(
-        DELETE FROM virtualshelfcontents
-        WHERE  shelfnumber=? AND biblionumber=?
+        DELETE FROM shelfcontents
+        WHERE  shelfnumber=? AND itemnumber=?
     );
     my $sth = $dbh->prepare($query);
-    $sth->execute( $shelfnumber, $biblionumber );
+    $sth->execute( $shelfnumber, $itemnumber );
 }
 
 =head2 DelShelf
@@ -387,7 +397,7 @@ sub DelFromShelf {
 #'
 sub DelShelf {
     my ( $shelfnumber ) = @_;
-        my $sth = $dbh->prepare("DELETE FROM virtualshelves WHERE shelfnumber=?");
+        my $sth = $dbh->prepare("DELETE FROM bookshelf WHERE shelfnumber=?");
         $sth->execute($shelfnumber);
         return 0;
 }
@@ -409,3 +419,53 @@ Koha Developement team <info@koha.org>
 C4::Circulation::Circ2(3)
 
 =cut
+
+#
+# $Log$
+# Revision 1.21  2007/04/04 16:46:22  tipaul
+# HUGE COMMIT : code cleaning circulation.
+#
+# some stuff to do, i'll write a mail on koha-devel NOW !
+#
+# Revision 1.20  2007/03/09 14:31:47  tipaul
+# rel_3_0 moved to HEAD
+#
+# Revision 1.15.8.10  2007/01/25 13:18:15  tipaul
+# checking that a bookshelf with the same name AND OWNER does not exist before creating it
+#
+# Revision 1.15.8.9  2006/12/15 17:37:52  toins
+# removing a function used only once.
+#
+# Revision 1.15.8.8  2006/12/14 17:22:55  toins
+# bookshelves work perfectly with mod_perl and are cleaned.
+#
+# Revision 1.15.8.7  2006/12/13 19:46:41  hdl
+# Some bug fixing.
+#
+# Revision 1.15.8.6  2006/12/11 17:10:06  toins
+# fixing some bugs on bookshelves.
+#
+# Revision 1.15.8.5  2006/12/07 16:45:43  toins
+# removing warn compilation. (perl -wc)
+#
+# Revision 1.15.8.4  2006/11/23 09:05:01  tipaul
+# enable removal of a bookshelf even if there are items inside
+#
+# Revision 1.15.8.3  2006/10/30 09:50:20  tipaul
+# removing getiteminformations (using direct SQL, as we are in a .pm, so it's "legal")
+#
+# Revision 1.15.8.2  2006/08/31 16:03:52  toins
+# Add Pod to DelShelf
+#
+# Revision 1.15.8.1  2006/08/30 15:59:14  toins
+# Code cleaned according to coding guide lines.
+#
+# Revision 1.15  2004/12/16 11:30:58  tipaul
+# adding bookshelf features :
+# * create bookshelf on the fly
+# * modify a bookshelf name & status
+#
+# Revision 1.14  2004/12/15 17:28:23  tipaul
+# adding bookshelf features :
+# * create bookshelf on the fly
+# * modify a bookshelf (this being not finished, will commit the rest soon)
index 79d4d54..4a540be 100644 (file)
@@ -91,7 +91,8 @@ foreach my $thisbranch (keys %$branches) {
 =cut
 
 sub GetBranches {
-    my ($onlymine)=@_;
+
+    my $onlymine=@_;
     # returns a reference to a hash of references to ALL branches...
     my %branches;
     my $dbh = C4::Context->dbh;
index bb5e56a..611f8b7 100644 (file)
@@ -86,7 +86,6 @@ WriteMakefile(
     PREREQ_PM => {
 'CGI' => 3.15,
 'CGI::Carp' => 1.29,
-'CGI::Session' => '4.10',
 'Class::Accessor' => 0.30,
 'DBD::mysql' => 3.0008,
 'DBI' => 1.53,
similarity index 60%
rename from virtualshelves/addbybiblionumber.pl
rename to bookshelves/addbookbybiblionumber.pl
index 1ad5775..787a13b 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-#script to provide virtual shelf management
+#script to provide bookshelf management
 #
 #
 # Copyright 2000-2002 Katipo Communications
 
 =head1 NAME
 
-    addbybiblionumber.pl
+    addbookbybiblionumber.pl
 
 =head1 DESCRIPTION
 
-    This script allow to add a virtual in a virtual shelf from a biblionumber.
+    This script allow to add a book in a virtual shelf from a biblionumber.
 
 =head1 CGI PARAMETERS
 
@@ -40,9 +40,9 @@
 
 =item shelfnumber
 
-    the shelfnumber where to add the virtual.
+    the shelfnumber where to add the book.
 
-=item newvirtualshelf
+=item newbookshelf
 
     if this parameter exists, then it must be equals to the name of the shelf
     to add.
@@ -59,68 +59,63 @@ use strict;
 use C4::Biblio;
 use CGI;
 use C4::Output;
-use C4::VirtualShelves;
+use C4::BookShelves;
 use C4::Circulation;
 use C4::Auth;
 
+
 #use it only to debug !
 use CGI::Carp qw/fatalsToBrowser/;
 use warnings;
 
-my $query           = new CGI;
-my $biblionumber    = $query->param('biblionumber');
-my $shelfnumber     = $query->param('shelfnumber');
-my $newvirtualshelf = $query->param('newvirtualshelf');
-my $category        = $query->param('category');
-
-my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
-    {
-        template_name   => "virtualshelves/addbybiblionumber.tmpl",
-        query           => $query,
-        type            => "intranet",
-        authnotrequired => 0,
-        flagsrequired   => { catalogue => 1 },
-    }
-);
-
-$shelfnumber = AddShelf( $newvirtualshelf, $loggedinuser, $category )
-  if $newvirtualshelf;
-if ( $shelfnumber || ( $shelfnumber == -1 ) ) {    # the shelf already exist.
-    &AddToShelfFromBiblio( $biblionumber, $shelfnumber );
-    print
-"Content-Type: text/html\n\n<html><body onload=\"window.close()\"></body></html>";
+my $query = new CGI;
+my $biblionumber = $query->param('biblionumber');
+my $shelfnumber = $query->param('shelfnumber');
+my $newbookshelf = $query->param('newbookshelf');
+my $category = $query->param('category');
+
+my ($template, $loggedinuser, $cookie)
+= get_template_and_user({template_name => "bookshelves/addbookbybiblionumber.tmpl",
+                            query => $query,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {catalogue => 1},
+                        });
+
+$shelfnumber = AddShelf($newbookshelf,$loggedinuser,$category) if $newbookshelf;
+
+if ($shelfnumber || ($shelfnumber == -1)) { # the shelf already exist.
+    &AddToShelfFromBiblio($biblionumber, $shelfnumber);
+    print "Content-Type: text/html\n\n<html><body onload=\"window.close()\"></body></html>";
     exit;
-}
-else {    # this shelf doesn't already exist.
-    my ( $bibliocount, @biblios ) = GetBiblio($biblionumber);
+} else {    # this shelf doesn't already exist.
+    my  ( $bibliocount, @biblios )  = GetBiblio($biblionumber);
 
-    my ($shelflist) = GetShelves( $loggedinuser, 3 );
+    my ($shelflist) = GetShelves($loggedinuser,3);
     my @shelvesloop;
     my %shelvesloop;
-    foreach my $element ( sort keys %$shelflist ) {
-        push( @shelvesloop, $element );
+    foreach my $element (sort keys %$shelflist) {
+        push (@shelvesloop, $element);
         $shelvesloop{$element} = $shelflist->{$element}->{'shelfname'};
     }
 
-    my $CGIvirtualshelves = CGI::scrolling_list(
-        -name     => 'shelfnumber',
-        -values   => \@shelvesloop,
-        -labels   => \%shelvesloop,
-        -size     => 1,
-        -tabindex => '',
-        -multiple => 0
-    );
+    my $CGIbookshelves=CGI::scrolling_list(
+                -name     => 'shelfnumber',
+                -values   => \@shelvesloop,
+                -labels   => \%shelvesloop,
+                -size     => 1,
+                -tabindex=>'',
+                -multiple => 0 );
 
     $template->param(
-        biblionumber      => $biblionumber,
-        title             => $biblios[0]->{'title'},
-        author            => $biblios[0]->{'author'},
-        CGIvirtualshelves => $CGIvirtualshelves,
-        intranetcolorstylesheet =>
-          C4::Context->preference("intranetcolorstylesheet"),
-        intranetstylesheet => C4::Context->preference("intranetstylesheet"),
-        IntranetNav        => C4::Context->preference("IntranetNav"),
-    );
+                biblionumber => $biblionumber,
+                title => $biblios[0]->{'title'},
+                author => $biblios[0]->{'author'},
+                CGIbookshelves => $CGIbookshelves,
+                intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
+                intranetstylesheet => C4::Context->preference("intranetstylesheet"),
+                IntranetNav => C4::Context->preference("IntranetNav"),
+                );
 
     output_html_with_http_headers $query, $cookie, $template->output;
 }
@@ -153,7 +148,7 @@ else {    # this shelf doesn't already exist.
 # theses scripts don't need to use C4::Search.
 #
 # Revision 1.4.2.3  2006/10/30 09:48:19  tipaul
-# samll bugfix to create a virtualshelf correctly
+# samll bugfix to create a bookshelf correctly
 #
 # Revision 1.4.2.2  2006/08/30 16:13:54  toins
 # correct an error in the "if condition".
similarity index 75%
rename from virtualshelves/shelves.pl
rename to bookshelves/shelves.pl
index ad2dce6..4062e38 100755 (executable)
@@ -24,7 +24,7 @@
 
 =head1 DESCRIPTION
 
-    this script is used to script to provide virtualshelf management
+    this script is used to script to provide bookshelf management
 
 =head1 CGI PARAMETERS
 
@@ -65,7 +65,7 @@
 
 use strict;
 use CGI;
-use C4::VirtualShelves;
+use C4::BookShelves;
 use C4::Biblio;
 use C4::Auth;
 use C4::Output;
@@ -74,7 +74,7 @@ my $query = new CGI;
 
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     {
-        template_name   => "virtualshelves/shelves.tmpl",
+        template_name   => "bookshelves/shelves.tmpl",
         query           => $query,
         type            => "intranet",
         authnotrequired => 0,
@@ -86,14 +86,12 @@ if ( $query->param('modifyshelfcontents') ) {
     my $shelfnumber = $query->param('viewshelf');
     my $barcode     = $query->param('addbarcode');
     my ($item) = GetItem( 0, $barcode );
-       my ($biblio) = GetBiblioFromItemNumber($item->{'itemnumber'});
-
     if ( ShelfPossibleAction( $loggedinuser, $shelfnumber, 'manage' ) ) {
-        AddToShelf( $biblio->{'biblionumber'}, $shelfnumber );
+        AddToShelf( $item->{'itemnumber'}, $shelfnumber );
         foreach ( $query->param ) {
             if (/REM-(\d*)/) {
-                my $biblionumber = $1;
-                DelFromShelf( $biblionumber, $shelfnumber );
+                my $itemnumber = $1;
+                DelFromShelf( $itemnumber, $shelfnumber );
             }
         }
     }
@@ -126,7 +124,6 @@ SWITCH: {
         last SWITCH;
     }
     if ( $query->param('viewshelf') ) {
-
         #check that the user can view the shelf
         my $shelfnumber = $query->param('viewshelf');
         if ( ShelfPossibleAction( $loggedinuser, $shelfnumber, 'view' ) ) {
@@ -135,9 +132,8 @@ SWITCH: {
                 shelfname   => $shelflist->{$shelfnumber}->{'shelfname'},
                 shelfnumber => $shelfnumber,
                 viewshelf   => $query->param('viewshelf'),
-                manageshelf =>
-                  &ShelfPossibleAction( $loggedinuser, $shelfnumber, 'manage' ),
-                itemsloop => $items,
+                manageshelf => &ShelfPossibleAction( $loggedinuser, $shelfnumber, 'manage' ),
+                itemsloop   => $items,
             );
         }
         last SWITCH;
@@ -158,44 +154,47 @@ SWITCH: {
                     }
                 );
             }
-        }
-        my @paramsloop;
-        foreach ( $query->param() ) {
-            my %line;
-            if (/DEL-(\d+)/) {
-                my $delshelf = $1;
-                my ( $status, $count ) = DelShelf($delshelf);
-                if ($status) {
-                    $line{'status'} = $status;
-                    $line{'count'}  = $count;
-                }
+    }
+    my @paramsloop;
+    foreach ( $query->param() ) {
+        my %line;
+        if (/DEL-(\d+)/) {
+            my $delshelf = $1;
+            my ( $status, $count ) = DelShelf($delshelf);
+            if ($status) {
+                $line{'status'} = $status;
+                $line{'count'}  = $count;
             }
-
-            #if the shelf is not deleted, %line points on null
-            push( @paramsloop, \%line );
         }
-        $template->param( paramsloop => \@paramsloop );
-        my ($shelflist) = GetShelves( $loggedinuser, 2 );
-        my $color = '';
-        my @shelvesloop;
-        foreach my $element ( sort keys %$shelflist ) {
-            my %line;
-            ( $color eq 1 ) ? ( $color = 0 ) : ( $color = 1 );
-            $line{'toggle'}            = $color;
-            $line{'shelf'}             = $element;
-            $line{'shelfname'}         = $shelflist->{$element}->{'shelfname'};
-            $line{'shelfvirtualcount'} = $shelflist->{$element}->{'count'};
-            push( @shelvesloop, \%line );
-        }
-        $template->param(
-            shelvesloop => \@shelvesloop,
-            shelves     => 1,
-        );
+
+        #if the shelf is not deleted, %line points on null
+        push( @paramsloop, \%line );
+    }
+    $template->param( paramsloop => \@paramsloop );
+    my ($shelflist) = GetShelves( $loggedinuser, 2 );
+    my $color = '';
+    my @shelvesloop;
+    foreach my $element ( sort keys %$shelflist ) {
+        my %line;
+        ( $color eq 1 ) ? ( $color = 0 ) : ( $color = 1 );
+        $line{'toggle'}         = $color;
+        $line{'shelf'}          = $element;
+        $line{'shelfname'}      = $shelflist->{$element}->{'shelfname'};
+        $line{'shelfbookcount'} = $shelflist->{$element}->{'count'};
+        push( @shelvesloop, \%line );
+    }
+    $template->param(
+        shelvesloop => \@shelvesloop,
+        shelves     => 1,
+    );
         last SWITCH;
     }
 }
 
-my $shelflist = GetShelves( $loggedinuser, 2 );
+($shelflist) =
+  GetShelves( $loggedinuser, 2 )
+  ;    # rebuild shelflist in case a shelf has been added
+
 my $color = '';
 my @shelvesloop;
 my $numberCanManage = 0;
@@ -206,22 +205,22 @@ foreach my $element ( sort keys %$shelflist ) {
     $line{'toggle'}    = $color;
     $line{'shelf'}     = $element;
     $line{'shelfname'} = $shelflist->{$element}->{'shelfname'};
-    $line{"viewcategory$shelflist->{$element}->{'category'}"} = 1;
+    $line{ "category" . $shelflist->{$element}->{'category'} } = 1;
     $line{'mine'} = 1 if $shelflist->{$element}->{'owner'} eq $loggedinuser;
-    $line{'shelfvirtualcount'} = $shelflist->{$element}->{'count'};
-    $line{'canmanage'} =
-      ShelfPossibleAction( $loggedinuser, $element, 'manage' );
+    $line{'shelfbookcount'} = $shelflist->{$element}->{'count'};
+    $line{'canmanage'} =  ShelfPossibleAction( $loggedinuser, $element, 'manage' );
     $line{'firstname'} = $shelflist->{$element}->{'firstname'}
-      unless $shelflist->{$element}->{'owner'} eq $loggedinuser;
+        unless $shelflist->{$element}->{'owner'} eq $loggedinuser;
     $line{'surname'} = $shelflist->{$element}->{'surname'}
-      unless $shelflist->{$element}->{'owner'} eq $loggedinuser;
+        unless $shelflist->{$element}->{'owner'} eq $loggedinuser;
+    
     $numberCanManage++ if $line{'canmanage'};
-    push( @shelvesloop, \%line );
+    
+        push( @shelvesloop, \%line );
 }
 
 $template->param(
     shelvesloop     => \@shelvesloop,
-
     numberCanManage => $numberCanManage,
 );
 
@@ -267,10 +266,10 @@ sub shelves {
     foreach my $element ( sort keys %$shelflist ) {
         my %line;
         ( $color eq 1 ) ? ( $color = 0 ) : ( $color = 1 );
-        $line{'toggle'}            = $color;
-        $line{'shelf'}             = $element;
-        $line{'shelfname'}         = $shelflist->{$element}->{'shelfname'};
-        $line{'shelfvirtualcount'} = $shelflist->{$element}->{'count'};
+        $line{'toggle'}         = $color;
+        $line{'shelf'}          = $element;
+        $line{'shelfname'}      = $shelflist->{$element}->{'shelfname'};
+        $line{'shelfbookcount'} = $shelflist->{$element}->{'count'};
         push( @shelvesloop, \%line );
     }
     $innertemplate->param(
@@ -305,13 +304,13 @@ sub shelves {
 # - adding syspref: BiblioDefaultView.
 #
 # Revision 1.9.2.7  2006/12/14 17:22:55  toins
-# virtualshelves work perfectly with mod_perl and are cleaned.
+# bookshelves work perfectly with mod_perl and are cleaned.
 #
 # Revision 1.9.2.6  2006/12/13 10:06:05  toins
 # fix a mod_perl specific bug.
 #
 # Revision 1.9.2.5  2006/12/11 17:10:06  toins
-# fixing some bugs on virtualshelves.
+# fixing some bugs on bookshelves.
 #
 # Revision 1.9.2.4  2006/11/30 18:23:51  toins
 # theses scripts don't need to use C4::Search.
diff --git a/help.pl b/help.pl
index 7c0743d..0a76f6e 100755 (executable)
--- a/help.pl
+++ b/help.pl
@@ -1,8 +1,27 @@
 #!/usr/bin/perl
-use HTML::Template;
+
+# Copyright 2006 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
 use strict;
 require Exporter;
-use C4::Output;  # contains gettemplate
+use C4::Output;    # contains gettemplate
+use C4::Output;
+
 # use C4::Auth;
 use C4::Context;
 use CGI;
@@ -10,45 +29,46 @@ use CGI;
 my $query = new CGI;
 
 # find the script that called the online help using the CGI referer()
-my $refer  = $query->referer();
+
+my $refer = $query->referer();
+
 # workaround for popup not functioning correctly in IE
 my $referurl = $query->param('url');
-if($referurl){
+if ($referurl) {
     $refer = $query->param('url');
 }
 
 $refer =~ /.*koha\/(.*)\.pl.*/;
 my $from = "help/$1.tmpl";
 
-my $template = gethelptemplate($from,"intranet");
+my $template = gethelptemplate( $from, "intranet" );
+
 # my $template
 output_html_with_http_headers $query, "", $template->output;
 
-
 sub gethelptemplate {
-       my ($tmplbase) = @_;
-
-       my $htdocs;
-               $htdocs = C4::Context->config('intrahtdocs');
-       my ($theme, $lang) = themelanguage($htdocs, $tmplbase, "intranet");
-       unless (-e "$htdocs/$theme/$lang/$tmplbase") {
-               $tmplbase="help/nohelp.tmpl";
-               ($theme, $lang) = themelanguage($htdocs, $tmplbase, "intranet");
-       }
-       my $template = HTML::Template->new(filename      => "$htdocs/$theme/$lang/$tmplbase",
-                                  die_on_bad_params => 0,
-                                  global_vars       => 1,
-                                  path              => ["$htdocs/$theme/$lang/includes"]);
-
-       # XXX temporary patch for Bug 182 for themelang
-       $template->param(themelang => '/intranet-tmpl' . "/$theme/$lang",
-                                                       interface => '/intranet-tmpl',
-                                                       theme => $theme,
-                                                       lang => $lang,
-                                                       intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
-               intranetstylesheet => C4::Context->preference("intranetstylesheet"),
-               IntranetNav => C4::Context->preference("IntranetNav"),
-               referer => $refer,
-                       );
-       return $template;
+    my ($tmplbase) = @_;
+
+    my $htdocs;
+    $htdocs = C4::Context->config('intrahtdocs');
+    my ( $theme, $lang ) = themelanguage( $htdocs, $tmplbase, "intranet" );
+    unless ( -e "$htdocs/$theme/$lang/$tmplbase" ) {
+        $tmplbase = "help/nohelp.tmpl";
+        ( $theme, $lang ) = themelanguage( $htdocs, $tmplbase, "intranet" );
+    }
+    my $template = HTML::Template->new(
+        filename          => "$htdocs/$theme/$lang/$tmplbase",
+        die_on_bad_params => 0,
+        global_vars       => 1,
+        path              => ["$htdocs/$theme/$lang/includes"]
+    );
+
+    # XXX temporary patch for Bug 182 for themelang
+    $template->param(
+        themelang => '/intranet-tmpl' . "/$theme/$lang",
+        interface => '/intranet-tmpl',
+        theme     => $theme,
+        lang      => $lang
+    );
+    return $template;
 }
index adbd4c7..144e7d5 100644 (file)
@@ -447,11 +447,11 @@ CREATE TABLE `biblioitems` (
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 --
--- Table structure for table `virtualshelves`
+-- Table structure for table `bookshelf`
 --
 
-DROP TABLE IF EXISTS `virtualshelves`;
-CREATE TABLE `virtualshelves` (
+DROP TABLE IF EXISTS `bookshelf`;
+CREATE TABLE `bookshelf` (
   `shelfnumber` int(11) NOT NULL auto_increment,
   `shelfname` char(255) default NULL,
   `owner` char(80) default NULL,
@@ -1382,19 +1382,19 @@ CREATE TABLE sessions (
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 --
--- Table structure for table `virtualshelfcontents`
+-- Table structure for table `shelfcontents`
 --
 
-DROP TABLE IF EXISTS `virtualshelfcontents`;
-CREATE TABLE `virtualshelfcontents` (
+DROP TABLE IF EXISTS `shelfcontents`;
+CREATE TABLE `shelfcontents` (
   `shelfnumber` int(11) NOT NULL default '0',
-  `biblionumber` int(11) NOT NULL default '0',
+  `itemnumber` int(11) NOT NULL default '0',
   `flags` int(11) default NULL,
   `dateadded` timestamp NULL default NULL,
   KEY `shelfnumber` (`shelfnumber`),
-  KEY `biblionumber` (`biblionumber`),
-  CONSTRAINT `virtualshelfcontents_ibfk_1` FOREIGN KEY (`shelfnumber`) REFERENCES `virtualshelves` (`shelfnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
-  CONSTRAINT `shelfcontents_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
+  KEY `itemnumber` (`itemnumber`),
+  CONSTRAINT `shelfcontents_ibfk_1` FOREIGN KEY (`shelfnumber`) REFERENCES `bookshelf` (`shelfnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
+  CONSTRAINT `shelfcontents_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 --
index d0a53a5..ff06429 100644 (file)
@@ -5,7 +5,7 @@
 
 <div id="main">
 <div id="mainbloc">
-       <h1>About Koha</h1>
+       <h1>Data about the current version of Koha for bug reports (or general interest).</h1>
        
 <table>
        <caption>Server information</caption>
index 69c6c4b..b91d737 100644 (file)
 <p>
 <label>Password:<br />
 <input type="password" name="password" id="password" class="input" value="" size="20" tabindex="20" /></label>
-</p> 
-<p>
-<label for="branch">Library:</label>
-<select name="branch" id="branch" class="input">
-<!-- TMPL_LOOP NAME="branchloop" -->
-<option value="<!-- TMPL_VAR NAME='branchcode' -->"><!-- TMPL_VAR NAME='branchname' --></option>
-<!-- /TMPL_LOOP -->
-</select>
-</p>
+</p>    
 <p class="submit"><input type="submit" value="Login &raquo;" /></p>
 </form>
+
 <!-- /TMPL_IF -->
 
 <script type="text/javascript">
@@ -9,32 +9,30 @@
     <!-- /TMPL_IF --> to a virtual shelf
 </h1>
 
-<form name="f1" method="POST" action="/cgi-bin/koha/virtualshelves/addbybiblionumber.pl">
+<form name="f1" method="post" action="/cgi-bin/koha/bookshelves/addbookbybiblionumber.pl">
     <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->">
     
     <b>Select an existing shelf</b>
     <p>
-        <label>Add to virtual shelf</label><!-- TMPL_VAR NAME="CGIvirtualshelves" -->
+        <label>Add to virtual shelf</label><!-- TMPL_VAR NAME="CGIbookshelves" -->
     </p>
     <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
     <input type="submit" value="Add to virtual shelf" class="submit" />
 </form>
 <p>...or...</p>
-<form name="f2" method="POST" action="/cgi-bin/koha/virtualshelves/addbybiblionumber.pl">
+<form name="f2" method="post" action="/cgi-bin/koha/bookshelves/addbookbybiblionumber.pl">
     <b>Add to a new shelf:</b>
         <p>
-            <label for="newvirtualshelf">
+            <label for="newbookshelf">
                 Shelf name:
             </label>
-                       <input type="hidden" name="biblionumber" id="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->"/>
-            <input type="text" name="newvirtualshelf" id="newvirtualshelf" size="40" />
+            <input type="text" name="newbookshelf" id="newbookshelf" size="40" />
         </p>
         <p>
             <label for="category">Category:</label>
             <select name="category" id="category">
                 <option value="1">Private</option>
                 <option value="2">Public</option>
-                               <option value="3">Free</option>
             </select>
         </p>
     <input type="submit" value="Add to virtual shelf" class="submit" /> 
@@ -1,25 +1,26 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
-<title>Koha &rsaquo; Virtual Shelves</title>
+<title>Koha &rsaquo; Add to Virtual Shelf</title>
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
 
 <!-- TMPL_INCLUDE NAME="menus.inc" -->
-<!-- TMPL_INCLUDE NAME="menu-virtualshelves.inc" -->
+<!-- TMPL_INCLUDE NAME="menu-bookshelves.inc" -->
+
+<!-- TMPL_IF Name="viewshelf" -->
 
-<!-- TMPL_IF NAME="viewshelf" -->
 <div id="action">
-    <a class="button" href="/cgi-bin/koha/virtualshelves/shelves.pl">Back to virtual Shelves</a>
+    <a class="button" href="/cgi-bin/koha/bookshelves/shelves.pl">Back to virtual Shelves</a>
     <!-- TMPL_IF name="manageshelf" -->
-    <a class="button" href="/cgi-bin/koha/virtualshelves/shelves.pl?op=modif&shelf=<!-- TMPL_VAR NAME="shelfnumber" -->">
-        Edit this shelf</a>
+    <a class="button" href="/cgi-bin/koha/bookshelves/shelves.pl?op=modif&shelf=<!-- TMPL_VAR Name="shelfnumber" -->">
+        Modify this shelf</a>
     <!-- /TMPL_IF -->
 </div>
 
-<h3>Contents of <!-- TMPL_VAR NAME="shelfname" --></h3>
+<h3>Contents of <!-- TMPL_VAR Name="shelfname" --></h3>
 
-<form class="inline" action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post" name="mainform">
+<form class="inline" action="/cgi-bin/koha/bookshelves/shelves.pl" method="post" name="mainform">
     <!-- TMPL_IF NAME="itemsloop" -->
     <table>
-        <input type="hidden" name="viewshelf" value="<!-- TMPL_VAR NAME="shelfnumber" -->" />
+        <input type="hidden" name="viewshelf" value="<!-- TMPL_VAR Name="shelfnumber" -->" />
         <input type="hidden" name="modifyshelfcontents" value="1" />
             <tr>
                 <th>
                 <th>Author</th>
                 <th>Call No.</th>
             </tr>
-        <!-- TMPL_LOOP NAME="itemsloop" -->
+        <!-- TMPL_LOOP Name="itemsloop" -->
             <tr<!-- TMPL_IF name="color" --> class="highlight"<!-- /TMPL_IF -->>
                     <td>
-                        <input type="checkbox" name="REM-<!-- TMPL_VAR NAME="biblionumber" -->" />
+                        <input type="checkbox" name="REM-<!-- TMPL_VAR Name="itemnumber" -->" />
                     </td>
                     <td>
                         <img src="<!-- TMPL_VAR NAME="themelang" -->/images/<!-- TMPL_VAR NAME="itemtype" -->.gif" alt="<!-- TMPL_VAR NAME="itemtype" -->" title="<!-- TMPL_VAR NAME="itemtype" -->" />
@@ -57,7 +58,7 @@
                             <!-- /TMPL_IF -->
                         <!-- /TMPL_IF -->
                     </td>
-                    <td><!-- TMPL_VAR NAME="author" --></td>
+                    <td><!-- TMPL_VAR Name="author" --></td>
                     <td><!-- TMPL_VAR NAME="classification" --></td>
         </tr>
         <!-- /TMPL_LOOP -->
@@ -88,7 +89,7 @@
     <!-- TMPL_IF name="manageshelf" -->
     
 <br />
-<form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post">
+<form action="/cgi-bin/koha/bookshelves/shelves.pl" method="post">
     <table>
         <tr><th colspan="2">Add an item to this shelf by barcode</th></tr>
         <tr>
@@ -97,7 +98,7 @@
             </td>
             <td>
                 <input name="addbarcode" type="text" id="addbarcode" size="14" maxlength="14" />
-                <input type="hidden" name="viewshelf" value="<!-- TMPL_VAR NAME="shelfnumber" -->" />
+                <input type="hidden" name="viewshelf" value="<!-- TMPL_VAR Name="shelfnumber" -->" />
                 <input type="hidden" name="modifyshelfcontents" value="1" />
                 <input type="submit" value="Save" />
             </td>
 </form>
 <!-- /TMPL_IF -->
 <!-- TMPL_ELSE -->
-    <!-- TMPL_IF NAME="shelves" -->
-        <!-- TMPL_IF NAME="status1" -->
-            <p class="error"><!-- TMPL_VAR NAME="string1" --></p>
+    <!-- TMPL_IF Name="shelves" -->
+        <!-- TMPL_IF Name="status1" -->
+            <p class="error"><!-- TMPL_VAR Name="string1" --></p>
         <!-- /TMPL_IF -->
-        <!-- TMPL_LOOP NAME="paramsloop" -->
-            <!-- TMPL_IF NAME="status" -->
-                <p class="error"><!-- TMPL_VAR NAME="string" --></p>
+        <!-- TMPL_LOOP Name="paramsloop" -->
+            <!-- TMPL_IF Name="status" -->
+                <p class="error"><!-- TMPL_VAR Name="string" --></p>
             <!-- /TMPL_IF -->
         <!-- /TMPL_LOOP -->
-    <form method="post" action="/cgi-bin/koha/virtualshelves/shelves.pl">
+    <form method="post" action="/cgi-bin/koha/bookshelves/shelves.pl">
         <input type="hidden" name="shelves" value="1">
         <h3>Create a new virtual shelf</h3>
         <table>
         <tr><th scope="row"><label for="category">Category:</label> </th><td><select name="category" id="category">
                                     <option value="1">Private</option>
                                     <option value="2">Public</option>
-                                                                       <option value="3">Free</option>
                                     </select></td></tr></table>
         <ul>
             <li>A <b>private</b> virtual shelf is managed by you and can be seen only by you.</li>
             <li> A <b>public</b> virtual shelf can be seen by everybody, but managed only by you.</li>
-                       <li> An <b>open</b> virtual shelf can be seen and managed by everybody.</li>
         </ul>
                                 <p><input type="submit" value="Add a new shelf"></p>
                     </form>
         
         <!-- TMPL_IF NAME="numberCanManage" -->
         <!-- TMPL_IF NAME="shelvesloop" -->
-        <form method="post" action="/cgi-bin/koha/virtualshelves/shelves.pl" name="mainform">
+        <form method="post" action="/cgi-bin/koha/bookshelves/shelves.pl" name="mainform">
                     <input type="hidden" name="shelves" value="1" />
                     <h3>Delete virtual shelves</h3>
                     <table>
                         <tr><th>&nbsp;</th><th>Shelf name</th><th>Contents</th></tr>
-                        <!-- TMPL_LOOP NAME="shelvesloop" -->
+                        <!-- TMPL_LOOP Name="shelvesloop" -->
                         <!-- TMPL_IF name="canmanage" -->
                         <tr>
                             <td>
-                                <input type="checkbox" name="DEL-<!-- TMPL_VAR NAME="shelf" -->" />
+                                <input type="checkbox" name="DEL-<!-- TMPL_VAR Name="shelf" -->" />
                             </td>
                             <td>
-                                <a href="/cgi-bin/koha/virtualshelves/shelves.pl?viewshelf=<!-- TMPL_VAR NAME="shelf" -->"><!-- TMPL_VAR NAME="shelfname" --></a>
+                                <a href="/cgi-bin/koha/bookshelves/shelves.pl?viewshelf=<!-- TMPL_VAR Name="shelf" -->"><!-- TMPL_VAR Name="shelfname" --></a>
                             </td>
                             <td>
-                                <!-- TMPL_VAR NAME="shelfvirtualcount" --> item(s)
+                                <!-- TMPL_VAR Name="shelfbookcount" --> item(s)
                             </td>
                         </tr>
                         <!-- /TMPL_IF -->
         <!-- /TMPL_IF -->
         <!-- /TMPL_IF -->
         <br />
-        <p><form class="inline" action="/cgi-bin/koha/virtualshelves/shelves.pl" method="get"><input type="submit" value="Back to virtual shelves" /></form></p>
+        <p><form class="inline" action="/cgi-bin/koha/bookshelves/shelves.pl" method="get"><input type="submit" value="Back to virtual shelves" /></form></p>
 
     <!-- TMPL_ELSE -->
     <!-- TMPL_IF name="edit" -->
         <form method="post">
             <input type="hidden" name="op" value="modifsave">
             <input type="hidden" name="shelfnumber" value="<!-- TMPL_VAR name="shelfnumber" -->">
-<h3>Edit virtual shelf '<!-- TMPL_VAR name="shelfname"-->'</h3>
+<h3>Modify virtual shelf <!-- TMPL_VAR name="shelfname"--></h3>
             <table>
             <tr><td><label for="shelfname">Shelf name: </label></td><td><input type="text" id="shelfname" name="shelfname" size="25" value="<!-- TMPL_VAR name="shelfname"-->" /></td></tr>
             <tr><td><label for="owner">Owner: </label></td><td><input type="hidden" id="owner" name="owner" value="<!-- TMPL_VAR NAME="loggedinuser" -->"><!-- TMPL_VAR NAME="loggedinusername" --></td></tr>
                         <option value="2" selected>Public</option>
                     <!-- TMPL_ELSE -->
                         <option value="2">Public</option>
-                                       <!-- TMPL_IF NAME="category3" -->
-                                               <option value="3" selected>Free</option>
-                                       <!-- TMPL_ELSE -->
-                                               <option value="3">Free</option>
                     <!-- /TMPL_IF -->
                 </select></td></tr>
             </table>
             <ul><li>A <strong>private</strong> virtual shelf is managed by you and can be seen <strong>only</strong> by you.</li>
                 <li> A <strong>public</strong> virtual shelf can be seen by <strong>everybody</strong>, but managed only by you.</li>
-                                <li> A <b>free</b> virtual shelf can be seen and managed by everybody.</li>
             </ul>
             <p><input type="submit" value="Save changes"></p>
 
         </form>
 <!-- /TMPL_IF -->
-<!-- /TMPL_IF -->
 <h3>Virtual shelves</h3>
 
 <table>
-<tr><th>Shelf name</th><th>Category</th><th>Items</th><th>&nbsp;</th></tr>
-
-<!-- TMPL_LOOP NAME="shelvesloop" -->
-<tr<!-- TMPL_IF name="color" --> class="highlight"<!-- /TMPL_IF -->>
-<td><a href="/cgi-bin/koha/virtualshelves/shelves.pl?viewshelf=<!-- TMPL_VAR NAME="shelf" -->"><!-- TMPL_VAR NAME="shelfname" --></a></td>
-<td>
-<!-- TMPL_IF NAME="viewcategory1" -->Private<!-- /TMPL_IF -->
-<!-- TMPL_IF NAME="viewcategory2" -->Public<!-- /TMPL_IF -->
-<!-- TMPL_IF NAME="viewcategory3" -->Free<!-- /TMPL_IF -->
-</td>
-<td><!-- TMPL_VAR NAME="shelfvirtualcount" --> </td>
-<td><!-- TMPL_IF name="mine" --><a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=modif&amp;shelf=<!-- TMPL_VAR NAME="shelf" -->">Edit</a><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></td></tr>
-
-<!-- /TMPL_LOOP -->
-</table>
-        <p><form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="get"><input type="hidden" value="1" name="shelves" /><input type="submit" value="Add or remove virtual shelves" /></form></p>
+<tr><th>Shelf name</th><th>Category</th><th>Content size</th><th>&nbsp;</th></tr>
+<!-- TMPL_LOOP Name="shelvesloop" -->
+<tr<!-- TMPL_IF name="color" --> class="highlight"<!-- /TMPL_IF -->><td><a href="/cgi-bin/koha/bookshelves/shelves.pl?viewshelf=<!-- TMPL_VAR Name="shelf" -->"><!-- TMPL_VAR Name="shelfname" --></a></td><td><!-- TMPL_IF NAME="category1" -->Private<!-- /TMPL_IF --><!-- TMPL_IF NAME="category2" -->Public<!-- /TMPL_IF --><!-- TMPL_IF NAME="category3" -->Free<!-- /TMPL_IF --></td><td><!-- TMPL_VAR Name="shelfbookcount" --> item(s)</td><td><!-- TMPL_IF name="mine" --><a href="/cgi-bin/koha/bookshelves/shelves.pl?op=modif&amp;shelf=<!-- TMPL_VAR NAME="shelf" -->">Modify</a><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></td></tr>
+            <!-- /TMPL_LOOP -->
+        </table>
+        <p><form action="/cgi-bin/koha/bookshelves/shelves.pl" method="get"><input type="hidden" value="1" name="shelves" /><input type="submit" value="Add or remove virtual shelves" /></form></p>
     <!-- /TMPL_IF -->
-
+<!-- /TMPL_IF -->
 
 <br clear="both" />
 
index 4ce7246..28b019f 100644 (file)
 
 <li><b>printcirculationslips --</b> if set to 1, circulation "slips" are printed on your receipt printer. If set to 0, no slips are printed.</li>
 
-<li><b>suggestion --</b> If set to 1, the Suggestions feature is activated in the OPAC. This feature allows OPAC users to suggest purchases. When a suggestion is made in the OPAC, it is assigned the status "ASKED." A librarian then manages the suggestion and can set the status to "REJECTED" or "ORDERED." When an itme is ordered and has arrived in the library, the status becomes "AVAILABLE." Suggestions that are not yet "AVAILABLE" are visible to all users of the OPAC.</li>
+<li><b>suggestion --</b> If set to 1, the Suggestions feature is activated in the OPAC. This feature allows OPAC users to suggest book purchases. When a suggestion is made in the OPAC, it is assigned the status "ASKED." A librarian then manages the suggestion and can set the status to "REJECTED" or "ORDERED." When a book is ordered and has arrived in the library, the status becomes "AVAILABLE." Suggestions that are not yet "AVAILABLE" are visible to all users of the OPAC.</li>
 
 <li><b>template --</b> Preference order for screen templates. Koha comes with several different options for templates that control the look and feel of your Koha screens, and you can also write your own templates.</li>
 
 <li><b>timeout --</b> Inactivity timeout period (in seconds). If a workstation is idle for longer than this period, the user will have to login again.</li>
 
-<li><b>virtualshelves --</b> Set virtual shelves management on or off ("1" or "0"). Users can set up and manage their own "virtual shelves" of favorite library items if this feature is turned on.</li></ul>
+<li><b>virtualshelves --</b> Set virtual shelves management on or off ("1" or "0"). Users can set up and manage their own "virtual bookshelves" of favorite library items if this feature is turned on.</li></ul>
 <!-- TMPL_INCLUDE name="intranet-bottom.inc" -->
index 055e813..38e250d 100644 (file)
@@ -1,13 +1,8 @@
-<!-- TMPL_INCLUDE NAME="help-top.inc" -->
-
-       <div id="main-compact">
+<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
+<title>Online Help &rsaquo; No Help For This Topic!</title>
+<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
+       
        <h1>Online Help</h1>
        <p>Sorry, there is no help available for this topic</p>
-<form action="/cgi-bin/koha/edithelp.pl" method="post">
-<input type="hidden" name="referer" value="<!-- TMPL_VAR NAME="referer" -->">
-<input type="hidden" name="type" value="addnew">
-<input type="submit" name="submit" value="Add help">
-</form>
        </div>
-       
-<!-- TMPL_INCLUDE NAME="help-bottom.inc" -->
+<!-- TMPL_INCLUDE name="intranet-bottom.inc" -->
index 3e4a263..33791aa 100644 (file)
@@ -28,7 +28,7 @@
             </div>
             
             <div class="others">
-                <a href="#" onclick="JavaScript:window.open('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->','Add_to_virtualshelf','width=500,height=400,toolbar=false,scrollbars=yes'); return false;">
+                <a href="#" onclick="JavaScript:window.open('/cgi-bin/koha/bookshelves/addbookbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->','Add_to_bookshelf','width=500,height=400,toolbar=false,scrollbars=yes'); return false;">
                     Add to shelf
                 </a>
                 <a href="/cgi-bin/koha/catalogue/detailprint.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">
index 2b03bbf..687031e 100644 (file)
@@ -54,7 +54,7 @@ a.catalogue:hover {
 <div id="submenu">
        <span class="koha">options &gt;&gt;&nbsp;&nbsp;</span>
        <a href="/cgi-bin/koha/catalogue/search.pl" class="submenu2">search</a>
-       <a href="/cgi-bin/koha/virtualshelves/shelves.pl" class="submenu">Virtual shelves</a>
+       <a href="/cgi-bin/koha/bookshelves/shelves.pl" class="submenu">Virtual shelves</a>
        <a href="/cgi-bin/koha/cataloguing/addbiblio.pl" class="submenu2">Add biblio</a>
        <a href="/cgi-bin/koha/maint/catmaintain.pl" class="submenu">Cat maintenance</a>
 </div>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/menu-bookshelves.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/menu-bookshelves.inc
new file mode 100644 (file)
index 0000000..baa9fef
--- /dev/null
@@ -0,0 +1,5 @@
+<div id="submenu">
+        <a href="/cgi-bin/koha/bookshelves/shelves.pl">Shelves</a>
+</div>
+
+<div id="main">
\ No newline at end of file
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/menu-virtualshelves.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/menu-virtualshelves.inc
deleted file mode 100644 (file)
index a2cfd1e..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<div id="submenu">
-        <a href="/cgi-bin/koha/virtualshelves/shelves.pl">Virtual Shelves</a>
-</div>
-
-<div id="main">
index d507c4a..344b8b5 100644 (file)
@@ -48,7 +48,7 @@
                         <input type="submit" value=" OK " class="submit" />
                         </form>
                      </li>
-                    <li><a href="/cgi-bin/koha/virtualshelves/shelves.pl">Virtual Shelves</a></li>
+                    <li><a href="/cgi-bin/koha/bookshelves/shelves.pl">Virtual Shelves</a></li>
                 </ul>
                 <!-- /TMPL_IF -->
     <!-- TMPL_IF NAME="CAN_user_editcatalogue" -->
index 6a17f0f..af7a989 100644 (file)
@@ -38,7 +38,7 @@
         </p>
         
         <p>
-            <label for="branch">Library</label>
+            <label for="branch">Branch</label>
             <select id="branch" name="branch">
             <option value="">-- All --</option>
                 <!-- TMPL_LOOP name="branchloop" -->
@@ -69,7 +69,7 @@
         <p>
         <label for="dont_export_fields">Don't export fields</label>
         <input id="dont_export_fields" type="text" name="dont_export_fields" />
-        <i>seperate by a blank. (e.g.: 100a 200 606)</i>
+        <i>splitted by a blank. (for example: 100a 200 606)</i>
         </p>
     </fieldset>
     <fieldset>
@@ -84,9 +84,6 @@
             </select>
             format.
         </p>
-        <p>
-        <label for="filename">Filename:</label><input id="filename" tyle=text" name="filename" value="koha.mrc" />
-        </p>
     </fieldset>
     <input type="hidden" name="op" value="export" />
     <input type="submit" value="Export" class="button" />
index f889bdd..ece26ec 100644 (file)
@@ -161,7 +161,7 @@ function addMultiple(){
 
 function addSelToShelf() {
     var items = document.getElementById('records').value;
-    document.location = "/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber="+items;
+    document.location = "/cgi-bin/koha/opac-addbookbybiblionumber.pl?biblionumber="+items;
 }
 
 function addSelRecords(valSel) { // function for adding a selection of biblios to the basket
index 1be9aec..433bb78 100644 (file)
@@ -24,7 +24,7 @@
         </a>
 <!-- TMPL_IF name="virtualshelves" -->
     <!-- TMPL_IF NAME="loggedinusername" -->
-        <a href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->'); return false;">
+        <a href="/cgi-bin/koha/opac-addbookbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" onclick="Dopop('opac-addbookbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->'); return false;">
             Add to My Book List
         </a>
     <!-- /TMPL_IF -->
index c9eaf51..890c1cc 100644 (file)
@@ -24,7 +24,7 @@
         </a>
 <!-- TMPL_IF name="virtualshelves" -->
     <!-- TMPL_IF NAME="loggedinusername" -->
-        <a href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->'); return false;">
+        <a href="/cgi-bin/koha/opac-addbookbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" onclick="Dopop('opac-addbookbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->'); return false;">
             Add to My Book List
         </a>
     <!-- /TMPL_IF -->
@@ -1,5 +1,5 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
-<!-- TMPL_VAR NAME="LibraryNameTitle" --> Catalog -- Add to My Virtual Shelf
+<!-- TMPL_VAR NAME="LibraryNameTitle" --> Catalog -- Add to My Book List
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
 
 
 </h1>
 <!-- /TMPL_IF -->
 
-<!-- TMPL_IF NAME="CGIvirtualshelves"-->
-<form name="f1" action="/cgi-bin/koha/opac-addbybiblionumber.pl" method="POST">
-    <p><b>Select an Existing Virtualshelf</b></p>
-    <label>Add to virtual shelf</label> <!-- TMPL_VAR NAME="CGIvirtualshelves" -->
+<!-- TMPL_IF NAME="CGIbookshelves"-->
+<form name="f1" action="/cgi-bin/koha/opac-addbookbybiblionumber.pl" method="post">
+    <p><b>Select an Existing Bookshelf</b></p>
+    <label>Add to virtual shelf</label> <!-- TMPL_VAR NAME="CGIbookshelves" -->
     <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
     <input type="hidden" name="modifyshelfcontents" value="1" />
     <input type="submit" value="Add to virtual shelf" class="submit" />
 <p>...or...</p>
 <!-- /TMPL_IF -->
 
-<form name="f2" method="POST" action="/cgi-bin/koha/opac-addbybiblionumber.pl">
-    <b>Add to a New Virtualshelf:</b>
+<form name="f2" method="post" action="/cgi-bin/koha/opac-addbookbybiblionumber.pl">
+    <b>Add to a New Bookshelf:</b>
         <p>
-            <label for="newvirtualshelf">
+            <label for="newbookshelf">
                 Shelf Name:
             </label>
-            <input type="text" name="newvirtualshelf" id="newvirtualshelf" size="40" />
+            <input type="text" name="newbookshelf" id="newbookshelf" size="40" />
         </p>
             <label for="category">Category:</label>
             <select name="category" id="category">
index f0aa599..8cadcf7 100644 (file)
@@ -24,7 +24,7 @@
         </a>
 <!-- TMPL_IF name="virtualshelves" -->
     <!-- TMPL_IF NAME="loggedinusername" -->
-        <a href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->'); return false;">
+        <a href="/cgi-bin/koha/opac-addbookbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" onclick="Dopop('opac-addbookbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->'); return false;">
             Add to My Book List
         </a>
     <!-- /TMPL_IF -->
index 33fc706..a061554 100644 (file)
 <h3><a href="/cgi-bin/koha/opac-shelves.pl">Virtual Shelves</a> <img src="<!-- TMPL_VAR NAME="themelang" -->/images/caret.gif" width="16" height="16" alt="&gt;" border="0" /> <!-- TMPL_IF NAME="itemsloop" --><em><!-- TMPL_VAR Name="shelfname" --></em><!-- TMPL_ELSE -->The Virtual Shelf <em><!-- TMPL_VAR Name="shelfname" --></em> is empty<!-- /TMPL_IF --></h3>
 <form class="inline" action="/cgi-bin/koha/opac-shelves.pl" method="post" name="myform">
     <table>
-        <input type="hidden" name="viewshelf" value="<!-- TMPL_VAR Name="shelfnumber" -->" />
-        <input type="hidden" name="modifyshelfcontents" value="1" />
-            <tr>
-                <th>
-                    <a style="color:white;" href="/cgi-bin/koha/opac-shelves.pl" onclick="CheckAll(); return false;">Check All</a>
-                </th>
-                <th>&nbsp;</th>
-                <th>Title</th>
-                <th>Author</th>
-                <th>Call No.</th>
-            </tr>
-        <!-- TMPL_LOOP Name="itemsloop" -->
-            <tr<!-- TMPL_IF name="color" --> class="highlight"<!-- /TMPL_IF -->>
-                    <td>
-                        <input type="checkbox" name="MOD-<!-- TMPL_VAR Name="biblionumber" -->" />
-                        <input type="hidden" name="ModBiblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->">
-                    </td>
-                    <td>
-                        <img src="<!-- TMPL_VAR NAME="themelang" -->/images/<!-- TMPL_VAR NAME="itemtype" -->.gif" alt="<!-- TMPL_VAR NAME="itemtype" -->" title="<!-- TMPL_VAR NAME="itemtype" -->" />
-                    </td>
-                    <td>
-                         <!-- TMPL_IF name="BiblioDefaultViewmarc" -->
-                                        <a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->">
-                                            <!-- TMPL_VAR NAME="title" --> <!-- TMPL_VAR NAME="subtitle" -->
-                                        </a>
-                                    <!-- TMPL_ELSE -->
-                                        <!-- TMPL_IF name="BiblioDefaultViewisbd" -->
-                                            <a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->">
-                                                <!-- TMPL_VAR NAME="title" --> <!-- TMPL_VAR NAME="subtitle" -->
-                                            </a>
-                                        <!-- TMPL_ELSE -->
-                                            <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->">
-                                                <!-- TMPL_VAR NAME="title" --> <!-- TMPL_VAR NAME="subtitle" -->
-                                            </a>
-                                        <!-- /TMPL_IF -->
-                                    <!-- /TMPL_IF -->
-                        </a>
-                    </td>
-                    <td><!-- TMPL_VAR Name="author" --></td>
-                    <td><!-- TMPL_VAR NAME="classification" --></td>
-        </tr>
-        <!-- /TMPL_LOOP -->
-    </table>
+        <!-- TMPL_IF name="manageshelf" --><tr>
+      <th><a href="/cgi-bin/koha/opac-shelves.pl" onclick="CheckAll(); return false;"><img src="<!-- TMPL_VAR NAME="themelang" -->/images/checkall.gif" height="18" width="18" alt="Check All" title="Check All" border="0" /></a></th><th colspan="2">&nbsp;</th>
+    </tr><!-- /TMPL_IF -->
+    <!-- TMPL_IF NAME="itemsloop" -->
+    <!-- TMPL_LOOP Name="itemsloop" -->
+      <tr>
+          <!-- TMPL_IF name="manageshelf" --><td><input type="checkbox" name="REM-<!-- TMPL_VAR Name="itemnumber" -->" /></td><!-- /TMPL_IF -->
+      <td><!-- TMPL_IF NAME="AmazonContent" --><a class="p1" href="/cgi-bin/koha/opac-detail.pl?bib=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->"><img src="<!-- TMPL_IF NAME="isbn" -->http://images.amazon.com/images/P/<!-- TMPL_VAR name="isbn" -->.01.TZZZZZZZ.jpg<!-- TMPL_ELSE -->http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif<!-- /TMPL_IF -->" alt="image" class="thumbnail" /></a><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></td>
+          <td><a class="title" href="opac-detail.pl?bib=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR Name="title" --> <!-- TMPL_VAR NAME="subtitle" --></a> <!-- TMPL_IF NAME="author" -->by <a href="/search?q=au:<!-- TMPL_VAR NAME="author" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="author" --></a><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --> <p> <!-- TMPL_IF name="publicationyear" --> - <!-- TMPL_VAR name="publicationyear" --><!-- /TMPL_IF -->
+            <!-- TMPL_IF name="publishercode" -->- <!-- TMPL_VAR name="publishercode" --><!-- /TMPL_IF -->
+            <!-- TMPL_IF name="place" --> ; <!-- TMPL_VAR name="place" --><!-- /TMPL_IF -->
+            <!-- TMPL_IF name="pages" --> <!-- TMPL_VAR name="pages" --><!-- /TMPL_IF -->
+            <!-- TMPL_IF name="notes" --> : <!-- TMPL_VAR name="notes" --><!-- /TMPL_IF -->
+            <!-- TMPL_IF name="size" --> <!-- TMPL_VAR name="size" --><!-- /TMPL_IF -->
+            <!-- TMPL_IF name="timestamp" --> <i>(modified on <!-- TMPL_VAR name="timestamp" -->)</i><!-- /TMPL_IF --></p>
+        <p><!-- TMPL_UNLESS NAME="norequests" --><!-- TMPL_IF NAME="opacuserlogin" --><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?bib=<!-- TMPL_VAR NAME="biblionumber" -->">Place Reserve</a><!-- /TMPL_IF --><!-- /TMPL_UNLESS --><img src="<!-- TMPL_VAR NAME="themelang" -->/images/<!-- TMPL_VAR NAME="ccode" -->.gif" alt="<!-- TMPL_VAR NAME="ccode" -->" title="<!-- TMPL_VAR NAME="ccode" -->" /><a href="/search?q=callnum:<!-- TMPL_VAR NAME="classification" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="classification" --></a></p>
+</td>
+    </tr>
+    <!-- /TMPL_LOOP -->
     <!-- TMPL_ELSE -->
     <tr><td colspan="5">This Virtual Shelf is empty.</td></tr>
     <!-- /TMPL_IF -->
similarity index 87%
rename from opac/opac-addbybiblionumber.pl
rename to opac/opac-addbookbybiblionumber.pl
index 4747712..88930c0 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-#script to provide virtualshelf management
+#script to provide bookshelf management
 # WARNING: This file uses 4-character tabs!
 #
 # $Header$
@@ -25,7 +25,7 @@
 use strict;
 use C4::Biblio;
 use CGI;
-use C4::VirtualShelves;
+use C4::BookShelves;
 use C4::Circulation;
 use C4::Auth;
 use C4::Output;
@@ -33,19 +33,19 @@ use C4::Output;
 my $query        = new CGI;
 my $biblionumber = $query->param('biblionumber');
 my $shelfnumber  = $query->param('shelfnumber');
-my $newvirtualshelf = $query->param('newvirtualshelf');
+my $newbookshelf = $query->param('newbookshelf');
 my $category     = $query->param('category');
 
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     {
-        template_name   => "opac-addbybiblionumber.tmpl",
+        template_name   => "opac-addbookbybiblionumber.tmpl",
         query           => $query,
         type            => "opac",
         authnotrequired => 1,
     }
 );
 
-$shelfnumber = AddShelf( '', $newvirtualshelf, $loggedinuser, $category ) if $newvirtualshelf;
+$shelfnumber = AddShelf( '', $newbookshelf, $loggedinuser, $category ) if $newbookshelf;
 
 # to know if we had to add more than one biblio.
 my $multiple = 0;
@@ -75,9 +75,9 @@ else {
             $shelvesloop{$element} = $shelflist->{$element}->{'shelfname'};
     }
 
-    my $CGIvirtualshelves;
+    my $CGIbookshelves;
     if ( @shelvesloop > 0 ) {
-        $CGIvirtualshelves = CGI::scrolling_list (
+        $CGIbookshelves = CGI::scrolling_list (
             -name     => 'shelfnumber',
             -values   => \@shelvesloop,
             -labels   => \%shelvesloop,
@@ -110,7 +110,7 @@ else {
     }
 
     $template->param (
-        CGIvirtualshelves       => $CGIvirtualshelves,
+        CGIbookshelves       => $CGIbookshelves,
     );
 
     output_html_with_http_headers $query, $cookie, $template->output;
index 8ec0eb0..cc42d1e 100755 (executable)
@@ -22,7 +22,7 @@ require Exporter;
 use CGI;
 use C4::Auth;    # get_template_and_user
 use C4::Output;
-use C4::VirtualShelves;
+use C4::BookShelves;
 use C4::Languages;       # getTranslatedLanguages
 use C4::Branch;          # GetBranches
 use C4::Members;         # GetMember
index 683610c..ac4a26c 100755 (executable)
@@ -25,7 +25,7 @@
 
 =head1 DESCRIPTION
 
-    this script is used to script to provide virtualshelf management
+    this script is used to script to provide bookshelf management
 
 =head1 CGI PARAMETERS
 
 use strict;
 use CGI;
 use C4::Output;
-use C4::VirtualShelves;
+use C4::BookShelves;
 use C4::Circulation;
 use C4::Auth;
 use C4::Output;
-use C4::Biblio;
 
 my $query = new CGI;
 
@@ -88,14 +87,13 @@ if ( $query->param('modifyshelfcontents') ) {
     my $shelfnumber = $query->param('viewshelf');
     my $barcode     = $query->param('addbarcode');
     my ($item) = GetItemnumberFromBarcode($barcode);
-       my ($biblio) = GetBiblioFromItemNumber($item->{'itemnumber'});
     if ( ShelfPossibleAction( $loggedinuser, $shelfnumber, 'manage' ) ) {
-        AddToShelf( $biblio->{'biblionumber'}, $shelfnumber );
+        AddToShelf( $item->{'itemnumber'}, $shelfnumber );
         foreach ( $query->param ) {
             if (/MOD-(\d*)/) {
-                my $biblionumber = $1;
+                my $itemnumber = $1;
                 if ( $query->param('remove') eq "on" ) {
-                    DelFromShelf( $biblionumber, $shelfnumber );
+                    DelFromShelf( $itemnumber, $shelfnumber );
                 }
             }
         }
@@ -185,7 +183,7 @@ SWITCH: {
         $line{'toggle'}         = $color;
         $line{'shelf'}          = $element;
         $line{'shelfname'}      = $shelflist->{$element}->{'shelfname'};
-        $line{'shelfvirtualcount'} = $shelflist->{$element}->{'count'};
+        $line{'shelfbookcount'} = $shelflist->{$element}->{'count'};
         push( @shelvesloop, \%line );
     }
     $template->param(
@@ -210,7 +208,7 @@ foreach my $element ( sort keys %$shelflist ) {
         $line{'shelfname'} = $shelflist->{$element}->{'shelfname'};
         $line{ "category" . $shelflist->{$element}->{'category'} } = 1;
         $line{'mine'} = 1 if $shelflist->{$element}->{'owner'} eq $loggedinuser;
-        $line{'shelfvirtualcount'} = $shelflist->{$element}->{'count'};
+        $line{'shelfbookcount'} = $shelflist->{$element}->{'count'};
         $line{'canmanage'}      =
           ShelfPossibleAction( $loggedinuser, $element, 'manage' );
         $line{'firstname'} = $shelflist->{$element}->{'firstname'}
@@ -267,13 +265,13 @@ output_html_with_http_headers $query, $cookie, $template->output;
 # add the link to "BiblioDefaultView systempref" and not to opac-detail.pl
 #
 # Revision 1.8.2.7  2006/12/14 17:22:55  toins
-# virtualshelves work perfectly with mod_perl and are cleaned.
+# bookshelves work perfectly with mod_perl and are cleaned.
 #
 # Revision 1.8.2.6  2006/12/14 16:04:25  toins
 # sync with intranet.
 #
 # Revision 1.8.2.5  2006/12/11 17:10:06  toins
-# fixing some bugs on virtualshelves.
+# fixing some bugs on bookshelves.
 #
 # Revision 1.8.2.4  2006/12/07 15:42:15  toins
 # synching opac & intranet.
similarity index 91%
rename from t/VirtualShelves.t
rename to t/BookShelves.t
index f3f3b35..40c6f77 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 
 #
-# This file is a test script for C4::VirtualShelves.pm
+# This file is a test script for C4::BookShelves.pm
 # Author : Antoine Farnault, antoine@koha-fr.org
 #
 
@@ -53,16 +53,16 @@ while(my $biblionumber = $sth->fetchrow){
 }
 
 # ---
-my $delete_virtualshelf = qq/
-    DELETE FROM  virtualshelf WHERE 1
+my $delete_bookshelf = qq/
+    DELETE FROM  bookshelf WHERE 1
 /;
-my $delete_virtualshelfcontent =qq/
+my $delete_bookshelfcontent =qq/
     DELETE  FROM  shelfcontents WHERE 1
 /;
 
-my $sth = $dbh->prepare($delete_virtualshelf);
+my $sth = $dbh->prepare($delete_bookshelf);
 $sth->execute;
-my $sth = $dbh->prepare($delete_virtualshelfcontent);
+my $sth = $dbh->prepare($delete_bookshelfcontent);
 $sth->execute;
 # ---
 
@@ -72,9 +72,9 @@ $sth->execute;
 #
 #----------------------------------------------------------------------#
 
-use C4::VirtualShelves;
-my $version = C4::VirtualShelves->VERSION;
-print "\n----------Testing C4::VirtualShelves version ".$version."--------\n";
+use C4::BookShelves;
+my $version = C4::BookShelves->VERSION;
+print "\n----------Testing C4::BookShelves version ".$version."--------\n";
 
 ok($version);   # First test: the module is loaded & the version is readable.
 
index 2d92842..0370ee4 100755 (executable)
@@ -29,13 +29,12 @@ use C4::Branch;  # GetBranches
 
 my $query = new CGI;
 my $op=$query->param("op");
-my $filename=$query->param("filename");
 my $dbh=C4::Context->dbh;
 my $marcflavour = C4::Context->preference("marcflavour");
 
 if ($op eq "export") {
        print $query->header(   -type => 'application/octet-stream', 
-                                                       -attachment=>$filename);
+               -attachment=>'koha.mrc');
     
     my $StartingBiblionumber  = $query->param("StartingBiblionumber");
     my $EndingBiblionumber    = $query->param("EndingBiblionumber");
index ee03721..26606ed 100755 (executable)
@@ -1252,7 +1252,7 @@ my %foreign_keys = (
     ],
     shelfcontents => [
         {    key => 'shelfnumber',
-            foreigntable => 'virtualshelf',
+            foreigntable => 'bookshelf',
             foreignkey => 'shelfnumber',
             onUpdate => 'CASCADE',
             onDelete => 'CASCADE',