Bugzilla – Attachment 131379 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
Lucas Gass (lukeg)
on 2022-03-04 15:12:06 UTC
(
hide
)
Description:
Bug 30108: (follow-up) Add required indication, differentiate alert
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2022-03-04 15:12:06 UTC
Size:
3.26 KB
patch
obsolete
>From ec55498e136f7aca78a849cb2612d5da14cd8d54 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> >--- > .../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 25fcc30964..ce63c327b6 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >@@ -495,7 +495,8 @@ > [% INCLUDE 'calendar.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."); > > // Clear the contents of an input field > $(".clearfield").on("click",function(e){ >@@ -525,8 +526,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); > >@@ -676,13 +683,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.20.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