Bugzilla – Attachment 167645 Details for
Bug 35635
Expand patron attribute type mandatory field to allow different settings for OPAC and staff interface
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35635: Split mandatory field into mandatory and opac_mandatory
Bug-35635-Split-mandatory-field-into-mandatory-and.patch (text/plain), 6.96 KB, created by
Brendan Lawlor
on 2024-06-11 19:45:14 UTC
(
hide
)
Description:
Bug 35635: Split mandatory field into mandatory and opac_mandatory
Filename:
MIME Type:
Creator:
Brendan Lawlor
Created:
2024-06-11 19:45:14 UTC
Size:
6.96 KB
patch
obsolete
>From e6da92edec4ae55397ceff1e4aae4576f7306d83 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Wed, 5 Jun 2024 22:14:00 +0000 >Subject: [PATCH] Bug 35635: Split mandatory field into mandatory and > opac_mandatory > >Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> >--- > admin/patron-attr-types.pl | 2 ++ > .../prog/en/modules/admin/patron-attr-types.tt | 12 ++++++++++-- > .../bootstrap/en/modules/opac-memberentry.tt | 8 ++++---- > 3 files changed, 16 insertions(+), 6 deletions(-) > >diff --git a/admin/patron-attr-types.pl b/admin/patron-attr-types.pl >index d591383e48..9197ce12f7 100755 >--- a/admin/patron-attr-types.pl >+++ b/admin/patron-attr-types.pl >@@ -121,6 +121,7 @@ sub add_update_attribute_type { > my $searched_by_default = $input->param('searched_by_default') ? 1 : 0; > my $keep_for_pseudonymization = $input->param('keep_for_pseudonymization') ? 1 : 0; > my $mandatory = $input->param('mandatory') ? 1 : 0; >+ my $opac_mandatory = $input->param('opac_mandatory') ? 1 : 0; > my $authorised_value_category = $input->param('authorised_value_category'); > my $display_checkout = $input->param('display_checkout') ? 1 : 0; > my $category_code = $input->param('category_code') || undef; >@@ -158,6 +159,7 @@ sub add_update_attribute_type { > searched_by_default => $searched_by_default, > keep_for_pseudonymization => $keep_for_pseudonymization, > mandatory => $mandatory, >+ opac_mandatory => $opac_mandatory, > authorised_value_category => $authorised_value_category, > display_checkout => $display_checkout, > category_code => $category_code, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt >index 6c87a2fe0c..d53210cea3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt >@@ -194,13 +194,21 @@ > field to be marked as searchable above > </span> > </li> >- <li><label for="mandatory">Mandatory: </label> >+ <li><label for="mandatory">Staff interface mandatory: </label> > [% IF attribute_type AND attribute_type.mandatory %] > <input type="checkbox" id="mandatory" name="mandatory" checked="checked" /> > [% ELSE %] > <input type="checkbox" id="mandatory" name="mandatory" /> > [% END %] >- <span class="hint">Check to make this attribute mandatory when creating or editing a patron.</span> >+ <span class="hint">Check to make this attribute mandatory when creating or editing a patron from the staff interface.</span> >+ </li> >+ <li><label for="opac_mandatory">OPAC mandatory: </label> >+ [% IF attribute_type AND attribute_type.opac_mandatory %] >+ <input type="checkbox" id="opac_mandatory" name="opac_mandatory" checked="checked" /> >+ [% ELSE %] >+ <input type="checkbox" id="opac_mandatory" name="opac_mandatory" /> >+ [% END %] >+ <span class="hint">Check to make this attribute mandatory when creating or editing a patron from the OPAC.</span> > </li> > <li><label for="display_checkout">Display in patron's brief information: </label> > [% IF attribute_type AND attribute_type.display_checkout %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >index f96165ddde..e428f18c53 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >@@ -983,7 +983,7 @@ > [% IF loop.first %]<a id="patron-attr-start-[% pa.type.code | html %]"></a>[% END %] > [% form_id = 'patron-attr-' _ Math.int( Math.rand(1000000) ) %] > <li data-category_code="[% pa.type.category_code | html %]"> >- [% IF pa.type.mandatory && pa.type.opac_editable %] >+ [% IF pa.type.opac_mandatory && pa.type.opac_editable %] > <label for="[% form_id | html %]" class="required">[% pa.type.description | html %]: </label> > [% ELSE %] > <label for="[% form_id | html %]">[% pa.type.description | html %]: </label> >@@ -1006,9 +1006,9 @@ > [% END %] > </select> > [% ELSE %] >- [% IF ( pa.type.is_date && pa.type.mandatory ) %] >+ [% IF ( pa.type.is_date && pa.type.opac_mandatory ) %] > <input type="text" id="[% form_id | html %]" name="patron_attribute_value" value="[% pa_value | html %]" size="10" required="required" class="flatpickr" /> >- [% ELSIF ( pa.type.is_date && !pa.type.mandatory ) %] >+ [% ELSIF ( pa.type.is_date && !pa.type.opac_mandatory ) %] > <input type="text" id="[% form_id | html %]" name="patron_attribute_value" value="[% pa_value | html %]" size="10" class="flatpickr" /> > [% ELSE %] > <textarea rows="2" cols="30" id="[% form_id | html %]" name="patron_attribute_value">[% pa_value | html %]</textarea> >@@ -1021,7 +1021,7 @@ > [% IF ( pa.type.repeatable ) %] > <a href="#" class="btn btn-sm btn-link clone-attribute"><i class="fa fa-plus" aria-hidden="true"></i> New</a> > [% END %] >- [% IF pa.type.mandatory %] >+ [% IF pa.type.opac_mandatory %] > <span class="required_label required">Required</span> > [% END %] > </div> >-- >2.39.2
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 35635
:
167500
|
167501
|
167502
|
167546
|
167548
|
167643
|
167644
|
167645
|
167646
|
174962
|
175059
|
175635
|
175858
|
176595
|
176596
|
176597
|
176598
|
176599
|
176600
|
176601
|
176602
|
176603
|
176604
|
177803
|
177804
|
177805
|
177806
|
177807
|
177808
|
177809
|
177810
|
177811
|
177812
|
177814
|
177815
|
177816
|
177817
|
177818
|
177819
|
177820
|
177821
|
177822
|
177823
|
179165