Bug 35977: Set holddatefrom default to today

This patch sets the holddatefrom date to today by default on the opac.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Martin Renvoize 2024-02-07 15:21:04 +00:00 committed by Katrin Fischer
parent ee960bd45f
commit c341b2d375
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
2 changed files with 7 additions and 6 deletions

View File

@ -288,7 +288,7 @@
[% IF ( reserve_in_future ) %]
<li>
<label for="from[% bibitemloo.biblionumber | html %]">Hold starts on date:</label>
<input type="text" name="reserve_date_[% bibitemloo.biblionumber | html %]" id="from[% bibitemloo.biblionumber | html %]" data-start_for="to[% bibitemloo.biblionumber | html %]" data-flatpickr-futureinclusive="true" size="10" class="flatpickr holddatefrom" />
<input type="text" name="reserve_date_[% bibitemloo.biblionumber | html %]" id="from[% bibitemloo.biblionumber | html %]" data-start_for="to[% bibitemloo.biblionumber | html %]" data-flatpickr-futureinclusive="true" size="10" class="flatpickr holddatefrom" value="[% today | $raw %]" />
<span class="date-format from" data-biblionumber="[% bibitemloo.biblionumber | html %]">[% INCLUDE 'date-format.inc' %]</span>
<div class="required_label" style="display:none;">Required</div>
</li>

View File

@ -35,6 +35,7 @@ use C4::Overdues;
use Koha::AuthorisedValues;
use Koha::Biblios;
use Koha::CirculationRules;
use Koha::DateUtils qw( dt_from_string );
use Koha::Items;
use Koha::ItemTypes;
use Koha::Checkouts;
@ -618,12 +619,12 @@ $template->param(OpacHoldNotes=>$show_notes);
# display infos
$template->param(bibitemloop => $biblioLoop);
# can set reserve date in future
if (
C4::Context->preference( 'AllowHoldDateInFuture' ) &&
C4::Context->preference( 'OPACAllowHoldDateInFuture' )
) {
if ( C4::Context->preference('AllowHoldDateInFuture')
&& C4::Context->preference('OPACAllowHoldDateInFuture') )
{
$template->param(
reserve_in_future => 1,
reserve_in_future => 1,
today => dt_from_string,
);
}