Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

new virtual shelves changes, keyed by biblionumber

Signed-off-by: Chris Cormack <crc@liblime.com>
  • Loading branch information...
commit 6cdf0832e2ad3739a42fa811cc08363908c0dec2 1 parent 0e0475b
authored Chris Cormack committed

Showing 32 changed files with 438 additions and 430 deletions. Show diff stats Hide diff stats

  1. 53  C4/Auth.pm
  2. 3  C4/Branch.pm
  3. 190  C4/{BookShelves.pm → VirtualShelves.pm}
  4. 1  Makefile.PL
  5. 82  help.pl
  6. 20  installer/kohastructure.sql
  7. 2  koha-tmpl/intranet-tmpl/prog/en/about.tmpl
  8. 11  koha-tmpl/intranet-tmpl/prog/en/auth.tmpl
  9. 4  koha-tmpl/intranet-tmpl/prog/en/help/admin/systempreferences.tmpl
  10. 15  koha-tmpl/intranet-tmpl/prog/en/help/nohelp.tmpl
  11. 2  koha-tmpl/intranet-tmpl/prog/en/includes/action-catalogue.inc
  12. 2  koha-tmpl/intranet-tmpl/prog/en/includes/error-top.inc
  13. 5  koha-tmpl/intranet-tmpl/prog/en/includes/menu-bookshelves.inc
  14. 5  koha-tmpl/intranet-tmpl/prog/en/includes/menu-virtualshelves.inc
  15. 2  koha-tmpl/intranet-tmpl/prog/en/includes/menus.inc
  16. 7  koha-tmpl/intranet-tmpl/prog/en/tools/export.tmpl
  17. 12  ...intranet-tmpl/prog/en/{bookshelves/addbookbybiblionumber.tmpl → virtualshelves/addbybiblionumber.tmpl}
  18. 89  koha-tmpl/intranet-tmpl/prog/en/{bookshelves → virtualshelves}/shelves.tmpl
  19. 2  koha-tmpl/opac-tmpl/prog/en/includes/basket.js
  20. 2  koha-tmpl/opac-tmpl/prog/en/opac-ISBDdetail.tmpl
  21. 2  koha-tmpl/opac-tmpl/prog/en/opac-MARCdetail.tmpl
  22. 18  koha-tmpl/opac-tmpl/prog/en/{opac-addbookbybiblionumber.tmpl → opac-addbybiblionumber.tmpl}
  23. 2  koha-tmpl/opac-tmpl/prog/en/opac-detail.tmpl
  24. 62  koha-tmpl/opac-tmpl/prog/en/opac-shelves.tmpl
  25. 16  opac/{opac-addbookbybiblionumber.pl → opac-addbybiblionumber.pl}
  26. 2  opac/opac-main.pl
  27. 20  opac/opac-shelves.pl
  28. 18  t/{BookShelves.t → VirtualShelves.t}
  29. 3  tools/export.pl
  30. 2  updater/updatedatabase
  31. 99  bookshelves/addbookbybiblionumber.pl → virtualshelves/addbybiblionumber.pl
  32. 115  {bookshelves → virtualshelves}/shelves.pl
53  C4/Auth.pm
@@ -223,18 +223,17 @@ sub get_template_and_user {
223 223
     if ( $in->{'type'} eq "intranet" ) {
224 224
         $template->param(
225 225
             intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
226  
-            intranetstylesheet      => C4::Context->preference("intranetstylesheet"),
227  
-            IntranetNav             => C4::Context->preference("IntranetNav"),
228  
-            intranetuserjs          => C4::Context->preference("intranetuserjs"),
229  
-            TemplateEncoding        => C4::Context->preference("TemplateEncoding"),
230  
-            AmazonContent           => C4::Context->preference("AmazonContent"),
231  
-            LibraryName             => C4::Context->preference("LibraryName"),
232  
-            LoginBranchcode         => (C4::Context->userenv?C4::Context->userenv->{"branch"}:"insecure"),
233  
-            LoginBranchname         => (C4::Context->userenv?C4::Context->userenv->{"branchname"}:"insecure"),
234  
-            LoginBranchnameShort    => substr((C4::Context->userenv?C4::Context->userenv->{"branchname"}:"insecure"),0,10),
235  
-            AutoLocation            => C4::Context->preference("AutoLocation"),
236  
-            hide_marc               => C4::Context->preference("hide_marc"),
237  
-            patronimages            => C4::Context->preference("patronimages"),
  226
+            intranetstylesheet => C4::Context->preference("intranetstylesheet"),
  227
+            IntranetNav        => C4::Context->preference("IntranetNav"),
  228
+            intranetuserjs     => C4::Context->preference("intranetuserjs"),
  229
+            TemplateEncoding   => C4::Context->preference("TemplateEncoding"),
  230
+            AmazonContent      => C4::Context->preference("AmazonContent"),
  231
+            LibraryName        => C4::Context->preference("LibraryName"),
  232
+            LoginBranchcode    => (C4::Context->userenv?C4::Context->userenv->{"branch"}:"insecure"),
  233
+            LoginBranchname    => (C4::Context->userenv?C4::Context->userenv->{"branchname"}:"insecure"),
  234
+            AutoLocation       => C4::Context->preference("AutoLocation"),
  235
+            hide_marc          => C4::Context->preference("hide_marc"),
  236
+            patronimages       => C4::Context->preference("patronimages"),
238 237
             "BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1,
239 238
             advancedMARCEditor      => C4::Context->preference("advancedMARCEditor"),
240 239
             suggestion              => C4::Context->preference("suggestion"),
@@ -346,7 +345,7 @@ has authenticated.
346 345
 
347 346
 sub checkauth {
348 347
     my $query = shift;
349  
-
  348
+	# warn "Checking Auth";
350 349
 # $authnotrequired will be set for scripts which will run without authentication
351 350
     my $authnotrequired = shift;
352 351
     my $flagsrequired   = shift;
@@ -389,7 +388,7 @@ sub checkauth {
389 388
     # state variables
390 389
     my $loggedin = 0;
391 390
     my %info;
392  
-    my ( $userid, $cookie, $sessionID, $flags, $envcookie );
  391
+    my ( $userid, $cookie, $sessionID, $flags );
393 392
     my $logout = $query->param('logout.x');
394 393
     if ( $userid = $ENV{'REMOTE_USER'} ) {
395 394
 
@@ -431,7 +430,7 @@ sub checkauth {
431 430
             close L;
432 431
         }
433 432
         if ($userid) {
434  
-			warn "here $userid";
  433
+			# warn "here $userid";
435 434
             if ( $lasttime < time() - $timeout ) {
436 435
 
437 436
                 # timed logout
@@ -551,10 +550,14 @@ sub checkauth {
551 550
 #  new op dev :
552 551
 # 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.
553 552
                 my $ip       = $ENV{'REMOTE_ADDR'};
  553
+				# if they specify at login, use that
  554
+				if ($query->param('branch')) {
  555
+ 				$branchcode  = $query->param('branch');
  556
+				$branchname = GetBranchName($branchcode);
  557
+				}
554 558
                 my $branches = GetBranches();
555 559
                 my @branchesloop;
556 560
                 foreach my $br ( keys %$branches ) {
557  
-
558 561
                     # 		now we work with the treatment of ip
559 562
                     my $domain = $branches->{$br}->{'branchip'};
560 563
                     if ( $domain && $ip =~ /^$domain/ ) {
@@ -593,7 +596,17 @@ sub checkauth {
593 596
                 $session->param('ip',$session->remote_addr());
594 597
 				$session->param('lasttime',time());
595 598
 			}
  599
+ 			if ($session){
  600
+            	C4::Context::set_userenv(
  601
+                $session->param('number'),       $session->param('id'),
  602
+                $session->param('cardnumber'),   $session->param('firstname'),
  603
+                $session->param('surname'),      $session->param('branch'),
  604
+                $session->param('branchname'),   $session->param('flags'),
  605
+                $session->param('emailaddress'), $session->param('branchprinter')
  606
+            	);
  607
+        	}		
596 608
         }
  609
+
597 610
         else {
598 611
             if ($userid) {
599 612
                 $info{'invalid_username_or_password'} = 1;
@@ -623,8 +636,16 @@ sub checkauth {
623 636
         my $value = $query->param($name);
624 637
         push @inputs, { name => $name, value => $value };
625 638
     }
  639
+    # get the branchloop, which we need for authetication
  640
+	use C4::Branch;
  641
+    my $branches = GetBranches();
  642
+    my @branch_loop;
  643
+    for my $branch_hash (keys %$branches) {
  644
+                push @branch_loop, {branchcode => "$branch_hash", branchname => $branches->{$branch_hash}->{'branchname'}, };
  645
+    }
626 646
 
627 647
     my $template = gettemplate( $template_name, $type, $query );
  648
+    $template->param(branchloop => \@branch_loop,);
628 649
     $template->param(
629 650
         INPUTS               => \@inputs,
630 651
         suggestion           => C4::Context->preference("suggestion"),
3  C4/Branch.pm
@@ -91,8 +91,7 @@ foreach my $thisbranch (keys %$branches) {
91 91
 =cut
92 92
 
93 93
 sub GetBranches {
94  
-
95  
-    my $onlymine=@_;
  94
+    my ($onlymine)=@_;
96 95
     # returns a reference to a hash of references to ALL branches...
97 96
     my %branches;
98 97
     my $dbh = C4::Context->dbh;
190  C4/BookShelves.pm → C4/VirtualShelves.pm
... ...
@@ -1,7 +1,7 @@
1 1
 # -*- tab-width: 8 -*-
2 2
 # Please use 8-character tabs for this file (indents are every 4 characters)
3 3
 
4  
-package C4::BookShelves;
  4
+package C4::VirtualShelves;
5 5
 
6 6
 # $Id$
7 7
 
@@ -33,17 +33,17 @@ $VERSION = do { my @v = '$Revision$' =~ /\d+/g; shift(@v) . "." . join( "_", map
33 33
 
34 34
 =head1 NAME
35 35
 
36  
-C4::BookShelves - Functions for manipulating Koha virtual bookshelves
  36
+C4::VirtualShelves - Functions for manipulating Koha virtual virtualshelves
37 37
 
38 38
 =head1 SYNOPSIS
39 39
 
40  
-  use C4::BookShelves;
  40
+  use C4::VirtualShelves;
41 41
 
42 42
 =head1 DESCRIPTION
43 43
 
44  
-This module provides functions for manipulating virtual bookshelves,
45  
-including creating and deleting bookshelves, and adding and removing
46  
-items to and from bookshelves.
  44
+This module provides functions for manipulating virtual virtualshelves,
  45
+including creating and deleting virtualshelves, and adding and removing
  46
+items to and from virtualshelves.
47 47
 
48 48
 =head1 FUNCTIONS
49 49
 
@@ -69,13 +69,13 @@ my $dbh = C4::Context->dbh;
69 69
   $shelflist = &GetShelves($owner, $mincategory);
70 70
   ($shelfnumber, $shelfhash) = each %{$shelflist};
71 71
 
72  
-Looks up the virtual bookshelves, and returns a summary. C<$shelflist>
73  
-is a reference-to-hash. The keys are the bookshelf numbers
  72
+Looks up the virtual virtualshelves, and returns a summary. C<$shelflist>
  73
+is a reference-to-hash. The keys are the virtualshelves numbers
74 74
 (C<$shelfnumber>, above), and the values (C<$shelfhash>, above) are
75 75
 themselves references-to-hash, with the following keys:
76 76
 
77  
-C<mincategory> : 2 if the list is for "look". 3 if the list is for "Select bookshelf for adding a book".
78  
-bookshelves of the owner are always selected, whatever the category
  77
+C<mincategory> : 2 if the list is for "look". 3 if the list is for "Select virtualshelves for adding a virtual".
  78
+virtualshelves of the owner are always selected, whatever the category
79 79
 
80 80
 =over 4
81 81
 
@@ -85,7 +85,7 @@ A string. The name of the shelf.
85 85
 
86 86
 =item C<$shelfhash-E<gt>{count}>
87 87
 
88  
-The number of books on that bookshelf.
  88
+The number of virtuals on that virtualshelves.
89 89
 
90 90
 =back
91 91
 
@@ -100,14 +100,14 @@ sub GetShelves {
100 100
     my ( $owner, $mincategory ) = @_;
101 101
 
102 102
     my $query = qq(
103  
-        SELECT bookshelf.shelfnumber, bookshelf.shelfname,owner,surname,firstname,bookshelf.category,
104  
-               count(shelfcontents.itemnumber) as count
105  
-        FROM   bookshelf
106  
-            LEFT JOIN   shelfcontents ON bookshelf.shelfnumber = shelfcontents.shelfnumber
107  
-            LEFT JOIN   borrowers ON bookshelf.owner = borrowers.borrowernumber
  103
+        SELECT virtualshelves.shelfnumber, virtualshelves.shelfname,owner,surname,firstname,virtualshelves.category,
  104
+               count(virtualshelfcontents.biblionumber) as count
  105
+        FROM   virtualshelves
  106
+            LEFT JOIN   virtualshelfcontents ON virtualshelves.shelfnumber = virtualshelfcontents.shelfnumber
  107
+            LEFT JOIN   borrowers ON virtualshelves.owner = borrowers.borrowernumber
108 108
         WHERE  owner=? OR category>=?
109  
-        GROUP BY bookshelf.shelfnumber
110  
-        ORDER BY bookshelf.category, bookshelf.shelfname, borrowers.firstname, borrowers.surname
  109
+        GROUP BY virtualshelves.shelfnumber
  110
+        ORDER BY virtualshelves.category, virtualshelves.shelfname, borrowers.firstname, borrowers.surname
111 111
     );
112 112
     my $sth = $dbh->prepare($query);
113 113
     $sth->execute( $owner, $mincategory );
@@ -134,10 +134,10 @@ sub GetShelves {
134 134
 
135 135
   (shelfnumber,shelfname,owner,category) = &GetShelf($shelfnumber);
136 136
 
137  
-Looks up information about the contents of virtual bookshelf number
  137
+Looks up information about the contents of virtual virtualshelves number
138 138
 C<$shelfnumber>
139 139
 
140  
-Returns the database's information on 'bookshelf' table.
  140
+Returns the database's information on 'virtualshelves' table.
141 141
 
142 142
 =cut
143 143
 
@@ -145,7 +145,7 @@ sub GetShelf {
145 145
     my ($shelfnumber) = @_;
146 146
     my $query = qq(
147 147
         SELECT shelfnumber,shelfname,owner,category
148  
-        FROM   bookshelf
  148
+        FROM   virtualshelves
149 149
         WHERE  shelfnumber=?
150 150
     );
151 151
     my $sth = $dbh->prepare($query);
@@ -157,7 +157,7 @@ sub GetShelf {
157 157
 
158 158
   $itemlist = &GetShelfContents($shelfnumber);
159 159
 
160  
-Looks up information about the contents of virtual bookshelf number
  160
+Looks up information about the contents of virtual virtualshelves number
161 161
 C<$shelfnumber>.
162 162
 
163 163
 Returns a reference-to-array, whose elements are references-to-hash,
@@ -170,23 +170,22 @@ sub GetShelfContents {
170 170
     my ( $shelfnumber ) = @_;
171 171
     my @itemlist;
172 172
     my $query =
173  
-       " SELECT itemnumber
174  
-         FROM   shelfcontents
  173
+       " SELECT biblionumber
  174
+         FROM   virtualshelfcontents
175 175
          WHERE  shelfnumber=?
176  
-         ORDER BY itemnumber
  176
+         ORDER BY biblionumber
177 177
        ";
178 178
     my $sth = $dbh->prepare($query);
179 179
     $sth->execute($shelfnumber);
180 180
     my $sth2 = $dbh->prepare("
181  
-        SELECT biblio.*,biblioitems.* FROM items 
182  
-            LEFT JOIN biblio on items.biblionumber=biblio.biblionumber
183  
-            LEFT JOIN biblioitems on items.biblionumber=biblioitems.biblionumber
184  
-        WHERE items.itemnumber=?"
  181
+        SELECT biblio.*,biblioitems.* FROM biblio
  182
+            LEFT JOIN biblioitems on biblio.biblionumber=biblioitems.biblionumber
  183
+        WHERE biblio.biblionumber=?"
185 184
     );
186  
-    while ( my ($itemnumber) = $sth->fetchrow ) {
187  
-        $sth2->execute($itemnumber);
  185
+    while ( my ($biblionumber) = $sth->fetchrow ) {
  186
+        $sth2->execute($biblionumber);
188 187
         my $item = $sth2->fetchrow_hashref;
189  
-        $item->{'itemnumber'}=$itemnumber;
  188
+        $item->{'biblionumber'}=$biblionumber;
190 189
         push( @itemlist, $item );
191 190
     }
192 191
     return ( \@itemlist );
@@ -196,11 +195,11 @@ sub GetShelfContents {
196 195
 
197 196
   $shelfnumber = &AddShelf( $shelfname, $owner, $category);
198 197
 
199  
-Creates a new virtual bookshelf with name C<$shelfname>, owner C<$owner> and category
  198
+Creates a new virtual virtualshelves with name C<$shelfname>, owner C<$owner> and category
200 199
 C<$category>.
201 200
 
202 201
 Returns a code to know what's happen.
203  
-    * -1 : if this bookshelf already exist.
  202
+    * -1 : if this virtualshelves already exist.
204 203
     * $shelfnumber : if success.
205 204
 
206 205
 =cut
@@ -209,7 +208,7 @@ sub AddShelf {
209 208
     my ( $shelfname, $owner, $category ) = @_;
210 209
     my $query = qq(
211 210
         SELECT *
212  
-        FROM   bookshelf
  211
+        FROM   virtualshelves
213 212
         WHERE  shelfname=? AND owner=?
214 213
     );
215 214
     my $sth = $dbh->prepare($query);
@@ -219,7 +218,7 @@ sub AddShelf {
219 218
     }
220 219
     else {
221 220
         my $query = qq(
222  
-            INSERT INTO bookshelf
  221
+            INSERT INTO virtualshelves
223 222
                 (shelfname,owner,category)
224 223
             VALUES (?,?,?)
225 224
         );
@@ -232,35 +231,35 @@ sub AddShelf {
232 231
 
233 232
 =item AddToShelf
234 233
 
235  
-  &AddToShelf($itemnumber, $shelfnumber);
  234
+  &AddToShelf($biblionumber, $shelfnumber);
236 235
 
237  
-Adds item number C<$itemnumber> to virtual bookshelf number
  236
+Adds item number C<$biblionumber> to virtual virtualshelves number
238 237
 C<$shelfnumber>, unless that item is already on that shelf.
239 238
 
240 239
 =cut
241 240
 
242 241
 #'
243 242
 sub AddToShelf {
244  
-    my ( $itemnumber, $shelfnumber ) = @_;
245  
-    return unless $itemnumber;
  243
+    my ( $biblionumber, $shelfnumber ) = @_;
  244
+    return unless $biblionumber;
246 245
     my $query = qq(
247 246
         SELECT *
248  
-        FROM   shelfcontents
249  
-        WHERE  shelfnumber=? AND itemnumber=?
  247
+        FROM   virtualshelfcontents
  248
+        WHERE  shelfnumber=? AND biblionumber=?
250 249
     );
251 250
     my $sth = $dbh->prepare($query);
252 251
 
253  
-    $sth->execute( $shelfnumber, $itemnumber );
  252
+    $sth->execute( $shelfnumber, $biblionumber );
254 253
     unless ( $sth->rows ) {
255 254
         # already on shelf
256 255
         my $query = qq(
257  
-            INSERT INTO shelfcontents
258  
-                (shelfnumber, itemnumber, flags)
  256
+            INSERT INTO virtualshelfcontents
  257
+                (shelfnumber, biblionumber, flags)
259 258
             VALUES
260 259
                 (?, ?, 0)
261 260
         );
262 261
         $sth = $dbh->prepare($query);
263  
-        $sth->execute( $shelfnumber, $itemnumber );
  262
+        $sth->execute( $shelfnumber, $biblionumber );
264 263
     }
265 264
 }
266 265
 
@@ -268,7 +267,7 @@ sub AddToShelf {
268 267
  
269 268
     &AddToShelfFromBiblio($biblionumber, $shelfnumber)
270 269
 
271  
-    this function allow to add a book into the shelf number $shelfnumber
  270
+    this function allow to add a virtual into the shelf number $shelfnumber
272 271
     from biblionumber.
273 272
 
274 273
 =cut
@@ -277,30 +276,21 @@ sub AddToShelfFromBiblio {
277 276
     my ( $biblionumber, $shelfnumber ) = @_;
278 277
     return unless $biblionumber;
279 278
     my $query = qq(
280  
-        SELECT itemnumber
281  
-        FROM   items
282  
-        WHERE  biblionumber=?
283  
-    );
284  
-    my $sth = $dbh->prepare($query);
285  
-    $sth->execute($biblionumber);
286  
-    my ($itemnumber) = $sth->fetchrow;
287  
-    $query = qq(
288 279
         SELECT *
289  
-        FROM   shelfcontents
290  
-        WHERE  shelfnumber=? AND itemnumber=?
  280
+        FROM   virtualshelfcontents
  281
+        WHERE  shelfnumber=? AND biblionumber=?
291 282
     );
292  
-    $sth = $dbh->prepare($query);
293  
-    $sth->execute( $shelfnumber, $itemnumber );
  283
+    my $sth = $dbh->prepare($query);
  284
+    $sth->execute( $shelfnumber, $biblionumber );
294 285
     unless ( $sth->rows ) {
295  
-        # "already on shelf";
296 286
         my $query =qq(
297  
-            INSERT INTO shelfcontents
298  
-                (shelfnumber, itemnumber, flags)
  287
+            INSERT INTO virtualshelfcontents
  288
+                (shelfnumber, biblionumber, flags)
299 289
             VALUES
300 290
                 (?, ?, 0)
301 291
         );
302 292
         $sth = $dbh->prepare($query);
303  
-        $sth->execute( $shelfnumber, $itemnumber );
  293
+        $sth->execute( $shelfnumber, $biblionumber );
304 294
     }
305 295
 }
306 296
 
@@ -308,14 +298,14 @@ sub AddToShelfFromBiblio {
308 298
 
309 299
 ModShelf($shelfnumber, $shelfname, $owner, $category )
310 300
 
311  
-Modify the value into bookshelf table with values given on input arg.
  301
+Modify the value into virtualshelves table with values given on input arg.
312 302
 
313 303
 =cut
314 304
 
315 305
 sub ModShelf {
316 306
     my ( $shelfnumber, $shelfname, $owner, $category ) = @_;
317 307
     my $query = qq(
318  
-        UPDATE bookshelf
  308
+        UPDATE virtualshelves
319 309
         SET    shelfname=?,owner=?,category=?
320 310
         WHERE  shelfnumber=?
321 311
     );
@@ -327,7 +317,7 @@ sub ModShelf {
327 317
 
328 318
   ($status) = &DelShelf($shelfnumber);
329 319
 
330  
-Deletes virtual bookshelf number C<$shelfnumber>. The bookshelf must
  320
+Deletes virtual virtualshelves number C<$shelfnumber>. The virtualshelves must
331 321
 be empty.
332 322
 
333 323
 Returns a two-element array, where C<$status> is 0 if the operation
@@ -354,7 +344,7 @@ sub ShelfPossibleAction {
354 344
     my ( $user, $shelfnumber, $action ) = @_;
355 345
     my $query = qq(
356 346
         SELECT owner,category
357  
-        FROM   bookshelf
  347
+        FROM   virtualshelves
358 348
         WHERE  shelfnumber=?
359 349
     );
360 350
     my $sth = $dbh->prepare($query);
@@ -367,23 +357,23 @@ sub ShelfPossibleAction {
367 357
 
368 358
 =item DelFromShelf
369 359
 
370  
-  &DelFromShelf( $itemnumber, $shelfnumber);
  360
+  &DelFromShelf( $biblionumber, $shelfnumber);
371 361
 
372  
-Removes item number C<$itemnumber> from virtual bookshelf number
373  
-C<$shelfnumber>. If the item wasn't on that bookshelf to begin with,
  362
+Removes item number C<$biblionumber> from virtual virtualshelves number
  363
+C<$shelfnumber>. If the item wasn't on that virtualshelves to begin with,
374 364
 nothing happens.
375 365
 
376 366
 =cut
377 367
 
378 368
 #'
379 369
 sub DelFromShelf {
380  
-    my ( $itemnumber, $shelfnumber ) = @_;
  370
+    my ( $biblionumber, $shelfnumber ) = @_;
381 371
     my $query = qq(
382  
-        DELETE FROM shelfcontents
383  
-        WHERE  shelfnumber=? AND itemnumber=?
  372
+        DELETE FROM virtualshelfcontents
  373
+        WHERE  shelfnumber=? AND biblionumber=?
384 374
     );
385 375
     my $sth = $dbh->prepare($query);
386  
-    $sth->execute( $shelfnumber, $itemnumber );
  376
+    $sth->execute( $shelfnumber, $biblionumber );
387 377
 }
388 378
 
389 379
 =head2 DelShelf
@@ -397,7 +387,7 @@ sub DelFromShelf {
397 387
 #'
398 388
 sub DelShelf {
399 389
     my ( $shelfnumber ) = @_;
400  
-        my $sth = $dbh->prepare("DELETE FROM bookshelf WHERE shelfnumber=?");
  390
+        my $sth = $dbh->prepare("DELETE FROM virtualshelves WHERE shelfnumber=?");
401 391
         $sth->execute($shelfnumber);
402 392
         return 0;
403 393
 }
@@ -419,53 +409,3 @@ Koha Developement team <info@koha.org>
419 409
 C4::Circulation::Circ2(3)
420 410
 
421 411
 =cut
422  
-
423  
-#
424  
-# $Log$
425  
-# Revision 1.21  2007/04/04 16:46:22  tipaul
426  
-# HUGE COMMIT : code cleaning circulation.
427  
-#
428  
-# some stuff to do, i'll write a mail on koha-devel NOW !
429  
-#
430  
-# Revision 1.20  2007/03/09 14:31:47  tipaul
431  
-# rel_3_0 moved to HEAD
432  
-#
433  
-# Revision 1.15.8.10  2007/01/25 13:18:15  tipaul
434  
-# checking that a bookshelf with the same name AND OWNER does not exist before creating it
435  
-#
436  
-# Revision 1.15.8.9  2006/12/15 17:37:52  toins
437  
-# removing a function used only once.
438  
-#
439  
-# Revision 1.15.8.8  2006/12/14 17:22:55  toins
440  
-# bookshelves work perfectly with mod_perl and are cleaned.
441  
-#
442  
-# Revision 1.15.8.7  2006/12/13 19:46:41  hdl
443  
-# Some bug fixing.
444  
-#
445  
-# Revision 1.15.8.6  2006/12/11 17:10:06  toins
446  
-# fixing some bugs on bookshelves.
447  
-#
448  
-# Revision 1.15.8.5  2006/12/07 16:45:43  toins
449  
-# removing warn compilation. (perl -wc)
450  
-#
451  
-# Revision 1.15.8.4  2006/11/23 09:05:01  tipaul
452  
-# enable removal of a bookshelf even if there are items inside
453  
-#
454  
-# Revision 1.15.8.3  2006/10/30 09:50:20  tipaul
455  
-# removing getiteminformations (using direct SQL, as we are in a .pm, so it's "legal")
456  
-#
457  
-# Revision 1.15.8.2  2006/08/31 16:03:52  toins
458  
-# Add Pod to DelShelf
459  
-#
460  
-# Revision 1.15.8.1  2006/08/30 15:59:14  toins
461  
-# Code cleaned according to coding guide lines.
462  
-#
463  
-# Revision 1.15  2004/12/16 11:30:58  tipaul
464  
-# adding bookshelf features :
465  
-# * create bookshelf on the fly
466  
-# * modify a bookshelf name & status
467  
-#
468  
-# Revision 1.14  2004/12/15 17:28:23  tipaul
469  
-# adding bookshelf features :
470  
-# * create bookshelf on the fly
471  
-# * modify a bookshelf (this being not finished, will commit the rest soon)
1  Makefile.PL
@@ -86,6 +86,7 @@ WriteMakefile(
86 86
     PREREQ_PM => {
87 87
 'CGI' => 3.15,
88 88
 'CGI::Carp' => 1.29,
  89
+'CGI::Session' => '4.10',
89 90
 'Class::Accessor' => 0.30,
90 91
 'DBD::mysql' => 3.0008,
91 92
 'DBI' => 1.53,
82  help.pl
... ...
@@ -1,27 +1,8 @@
1 1
 #!/usr/bin/perl
2  
-
3  
-# Copyright 2006 Katipo Communications
4  
-#
5  
-# This file is part of Koha.
6  
-#
7  
-# Koha is free software; you can redistribute it and/or modify it under the
8  
-# terms of the GNU General Public License as published by the Free Software
9  
-# Foundation; either version 2 of the License, or (at your option) any later
10  
-# version.
11  
-#
12  
-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13  
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14  
-# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15  
-#
16  
-# You should have received a copy of the GNU General Public License along with
17  
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
18  
-# Suite 330, Boston, MA  02111-1307 USA
19  
-
  2
+use HTML::Template;
20 3
 use strict;
21 4
 require Exporter;
22  
-use C4::Output;    # contains gettemplate
23  
-use C4::Output;
24  
-
  5
+use C4::Output;  # contains gettemplate
25 6
 # use C4::Auth;
26 7
 use C4::Context;
27 8
 use CGI;
@@ -29,46 +10,45 @@
29 10
 my $query = new CGI;
30 11
 
31 12
 # find the script that called the online help using the CGI referer()
32  
-
33  
-my $refer = $query->referer();
34  
-
  13
+my $refer  = $query->referer();
35 14
 # workaround for popup not functioning correctly in IE
36 15
 my $referurl = $query->param('url');
37  
-if ($referurl) {
  16
+if($referurl){
38 17
     $refer = $query->param('url');
39 18
 }
40 19
 
41 20
 $refer =~ /.*koha\/(.*)\.pl.*/;
42 21
 my $from = "help/$1.tmpl";
43 22
 
44  
-my $template = gethelptemplate( $from, "intranet" );
45  
-
  23
+my $template = gethelptemplate($from,"intranet");
46 24
 # my $template
47 25
 output_html_with_http_headers $query, "", $template->output;
48 26
 
49  
-sub gethelptemplate {
50  
-    my ($tmplbase) = @_;
51  
-
52  
-    my $htdocs;
53  
-    $htdocs = C4::Context->config('intrahtdocs');
54  
-    my ( $theme, $lang ) = themelanguage( $htdocs, $tmplbase, "intranet" );
55  
-    unless ( -e "$htdocs/$theme/$lang/$tmplbase" ) {
56  
-        $tmplbase = "help/nohelp.tmpl";
57  
-        ( $theme, $lang ) = themelanguage( $htdocs, $tmplbase, "intranet" );
58  
-    }
59  
-    my $template = HTML::Template->new(
60  
-        filename          => "$htdocs/$theme/$lang/$tmplbase",
61  
-        die_on_bad_params => 0,
62  
-        global_vars       => 1,
63  
-        path              => ["$htdocs/$theme/$lang/includes"]
64  
-    );
65 27
 
66  
-    # XXX temporary patch for Bug 182 for themelang
67  
-    $template->param(
68  
-        themelang => '/intranet-tmpl' . "/$theme/$lang",
69  
-        interface => '/intranet-tmpl',
70  
-        theme     => $theme,
71  
-        lang      => $lang
72  
-    );
73  
-    return $template;
  28
+sub gethelptemplate {
  29
+	my ($tmplbase) = @_;
  30
+
  31
+	my $htdocs;
  32
+		$htdocs = C4::Context->config('intrahtdocs');
  33
+	my ($theme, $lang) = themelanguage($htdocs, $tmplbase, "intranet");
  34
+	unless (-e "$htdocs/$theme/$lang/$tmplbase") {
  35
+		$tmplbase="help/nohelp.tmpl";
  36
+		($theme, $lang) = themelanguage($htdocs, $tmplbase, "intranet");
  37
+	}
  38
+	my $template = HTML::Template->new(filename      => "$htdocs/$theme/$lang/$tmplbase",
  39
+				   die_on_bad_params => 0,
  40
+				   global_vars       => 1,
  41
+				   path              => ["$htdocs/$theme/$lang/includes"]);
  42
+
  43
+	# XXX temporary patch for Bug 182 for themelang
  44
+	$template->param(themelang => '/intranet-tmpl' . "/$theme/$lang",
  45
+							interface => '/intranet-tmpl',
  46
+							theme => $theme,
  47
+							lang => $lang,
  48
+							intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
  49
+		intranetstylesheet => C4::Context->preference("intranetstylesheet"),
  50
+		IntranetNav => C4::Context->preference("IntranetNav"),
  51
+	        referer => $refer,
  52
+			);
  53
+	return $template;
74 54
 }
20  installer/kohastructure.sql
@@ -447,11 +447,11 @@ CREATE TABLE `biblioitems` (
447 447
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
448 448
 
449 449
 --
450  
--- Table structure for table `bookshelf`
  450
+-- Table structure for table `virtualshelves`
451 451
 --
452 452
 
453  
-DROP TABLE IF EXISTS `bookshelf`;
454  
-CREATE TABLE `bookshelf` (
  453
+DROP TABLE IF EXISTS `virtualshelves`;
  454
+CREATE TABLE `virtualshelves` (
455 455
   `shelfnumber` int(11) NOT NULL auto_increment,
456 456
   `shelfname` char(255) default NULL,
457 457
   `owner` char(80) default NULL,
@@ -1382,19 +1382,19 @@ CREATE TABLE sessions (
1382 1382
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1383 1383
 
1384 1384
 --
1385  
--- Table structure for table `shelfcontents`
  1385
+-- Table structure for table `virtualshelfcontents`
1386 1386
 --
1387 1387
 
1388  
-DROP TABLE IF EXISTS `shelfcontents`;
1389  
-CREATE TABLE `shelfcontents` (
  1388
+DROP TABLE IF EXISTS `virtualshelfcontents`;
  1389
+CREATE TABLE `virtualshelfcontents` (
1390 1390
   `shelfnumber` int(11) NOT NULL default '0',
1391  
-  `itemnumber` int(11) NOT NULL default '0',
  1391
+  `biblionumber` int(11) NOT NULL default '0',
1392 1392
   `flags` int(11) default NULL,
1393 1393
   `dateadded` timestamp NULL default NULL,
1394 1394
   KEY `shelfnumber` (`shelfnumber`),
1395  
-  KEY `itemnumber` (`itemnumber`),
1396  
-  CONSTRAINT `shelfcontents_ibfk_1` FOREIGN KEY (`shelfnumber`) REFERENCES `bookshelf` (`shelfnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1397  
-  CONSTRAINT `shelfcontents_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE
  1395
+  KEY `biblionumber` (`biblionumber`),
  1396
+  CONSTRAINT `virtualshelfcontents_ibfk_1` FOREIGN KEY (`shelfnumber`) REFERENCES `virtualshelves` (`shelfnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
  1397
+  CONSTRAINT `shelfcontents_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
1398 1398
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1399 1399
 
1400 1400
 --
2  koha-tmpl/intranet-tmpl/prog/en/about.tmpl
@@ -5,7 +5,7 @@
5 5
 
6 6
 <div id="main">
7 7
 <div id="mainbloc">
8  
-	<h1>Data about the current version of Koha for bug reports (or general interest).</h1>
  8
+	<h1>About Koha</h1>
9 9
 	
10 10
 <table>
11 11
 	<caption>Server information</caption>
11  koha-tmpl/intranet-tmpl/prog/en/auth.tmpl
@@ -43,10 +43,17 @@
43 43
 <p>
44 44
 <label>Password:<br />
45 45
 <input type="password" name="password" id="password" class="input" value="" size="20" tabindex="20" /></label>
46  
-</p>    
  46
+</p> 
  47
+<p>
  48
+<label for="branch">Library:</label>
  49
+<select name="branch" id="branch" class="input">
  50
+<!-- TMPL_LOOP NAME="branchloop" -->
  51
+<option value="<!-- TMPL_VAR NAME='branchcode' -->"><!-- TMPL_VAR NAME='branchname' --></option>
  52
+<!-- /TMPL_LOOP -->
  53
+</select>
  54
+</p>
47 55
 <p class="submit"><input type="submit" value="Login &raquo;" /></p>
48 56
 </form>
49  
-
50 57
 <!-- /TMPL_IF -->
51 58
 
52 59
 <script type="text/javascript">
4  koha-tmpl/intranet-tmpl/prog/en/help/admin/systempreferences.tmpl
@@ -63,11 +63,11 @@
63 63
 
64 64
 <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>
65 65
 
66  
-<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>
  66
+<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>
67 67
 
68 68
 <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>
69 69
 
70 70
 <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>
71 71
 
72  
-<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>
  72
+<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>
73 73
 <!-- TMPL_INCLUDE name="intranet-bottom.inc" -->
15  koha-tmpl/intranet-tmpl/prog/en/help/nohelp.tmpl
... ...
@@ -1,8 +1,13 @@
1  
-<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2  
-<title>Online Help &rsaquo; No Help For This Topic!</title>
3  
-<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4  
-	
  1
+<!-- TMPL_INCLUDE NAME="help-top.inc" -->
  2
+
  3
+	<div id="main-compact">
5 4
 	<h1>Online Help</h1>
6 5
 	<p>Sorry, there is no help available for this topic</p>
  6
+<form action="/cgi-bin/koha/edithelp.pl" method="post">
  7
+<input type="hidden" name="referer" value="<!-- TMPL_VAR NAME="referer" -->">
  8
+<input type="hidden" name="type" value="addnew">
  9
+<input type="submit" name="submit" value="Add help">
  10
+</form>
7 11
 	</div>
8  
-<!-- TMPL_INCLUDE name="intranet-bottom.inc" -->
  12
+	
  13
+<!-- TMPL_INCLUDE NAME="help-bottom.inc" -->
2  koha-tmpl/intranet-tmpl/prog/en/includes/action-catalogue.inc
@@ -28,7 +28,7 @@
28 28
             </div>
29 29
             
30 30
             <div class="others">
31  
-                <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;">
  31
+                <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;">
32 32
                     Add to shelf
33 33
                 </a>
34 34
                 <a href="/cgi-bin/koha/catalogue/detailprint.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">
2  koha-tmpl/intranet-tmpl/prog/en/includes/error-top.inc
@@ -54,7 +54,7 @@ a.catalogue:hover {
54 54
 <div id="submenu">
55 55
 	<span class="koha">options &gt;&gt;&nbsp;&nbsp;</span>
56 56
 	<a href="/cgi-bin/koha/catalogue/search.pl" class="submenu2">search</a>
57  
-	<a href="/cgi-bin/koha/bookshelves/shelves.pl" class="submenu">Virtual shelves</a>
  57
+	<a href="/cgi-bin/koha/virtualshelves/shelves.pl" class="submenu">Virtual shelves</a>
58 58
 	<a href="/cgi-bin/koha/cataloguing/addbiblio.pl" class="submenu2">Add biblio</a>
59 59
 	<a href="/cgi-bin/koha/maint/catmaintain.pl" class="submenu">Cat maintenance</a>
60 60
 </div>
5  koha-tmpl/intranet-tmpl/prog/en/includes/menu-bookshelves.inc
... ...
@@ -1,5 +0,0 @@
1  
-<div id="submenu">
2  
-        <a href="/cgi-bin/koha/bookshelves/shelves.pl">Shelves</a>
3  
-</div>
4  
-
5  
-<div id="main">
5  koha-tmpl/intranet-tmpl/prog/en/includes/menu-virtualshelves.inc
... ...
@@ -0,0 +1,5 @@
  1
+<div id="submenu">
  2
+        <a href="/cgi-bin/koha/virtualshelves/shelves.pl">Virtual Shelves</a>
  3
+</div>
  4
+
  5
+<div id="main">
2  koha-tmpl/intranet-tmpl/prog/en/includes/menus.inc
@@ -48,7 +48,7 @@
48 48
                         <input type="submit" value=" OK " class="submit" />
49 49
                         </form>
50 50
                      </li>
51  
-                    <li><a href="/cgi-bin/koha/bookshelves/shelves.pl">Virtual Shelves</a></li>
  51
+                    <li><a href="/cgi-bin/koha/virtualshelves/shelves.pl">Virtual Shelves</a></li>
52 52
                 </ul>
53 53
                 <!-- /TMPL_IF -->
54 54
     <!-- TMPL_IF NAME="CAN_user_editcatalogue" -->
7  koha-tmpl/intranet-tmpl/prog/en/tools/export.tmpl
@@ -38,7 +38,7 @@
38 38
         </p>
39 39
         
40 40
         <p>
41  
-            <label for="branch">Branch</label>
  41
+            <label for="branch">Library</label>
42 42
             <select id="branch" name="branch">
43 43
             <option value="">-- All --</option>
44 44
                 <!-- TMPL_LOOP name="branchloop" -->
@@ -69,7 +69,7 @@
69 69
         <p>
70 70
         <label for="dont_export_fields">Don't export fields</label>
71 71
         <input id="dont_export_fields" type="text" name="dont_export_fields" />
72  
-        <i>splitted by a blank. (for example: 100a 200 606)</i>
  72
+        <i>seperate by a blank. (e.g.: 100a 200 606)</i>
73 73
         </p>
74 74
     </fieldset>
75 75
     <fieldset>
@@ -84,6 +84,9 @@
84 84
             </select>
85 85
             format.
86 86
         </p>
  87
+        <p>
  88
+        <label for="filename">Filename:</label><input id="filename" tyle=text" name="filename" value="koha.mrc" />
  89
+        </p>
87 90
     </fieldset>
88 91
     <input type="hidden" name="op" value="export" />
89 92
     <input type="submit" value="Export" class="button" />
12  ...pl/prog/en/bookshelves/addbookbybiblionumber.tmpl → ...mpl/prog/en/virtualshelves/addbybiblionumber.tmpl
@@ -9,30 +9,32 @@
9 9
     <!-- /TMPL_IF --> to a virtual shelf
10 10
 </h1>
11 11
 
12  
-<form name="f1" method="post" action="/cgi-bin/koha/bookshelves/addbookbybiblionumber.pl">
  12
+<form name="f1" method="POST" action="/cgi-bin/koha/virtualshelves/addbybiblionumber.pl">
13 13
     <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->">
14 14
     
15 15
     <b>Select an existing shelf</b>
16 16
     <p>
17  
-        <label>Add to virtual shelf</label><!-- TMPL_VAR NAME="CGIbookshelves" -->
  17
+        <label>Add to virtual shelf</label><!-- TMPL_VAR NAME="CGIvirtualshelves" -->
18 18
     </p>
19 19
     <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
20 20
     <input type="submit" value="Add to virtual shelf" class="submit" />
21 21
 </form>
22 22
 <p>...or...</p>
23  
-<form name="f2" method="post" action="/cgi-bin/koha/bookshelves/addbookbybiblionumber.pl">
  23
+<form name="f2" method="POST" action="/cgi-bin/koha/virtualshelves/addbybiblionumber.pl">
24 24
     <b>Add to a new shelf:</b>
25 25
         <p>
26  
-            <label for="newbookshelf">
  26
+            <label for="newvirtualshelf">
27 27
                 Shelf name:
28 28
             </label>
29  
-            <input type="text" name="newbookshelf" id="newbookshelf" size="40" />
  29
+			<input type="hidden" name="biblionumber" id="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->"/>
  30
+            <input type="text" name="newvirtualshelf" id="newvirtualshelf" size="40" />
30 31
         </p>
31 32
         <p>
32 33
             <label for="category">Category:</label>
33 34
             <select name="category" id="category">
34 35
                 <option value="1">Private</option>
35 36
                 <option value="2">Public</option>
  37
+				<option value="3">Free</option>
36 38
             </select>
37 39
         </p>
38 40
     <input type="submit" value="Add to virtual shelf" class="submit" /> 
89  ...pl/intranet-tmpl/prog/en/bookshelves/shelves.tmpl → ...intranet-tmpl/prog/en/virtualshelves/shelves.tmpl
... ...
@@ -1,26 +1,25 @@
1 1
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2  
-<title>Koha &rsaquo; Add to Virtual Shelf</title>
  2
+<title>Koha &rsaquo; Virtual Shelves</title>
3 3
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4 4
 
5 5
 <!-- TMPL_INCLUDE NAME="menus.inc" -->
6  
-<!-- TMPL_INCLUDE NAME="menu-bookshelves.inc" -->
7  
-
8  
-<!-- TMPL_IF Name="viewshelf" -->
  6
+<!-- TMPL_INCLUDE NAME="menu-virtualshelves.inc" -->
9 7
 
  8
+<!-- TMPL_IF NAME="viewshelf" -->
10 9
 <div id="action">
11  
-    <a class="button" href="/cgi-bin/koha/bookshelves/shelves.pl">Back to virtual Shelves</a>
  10
+    <a class="button" href="/cgi-bin/koha/virtualshelves/shelves.pl">Back to virtual Shelves</a>
12 11
     <!-- TMPL_IF name="manageshelf" -->
13  
-    <a class="button" href="/cgi-bin/koha/bookshelves/shelves.pl?op=modif&shelf=<!-- TMPL_VAR Name="shelfnumber" -->">
14  
-        Modify this shelf</a>
  12
+    <a class="button" href="/cgi-bin/koha/virtualshelves/shelves.pl?op=modif&shelf=<!-- TMPL_VAR NAME="shelfnumber" -->">
  13
+        Edit this shelf</a>
15 14
     <!-- /TMPL_IF -->
16 15
 </div>
17 16
 
18  
-<h3>Contents of <!-- TMPL_VAR Name="shelfname" --></h3>
  17
+<h3>Contents of <!-- TMPL_VAR NAME="shelfname" --></h3>
19 18
 
20  
-<form class="inline" action="/cgi-bin/koha/bookshelves/shelves.pl" method="post" name="mainform">
  19
+<form class="inline" action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post" name="mainform">
21 20
     <!-- TMPL_IF NAME="itemsloop" -->
22 21
     <table>
23  
-        <input type="hidden" name="viewshelf" value="<!-- TMPL_VAR Name="shelfnumber" -->" />
  22
+        <input type="hidden" name="viewshelf" value="<!-- TMPL_VAR NAME="shelfnumber" -->" />
24 23
         <input type="hidden" name="modifyshelfcontents" value="1" />
25 24
             <tr>
26 25
                 <th>
@@ -33,10 +32,10 @@
33 32
                 <th>Author</th>
34 33
                 <th>Call No.</th>
35 34
             </tr>
36  
-        <!-- TMPL_LOOP Name="itemsloop" -->
  35
+        <!-- TMPL_LOOP NAME="itemsloop" -->
37 36
             <tr<!-- TMPL_IF name="color" --> class="highlight"<!-- /TMPL_IF -->>
38 37
                     <td>
39  
-                        <input type="checkbox" name="REM-<!-- TMPL_VAR Name="itemnumber" -->" />
  38
+                        <input type="checkbox" name="REM-<!-- TMPL_VAR NAME="biblionumber" -->" />
40 39
                     </td>
41 40
                     <td>
42 41
                         <img src="<!-- TMPL_VAR NAME="themelang" -->/images/<!-- TMPL_VAR NAME="itemtype" -->.gif" alt="<!-- TMPL_VAR NAME="itemtype" -->" title="<!-- TMPL_VAR NAME="itemtype" -->" />
@@ -58,7 +57,7 @@
58 57
                             <!-- /TMPL_IF -->
59 58
                         <!-- /TMPL_IF -->
60 59
                     </td>
61  
-                    <td><!-- TMPL_VAR Name="author" --></td>
  60
+                    <td><!-- TMPL_VAR NAME="author" --></td>
62 61
                     <td><!-- TMPL_VAR NAME="classification" --></td>
63 62
         </tr>
64 63
         <!-- /TMPL_LOOP -->
@@ -89,7 +88,7 @@
89 88
     <!-- TMPL_IF name="manageshelf" -->
90 89
     
91 90
 <br />
92  
-<form action="/cgi-bin/koha/bookshelves/shelves.pl" method="post">
  91
+<form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post">
93 92
     <table>
94 93
         <tr><th colspan="2">Add an item to this shelf by barcode</th></tr>
95 94
         <tr>
@@ -98,7 +97,7 @@
98 97
             </td>
99 98
             <td>
100 99
                 <input name="addbarcode" type="text" id="addbarcode" size="14" maxlength="14" />
101  
-                <input type="hidden" name="viewshelf" value="<!-- TMPL_VAR Name="shelfnumber" -->" />
  100
+                <input type="hidden" name="viewshelf" value="<!-- TMPL_VAR NAME="shelfnumber" -->" />
102 101
                 <input type="hidden" name="modifyshelfcontents" value="1" />
103 102
                 <input type="submit" value="Save" />
104 103
             </td>
@@ -107,16 +106,16 @@
107 106
 </form>
108 107
 <!-- /TMPL_IF -->
109 108
 <!-- TMPL_ELSE -->
110  
-    <!-- TMPL_IF Name="shelves" -->
111  
-        <!-- TMPL_IF Name="status1" -->
112  
-            <p class="error"><!-- TMPL_VAR Name="string1" --></p>
  109
+    <!-- TMPL_IF NAME="shelves" -->
  110
+        <!-- TMPL_IF NAME="status1" -->
  111
+            <p class="error"><!-- TMPL_VAR NAME="string1" --></p>
113 112
         <!-- /TMPL_IF -->
114  
-        <!-- TMPL_LOOP Name="paramsloop" -->
115  
-            <!-- TMPL_IF Name="status" -->
116  
-                <p class="error"><!-- TMPL_VAR Name="string" --></p>
  113
+        <!-- TMPL_LOOP NAME="paramsloop" -->
  114
+            <!-- TMPL_IF NAME="status" -->
  115
+                <p class="error"><!-- TMPL_VAR NAME="string" --></p>
117 116
             <!-- /TMPL_IF -->
118 117
         <!-- /TMPL_LOOP -->
119  
-    <form method="post" action="/cgi-bin/koha/bookshelves/shelves.pl">
  118
+    <form method="post" action="/cgi-bin/koha/virtualshelves/shelves.pl">
120 119
         <input type="hidden" name="shelves" value="1">
121 120
         <h3>Create a new virtual shelf</h3>
122 121
         <table>
@@ -125,32 +124,34 @@
125 124
         <tr><th scope="row"><label for="category">Category:</label> </th><td><select name="category" id="category">
126 125
                                     <option value="1">Private</option>
127 126
                                     <option value="2">Public</option>
  127
+									<option value="3">Free</option>
128 128
                                     </select></td></tr></table>
129 129
         <ul>
130 130
             <li>A <b>private</b> virtual shelf is managed by you and can be seen only by you.</li>
131 131
             <li> A <b>public</b> virtual shelf can be seen by everybody, but managed only by you.</li>
  132
+			<li> An <b>open</b> virtual shelf can be seen and managed by everybody.</li>
132 133
         </ul>
133 134
                                 <p><input type="submit" value="Add a new shelf"></p>
134 135
                     </form>
135 136
         
136 137
         <!-- TMPL_IF NAME="numberCanManage" -->
137 138
         <!-- TMPL_IF NAME="shelvesloop" -->
138  
-        <form method="post" action="/cgi-bin/koha/bookshelves/shelves.pl" name="mainform">
  139
+        <form method="post" action="/cgi-bin/koha/virtualshelves/shelves.pl" name="mainform">
139 140
                     <input type="hidden" name="shelves" value="1" />
140 141
                     <h3>Delete virtual shelves</h3>
141 142
                     <table>
142 143
                         <tr><th>&nbsp;</th><th>Shelf name</th><th>Contents</th></tr>
143  
-                        <!-- TMPL_LOOP Name="shelvesloop" -->
  144
+                        <!-- TMPL_LOOP NAME="shelvesloop" -->
144 145
                         <!-- TMPL_IF name="canmanage" -->
145 146
                         <tr>
146 147
                             <td>
147  
-                                <input type="checkbox" name="DEL-<!-- TMPL_VAR Name="shelf" -->" />
  148
+                                <input type="checkbox" name="DEL-<!-- TMPL_VAR NAME="shelf" -->" />
148 149
                             </td>
149 150
                             <td>
150  
-                                <a href="/cgi-bin/koha/bookshelves/shelves.pl?viewshelf=<!-- TMPL_VAR Name="shelf" -->"><!-- TMPL_VAR Name="shelfname" --></a>
  151
+                                <a href="/cgi-bin/koha/virtualshelves/shelves.pl?viewshelf=<!-- TMPL_VAR NAME="shelf" -->"><!-- TMPL_VAR NAME="shelfname" --></a>
151 152
                             </td>
152 153
                             <td>
153  
-                                <!-- TMPL_VAR Name="shelfbookcount" --> item(s)
  154
+                                <!-- TMPL_VAR NAME="shelfvirtualcount" --> item(s)
154 155
                             </td>
155 156
                         </tr>
156 157
                         <!-- /TMPL_IF -->
@@ -160,14 +161,14 @@
160 161
         <!-- /TMPL_IF -->
161 162
         <!-- /TMPL_IF -->
162 163
         <br />
163  
-        <p><form class="inline" action="/cgi-bin/koha/bookshelves/shelves.pl" method="get"><input type="submit" value="Back to virtual shelves" /></form></p>
  164
+        <p><form class="inline" action="/cgi-bin/koha/virtualshelves/shelves.pl" method="get"><input type="submit" value="Back to virtual shelves" /></form></p>
164 165
 
165 166
     <!-- TMPL_ELSE -->
166 167
     <!-- TMPL_IF name="edit" -->
167 168
         <form method="post">
168 169
             <input type="hidden" name="op" value="modifsave">
169 170
             <input type="hidden" name="shelfnumber" value="<!-- TMPL_VAR name="shelfnumber" -->">
170  
-<h3>Modify virtual shelf <!-- TMPL_VAR name="shelfname"--></h3>
  171
+<h3>Edit virtual shelf '<!-- TMPL_VAR name="shelfname"-->'</h3>
171 172
             <table>
172 173
             <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>
173 174
             <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>
@@ -181,27 +182,43 @@
181 182
                         <option value="2" selected>Public</option>
182 183
                     <!-- TMPL_ELSE -->
183 184
                         <option value="2">Public</option>
  185
+					<!-- TMPL_IF NAME="category3" -->
  186
+						<option value="3" selected>Free</option>
  187
+					<!-- TMPL_ELSE -->
  188
+						<option value="3">Free</option>
184 189
                     <!-- /TMPL_IF -->
185 190
                 </select></td></tr>
186 191
             </table>
187 192
             <ul><li>A <strong>private</strong> virtual shelf is managed by you and can be seen <strong>only</strong> by you.</li>
188 193
                 <li> A <strong>public</strong> virtual shelf can be seen by <strong>everybody</strong>, but managed only by you.</li>
  194
+				 <li> A <b>free</b> virtual shelf can be seen and managed by everybody.</li>
189 195
             </ul>
190 196
             <p><input type="submit" value="Save changes"></p>
191 197
 
192 198
         </form>
193 199
 <!-- /TMPL_IF -->
  200
+<!-- /TMPL_IF -->
194 201
 <h3>Virtual shelves</h3>
195 202
 
196 203
 <table>
197  
-<tr><th>Shelf name</th><th>Category</th><th>Content size</th><th>&nbsp;</th></tr>
198  
-<!-- TMPL_LOOP Name="shelvesloop" -->
199  
-<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>
200  
-            <!-- /TMPL_LOOP -->
201  
-        </table>
202  
-        <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>
  204
+<tr><th>Shelf name</th><th>Category</th><th>Items</th><th>&nbsp;</th></tr>
  205
+
  206
+<!-- TMPL_LOOP NAME="shelvesloop" -->
  207
+<tr<!-- TMPL_IF name="color" --> class="highlight"<!-- /TMPL_IF -->>
  208
+<td><a href="/cgi-bin/koha/virtualshelves/shelves.pl?viewshelf=<!-- TMPL_VAR NAME="shelf" -->"><!-- TMPL_VAR NAME="shelfname" --></a></td>
  209
+<td>
  210
+<!-- TMPL_IF NAME="viewcategory1" -->Private<!-- /TMPL_IF -->
  211
+<!-- TMPL_IF NAME="viewcategory2" -->Public<!-- /TMPL_IF -->
  212
+<!-- TMPL_IF NAME="viewcategory3" -->Free<!-- /TMPL_IF -->
  213
+</td>
  214
+<td><!-- TMPL_VAR NAME="shelfvirtualcount" --> </td>
  215
+<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>
  216
+
  217
+<!-- /TMPL_LOOP -->
  218
+</table>
  219
+        <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>
203 220
     <!-- /TMPL_IF -->
204  
-<!-- /TMPL_IF -->
  221
+
205 222
 
206 223
 <br clear="both" />
207 224
 
2  koha-tmpl/opac-tmpl/prog/en/includes/basket.js
@@ -161,7 +161,7 @@ function addMultiple(){
161 161
 
162 162
 function addSelToShelf() {
163 163
     var items = document.getElementById('records').value;
164  
-    document.location = "/cgi-bin/koha/opac-addbookbybiblionumber.pl?biblionumber="+items;