Bugzilla – Attachment 181466 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: (follow-up) Special update to fix bz39631 with DiscreteCalendar
Bug-17015-follow-up-Special-update-to-fix-bz39631-.patch (text/plain), 4.04 KB, created by
Hammat wele
on 2025-04-24 16:14:32 UTC
(
hide
)
Description:
Bug 17015: (follow-up) Special update to fix bz39631 with DiscreteCalendar
Filename:
MIME Type:
Creator:
Hammat wele
Created:
2025-04-24 16:14:32 UTC
Size:
4.04 KB
patch
obsolete
>From f5cbbc67e3a0daec3da5f7422b5fa3bba7eb1729 Mon Sep 17 00:00:00 2001 >From: Hammat Wele <hammat.wele@inlibro.com> >Date: Thu, 24 Apr 2025 16:13:32 +0000 >Subject: [PATCH] Bug 17015: (follow-up) Special update to fix bz39631 with > DiscreteCalendar > >--- > misc/cronjobs/longoverdue.pl | 37 +++++++++++------------------------- > 1 file changed, 11 insertions(+), 26 deletions(-) > >diff --git a/misc/cronjobs/longoverdue.pl b/misc/cronjobs/longoverdue.pl >index 16bda1bb77..d5232a9cf2 100755 >--- a/misc/cronjobs/longoverdue.pl >+++ b/misc/cronjobs/longoverdue.pl >@@ -351,18 +351,7 @@ sub longoverdue_sth { > SELECT items.itemnumber, borrowernumber, date_due, itemlost > FROM issues, items > WHERE items.itemnumber = issues.itemnumber >- "; >- if ( !C4::Context->preference('OverdueNoticeCalendar') ) { >- $query .= " >- AND DATE_SUB(CURDATE(), INTERVAL ? DAY) > date_due >- AND DATE_SUB(CURDATE(), INTERVAL ? DAY) <= date_due >- "; >- } else { >- $query .= " >- AND TO_DAYS(NOW())-TO_DAYS(issues.date_due) >= 0 >- "; >- } >- $query .= " >+ AND TO_DAYS(NOW())-TO_DAYS(issues.date_due) >= 0 > AND itemlost <> ? > $skip_lost_values_sql > ORDER BY date_due >@@ -482,11 +471,7 @@ foreach my $startrange ( sort keys %$lost ) { > $verbose > and printf "\nRange %s\nDue %3s - %3s days ago (%s to %s), lost => %s\n", ++$i, > $startrange, $endrange, $date2, $date1, $lostvalue; >- if ( C4::Context->preference('OverdueNoticeCalendar') ) { >- $sth_items->execute($lostvalue); >- } else { >- $sth_items->execute( $startrange, $endrange, $lostvalue ); >- } >+ $sth_items->execute($lostvalue); > $count = 0; > ITEM: while ( my $row = $sth_items->fetchrow_hashref ) { > my $patron; >@@ -513,6 +498,8 @@ foreach my $startrange ( sort keys %$lost ) { > } > next ITEM unless ( $branches_to_process{$lib} ); > } >+ my $date = dt_from_string(); >+ my $days_between = $date->delta_days( dt_from_string( $row->{date_due} ) ); > if ( C4::Context->preference('OverdueNoticeCalendar') ) { > my $lib; > if ( $circ_control_pref eq 'PatronLibrary' ) { >@@ -520,22 +507,20 @@ foreach my $startrange ( sort keys %$lost ) { > $lib = $patron->branchcode(); > } elsif ( $circ_control_pref eq 'PickupLibrary' ) { > $lib = C4::Context->userenv->{'branch'}; >- } else { # ( $circ_control_pref eq 'ItemHomeLibrary' ) >+ } else { > if ( $circ_control_pref eq 'homebranch' ) { > $lib = Koha::Items->find( $row->{itemnumber} )->homebranch(); >- } else { # ( $circ_control_pref eq 'holdingbranch' ) >+ } else { > $lib = Koha::Items->find( $row->{itemnumber} )->holdingbranch(); > } > } >- my $calendar = Koha::DiscreteCalendar->new({ branchcode => $lib }); >- my $date_to_run = dt_from_string(); >- my $days_between = $calendar->days_between( dt_from_string( $row->{date_due} ), $date_to_run ); >- $days_between = $days_between->in_units('days'); >- my $longoverdue_days = C4::Context->preference('DefaultLongOverdueDays'); >- if ( $days_between < $longoverdue_days ) { >- next; >+ if ($lib) { >+ my $calendar = Koha::DiscreteCalendar->new( { branchcode => $lib } ); >+ $days_between = $calendar->days_between( dt_from_string( $row->{date_due} ), $date ); > } > } >+ $days_between = $days_between->in_units('days'); >+ next ITEM if ( $days_between < $startrange ); > if ($filter_itemtypes) { > my $it = uc Koha::Items->find( $row->{itemnumber} )->effective_itemtype(); > next ITEM unless ( $itemtype_to_process{$it} ); >-- >2.34.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
|
180312
|
180313
|
180314
|
180315
|
180316
|
180552
|
180962
| 181466 |
183006