Bugzilla – Attachment 132734 Details for
Bug 30063
Make the main patron search use the /patrons REST API route
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30063: Remove svc/members/search
Bug-30063-Remove-svcmemberssearch.patch (text/plain), 9.84 KB, created by
Jonathan Druart
on 2022-03-31 12:46:39 UTC
(
hide
)
Description:
Bug 30063: Remove svc/members/search
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-03-31 12:46:39 UTC
Size:
9.84 KB
patch
obsolete
>From abc950c79df4b5a97c3284e22356e48f665e612c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 14 Feb 2022 11:16:26 +0100 >Subject: [PATCH] Bug 30063: Remove svc/members/search >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Signed-off-by: Séverine Queune <severine.queune@bulac.fr> >--- > .../modules/members/tables/members_results.tt | 44 ------ > svc/members/search | 149 ------------------ > 2 files changed, 193 deletions(-) > delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt > delete mode 100755 svc/members/search > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt >deleted file mode 100644 >index d339638c4ad..00000000000 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt >+++ /dev/null >@@ -1,44 +0,0 @@ >-[% USE raw %] >-[% USE I18N %] >-[% USE To %] >-[% USE AuthorisedValues %] >-[% USE KohaDates %] >-[% USE Price %] >-[% PROCESS 'member-display-address-style.inc' %] >-{ >- "sEcho": [% sEcho | html %], >- "iTotalRecords": [% iTotalRecords | html %], >- "iTotalDisplayRecords": [% iTotalDisplayRecords | html %], >- "aaData": [ >- [% FOREACH data IN aaData %] >- { >- [% IF CAN_user_borrowers_edit_borrowers || CAN_user_tools_manage_patron_lists %] >- "dt_borrowernumber": >- "<label for='check[% data.borrowernumber | html %]' class='content_hidden'>Select patron</label><input type='checkbox' id='check[% data.borrowernumber | html %]' class='selection' name='borrowernumber' value='[% data.borrowernumber | html %]' />", >- [% END %] >- "dt_cardnumber": >- "[% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]<a href='/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% data.borrowernumber | html %]' title=\"[% I18N.t("Check out") | html %]\">[% data.cardnumber | html | $To %]</a>[% ELSE %][% data.cardnumber | html | $To %][% END %]", >- "dt_name": >- "<a href=\"/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.borrowernumber | html %]\" class=\"patron_preview\" data-borrowernumber=\"[% data.borrowernumber | html %]\" style='white-space:nowrap' title=\"[% I18N.t("View") | html %]\">[% INCLUDE 'patron-title.inc' borrowernumber = data.borrowernumber category_type = data.category_type firstname = data.firstname surname = data.surname othernames = data.othernames invert_name = 1 | $To %]</a><br /><div class='address'><ul>[%~ INCLUDE 'display-address-style' patron=data no_line_break=1 | $To ~%][% IF data.email %]<li>Email: <a href='mailto:[% data.email | html | $To %]'>[% data.email | html | $To %]</a></li>[% END %]</ul></div>", >- "dt_dateofbirth": >- "[% INCLUDE 'patron-age.inc' patron = data %]", >- "dt_category": >- "[% data.category_description | html | $To %] <span class=\"patron_category_type\">([% data.category_type | html | $To %])</span>", >- "dt_branch": >- "[% data.branchname | html | $To %]", >- "dt_dateexpiry": >- "[% data.dateexpiry | html | $To %]", >- "dt_od_checkouts": >- "[% IF data.overdues %]<span class='overdue'><strong>[% data.overdues | html %]</strong></span>[% ELSE %][% data.overdues | html %][% END %] / [% data.issues | html %]", >- "dt_fines": >- "<span style='text-align: right; display: block;'><a href=\"/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% data.borrowernumber | html %]\">[% IF data.fines < 0 %]<span class='credit'>[% data.fines | $Price %]</span>[% ELSIF data.fines > 0 %]<span class='debit'><strong>[% data.fines | $Price %]</strong></span>[% ELSE %][% data.fines | $Price %][% END %]</a></span>", >- "dt_borrowernotes": >- "[% data.borrowernotes | html_line_break | collapse | $To %]", >- "dt_action": >- "<a href='/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=[% data.borrowernumber | html %]' class='btn btn-default btn-xs'><i class='fa fa-pencil'></i> Edit</a>[% IF ( CAN_user_circulate_circulate_remaining_permissions ) %] <a class='btn btn-default btn-xs' href='/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% data.borrowernumber | html %]'><i class='fa fa-barcode'></i> Check out</a>[% END %]", >- "borrowernumber": >- "[% data.borrowernumber | html %]" >- }[% UNLESS loop.last %],[% END %] >- [% END %] >- ] >-} >diff --git a/svc/members/search b/svc/members/search >deleted file mode 100755 >index 7cad0e8ab03..00000000000 >--- a/svc/members/search >+++ /dev/null >@@ -1,149 +0,0 @@ >-#!/usr/bin/perl >- >-# Copyright 2013 BibLibre >-# >-# 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 <http://www.gnu.org/licenses>. >- >-use Modern::Perl; >-use CGI; >- >-use C4::Auth qw( get_template_and_user haspermission get_user_subpermissions ); >-use C4::Output qw( output_with_http_headers ); >-use C4::Utils::DataTables qw( dt_get_params ); >-use C4::Utils::DataTables::Members qw( search ); >-use Koha::DateUtils qw( output_pref dt_from_string ); >-use Koha::Patrons; >- >-my $input = CGI->new; >- >-exit unless $input->param('template_path'); >- >-my ($template, $user, $cookie) = get_template_and_user({ >- template_name => scalar $input->param('template_path'), >- query => $input, >- type => "intranet", >- flagsrequired => { borrowers => 'edit_borrowers' } >-}); >- >-my $searchmember = $input->param('searchmember'); >-my $firstletter = $input->param('firstletter'); >-my $categorycode = $input->param('categorycode'); >-my $branchcode = $input->param('branchcode'); >-my $searchtype = $input->param('searchtype'); >-my $searchfieldstype = $input->param('searchfieldstype') || 'standard'; >-my $has_permission = $input->param('has_permission'); >-my $selection_type = $input->param('selection_type'); >- >-# variable information for DataTables (id) >-my $sEcho = $input->param('sEcho'); >- >-my %dt_params = dt_get_params($input); >-foreach (grep {$_ =~ /^mDataProp/} keys %dt_params) { >- $dt_params{$_} =~ s/^dt_//; >-} >- >-my $results; >-# If the user filled a term, maybe it's a cardnumber. >-# This cannot be the case if a first letter is given. >-if ( $searchmember >- and not $firstletter >- and $searchfieldstype >- and $searchfieldstype eq 'standard' ) >-{ >- my $member = Koha::Patrons->find( { cardnumber => $searchmember } ); >- $results = { >- iTotalRecords => 1, >- iTotalDisplayRecords => 1, >- patrons => [ $member->unblessed ], >- } if $member; >-} >- >-if ($has_permission) { >- my ( $permission, $subpermission ) = split /\./, $has_permission; >- $has_permission = {permission => $permission, subpermission => $subpermission}; >-} >- >-# Perform the patrons search >-$results = C4::Utils::DataTables::Members::search( >- { >- searchmember => $searchmember, >- firstletter => $firstletter, >- categorycode => $categorycode, >- branchcode => $branchcode, >- searchtype => $searchtype, >- searchfieldstype => $searchfieldstype, >- dt_params => \%dt_params, >- ( $has_permission ? ( has_permission => $has_permission ) : () ), >- } >-) unless $results; >- >-$template->param( >- sEcho => $sEcho, >- iTotalRecords => $results->{iTotalRecords}, >- iTotalDisplayRecords => $results->{iTotalDisplayRecords}, >- aaData => $results->{patrons}, >- selection_type => $selection_type, >-); >- >-output_with_http_headers $input, $cookie, $template->output, 'json'; >- >-__END__ >- >-=head1 NAME >- >-search - a search script for finding patrons >- >-=head1 SYNOPSIS >- >-This script provides a service for template for patron search using DataTables >- >-=head2 Performing a search >- >-Call this script from a DataTables table my $searchmember = $input->param('searchmember'); >-All following params are optional: >- searchmember => the search terms >- firstletter => search patrons with surname begins with this pattern (currently only used for 1 letter) >- categorycode and branchcode => search patrons belong to a given categorycode or a branchcode >- searchtype: can be 'contain' or 'start_with' >- searchfieldstype: Can be 'standard', 'email', 'borrowernumber', 'userid', 'phone' or 'address' >- >-=cut >- >-=back >- >-=head1 LICENSE >- >-Copyright 2013 BibLibre >- >-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 2 of the License, or (at your option) any later >-version. >- >-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>. >-- >2.25.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 30063
:
130608
|
130609
|
130610
|
130611
|
130612
|
130613
|
130614
|
130615
|
132387
|
132552
|
132731
|
132732
|
132733
|
132734
|
132735
|
132736
|
132737
|
132738
|
132739
|
132740
|
132741
|
132742
|
132743
|
132744
|
132745
|
132746
|
132747
|
132748
|
132749
|
132759
|
132760
|
132761
|
132762
|
132763
|
132764
|
132765
|
132766
|
132767
|
132768
|
132769
|
132770
|
132771
|
132772
|
132773
|
132774
|
132775
|
132776
|
132777
|
132958