Bugzilla – Attachment 187029 Details for
Bug 24194
Add system preference to disable the use of expiration dates for holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24194: Making the qa script happy
Bug-24194-Making-the-qa-script-happy.patch (text/plain), 10.36 KB, created by
Alex Buckley
on 2025-09-29 04:10:02 UTC
(
hide
)
Description:
Bug 24194: Making the qa script happy
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2025-09-29 04:10:02 UTC
Size:
10.36 KB
patch
obsolete
>From 474bada03c5eb0e1e18a3b6f03e4cf729f81979d Mon Sep 17 00:00:00 2001 >From: Chris Cormack <chris@bigballofwax.co.nz> >Date: Fri, 19 Jul 2024 02:30:59 +0000 >Subject: [PATCH] Bug 24194: Making the qa script happy > >Tidied up a bunch there are still a couple of perltidy complaints, but >I am running out of time today so attaching this patch so it doesn't get lost > >No more test fails, or failing patterns > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >--- > C4/UsageStats.pm | 1 + > Koha/Club/Hold.pm | 2 +- > Koha/REST/V1/Clubs/Holds.pm | 2 +- > circ/waitingreserves.pl | 7 ++--- > .../bug24194-add-ReserveExpiration-syspref.pl | 10 ++++--- > koha-tmpl/intranet-tmpl/prog/js/holds.js | 7 +++-- > .../bootstrap/en/includes/holds-table.inc | 5 ++-- > .../bootstrap/en/modules/opac-reserve.tt | 26 +++++++++---------- > misc/cronjobs/holds/cancel_expired_holds.pl | 2 +- > t/db_dependent/Reserves.t | 2 -- > 10 files changed, 34 insertions(+), 30 deletions(-) > mode change 100644 => 100755 installer/data/mysql/atomicupdate/bug24194-add-ReserveExpiration-syspref.pl > >diff --git a/C4/UsageStats.pm b/C4/UsageStats.pm >index 4492080c097..f651b78ecd8 100644 >--- a/C4/UsageStats.pm >+++ b/C4/UsageStats.pm >@@ -206,6 +206,7 @@ sub _shared_preferences { > ExpireReservesMaxPickUpDelay > OPACAllowHoldDateInFuture > OPACAllowUserToChooseBranch >+ ReserveExpiration > ReservesControlBranch > ReservesNeedReturns > SuspendHoldsIntranet >diff --git a/Koha/Club/Hold.pm b/Koha/Club/Hold.pm >index 13ff372f95f..6efc1005954 100644 >--- a/Koha/Club/Hold.pm >+++ b/Koha/Club/Hold.pm >@@ -70,7 +70,7 @@ sub add { > unless scalar @enrollments; > > my $biblio = Koha::Biblios->find( $params->{biblio_id} ); >- >+ > if ( !C4::Context->preference('ReserveExpiration') and $params->{expiration_date} ) { > Koha::Exceptions::Hold::ExpirationDateDisabled->throw; > } >diff --git a/Koha/REST/V1/Clubs/Holds.pm b/Koha/REST/V1/Clubs/Holds.pm >index ba3f274e6f6..9d654304e08 100644 >--- a/Koha/REST/V1/Clubs/Holds.pm >+++ b/Koha/REST/V1/Clubs/Holds.pm >@@ -53,7 +53,7 @@ sub add { > my $pickup_library_id = $body->{pickup_library_id}; > my $item_id = $body->{item_id}; > my $item_type = $body->{item_type}; >- my $expiration_date = C4::Context->preference('ReserveExpiration') ? $body->{expiration_date} : undef; >+ my $expiration_date = C4::Context->preference('ReserveExpiration') ? $body->{expiration_date} : undef; > my $notes = $body->{notes}; > my $default_patron_home = $body->{default_patron_home}; > >diff --git a/circ/waitingreserves.pl b/circ/waitingreserves.pl >index d93d7bb642a..e99b8880fdf 100755 >--- a/circ/waitingreserves.pl >+++ b/circ/waitingreserves.pl >@@ -104,10 +104,11 @@ my $today = Date_to_Days(&Today); > while ( my $hold = $holds->next ) { > next unless $hold->waitingdate; > >- my ( $expire_year, $expire_month, $expire_day ) = split (/-/, $hold->expirationdate); >- my $calcDate = Date_to_Days( $expire_year, $expire_month, $expire_day ) if $hold->expirationdate; >+ my ( $expire_year, $expire_month, $expire_day ) = split( /-/, $hold->expirationdate ); >+ my $calcDate; >+ $calcDate = Date_to_Days( $expire_year, $expire_month, $expire_day ) if $hold->expirationdate; > >- if ($calcDate and $today > $calcDate) { >+ if ( $calcDate and $today > $calcDate ) { > if ( $op eq 'cud-cancelall' ) { > my $res = cancel( > $hold->item->itemnumber, $hold->borrowernumber, $hold->item->holdingbranch, >diff --git a/installer/data/mysql/atomicupdate/bug24194-add-ReserveExpiration-syspref.pl b/installer/data/mysql/atomicupdate/bug24194-add-ReserveExpiration-syspref.pl >old mode 100644 >new mode 100755 >index 82668b44ae9..f2fa5cdb188 >--- a/installer/data/mysql/atomicupdate/bug24194-add-ReserveExpiration-syspref.pl >+++ b/installer/data/mysql/atomicupdate/bug24194-add-ReserveExpiration-syspref.pl >@@ -1,12 +1,14 @@ > use Modern::Perl; > > return { >- bug_number => "24194", >+ bug_number => "24194", > description => "Add new system preference ReserveExpiration", >- up => sub { >+ up => sub { > my ($args) = @_; >- my ($dbh, $out) = @$args{qw(dbh out)}; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; > >- $dbh->do(q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ("ReserveExpiration", 1, NULL, "Enable the use of expiration date in holds module.", "YesNo") }); >+ $dbh->do( >+ q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ("ReserveExpiration", 1, NULL, "Enable the use of expiration date in holds module.", "YesNo") } >+ ); > }, > }; >diff --git a/koha-tmpl/intranet-tmpl/prog/js/holds.js b/koha-tmpl/intranet-tmpl/prog/js/holds.js >index 50999755b50..94af16c6d67 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/holds.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/holds.js >@@ -339,8 +339,11 @@ $(document).ready(function () { > }, > }, > { >- "visible": ReserveExpiration, >- "data": { _: "expirationdate_formatted", "sort": "expirationdate" } >+ visible: ReserveExpiration, >+ data: { >+ _: "expirationdate_formatted", >+ sort: "expirationdate", >+ }, > }, > { > data: function (oObj) { >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc >index 8d5fc04f1ce..9ff34f9494d 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc >@@ -93,12 +93,11 @@ > [% ELSE %] > Never expires > [% END %] >+ </td> > [% ELSE %] >- <td class="expirationdate" data-order="0000-00-00"> >- - >+ <td class="expirationdate" data-order="0000-00-00"> - </td> > [% END %] > [% END %] >- </td> > [% UNLESS( singleBranchMode) %] > <td class="branch"> > [% HOLD.branch.branchname | html %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >index 8d1f0aa80f7..53e1e17be4a 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >@@ -291,19 +291,19 @@ > [% END %] > > [% IF Koha.Preference('ReserveExpiration') %] >- <li> >- <label for="to[% bibitemloo.biblionumber | html %]">Hold not needed after:</label> >- <input >- type="text" >- name="expiration_date_[% bibitemloo.biblionumber | html %]" >- id="to[% bibitemloo.biblionumber | html %]" >- size="10" >- data-flatpickr-future="true" >- class="flatpickr futuredate" >- /> >- <span class="date-format to" data-biblionumber="[% bibitemloo.biblionumber | html %]">[% INCLUDE 'date-format.inc' %]</span> >- <div class="required_label" style="display:none;">Required</div> >- </li> >+ <li> >+ <label for="to[% bibitemloo.biblionumber | html %]">Hold not needed after:</label> >+ <input >+ type="text" >+ name="expiration_date_[% bibitemloo.biblionumber | html %]" >+ id="to[% bibitemloo.biblionumber | html %]" >+ size="10" >+ data-flatpickr-future="true" >+ class="flatpickr futuredate" >+ /> >+ <span class="date-format to" data-biblionumber="[% bibitemloo.biblionumber | html %]">[% INCLUDE 'date-format.inc' %]</span> >+ <div class="required_label" style="display:none;">Required</div> >+ </li> > [% END %] > > [% IF Koha.Preference('AllowHoldItemTypeSelection') %] >diff --git a/misc/cronjobs/holds/cancel_expired_holds.pl b/misc/cronjobs/holds/cancel_expired_holds.pl >index 744c817fd55..1d925b346ab 100755 >--- a/misc/cronjobs/holds/cancel_expired_holds.pl >+++ b/misc/cronjobs/holds/cancel_expired_holds.pl >@@ -74,7 +74,7 @@ GetOptions( > ) or pod2usage(1); > pod2usage(1) if $help; > >-if( C4::Context->preference('ReserveExpiration') ) { >+if ( C4::Context->preference('ReserveExpiration') ) { > C4::Reserves::CancelExpiredReserves($reason); > } > >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index 2e052e0f995..a6c3d3050f5 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -1456,8 +1456,6 @@ subtest 'ReserveExpiration syspref tests' => sub { > } > } > ); >- >- $hold->set_waiting(); > $hold->revert_found(); > > is( >-- >2.39.5
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 24194
:
96120
|
96121
|
98048
|
98368
|
100927
|
110082
|
110127
|
111443
|
113284
|
113285
|
116626
|
116627
|
117016
|
117085
|
117089
|
117097
|
117098
|
117099
|
117100
|
117101
|
118258
|
118259
|
118260
|
118261
|
118262
|
118263
|
128301
|
128302
|
128303
|
128304
|
128305
|
128306
|
128307
|
128308
|
140646
|
140647
|
144076
|
147527
|
147528
|
150799
|
150800
|
159060
|
159061
|
167796
|
167797
|
169174
|
174650
|
174651
|
174652
|
187027
|
187028
| 187029