From e5001c5a37f4df02cad9f0490376fc2179aa966b Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Mon, 13 Apr 2020 18:22:04 +0000 Subject: [PATCH] Bug 24819: (follow-up) Rename suggestor to suggester I believe I suggested a typo - trying to fix it here. Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- .../prog/en/modules/suggestion/suggestion.tt | 2 +- .../modules/suggestion/tables/suggester_search.tt | 36 ++++++++++++ .../modules/suggestion/tables/suggestor_search.tt | 36 ------------ koha-tmpl/intranet-tmpl/prog/js/suggestions.js | 4 +- suggestion/suggester_search.pl | 57 ++++++++++++++++++++ suggestion/suggestor_search.pl | 57 -------------------- 6 files changed, 96 insertions(+), 96 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/tables/suggester_search.tt delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/tables/suggestor_search.tt create mode 100755 suggestion/suggester_search.pl delete mode 100755 suggestion/suggestor_search.pl diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt index 2794a0a..800d7dd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt @@ -378,7 +378,7 @@ [% INCLUDE 'date-format.inc' %] [% IF ( suggestedby_patron.borrowernumber ) %][% suggestedby_patron.surname | html %], [% suggestedby_patron.firstname | html %] ([% suggestedby_patron.cardnumber | html %]) [% Branches.GetName( suggestedby_patron.branchcode ) | html %] ([% suggestedby_patron.category.description | html %])[% END %] - Set to patron + Set to patron diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/tables/suggester_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/tables/suggester_search.tt new file mode 100644 index 0000000..a82f0e8 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/tables/suggester_search.tt @@ -0,0 +1,36 @@ +[% USE raw %] +[% USE To %] +[% USE Branches %] +[% USE KohaDates %] +{ + "sEcho": [% sEcho | html %], + "iTotalRecords": [% iTotalRecords | html %], + "iTotalDisplayRecords": [% iTotalDisplayRecords | html %], + "aaData": [ + [% FOREACH data IN aaData %] + { + "dt_cardnumber": + "[% data.cardnumber | html %]", + "dt_name": + "[% INCLUDE 'patron-title.inc' borrowernumber = data.borrowernumber category_type = data.category_type firstname = data.firstname surname = data.surname othernames = data.othernames cardnumber = data.cardnumber invert_name = 1%]", + "dt_dateofbirth": + "[% data.dateofbirth | $KohaDates %]", + "dt_address": + "[% INCLUDE escape_address data=data %]", + "dt_action": + "Select" + }[% UNLESS loop.last %],[% END %] + [% END %] + ] +} +[% BLOCK escape_address %] +[%~ SET address = data.streetnumber _ ' ' %] +[%~ IF data.address %][% SET address = address _ data.address _ ' ' %][% END %] +[%~ IF data.address2 %][% SET address = address _ data.address2 _ ' ' %][% END %] +[%~ IF data.city %][% SET address = address _ data.city _ ' ' %][% END %] +[%~ IF data.state %][% SET address = address _ data.state _ ' ' %][% END %] +[%~ IF data.zipcode %][% SET address = address _ data.zipcode _ ' ' %][% END %] +[%~ IF data.country %][% SET address = address _ data.country _ ' ' %][% END %] +[%~ SET address = address _ Branches.GetName( data.branchcode ) %] +[%~ To.json( address ) | $raw ~%] +[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/tables/suggestor_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/tables/suggestor_search.tt deleted file mode 100644 index a82f0e8..0000000 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/tables/suggestor_search.tt +++ /dev/null @@ -1,36 +0,0 @@ -[% USE raw %] -[% USE To %] -[% USE Branches %] -[% USE KohaDates %] -{ - "sEcho": [% sEcho | html %], - "iTotalRecords": [% iTotalRecords | html %], - "iTotalDisplayRecords": [% iTotalDisplayRecords | html %], - "aaData": [ - [% FOREACH data IN aaData %] - { - "dt_cardnumber": - "[% data.cardnumber | html %]", - "dt_name": - "[% INCLUDE 'patron-title.inc' borrowernumber = data.borrowernumber category_type = data.category_type firstname = data.firstname surname = data.surname othernames = data.othernames cardnumber = data.cardnumber invert_name = 1%]", - "dt_dateofbirth": - "[% data.dateofbirth | $KohaDates %]", - "dt_address": - "[% INCLUDE escape_address data=data %]", - "dt_action": - "Select" - }[% UNLESS loop.last %],[% END %] - [% END %] - ] -} -[% BLOCK escape_address %] -[%~ SET address = data.streetnumber _ ' ' %] -[%~ IF data.address %][% SET address = address _ data.address _ ' ' %][% END %] -[%~ IF data.address2 %][% SET address = address _ data.address2 _ ' ' %][% END %] -[%~ IF data.city %][% SET address = address _ data.city _ ' ' %][% END %] -[%~ IF data.state %][% SET address = address _ data.state _ ' ' %][% END %] -[%~ IF data.zipcode %][% SET address = address _ data.zipcode _ ' ' %][% END %] -[%~ IF data.country %][% SET address = address _ data.country _ ' ' %][% END %] -[%~ SET address = address _ Branches.GetName( data.branchcode ) %] -[%~ To.json( address ) | $raw ~%] -[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/suggestions.js b/koha-tmpl/intranet-tmpl/prog/js/suggestions.js index d884b6a..cff05bd 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/suggestions.js +++ b/koha-tmpl/intranet-tmpl/prog/js/suggestions.js @@ -9,9 +9,9 @@ function select_user(borrowernumber, borrower) { } $(document).ready(function(){ - $('body').on('click', '#suggestor_search', function(e) { + $('body').on('click', '#suggester_search', function(e) { e.preventDefault(); - var newin = window.open('suggestor_search.pl','popup','width=600,height=400,resizable=no,toolbar=false,scrollbars=yes,top'); + var newin = window.open('suggester_search.pl','popup','width=600,height=400,resizable=no,toolbar=false,scrollbars=yes,top'); }); }); diff --git a/suggestion/suggester_search.pl b/suggestion/suggester_search.pl new file mode 100755 index 0000000..bdbb281 --- /dev/null +++ b/suggestion/suggester_search.pl @@ -0,0 +1,57 @@ +#!/usr/bin/perl + +# This file is part of Koha. +# +# Copyright 2020 BibLibre +# +# 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::Auth; +use C4::Output; +use C4::Members; + +use Koha::Patron::Categories; + +my $input = new CGI; + +my $dbh = C4::Context->dbh; + +my ( $template, $loggedinuser, $cookie, $staff_flags ) = get_template_and_user( + { template_name => "common/patron_search.tt", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => { suggestions => 'suggestions_manage' }, + } +); + +my $q = $input->param('q') || ''; +my $op = $input->param('op') || ''; + +my $referer = $input->referer(); + +my $patron_categories = Koha::Patron::Categories->search_limited; +$template->param( + view => ( $input->request_method() eq "GET" ) ? "show_form" : "show_results", + columns => ['cardnumber', 'name', 'dateofbirth', 'address', 'action' ], + json_template => 'suggestion/tables/suggester_search.tt', + selection_type => 'select', + alphabet => ( C4::Context->preference('alphabet') || join ' ', 'A' .. 'Z' ), + categories => $patron_categories, + aaSorting => 1, +); +output_html_with_http_headers( $input, $cookie, $template->output ); diff --git a/suggestion/suggestor_search.pl b/suggestion/suggestor_search.pl deleted file mode 100755 index 05a831f..0000000 --- a/suggestion/suggestor_search.pl +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/perl - -# This file is part of Koha. -# -# Copyright 2020 BibLibre -# -# 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::Auth; -use C4::Output; -use C4::Members; - -use Koha::Patron::Categories; - -my $input = new CGI; - -my $dbh = C4::Context->dbh; - -my ( $template, $loggedinuser, $cookie, $staff_flags ) = get_template_and_user( - { template_name => "common/patron_search.tt", - query => $input, - type => "intranet", - authnotrequired => 0, - flagsrequired => { suggestions => 'suggestions_manage' }, - } -); - -my $q = $input->param('q') || ''; -my $op = $input->param('op') || ''; - -my $referer = $input->referer(); - -my $patron_categories = Koha::Patron::Categories->search_limited; -$template->param( - view => ( $input->request_method() eq "GET" ) ? "show_form" : "show_results", - columns => ['cardnumber', 'name', 'dateofbirth', 'address', 'action' ], - json_template => 'suggestion/tables/suggestor_search.tt', - selection_type => 'select', - alphabet => ( C4::Context->preference('alphabet') || join ' ', 'A' .. 'Z' ), - categories => $patron_categories, - aaSorting => 1, -); -output_html_with_http_headers( $input, $cookie, $template->output ); -- 1.7.2.5