From 7cc44be17d6655643bfbf742d03ed1ee896a9789 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 31 Dec 2009 12:43:57 -0500 Subject: [PATCH] Moving some list functions into the standard toolbar. - Adding download functions to menu button - Some markup corrections --- C4/VirtualShelves/Page.pm | 2 + .../en/includes/virtualshelves-toolbar.inc | 85 ++++++++++++++++--- .../modules/virtualshelves/sendshelfform.tmpl | 6 +- .../en/modules/virtualshelves/shelves.tmpl | 32 +++---- 4 files changed, 93 insertions(+), 32 deletions(-) diff --git a/C4/VirtualShelves/Page.pm b/C4/VirtualShelves/Page.pm index 9e618c5b16..d80c72c38b 100644 --- a/C4/VirtualShelves/Page.pm +++ b/C4/VirtualShelves/Page.pm @@ -33,6 +33,7 @@ use C4::Output; use C4::Dates qw/format_date/; use Exporter; use Data::Dumper; +use C4::Csv; use vars qw($debug @EXPORT @ISA $VERSION); @@ -317,6 +318,7 @@ $template->param( shelvesloopall => [(@shelvesloop, @shelveslooppriv)], numberCanManage => $numberCanManage, "BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1, + csv_profiles => GetCsvProfilesLoop() ); if ($template->param('viewshelf') or $template->param( 'shelves' ) or diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc index 5ad8bb9688..f05764da7a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc @@ -5,32 +5,95 @@ // prepare DOM for YUI Toolbar $(document).ready(function() { - $("#deleteshelfc").empty(); + $("#editlistc").empty(); + $("#deletelistc").remove(); + $("#sendlistc").empty(); + $("#downloadlistc").empty(); + $("#printlistc").empty(); + $("#sendlistc").before("
  • <\/li>"); yuiToolbar(); }); + + function sendList(){ + open(CGIBIN+'virtualshelves/sendshelf.pl?shelfid=','win_form','dependant=yes,scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); + } + + function downloadList(){ + open(CGIBIN+'virtualshelves/downloadshelf.pl?shelfid=','win_form','dependant=yes,scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); + } // YUI Toolbar Functions function yuiToolbar() { newshelfButton = new YAHOO.widget.Button("newshelf"); - editshelfButton = new YAHOO.widget.Button("editshelf"); - deleteshelfButton = new YAHOO.widget.Button({ - id: "deleteshelf", + editshelfButton = new YAHOO.widget.Button("editshelf"); + + var editmenu = [ + { text: _("Edit list"), url: "/cgi-bin/koha/virtualshelves/shelves.pl?shelfnumber=&op=modif" }, + { text: _("Delete list"), onclick: {fn:function(){confirmDelete(_("Are you sure you want to delete this list?"))}}} + ]; + + var downloadmenu = [ + { text: _("iso2709"), url: "/cgi-bin/koha/virtualshelves/downloadshelf.pl?format=iso2709&shelfid=" }, + { text: _("RIS"), url: "/cgi-bin/koha/virtualshelves/downloadshelf.pl?format=ris&shelfid=" }, + { text: _("BibTex"), url: "/cgi-bin/koha/virtualshelves/downloadshelf.pl?format=bibtex&shelfid=" }, + + { text: _("CSV - "), url: "/cgi-bin/koha/virtualshelves/downloadshelf.pl?format=&shelfid=" }, + + ]; + + new YAHOO.widget.Button({ + type: "menu", + label: _("Download list"), + name: "downloadmenubutton", + menu: downloadmenu, + container: "downloadmenuc" + }); + + new YAHOO.widget.Button({ + type: "menu", + label: _("Edit"), + name: "editmenubutton", + menu: editmenu, + container: "editlistc" + }); + + + downloadlistButton = new YAHOO.widget.Button({ + id: "downloadlist", type: "button", - label: _("Delete List"), - container: "deleteshelfc", - onclick: {fn:function(){confirmDelete(_("Are you sure you want to delete this shelf?"))}} + label: _("Download list"), + container: "downloadlistc", + onclick: {fn:downloadList} }); + sendlistButton = new YAHOO.widget.Button({ + id: "sendlist", + type: "button", + label: _("Send list"), + container: "sendlistc", + onclick: {fn:sendList} + }); + printlistButton = new YAHOO.widget.Button({ + id: "printbiblio", + type: "button", + label: _("Print list"), + container: "printlistc", + onclick: {fn:function(){print();}} + }); } //]]> + \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelfform.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelfform.tmpl index 41f7d32b36..1aec4c893f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelfform.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelfform.tmpl @@ -1,11 +1,11 @@ -Koha Online Catalog › Sending Your List +Koha › Lists › Sending your list
    -

    Message Sent

    +

    Message sent

    The list was sent to:

    Close window

    @@ -20,7 +20,7 @@
    Sending your list
    1. - +
    2. diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tmpl index d0998c8709..ff5edb06ea 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tmpl @@ -24,7 +24,7 @@ $(document).ready(function(){ function confirmDelete(message){ if (window.confirm(message)) { - location.href="/cgi-bin/koha/virtualshelves/shelves.pl?display=privateshelves&shelves=1&DEL-=1"; + location.href="/cgi-bin/koha/virtualshelves/shelves.pl?display=privateshelves&shelves=1&DEL-=1"; } else { return false; } @@ -140,16 +140,12 @@ function placeHold () {
      Contents of - + @@ -198,15 +194,15 @@ function placeHold () { -
      -
      -
      +
      - - - + + +
      +
      +
    @@ -215,7 +211,7 @@ function placeHold () {
    -
    +
    Add an item to
    1. @@ -369,10 +365,10 @@ function placeHold () { + - No Private Lists. +

      No Private Lists.

      -
    -- 2.39.2