From 2d3782666840ecd256b64db871d9043b0b7df9d5 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 9 Feb 2022 12:03:47 +0100 Subject: [PATCH] Bug 30055: Use /patrons for patron's cards Test plan: Create a new card batch and add new borrowernumber using the "Add patron(s)" button. Signed-off-by: Jonathan Druart --- api/v1/swagger/paths/patrons.yaml | 3 +- .../prog/en/modules/patroncards/edit-batch.tt | 2 +- patroncards/add_user_search.pl | 56 ------------------- 3 files changed, 3 insertions(+), 58 deletions(-) delete mode 100755 patroncards/add_user_search.pl diff --git a/api/v1/swagger/paths/patrons.yaml b/api/v1/swagger/paths/patrons.yaml index 76fe6c1bbbe..3fbbea475c2 100644 --- a/api/v1/swagger/paths/patrons.yaml +++ b/api/v1/swagger/paths/patrons.yaml @@ -379,7 +379,8 @@ $ref: ../definitions.yaml#/error x-koha-authorization: permissions: - borrowers: "1" + - borrowers: "1" + - tools: "label_creator" x-koha-embed: - extended_attributes post: diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt index 23a66e22c8d..2589e6dfe5b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt @@ -185,7 +185,7 @@ function Add() { var bor_nums = document.getElementById("bor_num_list"); if (bor_nums.value == '') { - window.open("/cgi-bin/koha/patroncards/add_user_search.pl", + window.open("/cgi-bin/koha/members/search.pl?columns=cardnumber,name,category,branch,dateexpiry,borrowernotes,action&selection_type=add", 'PatronPopup', 'width=840,height=500,location=yes,toolbar=no,' + 'scrollbars=yes,resize=yes'); diff --git a/patroncards/add_user_search.pl b/patroncards/add_user_search.pl deleted file mode 100755 index 04bc0eb5b39..00000000000 --- a/patroncards/add_user_search.pl +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/perl - -# This file is part of Koha. -# -# Copyright 2014 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 qw( get_template_and_user ); -use C4::Output qw( output_html_with_http_headers ); -use C4::Members; - -use Koha::Patron::Categories; - -my $input = CGI->new; - -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", - flagsrequired => { tools => 'label_creator' }, - } -); - -my $q = $input->param('q') || ''; -my $op = $input->param('op') || ''; - -my $referer = $input->referer(); - -my $patron_categories = Koha::Patron::Categories->search_with_library_limits; -$template->param( - view => ( $input->request_method() eq "GET" ) ? "show_form" : "show_results", - columns => ['cardnumber', 'name', 'category', 'branch', 'dateexpiry', 'borrowernotes', 'action'], - json_template => 'patroncards/tables/members_results.tt', - selection_type => 'add', - alphabet => ( C4::Context->preference('alphabet') || join ' ', 'A' .. 'Z' ), - categories => $patron_categories, - aaSorting => 1, -); -output_html_with_http_headers( $input, $cookie, $template->output ); -- 2.25.1