Bugzilla – Attachment 148402 Details for
Bug 32610
Add ability to specify patron attribute as a date
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32610: Add date option to extended patron attributes administration page
Bug-32610-Add-date-option-to-extended-patron-attri.patch (text/plain), 5.21 KB, created by
Katrin Fischer
on 2023-03-18 11:00:24 UTC
(
hide
)
Description:
Bug 32610: Add date option to extended patron attributes administration page
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2023-03-18 11:00:24 UTC
Size:
5.21 KB
patch
obsolete
>From 0ae8b744cd30700b0eaf1020a970a5b46a2fa7f1 Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <katrin.fischer.83@web.de> >Date: Sat, 18 Mar 2023 10:05:32 +0000 >Subject: [PATCH] Bug 32610: Add date option to extended patron attributes > administration page > >With this page it will be possible to configure patron attributes >to be a date. > >To test: >* Go to administration > patron attribute types >* Add a new patron attribute of type date > * Dates cannot be repeatable or linked to an AV category, so: > * Verify, if you check repeatable, date is disabled > * Verify, if you select an AV category, date disabled > * Verify, if you check date, AV category and repeatable are disabled >* Save the new patron attribute >* Edit the patron attribute > * Verify all settings have been kept/stored correctly >--- > admin/patron-attr-types.pl | 2 ++ > .../en/modules/admin/patron-attr-types.tt | 36 ++++++++++++++++++- > 2 files changed, 37 insertions(+), 1 deletion(-) > >diff --git a/admin/patron-attr-types.pl b/admin/patron-attr-types.pl >index e89b892776..aa53cb8c48 100755 >--- a/admin/patron-attr-types.pl >+++ b/admin/patron-attr-types.pl >@@ -114,6 +114,7 @@ sub add_update_attribute_type { > my $description = $input->param('description'); > my $repeatable = $input->param('repeatable') ? 1 : 0; > my $unique_id = $input->param('unique_id') ? 1 : 0; >+ my $is_date = $input->param('is_date') ? 1 : 0; > my $opac_display = $input->param('opac_display') ? 1 : 0; > my $opac_editable = $input->param('opac_editable') ? 1 : 0; > my $staff_searchable = $input->param('staff_searchable') ? 1 : 0; >@@ -149,6 +150,7 @@ sub add_update_attribute_type { > { > repeatable => $repeatable, > unique_id => $unique_id, >+ is_date => $is_date, > opac_display => $opac_display, > opac_editable => $opac_editable, > staff_searchable => $staff_searchable, >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 3c26281a29..39181502ca 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 >@@ -154,6 +154,16 @@ Patron attribute types › Administration › Koha > cannot be given to a different record.</span> > </li> > >+ <li> >+ <label for="is_date">Is a date: </label> >+ [% IF attribute_type.is_date %] >+ <input type="checkbox" id="is_date" name="is_date" checked="checked" /> >+ [% ELSE %] >+ <input type="checkbox" id="is_date" name="is_date" /> >+ [% END %] >+ <span class="hint">If checked, attribute will be a date. Date attributes cannot be repeatable or linked to an authorised value category.</span> >+ </li> >+ > <li><label for="opac_display">Display in OPAC: </label> > [% IF attribute_type AND attribute_type.opac_display %] > <input type="checkbox" id="opac_display" name="opac_display" checked="checked" /> >@@ -176,7 +186,7 @@ Patron attribute types › Administration › Koha > [% ELSE %] > <input type="checkbox" id="staff_searchable" name="staff_searchable" /> > [% END %] >- <span class="hint">Check to make this attribute staff_searchable in the staff patron search.</span> >+ <span class="hint">Check to make this attribute searchable in the staff patron search.</span> > </li> > <li><label for="mandatory">Mandatory: </label> > [% IF attribute_type AND attribute_type.mandatory %] >@@ -391,6 +401,30 @@ Patron attribute types › Administration › Koha > } > } ).change(); > >+ $("#is_date").change( function() { >+ if ( this.checked ) { >+ $("#repeatable, #authorised_value_category").attr('disabled', true).parent().attr('aria-disabled', 'true'); >+ } else { >+ $("#repeatable, #authorised_value_category").removeAttr('disabled').parent().removeAttr('aria-disabled'); >+ } >+ } ).change(); >+ >+ $("#repeatable").change( function() { >+ if ( this.checked ) { >+ $("#is_date").attr('disabled', true).parent().attr('aria-disabled', 'true'); >+ } else { >+ $("#is_date").removeAttr('disabled').parent().removeAttr('aria-disabled'); >+ } >+ } ).change(); >+ >+ $("#authorised_value_category").change( function() { >+ if ( $(this).val() != "" ) { >+ $("#is_date").attr('disabled', true).parent().attr('aria-disabled', 'true'); >+ } else { >+ $("#is_date").removeAttr('disabled').parent().removeAttr('aria-disabled'); >+ } >+ } ).change(); >+ > $(".patron_attributes_types").each(function(){ > var tableid = $(this).attr("id"); > KohaTable( tableid, { >-- >2.30.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 32610
:
148400
|
148401
|
148402
|
148403
|
148404
|
148405
|
148825
|
148826
|
148827
|
148828
|
148829
|
148830
|
157862
|
157863
|
157864
|
157865
|
157866
|
157867
|
157868
|
158994
|
158995
|
158996
|
158997
|
158998
|
158999
|
159000
|
165747
|
165750
|
165854
|
165855
|
165856
|
165857
|
165858
|
165859
|
165860
|
165861
|
165862
|
165863
|
165864
|
165865
|
165925
|
165926