Bugzilla – Attachment 100443 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.51 KB, created by
Jonathan Druart
on 2020-03-10 11:01:52 UTC
(
hide
)
Description:
Bug 22844: Add the new entry to the patron attr types form
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-03-10 11:01:52 UTC
Size:
6.51 KB
patch
obsolete
>From da9888369518030c3e60dcbe635a83160806c575 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/ > >Signed-off-by: David Nind <david@davidnind.com> >--- > C4/Members/AttributeTypes.pm | 23 ++++++++++++++++++- > admin/patron-attr-types.pl | 8 +++++++ > .../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 948acbe3a9..7f02ca5bf0 100644 >--- a/C4/Members/AttributeTypes.pm >+++ b/C4/Members/AttributeTypes.pm >@@ -38,6 +38,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(); >@@ -108,6 +109,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'} = ''; >@@ -150,6 +152,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'}; >@@ -191,6 +194,7 @@ sub store { > opac_display = ?, > opac_editable = ?, > staff_searchable = ?, >+ mandatory = ?, > authorised_value_category = ?, > display_checkout = ?, > category_code = ?, >@@ -204,13 +208,14 @@ sub store { > opac_display, > opac_editable, > staff_searchable, >+ mandatory, > authorised_value_category, > display_checkout, > category_code, > class, > code > ) >- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); >+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); > } > > $sth->execute( >@@ -220,6 +225,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, >@@ -363,6 +369,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.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 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