diff --git a/catalogue/ISBDdetail.pl b/catalogue/ISBDdetail.pl index 7ebe8e0c01..df84a3ae26 100755 --- a/catalogue/ISBDdetail.pl +++ b/catalogue/ISBDdetail.pl @@ -43,6 +43,7 @@ use CGI; use C4::Koha; use C4::Biblio; use C4::Items; +use C4::Members; # to use GetMember use C4::Branch; # GetBranchDetail use C4::Serials; # CountSubscriptionFromBiblionumber use C4::Search; # enabled_staff_search_views @@ -66,6 +67,16 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); +if($query->cookie("holdfor")){ + my $holdfor_patron = GetMember('borrowernumber' => $query->cookie("holdfor")); + $template->param( + holdfor => $query->cookie("holdfor"), + holdfor_surname => $holdfor_patron->{'surname'}, + holdfor_firstname => $holdfor_patron->{'firstname'}, + holdfor_cardnumber => $holdfor_patron->{'cardnumber'}, + ); +} + # my @blocs = split /\@/,$ISBD; # my @fields = $record->fields(); my $res = GetISBDView($biblionumber, "intranet"); diff --git a/catalogue/MARCdetail.pl b/catalogue/MARCdetail.pl index d73c5d99ae..ce8c93ece6 100755 --- a/catalogue/MARCdetail.pl +++ b/catalogue/MARCdetail.pl @@ -54,6 +54,7 @@ use MARC::Record; use C4::Biblio; use C4::Items; use C4::Acquisition; +use C4::Members; # to use GetMember use C4::Serials; #uses getsubscriptionsfrombiblionumber GetSubscriptionsFromBiblionumber use C4::Search; # enabled_staff_search_views @@ -84,6 +85,16 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); +if($query->cookie("holdfor")){ + my $holdfor_patron = GetMember('borrowernumber' => $query->cookie("holdfor")); + $template->param( + holdfor => $query->cookie("holdfor"), + holdfor_surname => $holdfor_patron->{'surname'}, + holdfor_firstname => $holdfor_patron->{'firstname'}, + holdfor_cardnumber => $holdfor_patron->{'cardnumber'}, + ); +} + #count of item linked my $itemcount = GetItemsCount($biblionumber); $template->param( count => $itemcount, diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 6ee79e62ed..3d42326fc3 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -30,7 +30,7 @@ use C4::Items; use C4::Circulation; use C4::Branch; use C4::Reserves; -use C4::Members; +use C4::Members; # to use GetMember use C4::Serials; use C4::XISBN qw(get_xisbns get_biblionumber_from_isbn); use C4::External::Amazon; @@ -51,6 +51,16 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( } ); +if($query->cookie("holdfor")){ + my $holdfor_patron = GetMember('borrowernumber' => $query->cookie("holdfor")); + $template->param( + holdfor => $query->cookie("holdfor"), + holdfor_surname => $holdfor_patron->{'surname'}, + holdfor_firstname => $holdfor_patron->{'firstname'}, + holdfor_cardnumber => $holdfor_patron->{'cardnumber'}, + ); +} + my $biblionumber = $query->param('biblionumber'); my $fw = GetFrameworkCode($biblionumber); diff --git a/catalogue/labeledMARCdetail.pl b/catalogue/labeledMARCdetail.pl index e72a6d115d..8faecfce38 100755 --- a/catalogue/labeledMARCdetail.pl +++ b/catalogue/labeledMARCdetail.pl @@ -26,6 +26,7 @@ use C4::Context; use C4::Output; use C4::Biblio; use C4::Items; +use C4::Members; # to use GetMember use C4::Search; # enabled_staff_search_views my $query = new CGI; @@ -52,6 +53,16 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); +if($query->cookie("holdfor")){ + my $holdfor_patron = GetMember('borrowernumber' => $query->cookie("holdfor")); + $template->param( + holdfor => $query->cookie("holdfor"), + holdfor_surname => $holdfor_patron->{'surname'}, + holdfor_firstname => $holdfor_patron->{'firstname'}, + holdfor_cardnumber => $holdfor_patron->{'cardnumber'}, + ); +} + #count of item linked my $itemcount = GetItemsCount($biblionumber); $template->param( count => $itemcount, diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl index 4f40b04b04..c3d7a95e34 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -31,6 +31,7 @@ use C4::Auth; use C4::Serials; use C4::Dates qw/format_date/; use C4::Circulation; # to use itemissues +use C4::Members; # to use GetMember use C4::Search; # enabled_staff_search_views my $query=new CGI; @@ -48,6 +49,16 @@ my ($template, $loggedinuser, $cookie) = get_template_and_user({ flagsrequired => {catalogue => 1}, }); +if($query->cookie("holdfor")){ + my $holdfor_patron = GetMember('borrowernumber' => $query->cookie("holdfor")); + $template->param( + holdfor => $query->cookie("holdfor"), + holdfor_surname => $holdfor_patron->{'surname'}, + holdfor_firstname => $holdfor_patron->{'firstname'}, + holdfor_cardnumber => $holdfor_patron->{'cardnumber'}, + ); +} + # get variables my $biblionumber=$query->param('biblionumber'); diff --git a/catalogue/search.pl b/catalogue/search.pl index b0fea2aa56..f3f6008973 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -145,6 +145,7 @@ use C4::Auth qw(:DEFAULT get_session); use C4::Search; use C4::Languages qw(getAllLanguages); use C4::Koha; +use C4::Members qw(GetMember); use C4::VirtualShelves qw(GetRecentShelves); use POSIX qw(ceil floor); use C4::Branch; # GetBranches @@ -181,6 +182,16 @@ if (C4::Context->preference("marcflavour") eq "UNIMARC" ) { $template->param('UNIMARC' => 1); } +if($cgi->cookie("holdfor")){ + my $holdfor_patron = GetMember('borrowernumber' => $cgi->cookie("holdfor")); + $template->param( + holdfor => $cgi->cookie("holdfor"), + holdfor_surname => $holdfor_patron->{'surname'}, + holdfor_firstname => $holdfor_patron->{'firstname'}, + holdfor_cardnumber => $holdfor_patron->{'cardnumber'}, + ); +} + ## URI Re-Writing # Deprecated, but preserved because it's interesting :-) # The same thing can be accomplished with mod_rewrite in diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css index 66b092c2e7..49ed8c3753 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -439,6 +439,7 @@ ul.toolbar { ul.toolbar button { padding-bottom : 2px; + font-family: arial, verdana, helvetica, sans-serif; } .yui-menu-button { @@ -927,13 +928,16 @@ fieldset.rows .inputnote { } #placehold a, -#placehold button { +#placehold button, +#holdfor .first-child { padding-left : 34px; background-image: url("../../img/toolbar-hold.gif"); background-position : center left; background-repeat : no-repeat; } +#holdfor .first-child { padding-left : 17px; } + #editmenuc .first-child, #deleteshelf .first-child,#newmenuc .first-child, #addbiblio .first-child, #z3950search .first-child, #printmenuc .first-child, #newsupplier .first-child, #savemenuc .first-child, #budgets_menuc .first-child, #periods_menuc .first-child { padding-left : 15px; } @@ -1417,6 +1421,11 @@ li.email { padding : .1em 0 .1em 1em; } +/* Hack just for Firefox */ +html>/**/body #searchheader button, x:-moz-any-link, x:default { + padding-bottom : 3px; +} + #searchheader h3 { } diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc index 1c5b20fb71..6cf3899dfa 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc @@ -148,7 +148,31 @@ function confirm_items_deletion() { container: this, onclick: {fn: printBiblio } }); + + + // Create an array of YAHOO.widget.MenuItem configuration properties + var onButtonClick = function () { + location.href="/cgi-bin/koha/reserve/request.pl?biblionumber="; + } + var HoldForButtonMenu = [ + { text: "Place hold", url: "/cgi-bin/koha/reserve/request.pl?biblionumber=" }, + { text: "Place hold for ()", url: "/cgi-bin/koha/reserve/request.pl?biblionumber=&findborrower=" } + ]; + // Instantiate a Split Button using the array of YAHOO.widget.MenuItem + // configuration properties as the value for the "menu" + // configuration attribute. + + var HoldForButton = new YAHOO.widget.Button({ + id: "holdfor", + type: "split", + label: "Place hold", + name: "holdfor", + menu: HoldForButtonMenu, + container: this, + onclick: { fn: onButtonClick } + }); + new YAHOO.widget.Button({ id: "placehold", type: "link", @@ -156,6 +180,8 @@ function confirm_items_deletion() { container: this, href: "/cgi-bin/koha/reserve/request.pl?biblionumber=" }); + + new YAHOO.widget.Button({ id: "z3950search", diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc index 976de151d1..e14590d9c4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc @@ -36,11 +36,8 @@ function update_child() { // prepare DOM for YUI Toolbar $(document).ready(function() { - $("#printslip").parent().remove(); - $("#patronflags").parent().remove(); - $("#deletepatron").parent().remove(); - $("#moremenuc").empty(); - $("#printmenuc").empty(); + $("#printslip,#patronflags,#deletepatron").parent().remove(); + $("#moremenuc,#printmenuc,#searchtoholdc").empty(); yuiToolbar(); }); @@ -49,7 +46,12 @@ function update_child() { window.open("/cgi-bin/koha/members/moremember.pl?borrowernumber=&print=" + print_type, "printwindow"); return false; } - + function searchToHold(){ + var date = new Date(); + date.setTime(date.getTime() + (10 * 60 * 1000)); + $.cookie("holdfor", "", { path: "/", expires: date }); + location.href="/cgi-bin/koha/catalogue/search.pl"; + } function yuiToolbar() { var printmenu = [ @@ -76,8 +78,14 @@ function update_child() { name: "printmenubutton", menu: printmenu, container: "printmenuc" - }); - + }); + new YAHOO.widget.Button({ + id: "searchtohold", + type: "button", + label: _("Search to hold"), + container: "searchtoholdc", + onclick: {fn: searchToHold } + }); new YAHOO.widget.Button({ type: "menu", label: _("More"), @@ -85,7 +93,7 @@ function update_child() { menu: moremenu, container: "moremenuc" }); - + new YAHOO.widget.Button("addchild"); new YAHOO.widget.Button("editpatron"); new YAHOO.widget.Button("addnote"); @@ -93,7 +101,7 @@ function update_child() { new YAHOO.widget.Button("changepassword"); new YAHOO.widget.Button("printslip"); new YAHOO.widget.Button("printpage"); - new YAHOO.widget.Button("renewpatron"); + new YAHOO.widget.Button("renewpatron"); @@ -127,12 +135,12 @@ function update_child() {