@@ -, +, @@ - Administration -> Authorized values -> New category - Create a new category to test with - Add multiple authorized values under this category - Administration -> Patron attribute types -> New patron attribute type. - Create an attribute which is linked to the authorized value category you created AND which is marked "Searchable." - Go to Circulation -> Overdues. - In the sidebar filter you should see your patron attribute as an option, styled as a Select2 dropdown. - Clicking the dropdown should trigger a list of the authorized values you created above. - Test that the search field at the top of the list works correctly to filter the results. - Test that any repeatable attribute field can be cloned by clicking the "Add" link, and that cloned fields can be removed using the "Delete" links. - Test that cloned fields remain in place after submitting the fitler form, and that any selected entry in a Select2 widget is preselected. --- circ/ypattrodue-attr-search-authvalue.pl | 58 --------- .../prog/en/modules/circ/overdue.tt | 122 +++++++++--------- 2 files changed, 61 insertions(+), 119 deletions(-) delete mode 100755 circ/ypattrodue-attr-search-authvalue.pl --- a/circ/ypattrodue-attr-search-authvalue.pl +++ a/circ/ypattrodue-attr-search-authvalue.pl @@ -1,58 +0,0 @@ -#!/usr/bin/perl - -# This software is placed under the gnu General Public License, v2 (http://www.gnu.org/licenses/gpl.html) - -# Parts copyright 2012 Athens County Public Libraries -# This file is part of Koha. -# -# Koha is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# Koha is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Koha; if not, see . - -use Modern::Perl; -use CGI qw ( -utf8 ); -use C4::Context; -use C4::Auth qw/check_cookie_auth/; -use C4::Debug; - -my $input = CGI->new; -my $query = $input->param('term'); -my $attrcode = $input->path_info || ''; -$attrcode =~ s|^/||; - -my ( $auth_status, $sessionID ) = check_cookie_auth( $input->cookie('CGISESSID'), { circulate => '*' } ); -exit 0 if $auth_status ne "ok"; - -binmode STDOUT, ":encoding(UTF-8)"; -print $input->header( -type => 'text/plain', -charset => 'UTF-8' ); - -print STDERR ">> CALLING $0 (attrcode=$attrcode, query=$query)\n" if $debug; - -my $dbh = C4::Context->dbh; -my $sql = qq(SELECT authorised_value, lib description - FROM borrower_attribute_types b, authorised_values v - WHERE b.code=? - AND b.authorised_value_category = v.category - AND v.lib like ?); -my $sth = $dbh->prepare($sql); -$sth->execute( $attrcode, "$query%" ); - -print "["; -my $i = 0; -while ( my $rec = $sth->fetchrow_hashref ) { - print STDERR ">> attrcode=$attrcode match '$query' ==> $rec->{description} ($rec->{authorised_value})\n" if $debug; - print "{\"description\":\"" . $rec->{description} . "\",\"" . - "authorised_value\":\"" . $rec->{authorised_value} . "\"" . - "}"; - $i++; -} -print "]"; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt @@ -1,5 +1,6 @@ [% USE raw %] [% USE Asset %] +[% USE AuthorisedValues %] [% USE KohaDates %] [%- USE Branches -%] [%- USE Price -%] @@ -10,9 +11,21 @@ [% INCLUDE 'doc-head-open.inc' %] Items overdue as of [% todaysdate | html %] › Circulation › Koha [% INCLUDE 'doc-head-close.inc' %] - +[% FILTER collapse %] + +[% END %] @@ -32,6 +45,7 @@ Overdues as of [% todaysdate | html %] +
@@ -173,23 +187,28 @@
  • [% IF ( patron_attr_filter_loo.authorised_value_category ) %] - - -
    - -
    -
    + [% SET authvals = AuthorisedValues.GetAuthValueDropbox( patron_attr_filter_loo.authorised_value_category ) %] + [% ELSE %] [% END %] [% IF ( patron_attr_filter_loo.repeatable ) %] - Add + Add [% IF ( patron_attr_filter_loo.isclone ) %] - Delete + Delete [% ELSIF ( patron_attr_filter_loo.ismany ) %] - Delete + Delete [% ELSE %] - Delete + [% END %] [% END %]
  • @@ -243,58 +262,25 @@ [% INCLUDE 'calendar.inc' %] [% INCLUDE 'datatables.inc' %] [% INCLUDE 'columns_settings.inc' %] + [% INCLUDE 'select2.inc' %] [% END %] --