소스 검색
Bug 23590 added a new feature to select the manager of a suggestion. One month later bug 24819 added the ability to pick the suggester. This second patchset broke the manager selection. This patch simplifies the way the suggester is selected, using the generic way and mimicking what is done for the manager. Test plan: - create a new purchase suggestion from within acquisitions (suggestion.pl?op=add) - click "select manager," search for user, click Select - see that the user you just selected shows under "Created by," - see that "Managed by" still says "You" - modify the suggester - save your suggestion => Everything is saved correctly QA will test the permission alert: Edit suggestion.tt and remove "&permissions=suggestions.suggestions_manage" Edit the suggestion, select a manager, pick a patron in the list who does not have sufficient permissions, save => you get the alert Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>20.11.x
Jonathan Druart
4 년 전
7개의 변경된 파일과 48개의 추가작업 그리고 119개의 파일을 삭제
@ -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": |
|||
"<a href=\"#\" class=\"btn btn-default btn-xs select_user\" data-borrowernumber=\"[% data.borrowernumber | html %]\">Select</a><input type=\"hidden\" id=\"borrower_data[% data.borrowernumber | html %]\" name=\"borrower_data[% data.borrowernumber | html %]\" value=\"[% To.json(data) | html %]\" />" |
|||
}[% 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 %] |
@ -1,17 +0,0 @@ |
|||
function select_user(borrowernumber, borrower) { |
|||
var suggested = '<input type="hidden" id="suggestedby" name="suggestedby" value="' + borrowernumber + '" />'; |
|||
suggested += '<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=' + borrowernumber + '">'; |
|||
suggested += borrower.surname + ', ' + borrower.firstname + ' (' + borrower.cardnumber + ')'; |
|||
suggested += '</a> '; |
|||
suggested += borrower.branchname + ' (' + borrower.category_description + ')'; |
|||
$("#tdsuggestedby").html(suggested); |
|||
return 0; |
|||
} |
|||
|
|||
$(document).ready(function(){ |
|||
$('body').on('click', '#suggester_search', function(e) { |
|||
e.preventDefault(); |
|||
var newin = window.open('suggester_search.pl','popup','width=600,height=400,resizable=no,toolbar=false,scrollbars=yes,top'); |
|||
}); |
|||
|
|||
}); |
@ -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 <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 = 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", |
|||
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 ); |
불러오는 중...
Reference in new issue