From 30d39284fb44ec44f08c474f4e64f1d763fb90d3 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 10 Sep 2012 17:06:00 +0200 Subject: [PATCH] Bug 8367: Add more granular level for ReservesMaxPickUpDelay This patch adds: - a new column in the issuing rules - a new column reserves.maxpickupdate (+old_reserves) It contains the waitingdate + the corresponding max pickup delay. Each time the waitingdate is modified, this value will be modified too. - a new field issuingrules.holdspickupdelay This patch removes the ReservesMaxPickUpDelay syspref. The update database script will update the issuingrules table with the correct value before removing it. You can now specify a pickup delay for an hold function of a patron category and/or a item type and/or a library. To test: Check there is no regression with a normal reserve workflow. Add one or more issuingrules. Update the new column 'Holds pickup delay' in your issuing rules. In 4 templates, you can see the max pickup delay for an hold (circ/circulation.tt, circ/waitingreserves.tt, members/moremember.tt, opac-user.tt). According to a library and an item type, the maxpickupdate value will be equal to the waiting date + the pickup delay defined. --- C4/Letters.pm | 3 +- C4/Reserves.pm | 137 +++++++++++++++++--- admin/smart-rules.pl | 13 +- circ/circulation.pl | 3 + circ/waitingreserves.pl | 56 ++++---- installer/data/mysql/kohastructure.sql | 3 + installer/data/mysql/updatedatabase.pl | 28 ++++ .../en/modules/admin/preferences/circulation.pref | 7 +- .../prog/en/modules/admin/smart-rules.tt | 6 +- .../prog/en/modules/circ/circulation.tt | 4 +- .../prog/en/modules/circ/waitingreserves.tt | 11 +- .../prog/en/modules/help/circ/waitingreserves.tt | 4 +- .../prog/en/modules/members/moremember.tt | 2 +- koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt | 2 +- members/moremember.pl | 1 + .../thirdparty/TalkingTech_itiva_outbound.pl | 5 +- opac/opac-user.pl | 6 +- 17 files changed, 212 insertions(+), 79 deletions(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index 0349efe..28bdeb0 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -610,8 +610,7 @@ sub _parseletter { if ( $table eq 'reserves' && $values->{'waitingdate'} ) { my @waitingdate = split /-/, $values->{'waitingdate'}; - my $dt = dt_from_string(); - $dt->add( days => C4::Context->preference('ReservesMaxPickUpDelay') ); + my $dt = dt_from_string($values->{maxpickupdate}); $values->{'expirationdate'} = output_pref( $dt, undef, 1 ); $values->{'waitingdate'} = output_pref( dt_from_string( $values->{'waitingdate'} ), undef, 1 ); diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 5ff12e4..c209f10 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -23,6 +23,7 @@ package C4::Reserves; use strict; #use warnings; FIXME - Bug 2505 +use Date::Calc qw( Add_Delta_Days ); use C4::Context; use C4::Biblio; use C4::Members; @@ -116,7 +117,7 @@ BEGIN { &CheckReserves &CanBookBeReserved - &CanItemBeReserved + &CanItemBeReserved &CancelReserve &CancelExpiredReserves @@ -130,6 +131,7 @@ BEGIN { &ReserveSlip &ToggleSuspend &SuspendAll + &GetReservesControlBranch ); @EXPORT_OK = qw( MergeHolds ); } @@ -169,35 +171,38 @@ sub AddReserve { $waitingdate = $resdate; } + my $item = C4::Items::GetItem( $checkitem ); + my $maxpickupdate = GetMaxPickupDate( undef, $item ); + #eval { # updates take place here if ( $fee > 0 ) { my $nextacctno = &getnextacctno( $borrowernumber ); - my $query = qq/ + my $query = q{ INSERT INTO accountlines (borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding) VALUES (?,?,now(),?,?,'Res',?) - /; + }; my $usth = $dbh->prepare($query); $usth->execute( $borrowernumber, $nextacctno, $fee, "Reserve Charge - $title", $fee ); } #if ($const eq 'a'){ - my $query = qq/ + my $query = q{ INSERT INTO reserves (borrowernumber,biblionumber,reservedate,branchcode,constrainttype, - priority,reservenotes,itemnumber,found,waitingdate,expirationdate) + priority,reservenotes,itemnumber,found,waitingdate,expirationdate,maxpickupdate) VALUES (?,?,?,?,?, - ?,?,?,?,?,?) - /; + ?,?,?,?,?,?,?) + }; my $sth = $dbh->prepare($query); $sth->execute( $borrowernumber, $biblionumber, $resdate, $branch, $const, $priority, $notes, $checkitem, - $found, $waitingdate, $expdate + $found, $waitingdate, $expdate, $maxpickupdate ); # Send e-mail to librarian if syspref is active @@ -497,6 +502,76 @@ sub CanItemBeReserved{ return 0; } } + +=head2 GetMaxPickupDate + +$maxpickupdate = &GetMaxPickupDate($reserve [, $item]); +$reserve->{waitingdate} is a string or a DateTime. + +this function returns the max pickup date (DateTime format). +(e.g. : the date after which the hold will be considered cancelled) + +=cut + +sub GetMaxPickupDate { + my ( $reserve, $item ) = @_; + + if ( not defined $reserve and not defined $item->{itemnumber} ) { + warn "ERROR: GetMaxPickupDate is called without reserve and without itemnumber"; + return; + } + + if ( defined $reserve and not defined $item ) { + $item = C4::Items::GetItem( $reserve->{itemnumber} ); + } + + unless ( defined $reserve ) { + my $reserve = GetReservesFromItemnumber( $item->{itemnumber} ); + } + return unless $reserve->{waitingdate}; + + my $borrower = C4::Members::GetMember( 'borrowernumber' => $reserve->{borrowernumber} ); + + my $controlbranch = GetReservesControlBranch( $borrower, $item ); + + my $issuingrule = C4::Circulation::GetIssuingRule( $borrower->{categorycode}, $item->{itype}, $controlbranch ); + + my $date = ref $reserve->{waitingdate} eq 'DateTime' + ? $reserve->{waitingdate} + : dt_from_string $reserve->{waitingdate}; + + my $holdspickupdelay = 0; + if ( defined($issuingrule) + and defined $issuingrule->{holdspickupdelay} ) { + $holdspickupdelay = $issuingrule->{holdspickupdelay} + } + + $date->add( days => $holdspickupdelay ); + + return $date; +} + +=head2 GetReservesControlBranch + +$branchcode = &GetReservesControlBranch($borrower, $item) + +Returns the branchcode to consider to check hold rules against + +=cut + +sub GetReservesControlBranch { + my ( $borrower, $item ) = @_; + my $controlbranch = C4::Context->preference('ReservesControlBranch'); + my $hbr = C4::Context->preference('HomeOrHoldingBranch') || "homebranch"; + my $branchcode = "*"; + if ( $controlbranch eq "ItemHomeLibrary" ) { + $branchcode = $item->{$hbr}; + } elsif ( $controlbranch eq "PatronLibrary" ) { + $branchcode = $borrower->{branchcode}; + } + return $branchcode; +} + #-------------------------------------------------------------------------------- =head2 GetReserveCount @@ -711,7 +786,7 @@ sub GetReservesToBranch { sub GetReservesForBranch { my ($frombranch) = @_; my $dbh = C4::Context->dbh; - my $query = "SELECT borrowernumber,reservedate,itemnumber,waitingdate + my $query = "SELECT borrowernumber,reservedate,itemnumber,waitingdate,maxpickupdate FROM reserves WHERE priority='0' AND found='W' "; @@ -906,15 +981,14 @@ sub CancelExpiredReserves { while ( my $res = $sth->fetchrow_hashref() ) { CancelReserve( $res->{'biblionumber'}, '', $res->{'borrowernumber'} ); } - + # Cancel reserves that have been waiting too long if ( C4::Context->preference("ExpireReservesMaxPickUpDelay") ) { - my $max_pickup_delay = C4::Context->preference("ReservesMaxPickUpDelay"); my $charge = C4::Context->preference("ExpireReservesMaxPickUpDelayCharge"); - my $query = "SELECT * FROM reserves WHERE TO_DAYS( NOW() ) - TO_DAYS( waitingdate ) > ? AND found = 'W' AND priority = 0"; + my $query = "SELECT * FROM reserves WHERE NOW() > maxpickupdate AND found = 'W' AND priority = 0"; $sth = $dbh->prepare( $query ); - $sth->execute( $max_pickup_delay ); + $sth->execute(); while (my $res = $sth->fetchrow_hashref ) { if ( $charge ) { @@ -1221,9 +1295,28 @@ sub ModReserveStatus { my ($itemnumber, $newstatus) = @_; my $dbh = C4::Context->dbh; - my $query = "UPDATE reserves SET found = ?, waitingdate = NOW() WHERE itemnumber = ? AND found IS NULL AND priority = 0"; + my $now = dt_from_string; + my $reserve = $dbh->selectrow_hashref(q{ + SELECT * + FROM reserves + WHERE itemnumber = ? + AND found IS NULL + AND priority = 0 + }, {}, $itemnumber); + return unless $reserve; + + my $maxpickupdate = GetMaxPickupDate( $reserve ); + my $query = q{ + UPDATE reserves + SET found = ?, + waitingdate = ?, + maxpickupdate = ? + WHERE itemnumber = ? + AND found IS NULL + AND priority = 0 + }; my $sth_set = $dbh->prepare($query); - $sth_set->execute( $newstatus, $itemnumber ); + $sth_set->execute( $newstatus, $now, $maxpickupdate, $itemnumber ); if ( C4::Context->preference("ReturnToShelvingCart") && $newstatus ) { CartToShelf( $itemnumber ); @@ -1271,21 +1364,26 @@ sub ModReserveAffect { WHERE borrowernumber = ? AND biblionumber = ? "; + $sth = $dbh->prepare($query); + $sth->execute( $itemnumber, $borrowernumber,$biblionumber); } else { # affect the reserve to Waiting as well. + my $item = C4::Items::GetItem( $itemnumber ); + my $maxpickupdate = GetMaxPickupDate( undef, $item ); $query = " UPDATE reserves SET priority = 0, found = 'W', waitingdate = NOW(), + maxpickupdate = ?, itemnumber = ? WHERE borrowernumber = ? AND biblionumber = ? "; + $sth = $dbh->prepare($query); + $sth->execute( $maxpickupdate, $itemnumber, $borrowernumber,$biblionumber); } - $sth = $dbh->prepare($query); - $sth->execute( $itemnumber, $borrowernumber,$biblionumber); _koha_notify_reserve( $itemnumber, $borrowernumber, $biblionumber ) if ( !$transferToDo && !$already_on_shelf ); if ( C4::Context->preference("ReturnToShelvingCart") ) { @@ -1361,6 +1459,7 @@ sub GetReserveInfo { reserves.biblionumber, reserves.branchcode, reserves.waitingdate, + reserves.maxpickupdate, notificationdate, reminderdate, priority, @@ -1815,6 +1914,7 @@ sub _Findgroupreserve { reserves.borrowernumber AS borrowernumber, reserves.reservedate AS reservedate, reserves.waitingdate AS waitingdate, + reserves.maxpickupdate AS maxpickupdate, reserves.branchcode AS branchcode, reserves.cancellationdate AS cancellationdate, reserves.found AS found, @@ -2130,7 +2230,8 @@ sub RevertWaitingStatus { SET priority = 1, found = NULL, - waitingdate = NULL + waitingdate = NULL, + maxpickupdate = NULL, WHERE reserve_id = ? "; diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl index 5d4166d..6f5145b 100755 --- a/admin/smart-rules.pl +++ b/admin/smart-rules.pl @@ -101,9 +101,9 @@ elsif ($op eq 'delete-branch-item') { # save the values entered elsif ($op eq 'add') { my $sth_search = $dbh->prepare('SELECT COUNT(*) AS total FROM issuingrules WHERE branchcode=? AND categorycode=? AND itemtype=?'); - my $sth_insert = $dbh->prepare('INSERT INTO issuingrules (branchcode, categorycode, itemtype, maxissueqty, renewalsallowed, renewalperiod, reservesallowed, issuelength, lengthunit, hardduedate, hardduedatecompare, fine, finedays, firstremind, chargeperiod,rentaldiscount, overduefinescap) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)'); - my $sth_update=$dbh->prepare("UPDATE issuingrules SET fine=?, finedays=?, firstremind=?, chargeperiod=?, maxissueqty=?, renewalsallowed=?, renewalperiod=?, reservesallowed=?, issuelength=?, lengthunit = ?, hardduedate=?, hardduedatecompare=?, rentaldiscount=?, overduefinescap=? WHERE branchcode=? AND categorycode=? AND itemtype=?"); - + my $sth_insert = $dbh->prepare('INSERT INTO issuingrules (branchcode, categorycode, itemtype, maxissueqty, renewalsallowed, renewalperiod, reservesallowed, holdspickupdelay, issuelength, lengthunit, hardduedate, hardduedatecompare, fine, finedays, firstremind, chargeperiod,rentaldiscount, overduefinescap) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)'); + my $sth_update=$dbh->prepare("UPDATE issuingrules SET fine=?, finedays=?, firstremind=?, chargeperiod=?, maxissueqty=?, renewalsallowed=?, renewalperiod=?, reservesallowed=?, holdspickupdelay=?, issuelength=?, lengthunit = ?, hardduedate=?, hardduedatecompare=?, rentaldiscount=?, overduefinescap=? WHERE branchcode=? AND categorycode=? AND itemtype=?"); + my $br = $branch; # branch my $bor = $input->param('categorycode'); # borrower category my $cat = $input->param('itemtype'); # item type @@ -115,6 +115,7 @@ elsif ($op eq 'add') { my $renewalsallowed = $input->param('renewalsallowed'); my $renewalperiod = $input->param('renewalperiod'); my $reservesallowed = $input->param('reservesallowed'); + my $holdspickupdelay = $input->param('holdspickupdelay'); $maxissueqty =~ s/\s//g; $maxissueqty = undef if $maxissueqty !~ /^\d+/; my $issuelength = $input->param('issuelength'); @@ -129,11 +130,11 @@ elsif ($op eq 'add') { $sth_search->execute($br,$bor,$cat); my $res = $sth_search->fetchrow_hashref(); if ($res->{total}) { - $sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed, $renewalperiod, $reservesallowed, $issuelength,$lengthunit, $hardduedate,$hardduedatecompare,$rentaldiscount,$overduefinescap, $br,$bor,$cat); + $sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed, $renewalperiod, $reservesallowed, $holdspickupdelay, $issuelength,$lengthunit, $hardduedate,$hardduedatecompare,$rentaldiscount,$overduefinescap, $br,$bor,$cat); } else { - $sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed, $renewalperiod, $reservesallowed,$issuelength,$lengthunit,$hardduedate,$hardduedatecompare,$fine,$finedays,$firstremind,$chargeperiod,$rentaldiscount,$overduefinescap); + $sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed, $renewalperiod, $reservesallowed, $holdspickupdelay, $issuelength,$lengthunit,$hardduedate,$hardduedatecompare,$fine,$finedays,$firstremind,$chargeperiod,$rentaldiscount,$overduefinescap); } -} +} elsif ($op eq "set-branch-defaults") { my $categorycode = $input->param('categorycode'); my $maxissueqty = $input->param('maxissueqty'); diff --git a/circ/circulation.pl b/circ/circulation.pl index 52823f4..de656dc 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -373,6 +373,9 @@ if ($borrowernumber) { if ( $num_res->{'found'} && $num_res->{'found'} eq 'W' ) { $getreserv{color} = 'reserved'; $getreserv{waiting} = 1; + $getWaitingReserveInfo{maxpickupdate} = $num_res->{maxpickupdate}; + $getreserv{maxpickupdate} = $num_res->{maxpickupdate}; + # genarate information displaying only waiting reserves $getWaitingReserveInfo{title} = $getiteminfo->{'title'}; $getWaitingReserveInfo{biblionumber} = $getiteminfo->{'biblionumber'}; diff --git a/circ/waitingreserves.pl b/circ/waitingreserves.pl index 1ec6b2d..cb4d7b3 100755 --- a/circ/waitingreserves.pl +++ b/circ/waitingreserves.pl @@ -21,23 +21,20 @@ use strict; use warnings; use CGI; +use DateTime; use C4::Context; use C4::Output; use C4::Branch; # GetBranchName use C4::Auth; use C4::Dates qw/format_date/; use C4::Circulation; +use C4::Reserves; use C4::Members; use C4::Biblio; use C4::Items; - -use Date::Calc qw( - Today - Add_Delta_Days - Date_to_Days -); use C4::Reserves; use C4::Koha; +use Koha::DateUtils; my $input = new CGI; @@ -86,31 +83,44 @@ my ($reservcount, $overcount); my @getreserves = $all_branches ? GetReservesForBranch() : GetReservesForBranch($default); # get reserves for the branch we are logged into, or for all branches -my $today = Date_to_Days(&Today); +my $today = dt_from_string; foreach my $num (@getreserves) { next unless ($num->{'waitingdate'} && $num->{'waitingdate'} ne '0000-00-00'); my $itemnumber = $num->{'itemnumber'}; my $gettitle = GetBiblioFromItemNumber( $itemnumber ); - my $borrowernum = $num->{'borrowernumber'}; + my $borrowernumber = $num->{'borrowernumber'}; my $holdingbranch = $gettitle->{'holdingbranch'}; my $homebranch = $gettitle->{'homebranch'}; my %getreserv = ( itemnumber => $itemnumber, - borrowernum => $borrowernum, + borrowernum => $borrowernumber, ); # fix up item type for display $gettitle->{'itemtype'} = C4::Context->preference('item-level_itypes') ? $gettitle->{'itype'} : $gettitle->{'itemtype'}; my $getborrower = GetMember(borrowernumber => $num->{'borrowernumber'}); 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'}); - ( $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 ( $num->{waitingdate} ) { + my $maxpickupdate = dt_from_string($num->{maxpickupdate}); + $getreserv{waitingdate} = $num->{waitingdate}; + $getreserv{maxpickupdate} = $num->{maxpickupdate}; + if ( DateTime->compare( $today, $maxpickupdate ) == 1 ) { + if ($cancelall) { + my $res = cancel( $itemnumber, $borrowernumber, $holdingbranch, $homebranch, !$transfer_when_cancel_all ); + push @cancel_result, $res if $res; + next; + } else { + push @overloop, \%getreserv; + $overcount++; + } + }else{ + push @reservloop, \%getreserv; + $reservcount++; + } + } $getreserv{'itemtype'} = $itemtypeinfo->{'description'}; $getreserv{'title'} = $gettitle->{'title'}; @@ -131,21 +141,6 @@ foreach my $num (@getreserves) { if ( $getborrower->{'emailaddress'} ) { $getreserv{'borrowermail'} = $getborrower->{'emailaddress'}; } - - if ($today > $calcDate) { - if ($cancelall) { - my $res = cancel( $itemnumber, $borrowernum, $holdingbranch, $homebranch, !$transfer_when_cancel_all ); - push @cancel_result, $res if $res; - next; - } else { - push @overloop, \%getreserv; - $overcount++; - } - }else{ - push @reservloop, \%getreserv; - $reservcount++; - } - } $template->param(cancel_result => \@cancel_result) if @cancel_result; @@ -155,7 +150,6 @@ $template->param( overloop => \@overloop, overcount => $overcount, show_date => format_date(C4::Dates->today('iso')), - ReservesMaxPickUpDelay => C4::Context->preference('ReservesMaxPickUpDelay') ); if ($cancelall) { diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index d7eebdd..a6fe3f7 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1129,6 +1129,7 @@ CREATE TABLE `issuingrules` ( -- circulation and fine rules `renewalsallowed` smallint(6) NOT NULL default "0", -- how many renewals are allowed `renewalperiod` int(4) default NULL, -- renewal period in the unit set in issuingrules.lengthunit `reservesallowed` smallint(6) NOT NULL default "0", -- how many holds are allowed + `holdspickupdelay` int(11) default NULL, -- after how many days a hold is problematic (in days) `branchcode` varchar(10) NOT NULL default '', -- the branch this rule is for (branches.branchcode) overduefinescap decimal default NULL, -- the maximum amount of an overdue fine PRIMARY KEY (`branchcode`,`categorycode`,`itemtype`), @@ -1590,6 +1591,7 @@ CREATE TABLE `old_reserves` ( -- this table holds all holds/reserves that have b `lowestPriority` tinyint(1) NOT NULL, -- has this hold been pinned to the lowest priority in the holds queue (1 for yes, 0 for no) `suspend` BOOLEAN NOT NULL DEFAULT 0, -- in this hold suspended (1 for yes, 0 for no) `suspend_until` DATETIME NULL DEFAULT NULL, -- the date this hold is suspended until (NULL for infinitely) + `maxpickupdate` date NULL DEFAULT NULL, -- the max pickup date for this reserves PRIMARY KEY (`reserve_id`), KEY `old_reserves_borrowernumber` (`borrowernumber`), KEY `old_reserves_biblionumber` (`biblionumber`), @@ -1789,6 +1791,7 @@ CREATE TABLE `reserves` ( -- information related to holds/reserves in Koha `lowestPriority` tinyint(1) NOT NULL, `suspend` BOOLEAN NOT NULL DEFAULT 0, `suspend_until` DATETIME NULL DEFAULT NULL, + `maxpickupdate` date NULL DEFAULT NULL, -- the max pickup date for this reserves PRIMARY KEY (`reserve_id`), KEY priorityfoundidx (priority,found), KEY `borrowernumber` (`borrowernumber`), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 5963d24..5978d18 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -7010,6 +7010,34 @@ CREATE TABLE IF NOT EXISTS borrower_files ( SetVersion($DBversion); } + +$DBversion = "3.11.00.XXX"; +if ( CheckVersion($DBversion) ) { + my $maxpickupdelay = C4::Context->preference('ReservesMaxPickUpDelay') || 0; + $dbh->do(q{ + DELETE FROM systempreferences WHERE variable='ReservesMaxPickUpDelay'; + }); + $dbh->do(qq{ + ALTER TABLE issuingrules ADD COLUMN holdspickupdelay INT(11) NULL default NULL AFTER reservesallowed; + }); + my $sth = $dbh->prepare(q{ + UPDATE issuingrules SET holdspickupdelay = ? + }); + $sth->execute( $maxpickupdelay ); + $dbh->do(q{ + ALTER TABLE reserves ADD COLUMN maxpickupdate DATE NULL default NULL AFTER suspend_until; + }); + $sth = $dbh->prepare(q{ + UPDATE reserves SET maxpickupdate = ADDDATE(waitingdate, INTERVAL ? DAY); + }); + $sth->execute( $maxpickupdelay ); + $dbh->do(q{ + ALTER TABLE old_reserves ADD COLUMN maxpickupdate DATE NULL default NULL AFTER suspend_until; + }); + print "Upgrade to $DBversion done (8367: Add colum issuingrules.holdspickupdelay and reserves.maxpickupdate. Delete the ReservesMaxPickUpDelay syspref)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index 64cf338..8b589c5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -365,16 +365,11 @@ Circulation: PatronLibrary: "patron's home library" - to see if the patron can place a hold on the item. - - - Mark a hold as problematic if it has been waiting for more than - - pref: ReservesMaxPickUpDelay - class: integer - - days. - - - pref: ExpireReservesMaxPickUpDelay choices: yes: Allow no: "Don't allow" - - "holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay" + - "holds to expire automatically if they have not been picked by within the time period specified in hold pickup delay defined in the issuing rules" - - If using ExpireReservesMaxPickUpDelay, charge a borrower who allows his or her waiting hold to expire a fee of - pref: ExpireReservesMaxPickUpDelayCharge diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt index 1c83cc0..2d2a285 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt @@ -151,8 +151,10 @@ for="tobranch">Clone these rules to:   +   +   @@ -208,6 +210,7 @@ for="tobranch">Clone these rules to: Edit @@ -257,6 +260,7 @@ for="tobranch">Clone these rules to: + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 95252e7..66db55b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -710,7 +710,7 @@ No patron matched [% message %]

Holds waiting:

[% FOREACH WaitingReserveLoo IN WaitingReserveLoop %]