synch'ing virtual shelves management in opac with the librarian one, that has more...
authortipaul <tipaul>
Mon, 3 Jan 2005 11:09:33 +0000 (11:09 +0000)
committertipaul <tipaul>
Mon, 3 Jan 2005 11:09:33 +0000 (11:09 +0000)
koha-tmpl/opac-tmpl/css/en/opac-ISBDdetail.tmpl
koha-tmpl/opac-tmpl/css/en/opac-MARCdetail.tmpl
koha-tmpl/opac-tmpl/css/en/opac-addbookbybiblionumber.tmpl [new file with mode: 0644]
koha-tmpl/opac-tmpl/css/en/opac-detail.tmpl
koha-tmpl/opac-tmpl/css/en/opac-main.tmpl
koha-tmpl/opac-tmpl/css/en/opac-shelves.tmpl
opac/opac-shelves.pl

index f60eb8a..a27c2a4 100644 (file)
@@ -2,10 +2,16 @@
 <link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR name="themelang" -->/includes/marc-editor.css">
 <div id="bibliomenu">
        <a href="opac-detail.pl?bib=<!-- TMPL_VAR name="biblionumber" -->" class="button catalogue">
-               Normal
+               Simple
        </a>
        <a href="opac-MARCdetail.pl?bib=<!-- TMPL_VAR name="biblionumber" -->" class="button">
-               MARC
+               Complete
+       </a>
+       <a href="opac-ISBDdetail.pl?bib=<!-- TMPL_VAR name="biblionumber" -->" class="button catalogue">
+               ISBD
+       </a>
+       <a href="javascript:Dopop('opac-addbookbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->')" class="button catalogue">
+               Add to shelf
        </a>
        <a href="javascript:Dopop('opac-detailprint.pl?bib=<!-- TMPL_VAR name="biblionumber" -->')" class="button catalogue">
                Print
                        Request
                </a>
        <!-- /TMPL_UNLESS -->
+       <!-- TMPL_IF name="subscriptionid" -->
+       <a href="opac-serial-issues.pl?subscriptionid=<!-- TMPL_VAR NAME="subscriptionid" -->" class="button catalogue" title="Serial issues">
+               Issues
+       </a>
+       <!-- /TMPL_IF -->
+       <a class="button" href="javascript:addRecord('<!-- TMPL_VAR NAME="biblionumber" ESCAPE=URL -->')">Add to basket</a>
 </div>
 
 <div id="mainbloc">
index af67076..f978da8 100644 (file)
@@ -1,21 +1,31 @@
 <!-- TMPL_INCLUDE NAME="opac-top.inc" -->
-<link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR name="themelang" -->/includes/marc-editor.css">
 <div id="bibliomenu">
        <a href="opac-detail.pl?bib=<!-- TMPL_VAR name="biblionumber" -->" class="button catalogue">
-               Normal
+               Simple
+       </a>
+       <a href="opac-MARCdetail.pl?bib=<!-- TMPL_VAR name="biblionumber" -->" class="button">
+               Complete
        </a>
        <a href="opac-ISBDdetail.pl?bib=<!-- TMPL_VAR name="biblionumber" -->" class="button catalogue">
                ISBD
        </a>
+       <a href="javascript:Dopop('opac-addbookbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->')" class="button catalogue">
+               Add to shelf
+       </a>
        <a href="javascript:Dopop('opac-detailprint.pl?bib=<!-- TMPL_VAR name="biblionumber" -->')" class="button catalogue">
                Print
        </a>
-       <!-- TMPL_IF NAME="norequests" -->
-       <!-- TMPL_ELSE -->
+       <!-- TMPL_UNLESS NAME="norequests" -->
                <a class="button" href="/cgi-bin/koha/opac-reserve.pl?bib=<!-- TMPL_VAR NAME="biblionumber" ESCAPE=URL -->">
                        Request
                </a>
+       <!-- /TMPL_UNLESS -->
+       <!-- TMPL_IF name="subscriptionid" -->
+       <a href="opac-serial-issues.pl?subscriptionid=<!-- TMPL_VAR NAME="subscriptionid" -->" class="button catalogue" title="Serial issues">
+               Issues
+       </a>
        <!-- /TMPL_IF -->
+       <a class="button" href="javascript:addRecord('<!-- TMPL_VAR NAME="biblionumber" ESCAPE=URL -->')">Add to basket</a>
 </div>
 
        <div class="tabs">
diff --git a/koha-tmpl/opac-tmpl/css/en/opac-addbookbybiblionumber.tmpl b/koha-tmpl/opac-tmpl/css/en/opac-addbookbybiblionumber.tmpl
new file mode 100644 (file)
index 0000000..c80db47
--- /dev/null
@@ -0,0 +1,22 @@
+<!-- TMPL_INCLUDE Name="popup-top.inc" -->
+<div id="mainbloc">
+<h1>Add book to bookshelf</h1> 
+<p><label>Title</label><!-- TMPL_VAR NAME="title" --></p>
+<p><label>Author</label><!-- TMPL_VAR NAME="author" --></p>
+<h2>Select bookshelf</h2>
+<form>
+       <p><label>Add to virtual shelf</label><!-- TMPL_VAR NAME="CGIbookshelves" --></p>
+</form>
+<form>
+<h2>or add to a new bookshelf</h2>
+       <p><input type="text" name="newbookshelf" maxlength=40 size=40>
+       <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->">
+               <select name="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="button catalogue">
+</form>
+<!-- TMPL_INCLUDE Name="popup-bottom.inc" -->
index 6483007..c672f04 100644 (file)
@@ -2,11 +2,17 @@
 <link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR name="themelang" -->/includes/marc-editor.css">
 
 <div id="bibliomenu">
+       <a href="opac-detail.pl?bib=<!-- TMPL_VAR name="biblionumber" -->" class="button catalogue">
+               Simple
+       </a>
+       <a href="opac-MARCdetail.pl?bib=<!-- TMPL_VAR name="biblionumber" -->" class="button">
+               Complete
+       </a>
        <a href="opac-ISBDdetail.pl?bib=<!-- TMPL_VAR name="biblionumber" -->" class="button catalogue">
                ISBD
        </a>
-       <a href="opac-MARCdetail.pl?bib=<!-- TMPL_VAR name="biblionumber" -->" class="button">
-               MARC
+       <a href="javascript:Dopop('opac-addbookbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->')" class="button catalogue">
+               Add to shelf
        </a>
        <a href="javascript:Dopop('opac-detailprint.pl?bib=<!-- TMPL_VAR name="biblionumber" -->')" class="button catalogue">
                Print
index 1050595..3c30e25 100644 (file)
@@ -3,13 +3,12 @@
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-       <link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR name="themelang" -->/includes/opac.css" />
+       <!-- TMPL_IF name="opacstylesheet" -->
+               <link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR name="opacstylesheet"-->" />
+       <!-- TMPL_ELSE -->
+               <link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR name="themelang"-->/includes/opac.css" />
+       <!-- /TMPL_IF -->
        <title><!--TMPL_VAR name="LibraryName"--></title>
-       <style type="text/css">
-       input {
-               background-color: #ACE6E6;
-       }
-       </style>
 </head>
 
 <body>
index fc1c6fc..f8f1a3f 100644 (file)
 <!-- TMPL_INCLUDE Name="opac-top.inc" -->
 <div id="mainbloc">
 <!-- TMPL_IF Name="viewshelf" -->
-<form>
-    <table>
-               <tr>
-                       <th colspan=4>
-                               Contents of <!-- TMPL_VAR Name="shelfname" -->
-                       </th>
-               </tr>
-               <!-- TMPL_LOOP Name="itemsloop" -->
-                       <tr>
-                               <!-- TMPL_IF name="color" -->
-                                       <td class="hilighted"><input type=checkbox name="REM-<!-- TMPL_VAR Name="itemnumber" -->"></td>
-                                       <td class="hilighted"><a href="opac-detail.pl?bib=<!-- TMPL_VAR name="biblionumber" -->"><!-- TMPL_VAR Name="barcode" --></a></td>
-                                       <td class="hilighted"><!-- TMPL_VAR Name="title" --></td>
-                                       <td class="hilighted"><!-- TMPL_VAR Name="author" --></td>
-                               <!-- TMPL_ELSE -->
-                                       <td><input type=checkbox name="REM-<!-- TMPL_VAR Name="itemnumber" -->"></td>
-                                       <td class="hilighted"><a href="opac-detail.pl?bib=<!-- TMPL_VAR name="biblionumber" -->"><!-- TMPL_VAR Name="barcode" --></a></td>
-                                       <td><!-- TMPL_VAR Name="title" --></td>
-                                       <td><!-- TMPL_VAR Name="author" --></td>
-                               <!-- /TMPL_IF -->
-                       </tr>
-               <!-- /TMPL_LOOP -->
-       </table>
-       <br>
-       <a href="opac-shelves.pl" class="button">Shelf list</a>
-       <input type=hidden name=shelfnumber value="<!-- TMPL_VAR Name="shelfnumber" -->">
-       <input type=hidden name=modifyshelfcontents value=1>
-       <input type=hidden name=viewshelf value="<!-- TMPL_VAR Name="shelfnumber" -->">
+       <form>
+               <h1><!-- TMPL_VAR NAME="shelfname" --></h1>
+
+               <div>
+               <h2>Shelf content</h2>
+                       <table class="small">
+                               <tr colspan="4">
+                                       <th>delete</th>
+                                       <th>barcode</th>
+                                       <th>title</th>
+                                       <th>Author</th>
+                               </tr>
+                               <!-- TMPL_LOOP Name="itemsloop" -->
+                                       <tr>
+                                               <td bgcolor="<!-- TMPL_VAR NAME="color" -->"><input type="checkbox" name="REM-<!-- TMPL_VAR NAME="itemnumber" -->"></td>
+                                               <td bgcolor="<!-- TMPL_VAR NAME="color" -->"><!-- TMPL_VAR NAME="barcode" --></td>
+                                               <td bgcolor="<!-- TMPL_VAR NAME="color" -->"><a href="opac-MARCdetail.pl?bib=<!-- TMPL_VAR name="biblionumber" -->"><!-- TMPL_VAR NAME="title" --></a></td>
+                                               <td bgcolor="<!-- TMPL_VAR NAME="color" -->"><!-- TMPL_VAR NAME="author" --></td>
+                                       </tr>
+                               <!-- /TMPL_LOOP -->
+                       </table>
+                       <input type="hidden" name="shelfnumber" value="<!-- TMPL_VAR NAME="shelfnumber" -->">
+                       <input type="hidden" name="modifyshelfcontents" value="1">
+                       <input type="hidden" name="viewshelf" value="<!-- TMPL_VAR NAME="shelfnumber" -->">
+                       <!-- TMPL_IF name="manageshelf" -->
+                               <input type="submit" value="Remove Selected Items" class="button">
+                       <!-- /TMPL_IF -->
+                       <a href="opac-shelves.pl" class="button">Shelf list</a>
+               </div>
+       </form>
+
        <!-- TMPL_IF name="manageshelf" -->
-               <input type=submit value="Remove Selected Items" class="button">
+       <div id="bloc20">
+               <form>
+               <h2>Add a book by barcode</h2>
+                       <input type="hidden" name="shelfnumber" value="<!-- TMPL_VAR NAME="shelfnumber" -->">
+                       <input type="hidden" name="modifyshelfcontents" value="1">
+                       <input type="hidden" name="viewshelf" value="<!-- TMPL_VAR NAME="shelfnumber" -->">
+                       <input name="addbarcode">
+                       <input type="hidden" name="modifyshelfcontents" value="1">
+                       <input type="hidden" name="shelfnumber" value="<!-- TMPL_VAR NAME="shelfnumber" -->">
+                       <input type="submit" value="Save" class="button">
+               </form>
+       </div>
        <!-- /TMPL_IF -->
-</form>
-<!-- TMPL_IF name="manageshelf" -->
-<form>
-       <input type=hidden name=shelfnumber value="<!-- TMPL_VAR Name="shelfnumber" -->">
-       <input type=hidden name=modifyshelfcontents value=1>
-       <input type=hidden name=viewshelf value="<!-- TMPL_VAR Name="shelfnumber" -->">
-       <table>
-               <tr>
-                       <td>
-                               Add a book by barcode in <!-- TMPL_VAR name="shelfname" -->:
-                       </td>
-                       <td>
-                               <input name="addbarcode">
-                               <input type=hidden name=modifyshelfcontents value=1>
-                               <input type="hidden" name="shelfnumber" value="<!-- TMPL_VAR Name="shelfnumber" -->">
-                               <input type="submit" value="Save" class="button">
-                       </td>
-               </tr>
-       </table>
-</form>
-<!-- /TMPL_IF -->
 <!-- TMPL_ELSE -->
        <!-- TMPL_IF Name="shelves" -->
+               <h1>Bookshelves</h1>
                <!-- TMPL_IF Name="status1" -->
-                       <font color=red><!-- TMPL_VAR Name="string1" --></font><p>
+                       <p class="problem"><!-- TMPL_VAR NAME="string1" --><p>
                <!-- /TMPL_IF -->
                <!-- TMPL_LOOP Name="paramsloop" -->
                        <!-- TMPL_IF Name="status" -->
-                               <font color=red><!-- TMPL_VAR Name="string" --></font><p>
+                               <p class="problem"><!-- TMPL_VAR NAME="string" --><p>
                        <!-- /TMPL_IF -->
                <!-- /TMPL_LOOP -->
-               <center>
-               <h1>Bookshelves</h1>
-               <table border=0 cellpadding=7>
-                       <tr>
-                               <td align=center valign="bottom">
-                                       <form>
-                                               <p>
-                                                       <a href="opac-shelves.pl" class="button">Shelf list</a>
-                                               </p>
-                                       </form>
-                               </td>
-                               <td align=center valign="bottom">
-                                       <form method=post>
-                                       <input type="hidden" name="shelves" value=1>
-                                       <table border=0 cellpadding=0 cellspacing=0>
-                                               <tr>
-                                                       <th>Select Shelves to Delete
-                                                       </th>
-                                               </tr>
+               <div id="bloc20">
+                                       <h2>Select Shelves to Delete</h2>
+                                       <form method="post">
+                                       <input type="hidden" name="shelves" value="1">
                                                <!-- TMPL_LOOP Name="shelvesloop" -->
                                                <!-- TMPL_IF name="canmanage" -->
-                                               <tr>
-                                                       <td bgcolor="<!-- TMPL_VAR Name="color" -->">
-                                                               <input type=checkbox name="DEL-<!-- TMPL_VAR Name="shelf" -->">
-                                                               <!-- TMPL_VAR Name="shelfname" --> (<!-- TMPL_VAR Name="shelfbookcount" --> books)
-                                                       </td>
-                                               </tr>
+                                               <p>
+                                                       <label>
+                                                               <input type="checkbox" name="DEL-<!-- TMPL_VAR NAME="shelf" -->">
+                                                       </label>
+                                                               <a href="opac-shelves.pl?viewshelf=<!-- TMPL_VAR name="shelf" -->"><!-- TMPL_VAR NAME="shelfname" --></a> (<!-- TMPL_VAR NAME="shelfbookcount" --> item(s))
+                                               </p>
                                                <!-- /TMPL_IF -->
                                                <!-- /TMPL_LOOP -->
-                                       </table>
                                        <p>
-                                               <input type=submit value="Delete Shelves" class="button"></form>
+                                               <input type="submit" value="Delete Shelves" class="button">
                                        </p>
-                               </td>
-                               <td align=center valign=bottom>
-                                       <form method=post>
-                                       <input type=hidden name=shelves value=1>
-                                       <table border=0 cellpadding=0 cellspacing=0>
-                                               <tr>
-                                                       <th>
-                                                               <font color=white>Add Shelf</font>
-                                                       </th>
-                                               </tr>
-                                               <tr>
-                                                       <td>
-                                                               <p>Name : <input type="text" name="addshelf" size="25"></p>
-                                                               <p>Owner : <input type="hidden" name="owner" value="<!-- TMPL_VAR name="loggedinuser" -->"><!-- TMPL_VAR name="loggedinusername" --></p>
-                                                               <p>Category : <select name="category">
-                                                                       <option value="1">Private</option>
-                                                                       <option value="2">Public</option>
-                                                                       <option value="3">Free</option>
-                                                                       </select>
-                                                               </p>
-                                                               <p> <li>a private bookshelf is managed by you & can be seen only by you.</li>
-                                                                       <li> A public can be seen by everybody, but managed only by you.</li>
-                                                                       <li> A free can be managed by any user.</li>
-                                                               </p>
-                                                       </td>
-                                               </tr>
-                                       </table>
-                                                               <p><input type=submit value="Add New Shelf" class="button"></p>
                                        </form>
-                               </td>
-                       </tr>
-               </table>
+               </div>
+               <div id="bloc60">
+                       <form method="post">
+                               <input type="hidden" name="shelves" value="1">
+                               <h2>Add Shelf</h2>
+                               <p><label>Name</label><input type="text" name="addshelf" size="25"></p>
+                               <p><label>Owner</label><input type="hidden" name="owner" value="<!-- TMPL_VAR NAME="loggedinuser" -->"><!-- TMPL_VAR NAME="loggedinusername" --></p>
+                               <p><label>Category</label>
+                                       <select name="category">
+                                               <option value="1">Private</option>
+                                               <option value="2">Public</option>
+                                               <option value="3">Free</option>
+                                       </select>
+                               </p>
+                               <ul> <li>a private bookshelf is managed by you &amp; can be seen only by you.</li>
+                                       <li> A public can be seen by everybody, but managed only by you.</li>
+                                       <li> A free can be managed by any user.</li>
+                               </ul>
+                               <p>
+                                       <input type="submit" value="Add New Shelf" class="button">
+                                       <a href="opac-shelves.pl" class="button">back to shelf list</a>
+                               </p>
 
+                       </form>
+               </div>
        <!-- TMPL_ELSE -->
-               <center>
-               <table border=0 cellpadding=4 cellspacing=0>
-                       <tr>
-                               <th>
-                               Shelf List
-                               </th>
-                       </tr>
-                       <!-- TMPL_LOOP Name="shelvesloop" -->
-                       <tr>
-                               <!-- TMPL_IF name="color" -->
-                                       <td class="hilighted">
-                               <!-- TMPL_ELSE -->
-                                       <td>
-                               <!-- /TMPL_IF -->
-                                       <a href="opac-shelves.pl?viewshelf=<!-- TMPL_VAR Name="shelf" -->">
-                                               <!-- TMPL_VAR Name="shelfname" -->(<!-- TMPL_VAR Name="shelfbookcount" --> books)
-                                       </a>
-                               </td>
-                       </tr>
-                       <!-- /TMPL_LOOP -->
-               </table>
-               <P>
+               <div id="bloc20">
+                       <h2>Shelf list</h2>
+                       <table class="small">
+                               <tr>
+                                       <th>Shelf name</th>
+                                       <th>Category</th>
+                                       <th>Content size</th>
+                                       <th>Modify</th>
+                               </tr>
+                               <!-- TMPL_LOOP Name="shelvesloop" -->
+                               <tr>
+                                       <td bgcolor="<!-- TMPL_VAR NAME="color" -->">
+                                               <a href="opac-shelves.pl?viewshelf=<!-- TMPL_VAR NAME="shelf" -->">
+                                                       <!-- TMPL_VAR NAME="shelfname" -->
+                                               </a>
+                                       </td>
+                                       <td bgcolor="<!-- TMPL_VAR NAME="color" -->">
+                                               <!-- TMPL_IF NAME="category1" -->
+                                                       Private
+                                               <!-- /TMPL_IF -->
+                                               <!-- TMPL_IF NAME="category2" -->
+                                                       Public
+                                               <!-- /TMPL_IF -->
+                                               <!-- TMPL_IF NAME="category3" -->
+                                                       Free
+                                               <!-- /TMPL_IF -->
+                                       </td>
+                                       <td bgcolor="<!-- TMPL_VAR NAME="color" -->">
+                                               <!-- TMPL_VAR NAME="shelfbookcount" --> item(s)
+                                       </td>
+                                       <!-- TMPL_IF name="mine" -->
+                                               <td bgcolor="<!-- TMPL_VAR NAME="color" -->">
+                                                       <a href="opac-shelves.pl?op=modif&shelf=<!-- TMPL_VAR NAME="shelf" -->" class="button">Modify</a>
+                                                       <!-- TMPL_VAR name="surname" --><!-- TMPL_VAR name="firstname" -->
+                                               </td>
+                                       <!-- /TMPL_IF -->
+                               </tr>
+                               <!-- /TMPL_LOOP -->
+                       </table>
+               </div>
+               <div id="bloc20">
                        <a href="opac-shelves.pl?shelves=1" class="button">Add or Remove Book Shelves</a>
-               </p>
+               </div>
        <!-- /TMPL_IF -->
 <!-- /TMPL_IF -->
+
+<!-- TMPL_IF name="edit" -->
+       <div id="bloc20">
+               <form method="post">
+                       <input type="hidden" name="op" value="modifsave">
+                       <h2>Modify shelf</h2>
+                       <input type="hidden" name="shelfnumber" value="<!-- TMPL_VAR name="shelfnumber" -->">
+                       <p><label>Name</label><input type="text" name="shelfname" size="25" value="<!-- TMPL_VAR name="shelfname"-->"></p>
+                       <p><label>Owner</label><input type="hidden" name="owner" value="<!-- TMPL_VAR NAME="loggedinuser" -->"><!-- TMPL_VAR NAME="loggedinusername" --></p>
+                       <p><label>Category</label>
+                               <select name="category">
+                                       <!-- TMPL_IF name="category1" -->
+                                               <option value="1" selected>Private</option>
+                                       <!-- TMPL_ELSE -->
+                                               <option value="1">Private</option>
+                                       <!-- /TMPL_IF -->
+                                       <!-- TMPL_IF name="category2" -->
+                                               <option value="2" selected>Public</option>
+                                       <!-- TMPL_ELSE -->
+                                               <option value="2">Public</option>
+                                       <!-- /TMPL_IF -->
+                                       <!-- TMPL_IF name="category3" -->
+                                               <option value="3" selected>Free</option>
+                                       <!-- TMPL_ELSE -->
+                                               <option value="3">Free</option>
+                                       <!-- /TMPL_IF -->
+                               </select>
+                       </p>
+                       <p> <li>a private bookshelf is managed by you &amp; can be seen only by you.</li>
+                               <li> A public can be seen by everybody, but managed only by you.</li>
+                               <li> A free can be managed by any user.</li>
+                       </p>
+                       <p>
+                               <input type="submit" value="Save" class="button">
+                       </p>
+
+               </form>
+       </div>
+<!-- /TMPL_IF -->
 </div>
 <!-- TMPL_INCLUDE Name="opac-bottom.inc" -->
index 2775eb2..6db9162 100755 (executable)
@@ -33,11 +33,16 @@ use HTML::Template;
 
 my $env;
 my $query = new CGI;
+my $headerbackgroundcolor='#663266';
+my $circbackgroundcolor='#555555';
+my $circbackgroundcolor='#550000';
+my $linecolor1='#bbbbbb';
+my $linecolor2='#dddddd';
 my ($template, $loggedinuser, $cookie)
     = get_template_and_user({template_name => "opac-shelves.tmpl",
                                                        query => $query,
                                                        type => "opac",
-                                                       authnotrequired => 1,
+                                                       authnotrequired => 0,
                                                });
 
 if ($query->param('modifyshelfcontents')) {
@@ -57,25 +62,48 @@ if ($query->param('modifyshelfcontents')) {
 my ($shelflist) = GetShelfList($loggedinuser,2);
 
 $template->param({     loggedinuser => $loggedinuser,
-                                            LibraryName => C4::Context->preference("LibraryName"),
-                                       });
+                                       headerbackgroundcolor => $headerbackgroundcolor,
+                                       circbackgroundcolor => $circbackgroundcolor });
 SWITCH: {
-       if ($query->param('viewshelf')) {  viewshelf($query->param('viewshelf')); last SWITCH;}
-       if ($query->param('shelves')) {  shelves(); last SWITCH;}
+       if ($query->param('op') eq 'modifsave') {
+               ModifShelf($query->param('shelfnumber'),$query->param('shelfname'),$loggedinuser,$query->param('category'));
+               last SWITCH;
+       }
+       if ($query->param('op') eq 'modif') {
+               my ($shelfnumber,$shelfname,$owner,$category) = GetShelf($query->param('shelf'));
+               $template->param(edit => 1,
+                                               shelfnumber => $shelfnumber,
+                                               shelfname => $shelfname,
+                                               "category$category" => 1);
+#              editshelf($query->param('shelf'));
+               last SWITCH;
+       }
+       if ($query->param('viewshelf')) {
+               viewshelf($query->param('viewshelf'));
+               last SWITCH;
+       }
+       if ($query->param('shelves')) {
+               shelves();
+               last SWITCH;
+       }
 }
 
 ($shelflist) = GetShelfList($loggedinuser,2); # rebuild shelflist in case a shelf has been added
 
-my $color=1;
+my $color='';
 my @shelvesloop;
 foreach my $element (sort keys %$shelflist) {
                my %line;
-               $line{'color'}= 1 if ($color eq 1);
-               $color = -$color;
+               ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1);
+               $line{'color'}= $color;
                $line{'shelf'}=$element;
                $line{'shelfname'}=$shelflist->{$element}->{'shelfname'};
+               $line{"category".$shelflist->{$element}->{'category'}} = 1;
+               $line{'mine'} = 1 if $shelflist->{$element}->{'owner'} eq $loggedinuser;
                $line{'shelfbookcount'}=$shelflist->{$element}->{'count'};
                $line{'canmanage'} = ShelfPossibleAction($loggedinuser,$element,'manage');
+               $line{'firstname'}=$shelflist->{$element}->{'firstname'} unless $shelflist->{$element}->{'owner'} eq $loggedinuser;
+               $line{'surname'}=$shelflist->{$element}->{'surname'} unless $shelflist->{$element}->{'owner'} eq $loggedinuser;
 ;
                push (@shelvesloop, \%line);
 }
@@ -83,6 +111,14 @@ $template->param(shelvesloop => \@shelvesloop);
 
 output_html_with_http_headers $query, $cookie, $template->output;
 
+# sub editshelf {
+#      my ($shelfnumber) = @_;
+#      my ($shelfnumber,$shelfname,$owner,$category) = GetShelf($shelfnumber);
+#      $template->param(edit => 1,
+#                                      shelfnumber => $shelfnumber,
+#                                      shelfname => $shelfname,
+#                                      "category$category" => 1);
+# }
 sub shelves {
        if (my $newshelf=$query->param('addshelf')) {
                my ($status, $string) = AddShelf($env,$newshelf,$query->param('owner'),$query->param('category'));
@@ -106,12 +142,12 @@ sub shelves {
        }
        $template->param(paramsloop => \@paramsloop);
        my ($shelflist) = GetShelfList($loggedinuser,2);
-       my $color=1;
+       my $color='';
        my @shelvesloop;
        foreach my $element (sort keys %$shelflist) {
                my %line;
-               $line{'color'}=1 if ($color eq 1);
-               $color = -$color;
+               ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1);
+               $line{'color'}=$color;
                $line{'shelf'}=$element;
                $line{'shelfname'}=$shelflist->{$element}->{'shelfname'} ;
                $line{'shelfbookcount'}=$shelflist->{$element}->{'count'} ;
@@ -128,17 +164,17 @@ sub viewshelf {
        return unless (ShelfPossibleAction($loggedinuser,$shelfnumber,'view'));
        my ($itemlist) = GetShelfContents($env, $shelfnumber);
        my $item='';
-       my $color=1;
+       my $color='';
        my @itemsloop;
        foreach $item (sort {$a->{'barcode'} cmp $b->{'barcode'}} @$itemlist) {
                my %line;
-               $line{'color'}=1 if ($color eq 1);
-               $color = -$color;
+               ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1);
+               $line{'color'}=$color;
                $line{'itemnumber'}=$item->{'itemnumber'};
                $line{'barcode'}=$item->{'barcode'};
                $line{'title'}=$item->{'title'};
                $line{'author'}=$item->{'author'};
-               $line{'biblionumber'} = $item->{'biblionumber'};
+               $line{biblionumber} = $item->{biblionumber};
                push(@itemsloop, \%line);
        }
        $template->param(       itemsloop => \@itemsloop,
@@ -151,11 +187,24 @@ sub viewshelf {
 
 #
 # $Log$
-# Revision 1.2  2004/11/12 16:27:33  tipaul
-# fixes for printing a biblio
+# Revision 1.3  2005/01/03 11:09:34  tipaul
+# synch'ing virtual shelves management in opac with the librarian one, that has more features
+#
+# Revision 1.5  2004/12/16 11:30:57  tipaul
+# adding bookshelf features :
+# * create bookshelf on the fly
+# * modify a bookshelf name & status
+#
+# Revision 1.4  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)
+#
+# Revision 1.3  2004/12/02 16:38:50  tipaul
+# improvement in book shelves
 #
-# Revision 1.1  2004/03/15 15:02:19  tipaul
-# adding virtual shelves to opac
+# Revision 1.2  2004/11/19 16:31:30  tipaul
+# bugfix for bookshelves not in official CVS
 #
 # Revision 1.1.2.1  2004/03/10 15:08:18  tipaul
 # modifying shelves : introducing category of shelf : private, public, free for all