Bugzilla – Attachment 132666 Details for
Bug 30055
Rewrite some of the patron searches to make them use the REST API routes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30055: Use /patrons for patron's cards
Bug-30055-Use-patrons-for-patrons-cards.patch (text/plain), 6.36 KB, created by
Martin Renvoize (ashimema)
on 2022-03-31 08:39:01 UTC
(
hide
)
Description:
Bug 30055: Use /patrons for patron's cards
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-03-31 08:39:01 UTC
Size:
6.36 KB
patch
obsolete
>From 53978fc39a173c026540debb98aa224fabc6d58f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 9 Feb 2022 12:03:47 +0100 >Subject: [PATCH] Bug 30055: Use /patrons for patron's cards >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Test plan: >Create a new card batch and add new borrowernumber using the "Add >patron(s)" button. > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Séverine Queune <severine.queune@bulac.fr> >--- > api/v1/swagger/paths/patrons.yaml | 3 +- > .../prog/en/modules/patroncards/edit-batch.tt | 2 +- > .../patroncards/tables/members_results.tt | 26 --------- > patroncards/add_user_search.pl | 56 ------------------- > 4 files changed, 3 insertions(+), 84 deletions(-) > delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/tables/members_results.tt > 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 50a672643f..452b9827db 100644 >--- a/api/v1/swagger/paths/patrons.yaml >+++ b/api/v1/swagger/paths/patrons.yaml >@@ -379,7 +379,8 @@ > $ref: "../swagger.yaml#/definitions/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 23a66e22c8..2589e6dfe5 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/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/tables/members_results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/tables/members_results.tt >deleted file mode 100644 >index 9660e3e56e..0000000000 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/tables/members_results.tt >+++ /dev/null >@@ -1,26 +0,0 @@ >-[% USE To %] >-{ >- "sEcho": [% sEcho | html %], >- "iTotalRecords": [% iTotalRecords | html %], >- "iTotalDisplayRecords": [% iTotalDisplayRecords | html %], >- "aaData": [ >- [% FOREACH data IN aaData %] >- { >- "dt_cardnumber": >- "[% data.cardnumber | html %]", >- "dt_name": >- "<a href=\"#\" class=\"patron_preview\" data-borrowernumber=\"[% data.borrowernumber | html %]\" style='white-space:nowrap'>[% INCLUDE 'patron-title.inc' borrowernumber = data.borrowernumber category_type = data.category_type firstname = To.json(data.firstname) surname = To.json(data.surname) othernames = To.json(data.othernames) cardnumber = data.cardnumber invert_name = 1%]</a>", >- "dt_category": >- "[% data.category_description | html %] <span class=\"patron_category_type\">([% data.category_type | html %])</span>", >- "dt_branch": >- "[% data.branchname | html %]", >- "dt_dateexpiry": >- "[% data.dateexpiry | html %]", >- "dt_borrowernotes": >- "[% data.borrowernotes.replace('\\\\' , '\\\\') |html_line_break |collapse %]", >- "dt_action": >- "<a href=\"#\" data-borrowernumber=\"[% data.borrowernumber | html %]\" data-firstname=\"[% data.firstname | html %]\" data-surname=\"[% data.surname | html %]\" class=\"btn btn-default btn-xs add_user\"><i class=\"fa fa-plus\"></i> Add</a>" >- }[% UNLESS loop.last %],[% END %] >- [% END %] >- ] >-} >diff --git a/patroncards/add_user_search.pl b/patroncards/add_user_search.pl >deleted file mode 100755 >index 04bc0eb5b3..0000000000 >--- 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 <http://www.gnu.org/licenses>. >- >-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.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 30055
:
130364
|
130365
|
130366
|
130367
|
130368
|
130369
|
130370
|
130371
|
130372
|
130385
|
130386
|
130387
|
130388
|
130389
|
130390
|
130391
|
130392
|
130393
|
130394
|
130395
|
130457
|
130487
|
130488
|
130491
|
130507
|
130511
|
130629
|
130630
|
130671
|
130672
|
130701
|
130702
|
130704
|
130716
|
130717
|
131829
|
132168
|
132419
|
132420
|
132421
|
132422
|
132423
|
132424
|
132425
|
132426
|
132427
|
132428
|
132429
|
132430
|
132431
|
132432
|
132433
|
132434
|
132435
|
132436
|
132437
|
132438
|
132439
|
132440
|
132441
|
132450
|
132451
|
132452
|
132453
|
132454
|
132455
|
132456
|
132457
|
132458
|
132459
|
132460
|
132461
|
132462
|
132463
|
132464
|
132465
|
132466
|
132467
|
132468
|
132469
|
132470
|
132471
|
132472
|
132473
|
132539
|
132616
|
132617
|
132618
|
132619
|
132620
|
132621
|
132622
|
132623
|
132624
|
132625
|
132627
|
132628
|
132629
|
132630
|
132631
|
132632
|
132633
|
132634
|
132635
|
132636
|
132637
|
132638
|
132639
|
132640
|
132641
|
132664
|
132665
| 132666 |
132667
|
132668
|
132669
|
132670
|
132671
|
132672
|
132673
|
132674
|
132675
|
132676
|
132677
|
132678
|
132679
|
132680
|
132681
|
132682
|
132683
|
132684
|
132685
|
132686
|
132687
|
132688