From 631a875de1abafe46f07524255f022ce5f00a576 Mon Sep 17 00:00:00 2001 From: Nahuel ANGELINETTI Date: Wed, 2 Dec 2009 11:44:43 +0100 Subject: [PATCH] (bug #3825) improve waiting holds [cherry-pick from 3.0.x] This patch : * fix indentation * Separate waiting holds from holds over with tabs * Select only holds for librarian library Signed-off-by: Galen Charlton --- circ/waitingreserves.pl | 27 +++-- .../prog/en/modules/circ/waitingreserves.tmpl | 103 +++++++++++++----- 2 files changed, 96 insertions(+), 34 deletions(-) diff --git a/circ/waitingreserves.pl b/circ/waitingreserves.pl index 812027fe8f..6a9d58effd 100755 --- a/circ/waitingreserves.pl +++ b/circ/waitingreserves.pl @@ -91,10 +91,11 @@ if ($item) { } } -my @reservloop; -my @getreserves = C4::Context->preference('IndependantBranches') ? GetReservesForBranch($default) : GetReservesForBranch(); +my (@reservloop, @overloop); +my ($reservcount, $overcount); +my @getreserves = $default ? GetReservesForBranch($default) : GetReservesForBranch(); # get reserves for the branch we are logged into, or for all branches - + my $today = Date_to_Days(&Today); foreach my $num (@getreserves) { next unless ($num->{'waitingdate'} && $num->{'waitingdate'} ne '0000-00-00'); @@ -106,21 +107,18 @@ foreach my $num (@getreserves) { my $itemtypeinfo = getitemtypeinfo( $gettitle->{'itemtype'} ); # using the fixed up itype/itemtype $getreserv{'waitingdate'} = format_date( $num->{'waitingdate'} ); - my ( $waiting_year, $waiting_month, $waiting_day ) = split /-/, $num->{'waitingdate'}; + my ( $waiting_year, $waiting_month, $waiting_day ) = split (/-/, $num->{'waitingdate'}); ( $waiting_year, $waiting_month, $waiting_day ) = Add_Delta_Days( $waiting_year, $waiting_month, $waiting_day, C4::Context->preference('ReservesMaxPickUpDelay')); my $calcDate = Date_to_Days( $waiting_year, $waiting_month, $waiting_day ); - if ($today > $calcDate) { - $getreserv{'messcompa'} = 1; - } $getreserv{'itemtype'} = $itemtypeinfo->{'description'}; $getreserv{'title'} = $gettitle->{'title'}; $getreserv{'itemnumber'} = $gettitle->{'itemnumber'}; $getreserv{'biblionumber'} = $gettitle->{'biblionumber'}; $getreserv{'barcode'} = $gettitle->{'barcode'}; - $getreserv{'homebranch'} = $gettitle->{'homebranch'}; + $getreserv{'homebranch'} = GetBranchName($gettitle->{'homebranch'}); $getreserv{'holdingbranch'} = $gettitle->{'holdingbranch'}; $getreserv{'itemcallnumber'} = $gettitle->{'itemcallnumber'}; if ( $gettitle->{'homebranch'} ne $gettitle->{'holdingbranch'} ) { @@ -133,11 +131,22 @@ foreach my $num (@getreserves) { if ( $getborrower->{'emailaddress'} ) { $getreserv{'borrowermail'} = $getborrower->{'emailaddress'}; } - push @reservloop, \%getreserv; + + if ($today > $calcDate) { + push @overloop, \%getreserv; + $overcount++; + }else{ + push @reservloop, \%getreserv; + $reservcount++; + } + } $template->param( reserveloop => \@reservloop, + reservecount => $reservcount, + overloop => \@overloop, + overcount => $overcount, show_date => format_date(C4::Dates->today('iso')), dateformat => C4::Context->preference("dateformat"), ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tmpl index 5f6d29ae53..f0de15ccc0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tmpl @@ -10,15 +10,16 @@ $.tablesorter.addParser({ format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); }, type: 'text' }); - $(document).ready(function() { - $("th a").hide(); - $.tablesorter.defaults.widgets = ['zebra']; - $("#holdst").tablesorter({ - dateFormat: 'uk', - sortList: [[3,0]], - headers: { 1:{sorter:'articles'},3: { sorter: 'articles' },4:{sorter:false}} - }); - }); + $(document).ready(function() { + $('#resultlist > ul').tabs(); + $("th a").hide(); + $.tablesorter.defaults.widgets = ['zebra']; + $("#holdst").tablesorter({ + dateFormat: 'uk', + sortList: [[3,0]], + headers: { 1:{sorter:'articles'},3: { sorter: 'articles' },4:{sorter:false}} + }); + }); //]]> @@ -34,8 +35,8 @@ $.tablesorter.addParser({
-
-
+
+

Holds awaiting pickup for your library on:

@@ -60,7 +61,12 @@ $.tablesorter.addParser({
-
+
+ +
@@ -71,21 +77,67 @@ $.tablesorter.addParser({ - - + + + + + + +
Action

- Hold Over +

+ + "> + + "> + + "> + + + +   () +
Barcode: +
+ ">,

+ ?subject=Reservation: "> +

- - "> - - "> - - "> - - - -   () +
+ " /> + " /> + " /> + " /> + + " /> + + + +
+
+
+
+ + + + + + + + + + + +
Available sinceTitlePatronLocationAction

+ + "> + + "> + + "> + + + +   ()
Barcode:
@@ -110,6 +162,7 @@ $.tablesorter.addParser({
+
No holds found.
-- 2.39.5