Bugzilla – Attachment 89905 Details for
Bug 22844
Simplify the process of selecting database columns for system preferences
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22844: Make the attribute mandatory when editing a patron
Bug-22844-Make-the-attribute-mandatory-when-editin.patch (text/plain), 3.42 KB, created by
Jonathan Druart
on 2019-05-17 14:34:31 UTC
(
hide
)
Description:
Bug 22844: Make the attribute mandatory when editing a patron
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-05-17 14:34:31 UTC
Size:
3.42 KB
patch
obsolete
>From 445d6aa689414a4ba919509b7c18e35ca082d700 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 17 May 2019 09:30:02 -0500 >Subject: [PATCH] Bug 22844: Make the attribute mandatory when editing a patron > >Note: I am not confident with this patch, I think it's not polished. I >will not have time to improve it to make it ready for 19.05.00 >1. Conflict with bug 20443 (which would have make this change way much >easier!) >2. It does not work :) You will be able to submit the memberentry form >even if the patron attribute is marked as mandatory (??) >3. What about the OPAC? >4. What about repeatable fields? We certainly will need JS code here >5. What about the "Quick add" feature? (I had trouble in the past to not >introduce regression when we played with this template...) > >Do not forget to run updatedatabase.pl and regenerate DBIC schema if you >want to play with this patchset. >--- > koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt | 7 ++++++- > members/memberentry.pl | 1 + > 2 files changed, 7 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >index 62fc2db2de..c5b2f3510f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -1050,7 +1050,11 @@ > [% END %] > [% FOREACH patron_attribute IN pa_loo.items %] > <li data-category_code="[% patron_attribute.category_code | html %]"> >- <label for="[% patron_attribute.form_id | html %]">[% patron_attribute.description | html %]: </label> >+ [% IF patron_attribute.mandatory %] >+ <label for="[% patron_attribute.form_id | html %]" class="required" required="required">[% patron_attribute.description | html %]: </label> >+ [% ELSE %] >+ <label for="[% patron_attribute.form_id | html %]">[% patron_attribute.description | html %]: </label> >+ [% END %] > [% IF ( patron_attribute.use_dropdown ) %] > <select id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]"> > <option value=""></option> >@@ -1074,6 +1078,7 @@ > [% IF ( patron_attribute.repeatable ) %] > <a href="#" onclick="clone_entry(this); return false;"><i class="fa fa-fw fa-plus"></i> New</a> > [% END %] >+ [% IF patron_attribute.mandatory %]<span class="required">Required</span>[% END %] > </li> > [% END %] > [% IF pa_loo.class %]</fieldset>[% END %] >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 166302006b..a9fc9735ec 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -874,6 +874,7 @@ sub patron_attributes_form { > repeatable => $attr_type->repeatable(), > category => $attr_type->authorised_value_category(), > category_code => $attr_type->category_code(), >+ mandatory => $attr_type->mandatory(), > }; > if (exists $attr_hash{$attr_type->code()}) { > foreach my $attr (@{ $attr_hash{$attr_type->code()} }) { >-- >2.11.0
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 22844
:
89322
|
89323
|
89389
|
89403
|
89530
|
89531
|
89749
|
89903
|
89904
|
89905
|
90407
|
96007
|
98145
|
98146
|
98147
|
98148
|
98149
|
98150
|
98151
|
98297
|
98298
|
100440
|
100441
|
100442
|
100443
|
100444
|
100445
|
100446
|
100447
|
101198
|
101199
|
101200
|
101201
|
101202
|
101203
|
101204
|
101205
|
101302
|
101480
|
101481
|
101482
|
101483
|
101484
|
101485
|
101486
|
101487
|
101488
|
101617
|
101618
|
101619
|
101620
|
101621
|
101622
|
101623
|
101624
|
103842
|
103843
|
103844
|
103845
|
103846
|
103847
|
103848
|
103849
|
103850
|
103904
|
103960
|
103961
|
103962
|
103963
|
103964
|
103965
|
103966
|
103967
|
103968
|
103969
|
106545
|
106546
|
106547
|
106548
|
106549
|
106550
|
106551
|
106552
|
106553
|
106554
|
107126