Bugzilla – Attachment 133465 Details for
Bug 30108
Allow making hold dates required
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30108: (follow-up) Add required indication, differentiate alert
Bug-30108-follow-up-Add-required-indication-differ.patch (text/plain), 3.26 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-04-20 12:26:00 UTC
(
hide
)
Description:
Bug 30108: (follow-up) Add required indication, differentiate alert
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-04-20 12:26:00 UTC
Size:
3.26 KB
patch
obsolete
>From eb2b3c90c83d24cf506b14f9c9428636efbc00d1 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 4 Mar 2022 10:47:19 +0000 >Subject: [PATCH] Bug 30108: (follow-up) Add required indication, differentiate > alert > >As asked on comment4: >[1] Add a required div as a visible hint when applicable. >[2] Differentiate alert for hold start and end date. > >Test plan: >See former patch. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > .../bootstrap/en/modules/opac-reserve.tt | 17 ++++++++++++----- > 1 file changed, 12 insertions(+), 5 deletions(-) > >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 7c8b8c77dd0..99e282cffb8 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >@@ -498,7 +498,8 @@ > [% INCLUDE 'datatables.inc' %] > <script> > var MSG_NO_ITEM_SELECTED = _("Expecting a specific item selection."); >- var MSG_EMPTY_DATE = _("Date should be filled."); >+ var MSG_EMPTY_START_DATE = _("Hold start date should be filled."); >+ var MSG_EMPTY_END_DATE = _("Hold expiration date should be filled."); > > $(document).ready(function() { > >@@ -516,8 +517,14 @@ > $(".hold-options").hide(); > var OPACMandatoryHoldDates = "[% Koha.Preference('OPACMandatoryHoldDates') | html %]"; > if( OPACMandatoryHoldDates ) { >- if( OPACMandatoryHoldDates == "start" || OPACMandatoryHoldDates == "both" ) $(".holddatefrom").prop( 'required', true ); >- if( OPACMandatoryHoldDates == "end" || OPACMandatoryHoldDates == "both" ) $(".futuredate").prop( 'required', true ); >+ if( OPACMandatoryHoldDates == "start" || OPACMandatoryHoldDates == "both" ) { >+ $(".holddatefrom").prop( 'required', true ); >+ $(".holddatefrom").parent().append('<div class="required_label required">Required</div>'); >+ } >+ if( OPACMandatoryHoldDates == "end" || OPACMandatoryHoldDates == "both" ) { >+ $(".futuredate").prop( 'required', true ); >+ $(".futuredate").parent().append('<div class="required_label required">Required</div>'); >+ } > } > $(".holddatefrom,.futuredate").prop("readOnly", true); > >@@ -661,13 +668,13 @@ > } > > if( $(".holddatefrom").prop('required') && $("#from"+ biblioNum).val() == '' ) { >- alert(MSG_EMPTY_DATE); >+ alert(MSG_EMPTY_START_DATE); > badBib = biblioNum; > if( $("#from"+biblioNum+":hidden").length ) $("#toggle-hold-options-"+biblioNum).click(); > $("#from"+ biblioNum).focus(); > return false; > } else if( $(".futuredate").prop('required') && $("#to"+ biblioNum).val() == '' ) { >- alert(MSG_EMPTY_DATE); >+ alert(MSG_EMPTY_END_DATE); > badBib = biblioNum; > if( $("#to"+biblioNum+":hidden").length ) $("#toggle-hold-options-"+biblioNum).click(); > $("#to"+ biblioNum).focus(); >-- >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 30108
:
130745
|
130746
|
130747
|
131372
|
131376
|
131377
|
131378
|
131379
|
133462
|
133463
|
133464
| 133465 |
134476