Bugzilla – Attachment 95425 Details for
Bug 23590
Add the ability to change the manager of a suggestion and notify the new manager
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23590: Only return patrons that have the suggestions_manage permission
Bug-23590-Only-return-patrons-that-have-the-sugges.patch (text/plain), 5.16 KB, created by
Séverine Queune
on 2019-11-14 16:15:56 UTC
(
hide
)
Description:
Bug 23590: Only return patrons that have the suggestions_manage permission
Filename:
MIME Type:
Creator:
Séverine Queune
Created:
2019-11-14 16:15:56 UTC
Size:
5.16 KB
patch
obsolete
>From 4b2850830497372f14e8c6b939e2b4c0f2b397fc Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 6 Nov 2019 19:59:21 +0100 >Subject: [PATCH] Bug 23590: Only return patrons that have the > suggestions_manage permission >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> >--- > .../prog/en/modules/common/patron_search.tt | 9 ++++ > .../prog/en/modules/suggestion/suggestion.tt | 2 +- > suggestion/add_user_search.pl | 63 ++++++++++++++++++++++ > 3 files changed, 73 insertions(+), 1 deletion(-) > create mode 100755 suggestion/add_user_search.pl > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt >index 54f9899..19cd0ab 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt >@@ -53,6 +53,10 @@ > <div class="hint">Only staff with superlibrarian or acquisitions permissions (or order_manage permission if granular permissions are enabled) are returned in the search results</div> > [% END %] > >+ [% IF patrons_with_suggestion_perm_only %] >+ <div class="hint">Only staff with superlibrarian or suggestions_manage permissions are returned in the search results</div> >+ [% END %] >+ > <div class="browse"> > Browse by last name: > [% FOREACH letter IN alphabet.split(' ') %] >@@ -167,6 +171,11 @@ > 'name': 'has_permission', > 'value': 'acquisition.order_manage', > } >+ [% ELSIF patrons_with_suggestion_perm_only %] >+ ,{ >+ 'name': 'has_permission', >+ 'value': 'acquisition.suggestions_manage', >+ } > [% END %] > ); > $.ajax({ >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 8bf80a1..c3287b0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >@@ -847,7 +847,7 @@ > > <script type="text/javascript"> > function editManagerPopup() { >- window.open("/cgi-bin/koha/admin/add_user_search.pl?selection_type=select", >+ window.open("/cgi-bin/koha/suggestion/add_user_search.pl?selection_type=select", > 'PatronPopup', > 'width=740,height=450,location=yes,toolbar=no,' > + 'scrollbars=yes,resize=yes' >diff --git a/suggestion/add_user_search.pl b/suggestion/add_user_search.pl >new file mode 100755 >index 0000000..290f80d >--- /dev/null >+++ b/suggestion/add_user_search.pl >@@ -0,0 +1,63 @@ >+#!/usr/bin/perl >+ >+# 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 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 => { acquisition => 'suggestions_manage' }, >+ } >+); >+ >+my $q = $input->param('q') || ''; >+my $op = $input->param('op') || ''; >+my $selection_type = $input->param('selection_type') || 'add'; >+ >+my $referer = $input->referer(); >+ >+# If this script is called by suggestion/suggestion.pl >+# the patrons to return should be superlibrarian or have the suggestions_manage flag >+my $search_patrons_with_suggestion_perm_only = >+ ( $referer =~ m|suggestion/suggestion.pl| ) >+ ? 1 : 0; >+ >+my $patron_categories = Koha::Patron::Categories->search_limited; >+$template->param( >+ patrons_with_suggestion_perm_only => $search_patrons_with_suggestion_perm_only, >+ view => ( $input->request_method() eq "GET" ) ? "show_form" : "show_results", >+ columns => ['cardnumber', 'name', 'branch', 'category', 'action'], >+ json_template => 'acqui/tables/members_results.tt', >+ selection_type => $selection_type, >+ alphabet => ( C4::Context->preference('alphabet') || join ' ', 'A' .. 'Z' ), >+ categories => $patron_categories, >+ aaSorting => 1, >+); >+output_html_with_http_headers( $input, $cookie, $template->output ); >-- >2.1.4
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 23590
:
95162
|
95163
|
95164
|
95165
|
95166
|
95167
|
95168
|
95169
|
95317
|
95318
|
95319
|
95320
|
95321
|
95322
|
95323
|
95324
|
95398
|
95399
|
95407
|
95408
|
95420
|
95421
|
95422
|
95423
|
95424
|
95425
|
95426
|
95427
|
95428
|
95429
|
95430
|
95431
|
95487
|
95488
|
95489
|
95490
|
95491
|
95492
|
95493
|
95494
|
95495
|
95496
|
95497
|
95498
|
98119
|
98120
|
98121
|
98122
|
98123
|
98124
|
98126
|
98127
|
98128
|
98129
|
98130
|
98131
|
98240
|
98267
|
98268
|
98279
|
100788
|
100789
|
100790
|
100791
|
100792
|
100793
|
100794
|
100795
|
100796
|
100797
|
100798
|
100799
|
100800
|
100801
|
100802
|
100803
|
100804
|
100846
|
100847
|
100848
|
100849
|
100850
|
100851
|
100852
|
100853
|
101539
|
101548
|
101588
|
101589
|
101590
|
101591
|
101592
|
101593
|
101594
|
101595
|
101596
|
101597
|
101598
|
101599
|
101600
|
101601
|
101602
|
101603
|
101604
|
101605
|
101606
|
101695