From c591cf1859c4fd4f75d0b544f2595d7bc398ea83 Mon Sep 17 00:00:00 2001 From: tipaul Date: Mon, 3 Jan 2005 11:09:33 +0000 Subject: [PATCH] synch'ing virtual shelves management in opac with the librarian one, that has more features --- .../opac-tmpl/css/en/opac-ISBDdetail.tmpl | 16 +- .../opac-tmpl/css/en/opac-MARCdetail.tmpl | 18 +- .../css/en/opac-addbookbybiblionumber.tmpl | 22 ++ koha-tmpl/opac-tmpl/css/en/opac-detail.tmpl | 10 +- koha-tmpl/opac-tmpl/css/en/opac-main.tmpl | 11 +- koha-tmpl/opac-tmpl/css/en/opac-shelves.tmpl | 295 ++++++++++-------- opac/opac-shelves.pl | 87 ++++-- 7 files changed, 293 insertions(+), 166 deletions(-) create mode 100644 koha-tmpl/opac-tmpl/css/en/opac-addbookbybiblionumber.tmpl diff --git a/koha-tmpl/opac-tmpl/css/en/opac-ISBDdetail.tmpl b/koha-tmpl/opac-tmpl/css/en/opac-ISBDdetail.tmpl index f60eb8a3ee..a27c2a414b 100644 --- a/koha-tmpl/opac-tmpl/css/en/opac-ISBDdetail.tmpl +++ b/koha-tmpl/opac-tmpl/css/en/opac-ISBDdetail.tmpl @@ -2,10 +2,16 @@ /includes/marc-editor.css">
" class="button catalogue"> - Normal + Simple " class="button"> - MARC + Complete + + " class="button catalogue"> + ISBD + + ')" class="button catalogue"> + Add to shelf ')" class="button catalogue"> Print @@ -15,6 +21,12 @@ Request + + " class="button catalogue" title="Serial issues"> + Issues + + + ')">Add to basket
diff --git a/koha-tmpl/opac-tmpl/css/en/opac-MARCdetail.tmpl b/koha-tmpl/opac-tmpl/css/en/opac-MARCdetail.tmpl index af67076deb..f978da80b5 100644 --- a/koha-tmpl/opac-tmpl/css/en/opac-MARCdetail.tmpl +++ b/koha-tmpl/opac-tmpl/css/en/opac-MARCdetail.tmpl @@ -1,21 +1,31 @@ -/includes/marc-editor.css">
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 index 0000000000..c80db472dd --- /dev/null +++ b/koha-tmpl/opac-tmpl/css/en/opac-addbookbybiblionumber.tmpl @@ -0,0 +1,22 @@ + +
+

Add book to bookshelf

+

+

+

Select bookshelf

+
+

+
+
+

or add to a new bookshelf

+

+ "> + +

+ +
+ diff --git a/koha-tmpl/opac-tmpl/css/en/opac-detail.tmpl b/koha-tmpl/opac-tmpl/css/en/opac-detail.tmpl index 648300792c..c672f045b0 100644 --- a/koha-tmpl/opac-tmpl/css/en/opac-detail.tmpl +++ b/koha-tmpl/opac-tmpl/css/en/opac-detail.tmpl @@ -2,11 +2,17 @@ /includes/marc-editor.css">
+ " class="button catalogue"> + Simple + + " class="button"> + Complete + " class="button catalogue"> ISBD - " class="button"> - MARC + ')" class="button catalogue"> + Add to shelf ')" class="button catalogue"> Print diff --git a/koha-tmpl/opac-tmpl/css/en/opac-main.tmpl b/koha-tmpl/opac-tmpl/css/en/opac-main.tmpl index 1050595d15..3c30e251c9 100644 --- a/koha-tmpl/opac-tmpl/css/en/opac-main.tmpl +++ b/koha-tmpl/opac-tmpl/css/en/opac-main.tmpl @@ -3,13 +3,12 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - /includes/opac.css" /> + + " /> + + /includes/opac.css" /> + <!--TMPL_VAR name="LibraryName"--> - diff --git a/koha-tmpl/opac-tmpl/css/en/opac-shelves.tmpl b/koha-tmpl/opac-tmpl/css/en/opac-shelves.tmpl index fc1c6fcf43..f8f1a3fb37 100644 --- a/koha-tmpl/opac-tmpl/css/en/opac-shelves.tmpl +++ b/koha-tmpl/opac-tmpl/css/en/opac-shelves.tmpl @@ -1,160 +1,189 @@
-
- - - - - - - - - - - - - - - - - - - -
- Contents of -
">">">">
-
-
Shelf list - "> - - "> + +

+ +
+

Shelf content

+ + + + + + + + + + + + + + + +
deletebarcodetitleAuthor
">">">">">">
+ "> + + "> + + + + Shelf list +
+
+ - +
+
+

Add a book by barcode

+ "> + + "> + + + "> + +
+
- - -
- "> - - "> - - - - - -
- Add a book by barcode in : - - - - "> - -
-
- +

Bookshelves

-

+

-

+

-

-

Bookshelves

- - - - - - -
-
-

- Shelf list -

-
-
-
- - - - - +
+

Select Shelves to Delete

+ + -
- - +

+ + "> ( item(s)) +

-
Select Shelves to Delete -
"> - "> - ( books) -

-

+

-
-
- - - - - - - - -
- Add Shelf -
-

Name :

-

Owner : ">

-

Category : -

-

  • a private bookshelf is managed by you & can be seen only by you.
  • -
  • A public can be seen by everybody, but managed only by you.
  • -
  • A free can be managed by any user.
  • -

    -
    -

    -
    +
    +
    +
    + +

    Add Shelf

    +

    +

    ">

    +

    + +

    +
    • a private bookshelf is managed by you & can be seen only by you.
    • +
    • A public can be seen by everybody, but managed only by you.
    • +
    • A free can be managed by any user.
    • +
    +

    + + back to shelf list +

    +
    +
    -
    - - - - - - - - - - -
    - Shelf List -
    - - - - "> - ( books) - -
    -

    +

    +

    Shelf list

    + + + + + + + + + + + + + + + + + +
    Shelf nameCategoryContent sizeModify
    "> + "> + + + "> + + Private + + + Public + + + Free + + "> + item(s) + "> + " class="button">Modify + +
    +
    + + + +
    +
    + +

    Modify shelf

    + "> +

    ">

    +

    ">

    +

    + +

    +

  • a private bookshelf is managed by you & can be seen only by you.
  • +
  • A public can be seen by everybody, but managed only by you.
  • +
  • A free can be managed by any user.
  • +

    +

    + +

    + +
    +
    +
    diff --git a/opac/opac-shelves.pl b/opac/opac-shelves.pl index 2775eb2ac3..6db9162f08 100755 --- a/opac/opac-shelves.pl +++ b/opac/opac-shelves.pl @@ -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 -- 2.20.1