Bugzilla – Attachment 89904 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: Add the new entry to the patron attr types form
Bug-22844-Add-the-new-entry-to-the-patron-attr-typ.patch (text/plain), 6.48 KB, created by
Jonathan Druart
on 2019-05-17 14:34:27 UTC
(
hide
)
Description:
Bug 22844: Add the new entry to the patron attr types form
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-05-17 14:34:27 UTC
Size:
6.48 KB
patch
obsolete
>From 4a2cf4f5abe1525b286fd74c0f21b6c3903acd2f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 17 May 2019 09:14:00 -0500 >Subject: [PATCH] Bug 22844: Add the new entry to the patron attr types form > >Will conflict with bug 20443 \o/ >--- > C4/Members/AttributeTypes.pm | 23 +++++++++++++++++++++- > admin/patron-attr-types.pl | 8 ++++++++ > .../prog/en/modules/admin/patron-attr-types.tt | 8 ++++++++ > 3 files changed, 38 insertions(+), 1 deletion(-) > >diff --git a/C4/Members/AttributeTypes.pm b/C4/Members/AttributeTypes.pm >index bfd1494ee8..abb4b2b356 100644 >--- a/C4/Members/AttributeTypes.pm >+++ b/C4/Members/AttributeTypes.pm >@@ -39,6 +39,7 @@ C4::Members::AttributeTypes - mananage extended patron attribute types > $attr_type->opac_display($opac_display); > $attr_type->opac_editable($opac_editable); > $attr_type->staff_searchable($staff_searchable); >+ $attr_type->mandatory($mandatory); > $attr_type->authorised_value_category($authorised_value_category); > $attr_type->store(); > $attr_type->delete(); >@@ -109,6 +110,7 @@ sub new { > $self->{'opac_display'} = 0; > $self->{'opac_editable'} = 0; > $self->{'staff_searchable'} = 0; >+ $self->{'mandatory'} = 0; > $self->{'display_checkout'} = 0; > $self->{'authorised_value_category'} = ''; > $self->{'category_code'} = ''; >@@ -151,6 +153,7 @@ sub fetch { > $self->{'opac_display'} = $row->{'opac_display'}; > $self->{'opac_editable'} = $row->{'opac_editable'}; > $self->{'staff_searchable'} = $row->{'staff_searchable'}; >+ $self->{'mandatory'} = $row->{'mandatory'}; > $self->{'display_checkout'} = $row->{'display_checkout'}; > $self->{'authorised_value_category'} = $row->{'authorised_value_category'}; > $self->{'category_code'} = $row->{'category_code'}; >@@ -192,6 +195,7 @@ sub store { > opac_display = ?, > opac_editable = ?, > staff_searchable = ?, >+ mandatory = ?, > authorised_value_category = ?, > display_checkout = ?, > category_code = ?, >@@ -205,13 +209,14 @@ sub store { > opac_display, > opac_editable, > staff_searchable, >+ mandatory, > authorised_value_category, > display_checkout, > category_code, > class, > code > ) >- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); >+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); > } > > $sth->execute( >@@ -221,6 +226,7 @@ sub store { > $self->{'opac_display'}, > $self->{'opac_editable'}, > $self->{'staff_searchable'} || 0, >+ $self->{'mandatory'} || 0, > $self->{'authorised_value_category'}, > $self->{'display_checkout'}, > $self->{'category_code'} || undef, >@@ -364,6 +370,21 @@ sub staff_searchable { > @_ ? $self->{'staff_searchable'} = ((shift) ? 1 : 0) : $self->{'staff_searchable'}; > } > >+=head2 mandatory >+ >+ my $mandatory = $attr_type->mandatory(); >+ $attr_type->mandatory($mandatory); >+ >+Accessor. The C<$mandatory> argument >+is interpreted as a Perl boolean. >+ >+=cut >+ >+sub mandatory { >+ my $self = shift; >+ @_ ? $self->{'mandatory'} = ((shift) ? 1 : 0) : $self->{'mandatory'}; >+} >+ > =head2 display_checkout > > my $display_checkout = $attr_type->display_checkout(); >diff --git a/admin/patron-attr-types.pl b/admin/patron-attr-types.pl >index 174bac5926..ed9072bd91 100755 >--- a/admin/patron-attr-types.pl >+++ b/admin/patron-attr-types.pl >@@ -125,6 +125,9 @@ sub error_add_attribute_type_form { > if ($input->param('staff_searchable')) { > $template->param(staff_searchable_checked => 1); > } >+ if ($input->param('mandatory')) { >+ $template->param(mandatory_checked => 1); >+ } > if ($input->param('display_checkout')) { > $template->param(display_checkout_checked => 'checked="checked"'); > } >@@ -170,6 +173,8 @@ sub add_update_attribute_type { > $attr_type->opac_editable($opac_editable); > my $staff_searchable = $input->param('staff_searchable'); > $attr_type->staff_searchable($staff_searchable); >+ my $mandatory = $input->param('mandatory'); >+ $attr_type->mandatory($mandatory); > my $authorised_value_category = $input->param('authorised_value_category'); > $attr_type->authorised_value_category($authorised_value_category); > my $display_checkout = $input->param('display_checkout'); >@@ -254,6 +259,9 @@ sub edit_attribute_type_form { > if ($attr_type->staff_searchable()) { > $template->param(staff_searchable_checked => 1); > } >+ if ($attr_type->mandatory()) { >+ $template->param(mandatory_checked => 1); >+ } > if ($attr_type->display_checkout()) { > $template->param(display_checkout_checked => 'checked="checked"'); > } >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 d4cecaafdf..cb3195fa62 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 >@@ -132,6 +132,14 @@ > [% END %] > <span>Check to make this attribute staff_searchable in the staff patron search.</span> > </li> >+ <li><label for="mandatory">Mandatory: </label> >+ [% IF ( mandatory_checked ) %] >+ <input type="checkbox" id="mandatory" name="mandatory" checked="checked" /> >+ [% ELSE %] >+ <input type="checkbox" id="mandatory" name="mandatory" /> >+ [% END %] >+ <span>Check to make this attribute mandatory when creating or editing a patron.</span> >+ </li> > <li><label for="display_checkout">Display in check-out: </label> > [% IF display_checkout_checked %] > <input type="checkbox" id="display_checkout" name="display_checkout" checked="checked" /> >-- >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