Bugzilla – Attachment 59169 Details for
Bug 17015
New Koha Calendar
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17015 - Koha now uses the new DiscreteCalendar module
Bug-17015---Koha-now-uses-the-new-DiscreteCalendar.patch (text/plain), 26.06 KB, created by
Mehdi Hamidi
on 2017-01-18 16:20:55 UTC
(
hide
)
Description:
Bug 17015 - Koha now uses the new DiscreteCalendar module
Filename:
MIME Type:
Creator:
Mehdi Hamidi
Created:
2017-01-18 16:20:55 UTC
Size:
26.06 KB
patch
obsolete
>From b861737dc319fc033daed93a5f90ac97e2bdacb0 Mon Sep 17 00:00:00 2001 >From: mehdi <mehdi@inlibro.com> >Date: Mon, 16 Jan 2017 10:09:23 -0500 >Subject: [PATCH] Bug 17015 - Koha now uses the new DiscreteCalendar module > >Conflicts: > circ/returns.pl >--- > C4/Circulation.pm | 104 ++++++++++----------- > C4/HoldsQueue.pm | 8 +- > C4/Overdues.pm | 5 +- > C4/Reserves.pm | 4 +- > circ/returns.pl | 4 +- > .../prog/en/modules/tools/tools-home.tt | 5 + > misc/cronjobs/fines.pl | 4 +- > misc/cronjobs/overdue_notices.pl | 8 +- > misc/cronjobs/staticfines.pl | 4 +- > .../thirdparty/TalkingTech_itiva_outbound.pl | 4 +- > 10 files changed, 78 insertions(+), 72 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index cfccbfc..f9ac8fd 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -42,7 +42,7 @@ use Data::Dumper; > use Koha::Account; > use Koha::AuthorisedValues; > use Koha::DateUtils; >-use Koha::Calendar; >+use Koha::DiscreteCalendar; > use Koha::Checkouts; > use Koha::IssuingRules; > use Koha::Items; >@@ -153,11 +153,11 @@ Generic filter function for barcode string. > Called on every circ if the System Pref itemBarcodeInputFilter is set. > Will do some manipulation of the barcode for systems that deliver a barcode > to circulation.pl that differs from the barcode stored for the item. >-For proper functioning of this filter, calling the function on the >+For proper functioning of this filter, calling the function on the > correct barcode string (items.barcode) should return an unaltered barcode. > >-The optional $filter argument is to allow for testing or explicit >-behavior that ignores the System Pref. Valid values are the same as the >+The optional $filter argument is to allow for testing or explicit >+behavior that ignores the System Pref. Valid values are the same as the > System Pref options. > > =cut >@@ -247,7 +247,7 @@ sub decode { > > =head2 transferbook > >- ($dotransfer, $messages, $iteminformation) = &transferbook($newbranch, >+ ($dotransfer, $messages, $iteminformation) = &transferbook($newbranch, > $barcode, $ignore_reserves); > > Transfers an item to a new branch. If the item is currently on loan, it is automatically returned before the actual transfer. >@@ -263,7 +263,7 @@ Returns three values: > > =over > >-=item $dotransfer >+=item $dotransfer > > is true if the transfer was successful. > >@@ -391,10 +391,10 @@ sub TooMany { > my $branch; > # Get which branchcode we need > $branch = _GetCircControlBranch($item,$borrower); >- my $type = (C4::Context->preference('item-level_itypes')) >+ my $type = (C4::Context->preference('item-level_itypes')) > ? $item->{'itype'} # item-level > : $item->{'itemtype'}; # biblio-level >- >+ > # given branch, patron category, and item type, determine > # applicable issuing rule > my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( >@@ -428,8 +428,8 @@ sub TooMany { > AND (categorycode = ? OR categorycode = ?) > AND itemtype <> '*' > ) "; >- } else { >- $count_query .= " JOIN biblioitems USING (biblionumber) >+ } else { >+ $count_query .= " JOIN biblioitems USING (biblionumber) > WHERE biblioitems.itemtype NOT IN ( > SELECT itemtype FROM issuingrules > WHERE branchcode = ? >@@ -445,8 +445,8 @@ sub TooMany { > # specific item type > if (C4::Context->preference('item-level_itypes')) { > $count_query .= " WHERE items.itype = ? "; >- } else { >- $count_query .= " JOIN biblioitems USING (biblionumber) >+ } else { >+ $count_query .= " JOIN biblioitems USING (biblionumber) > WHERE biblioitems.itemtype= ? "; > } > push @bind_params, $type; >@@ -561,7 +561,7 @@ sub TooMany { > > =head2 CanBookBeIssued > >- ( $issuingimpossible, $needsconfirmation ) = CanBookBeIssued( $borrower, >+ ( $issuingimpossible, $needsconfirmation ) = CanBookBeIssued( $borrower, > $barcode, $duedate, $inprocess, $ignore_reserves, $params ); > > Check if a book can be issued. >@@ -597,7 +597,7 @@ Possible values are : > > =back > >-=head3 INVALID_DATE >+=head3 INVALID_DATE > > sticky due date is invalid > >@@ -629,7 +629,7 @@ item withdrawn. > > item is restricted (set by ??) > >-C<$needsconfirmation> a reference to a hash. It contains reasons why the loan >+C<$needsconfirmation> a reference to a hash. It contains reasons why the loan > could be prevented, but ones that can be overriden by the operator. > > Possible values are : >@@ -673,7 +673,7 @@ sub CanBookBeIssued { > my $item = GetItem(GetItemnumberFromBarcode( $barcode )); > my $issue = GetItemIssue($item->{itemnumber}); > my $biblioitem = GetBiblioItemData($item->{biblioitemnumber}); >- $item->{'itemtype'}=$item->{'itype'}; >+ $item->{'itemtype'}=$item->{'itype'}; > my $dbh = C4::Context->dbh; > > # MANDATORY CHECKS - unless item exists, nothing else matters >@@ -712,7 +712,7 @@ sub CanBookBeIssued { > # > # BORROWER STATUS > # >- if ( $borrower->{'category_type'} eq 'X' && ( $item->{barcode} )) { >+ if ( $borrower->{'category_type'} eq 'X' && ( $item->{barcode} )) { > # stats only borrower -- add entry to statistics table, and return issuingimpossible{STATS} = 1 . > &UpdateStats({ > branch => C4::Context->userenv->{'branch'}, >@@ -1203,7 +1203,7 @@ sub checkHighHolds { > > my $issuedate = DateTime->now( time_zone => C4::Context->tz() ); > >- my $calendar = Koha::Calendar->new( branchcode => $branch ); >+ my $calendar = Koha::DiscreteCalendar->new( branchcode => $branch ); > > my $itype = > ( C4::Context->preference('item-level_itypes') ) >@@ -1333,7 +1333,7 @@ sub AddIssue { > if ($datesent) { > # updating line of branchtranfert to finish it, and changing the to branch value, implement a comment for visibility of this case (maybe for stats ....) > my $sth = $dbh->prepare( >- "UPDATE branchtransfers >+ "UPDATE branchtransfers > SET datearrived = now(), > tobranch = ?, > comments = 'Forced branchtransfer' >@@ -1573,7 +1573,7 @@ sub GetHardDueDate { > my $branch_cat_rule = GetBranchBorrowerCircRule($branchcode, $categorycode); > > Retrieves circulation rule attributes that apply to the given >-branch and patron category, regardless of item type. >+branch and patron category, regardless of item type. > The return value is a hashref containing the following key: > > maxissueqty - maximum number of loans that a >@@ -1585,11 +1585,11 @@ patron of the given category can have at the given > branch. If the value is undef, no limit. > > This will first check for a specific branch and >-category match from branch_borrower_circ_rules. >+category match from branch_borrower_circ_rules. > > If no rule is found, it will then check default_branch_circ_rules > (same branch, default category). If no rule is found, >-it will then check default_borrower_circ_rules (default >+it will then check default_borrower_circ_rules (default > branch, same category), then failing that, default_circ_rules > (default branch, default category). > >@@ -1710,7 +1710,7 @@ sub GetBranchItemRule { > $result->{'hold_fulfillment_policy'} = $search_result->{'hold_fulfillment_policy'} unless ( defined $result->{'hold_fulfillment_policy'} ); > $result->{'returnbranch'} = $search_result->{'returnbranch'} unless ( defined $result->{'returnbranch'} ); > } >- >+ > # built-in default circulation rule > $result->{'holdallowed'} = 2 unless ( defined $result->{'holdallowed'} ); > $result->{'hold_fulfillment_policy'} = 'any' unless ( defined $result->{'hold_fulfillment_policy'} ); >@@ -2011,7 +2011,7 @@ sub AddReturn { > if ($borrowernumber) { > my $fix = _FixOverduesOnReturn($borrowernumber, $item->{itemnumber}, $exemptfine, $dropbox); > defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $item->{itemnumber}...) failed!"; # zero is OK, check defined >- >+ > if ( $issue->{overdue} && $issue->{date_due} ) { > # fix fine days > $today = $dropboxdate if $dropbox; >@@ -2072,10 +2072,10 @@ sub AddReturn { > branch => $branch, > }); > } >- >+ > logaction("CIRCULATION", "RETURN", $borrowernumber, $item->{'itemnumber'}) > if C4::Context->preference("ReturnLog"); >- >+ > # Remove any OVERDUES related debarment if the borrower has no overdues > if ( $borrowernumber > && $borrower->{'debarred'} >@@ -2112,7 +2112,7 @@ Unconditionally marks an issue as being returned by > moving the C<issues> row to C<old_issues> and > setting C<returndate> to the current date, or > the last non-holiday date of the branccode specified in >-C<dropbox_branch> . Assumes you've already checked that >+C<dropbox_branch> . Assumes you've already checked that > it's safe to do this, i.e. last non-holiday > issuedate. > > if C<$returndate> is specified (in iso format), it is used as the date >@@ -2122,7 +2122,7 @@ C<$privacy> contains the privacy parameter. If the patron has set privacy to 2, > the old_issue is immediately anonymised > > Ideally, this function would be internal to C<C4::Circulation>, >-not exported, but it is currently needed by one >+not exported, but it is currently needed by one > routine in C<C4::Accounts>. > > =cut >@@ -2144,7 +2144,7 @@ sub MarkIssueReturned { > my $query = 'UPDATE issues SET returndate='; > my @bind; > if ($dropbox_branch) { >- my $calendar = Koha::Calendar->new( branchcode => $dropbox_branch ); >+ my $calendar = Koha::DiscreteCalendar->new( branchcode => $dropbox_branch ); > my $dropboxdate = $calendar->addDate( DateTime->now( time_zone => C4::Context->tz), -1 ); > $query .= ' ? '; > push @bind, $dropboxdate->strftime('%Y-%m-%d %H:%M'); >@@ -2271,7 +2271,7 @@ C<$brn> borrowernumber > > C<$itm> itemnumber > >-C<$exemptfine> BOOL -- remove overdue charge associated with this issue. >+C<$exemptfine> BOOL -- remove overdue charge associated with this issue. > C<$dropboxmode> BOOL -- remove lastincrement on overdue charge associated with this issue. > > Internal function, called only by AddReturn >@@ -2418,7 +2418,7 @@ sub _FixAccountForLostAndReturned { > > my $circ_control_branch = _GetCircControlBranch($iteminfos, $borrower); > >-Internal function : >+Internal function : > > Return the library code to be used to determine which circulation > policy applies to a transaction. Looks up the CircControl and >@@ -2505,7 +2505,7 @@ Returns a hashref > sub GetOpenIssue { > my ( $itemnumber ) = @_; > return unless $itemnumber; >- my $dbh = C4::Context->dbh; >+ my $dbh = C4::Context->dbh; > my $sth = $dbh->prepare( "SELECT * FROM issues WHERE itemnumber = ? AND returndate IS NULL" ); > $sth->execute( $itemnumber ); > return $sth->fetchrow_hashref(); >@@ -2570,7 +2570,7 @@ sub GetUpcomingDueIssues { > > my $statement = <<END_SQL; > SELECT issues.*, items.itype as itemtype, items.homebranch, TO_DAYS( date_due )-TO_DAYS( NOW() ) as days_until_due, branches.branchemail >-FROM issues >+FROM issues > LEFT JOIN items USING (itemnumber) > LEFT OUTER JOIN branches USING (branchcode) > WHERE returndate is NULL >@@ -2578,7 +2578,7 @@ HAVING days_until_due >= 0 AND days_until_due <= ? > END_SQL > > my @bind_parameters = ( $params->{'days_in_advance'} ); >- >+ > my $sth = $dbh->prepare( $statement ); > $sth->execute( @bind_parameters ); > my $upcoming_dues = $sth->fetchall_arrayref({}); >@@ -2844,7 +2844,7 @@ sub AddRenewal { > # of how many times it has been renewed. > my $renews = $issuedata->{'renewals'} + 1; > my $sth = $dbh->prepare("UPDATE issues SET date_due = ?, renewals = ?, lastreneweddate = ? >- WHERE borrowernumber=? >+ WHERE borrowernumber=? > AND itemnumber=?" > ); > >@@ -2860,7 +2860,7 @@ sub AddRenewal { > my $accountno = getnextacctno( $borrowernumber ); > my $item = GetBiblioFromItemNumber($itemnumber); > my $manager_id = 0; >- $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; >+ $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; > $sth = $dbh->prepare( > "INSERT INTO accountlines > (date, borrowernumber, accountno, amount, manager_id, >@@ -2929,7 +2929,7 @@ sub GetRenewCount { > my $renewsleft = 0; > > my $borrower = C4::Members::GetMember( borrowernumber => $bornum); >- my $item = GetItem($itemno); >+ my $item = GetItem($itemno); > > # Look in the issues table for this item, lent to this borrower, > # and not yet returned. >@@ -3409,13 +3409,13 @@ sub SendCirculationAlert { > > $items = updateWrongTransfer($itemNumber,$borrowernumber,$waitingAtLibrary,$FromLibrary); > >-This function validate the line of brachtransfer but with the wrong destination (mistake from a librarian ...), and create a new line in branchtransfer from the actual library to the original library of reservation >+This function validate the line of brachtransfer but with the wrong destination (mistake from a librarian ...), and create a new line in branchtransfer from the actual library to the original library of reservation > > =cut > > sub updateWrongTransfer { > my ( $itemNumber,$waitingAtLibrary,$FromLibrary ) = @_; >- my $dbh = C4::Context->dbh; >+ my $dbh = C4::Context->dbh; > # first step validate the actual line of transfert . > my $sth = > $dbh->prepare( >@@ -3502,7 +3502,7 @@ sub CalcDateDue { > else { # days > $dur = DateTime::Duration->new( days => $loanlength->{$length_key}); > } >- my $calendar = Koha::Calendar->new( branchcode => $branch ); >+ my $calendar = Koha::DiscreteCalendar->new( branchcode => $branch ); > $datedue = $calendar->addDate( $datedue, $dur, $loanlength->{lengthunit} ); > if ($loanlength->{lengthunit} eq 'days') { > $datedue->set_hour(23); >@@ -3549,8 +3549,8 @@ sub CalcDateDue { > sub CheckValidBarcode{ > my ($barcode) = @_; > my $dbh = C4::Context->dbh; >-my $query=qq|SELECT count(*) >- FROM items >+my $query=qq|SELECT count(*) >+ FROM items > WHERE barcode=? > |; > my $sth = $dbh->prepare($query); >@@ -3571,21 +3571,21 @@ sub IsBranchTransferAllowed { > my ( $toBranch, $fromBranch, $code ) = @_; > > if ( $toBranch eq $fromBranch ) { return 1; } ## Short circuit for speed. >- >- my $limitType = C4::Context->preference("BranchTransferLimitsType"); >+ >+ my $limitType = C4::Context->preference("BranchTransferLimitsType"); > my $dbh = C4::Context->dbh; >- >+ > my $sth = $dbh->prepare("SELECT * FROM branch_transfer_limits WHERE toBranch = ? AND fromBranch = ? AND $limitType = ?"); > $sth->execute( $toBranch, $fromBranch, $code ); > my $limit = $sth->fetchrow_hashref(); >- >+ > ## If a row is found, then that combination is not allowed, if no matching row is found, then the combination *is allowed* > if ( $limit->{'limitId'} ) { > return 0; > } else { > return 1; > } >-} >+} > > =head2 CreateBranchTransferLimit > >@@ -3599,9 +3599,9 @@ sub CreateBranchTransferLimit { > my ( $toBranch, $fromBranch, $code ) = @_; > return unless defined($toBranch) && defined($fromBranch); > my $limitType = C4::Context->preference("BranchTransferLimitsType"); >- >+ > my $dbh = C4::Context->dbh; >- >+ > my $sth = $dbh->prepare("INSERT INTO branch_transfer_limits ( $limitType, toBranch, fromBranch ) VALUES ( ?, ?, ? )"); > return $sth->execute( $code, $toBranch, $fromBranch ); > } >@@ -3642,9 +3642,9 @@ sub LostItem{ > my ($itemnumber, $mark_returned) = @_; > > my $dbh = C4::Context->dbh(); >- my $sth=$dbh->prepare("SELECT issues.*,items.*,biblio.title >- FROM issues >- JOIN items USING (itemnumber) >+ my $sth=$dbh->prepare("SELECT issues.*,items.*,biblio.title >+ FROM issues >+ JOIN items USING (itemnumber) > JOIN biblio USING (biblionumber) > WHERE issues.itemnumber=?"); > $sth->execute($itemnumber); >diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm >index e5f29c7..8041fd5 100755 >--- a/C4/HoldsQueue.pm >+++ b/C4/HoldsQueue.pm >@@ -29,7 +29,7 @@ use C4::Circulation; > use C4::Members; > use C4::Biblio; > use Koha::DateUtils; >- >+use Koha::DiscreteCalendar; > use List::Util qw(shuffle); > use List::MoreUtils qw(any); > use Data::Dumper; >@@ -76,7 +76,7 @@ sub TransportCostMatrix { > }; > > if ( C4::Context->preference("HoldsQueueSkipClosed") ) { >- $calendars->{$from} ||= Koha::Calendar->new( branchcode => $from ); >+ $calendars->{$from} ||= Koha::DiscreteCalendar->new( branchcode => $from ); > $transport_cost_matrix{$to}{$from}{disable_transfer} ||= > $calendars->{$from}->is_holiday( $today ); > } >@@ -205,7 +205,7 @@ sub CreateQueue { > $total_requests += scalar(@$hold_requests); > $total_available_items += scalar(@$available_items); > >- my $item_map = MapItemsToHoldRequests($hold_requests, $available_items, $branches_to_use, $transport_cost_matrix); >+ my $item_map = MapItemsToHoldRequests($hold_requests, $available_items, $branches_to_use, $transport_cost_matrix); > $item_map or next; > my $item_map_size = scalar(keys %$item_map) > or next; >@@ -736,7 +736,7 @@ sub load_branches_to_pull_from { > my $today = dt_from_string(); > if ( C4::Context->preference('HoldsQueueSkipClosed') ) { > @branches_to_use = grep { >- !Koha::Calendar->new( branchcode => $_ ) >+ !Koha::DiscreteCalendar->new( branchcode => $_ ) > ->is_holiday( $today ) > } @branches_to_use; > } >diff --git a/C4/Overdues.pm b/C4/Overdues.pm >index 8300a1e..9a4a942 100644 >--- a/C4/Overdues.pm >+++ b/C4/Overdues.pm >@@ -34,6 +34,7 @@ use C4::Accounts; > use C4::Log; # logaction > use C4::Debug; > use Koha::DateUtils; >+use Koha::DiscreteCalendar; > use Koha::Account::Line; > use Koha::Account::Lines; > use Koha::IssuingRules; >@@ -298,7 +299,7 @@ sub get_chargeable_units { > my $charge_duration; > if ($unit eq 'hours') { > if(C4::Context->preference('finesCalendar') eq 'noFinesWhenClosed') { >- my $calendar = Koha::Calendar->new( branchcode => $branchcode ); >+ my $calendar = Koha::DiscreteCalendar->new( branchcode => $branchcode ); > $charge_duration = $calendar->hours_between( $date_due, $date_returned ); > } else { > $charge_duration = $date_returned->delta_ms( $date_due ); >@@ -310,7 +311,7 @@ sub get_chargeable_units { > } > else { # days > if(C4::Context->preference('finesCalendar') eq 'noFinesWhenClosed') { >- my $calendar = Koha::Calendar->new( branchcode => $branchcode ); >+ my $calendar = Koha::DiscreteCalendar->new( branchcode => $branchcode ); > $charge_duration = $calendar->days_between( $date_due, $date_returned ); > } else { > $charge_duration = $date_returned->delta_days( $date_due ); >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 3f124a6..118b593 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -37,7 +37,7 @@ use C4::Letters; > use C4::Log; > > use Koha::DateUtils; >-use Koha::Calendar; >+use Koha::DiscreteCalendar; > use Koha::Database; > use Koha::Hold; > use Koha::Old::Hold; >@@ -1031,7 +1031,7 @@ sub CancelExpiredReserves { > while ( my $res = $sth->fetchrow_hashref ) { > my $do_cancel = 1; > unless ( $cancel_on_holidays ) { >- my $calendar = Koha::Calendar->new( branchcode => $res->{'branchcode'} ); >+ my $calendar = Koha::DiscreteCalendar->new( branchcode => $res->{'branchcode'} ); > my $is_holiday = $calendar->is_holiday( $today ); > > if ( $is_holiday ) { >diff --git a/circ/returns.pl b/circ/returns.pl >index de701ff..ffe4496 100755 >--- a/circ/returns.pl >+++ b/circ/returns.pl >@@ -49,7 +49,7 @@ use C4::Koha; # FIXME : is it still useful ? > use C4::RotatingCollections; > use Koha::AuthorisedValues; > use Koha::DateUtils; >-use Koha::Calendar; >+use Koha::DiscreteCalendar; > use Koha::Checkouts; > > my $query = new CGI; >@@ -202,7 +202,7 @@ my $dropboxmode = $query->param('dropboxmode'); > my $dotransfer = $query->param('dotransfer'); > my $canceltransfer = $query->param('canceltransfer'); > my $dest = $query->param('dest'); >-my $calendar = Koha::Calendar->new( branchcode => $userenv_branch ); >+my $calendar = Koha::DiscreteCalendar->new( branchcode => $userenv_branch ); > #dropbox: get last open day (today - 1) > my $today = DateTime->now( time_zone => C4::Context->tz()); > my $dropboxdate = $calendar->addDate($today, -1); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt >index 3220aad..3f24e77 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt >@@ -74,6 +74,11 @@ > <dd>Define days when the library is closed</dd> > [% END %] > >+ [% IF ( CAN_user_tools_edit_calendar ) %] >+ <dt><a href="/cgi-bin/koha/tools/discrete_calendar.pl">Discrete Calendar</a></dt> >+ <dd>Define days when the library is closed</dd> >+ [% END %] >+ > [% IF ( CAN_user_tools_manage_csv_profiles ) %] > <dt><a href="/cgi-bin/koha/tools/csv-profiles.pl">CSV profiles</a></dt> > <dd>Manage CSV export profiles</dd> >diff --git a/misc/cronjobs/fines.pl b/misc/cronjobs/fines.pl >index 6c3f830..d544537 100755 >--- a/misc/cronjobs/fines.pl >+++ b/misc/cronjobs/fines.pl >@@ -36,7 +36,7 @@ use Getopt::Long; > use Carp; > use File::Spec; > >-use Koha::Calendar; >+use Koha::DiscreteCalendar; > use Koha::DateUtils; > use C4::Log; > >@@ -176,7 +176,7 @@ EOM > sub set_holiday { > my ( $branch, $dt ) = @_; > >- my $calendar = Koha::Calendar->new( branchcode => $branch ); >+ my $calendar = Koha::DiscreteCalendar->new( branchcode => $branch ); > return $calendar->is_holiday($dt); > } > >diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl >index 0aaf22a..480e508 100755 >--- a/misc/cronjobs/overdue_notices.pl >+++ b/misc/cronjobs/overdue_notices.pl >@@ -40,7 +40,7 @@ use C4::Overdues qw(GetFine GetOverdueMessageTransportTypes parse_overdues_lette > use C4::Log; > use Koha::Patron::Debarments qw(AddUniqueDebarment); > use Koha::DateUtils; >-use Koha::Calendar; >+use Koha::DiscreteCalendar; > use Koha::Libraries; > use Koha::Acquisition::Currencies; > >@@ -444,7 +444,7 @@ elsif ( defined $text_filename ) { > > foreach my $branchcode (@branches) { > if ( C4::Context->preference('OverdueNoticeCalendar') ) { >- my $calendar = Koha::Calendar->new( branchcode => $branchcode ); >+ my $calendar = Koha::DiscreteCalendar->new( branchcode => $branchcode ); > if ( $calendar->is_holiday($date_to_run) ) { > next; > } >@@ -543,7 +543,7 @@ END_SQL > if ( C4::Context->preference('OverdueNoticeCalendar') ) > { > my $calendar = >- Koha::Calendar->new( branchcode => $branchcode ); >+ Koha::DiscreteCalendar->new( branchcode => $branchcode ); > $days_between = > $calendar->days_between( dt_from_string($data->{date_due}), > $date_to_run ); >@@ -627,7 +627,7 @@ END_SQL > while ( my $item_info = $sth2->fetchrow_hashref() ) { > if ( C4::Context->preference('OverdueNoticeCalendar') ) { > my $calendar = >- Koha::Calendar->new( branchcode => $branchcode ); >+ Koha::DiscreteCalendar->new( branchcode => $branchcode ); > $days_between = > $calendar->days_between( > dt_from_string( $item_info->{date_due} ), $date_to_run ); >diff --git a/misc/cronjobs/staticfines.pl b/misc/cronjobs/staticfines.pl >index c57e99e..7369d73 100755 >--- a/misc/cronjobs/staticfines.pl >+++ b/misc/cronjobs/staticfines.pl >@@ -40,7 +40,7 @@ use Date::Calc qw/Date_to_Days/; > use C4::Context; > use C4::Circulation; > use C4::Overdues; >-use C4::Calendar qw(); # don't need any exports from Calendar >+use C4::DiscreteCalendar qw(); # don't need any exports from Calendar > use C4::Biblio; > use C4::Debug; # supplying $debug and $cgi_debug > use C4::Log; >@@ -176,7 +176,7 @@ for ( my $i = 0 ; $i < scalar(@$data) ; $i++ ) { > > my $calendar; > unless ( defined( $calendars{$branchcode} ) ) { >- $calendars{$branchcode} = C4::Calendar->new( branchcode => $branchcode ); >+ $calendars{$branchcode} = C4::DiscreteCalendar->new( branchcode => $branchcode ); > } > $calendar = $calendars{$branchcode}; > my $isHoliday = $calendar->isHoliday( $tday, $tmonth, $tyear ); >diff --git a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl b/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl >index 1299b7d..7138c15 100755 >--- a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl >+++ b/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl >@@ -35,7 +35,7 @@ use C4::Context; > use C4::Items; > use C4::Letters; > use C4::Overdues; >-use Koha::Calendar; >+use Koha::DiscreteCalendar; > use Koha::DateUtils; > > sub usage { >@@ -291,7 +291,7 @@ sub GetWaitingHolds { > $sth->execute(); > my @results; > while ( my $issue = $sth->fetchrow_hashref() ) { >- my $calendar = Koha::Calendar->new( branchcode => $issue->{'site'} ); >+ my $calendar = Koha::DiscreteCalendar->new( branchcode => $issue->{'site'} ); > > my $waiting_date = dt_from_string( $issue->{waitingdate}, 'sql' ); > my $pickup_date = $waiting_date->clone->add( days => $pickupdelay ); >-- >1.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17015
:
53859
|
54318
|
54419
|
59166
|
59167
|
59168
|
59169
|
59170
|
59171
|
59267
|
59268
|
59269
|
59270
|
59271
|
59463
|
59516
|
59517
|
59518
|
59519
|
59520
|
59561
|
59562
|
59586
|
59587
|
59888
|
59889
|
60902
|
60903
|
60904
|
60905
|
60906
|
60986
|
61737
|
62375
|
62376
|
62380
|
63257
|
63282
|
63362
|
63363
|
63364
|
63365
|
63366
|
63367
|
64235
|
65073
|
65074
|
65075
|
65076
|
65077
|
67721
|
67722
|
67723
|
67724
|
67725
|
67879
|
67929
|
67930
|
67931
|
67932
|
67933
|
67934
|
68392
|
68393
|
68394
|
68395
|
68396
|
68397
|
71634
|
71635
|
71636
|
71637
|
71638
|
72890
|
73145
|
74859
|
74860
|
74861
|
74862
|
74863
|
74864
|
74865
|
74866
|
75444
|
75479
|
76594
|
77249
|
77250
|
77607
|
77608
|
77609
|
77610
|
77611
|
77612
|
77613
|
77770
|
77771
|
77772
|
77773
|
77774
|
79035
|
80523
|
80524
|
80525
|
80526
|
80527
|
80528
|
80529
|
80530
|
80531
|
80532
|
80533
|
80534
|
80535
|
83547
|
85394
|
85677
|
85678
|
85679
|
85680
|
85681
|
85682
|
85683
|
85684
|
85685
|
85686
|
85687
|
85688
|
85689
|
85690
|
85691
|
92595
|
92596
|
92597
|
92598
|
100079
|
110383
|
110384
|
110386
|
110387
|
110388
|
110389
|
113541
|
113905
|
115501
|
115502
|
115503
|
115504
|
115505
|
115506
|
115507
|
115508
|
115509
|
115510
|
115511
|
118554
|
118555
|
118556
|
118557
|
118558
|
118559
|
119095
|
119097
|
119099
|
119100
|
119101
|
119102
|
131619
|
131620
|
131621
|
131622
|
131623
|
131624
|
131625
|
131626
|
131634
|
131635
|
131636
|
131637
|
131638
|
131639
|
131640
|
131641
|
131667
|
132199
|
133596
|
133597
|
133598
|
133599
|
133600
|
133601
|
133602
|
133603
|
133604
|
133605
|
133678
|
137219
|
137220
|
137221
|
137222
|
137223
|
137224
|
137225
|
137226
|
137227
|
137228
|
137229
|
139378
|
139379
|
139380
|
139381
|
139382
|
139599
|
139600
|
139601
|
139602
|
139603
|
139851
|
140150
|
141176
|
144257
|
144258
|
144259
|
144260
|
144261
|
144262
|
144264
|
144268
|
144269
|
144270
|
144271
|
144272
|
144273
|
151438
|
151439
|
151440
|
151441
|
151442
|
151443
|
151444
|
151445
|
151446
|
151447
|
151448
|
151449
|
151450
|
156340
|
156341
|
156342
|
156343
|
156344
|
156345
|
156346
|
156347
|
156348
|
156349
|
156350
|
156351
|
156352
|
156353
|
156354
|
156355
|
157656
|
157657
|
157658
|
157659
|
157660
|
157661
|
157662
|
157663
|
157664
|
157665
|
157666
|
157667
|
157668
|
157669
|
157670
|
157671
|
157672
|
167805
|
167806
|
167807
|
167808
|
167809