Lines 25-30
use CGI;
Link Here
|
25 |
use C4::Auth; |
25 |
use C4::Auth; |
26 |
use C4::Output; |
26 |
use C4::Output; |
27 |
use C4::Members; |
27 |
use C4::Members; |
|
|
28 |
use C4::Acquisition; |
28 |
|
29 |
|
29 |
my $input = new CGI; |
30 |
my $input = new CGI; |
30 |
|
31 |
|
Lines 41-69
my ( $template, $loggedinuser, $cookie, $staff_flags ) = get_template_and_user(
Link Here
|
41 |
|
42 |
|
42 |
my $q = $input->param('q') || ''; |
43 |
my $q = $input->param('q') || ''; |
43 |
my $op = $input->param('op') || ''; |
44 |
my $op = $input->param('op') || ''; |
|
|
45 |
my $basketno = $input->param('basketno'); |
46 |
my $basket = C4::Acquisition::GetBasket($basketno); |
44 |
|
47 |
|
45 |
if( $op eq "do_search" ) { |
48 |
if( $op eq "do_search" ) { |
46 |
my $results = C4::Members::Search( $q, "surname"); |
49 |
my $results = C4::Members::Search( $q, "surname"); |
47 |
|
50 |
|
48 |
my @users_loop; |
51 |
my @users_loop; |
49 |
my $nresults = 0; |
52 |
my $nresults = 0; |
50 |
foreach my $res (@$results) { |
53 |
foreach my $borrower (@$results) { |
51 |
my $perms = haspermission( $res->{userid} ); |
54 |
if (C4::Acquisition::CanUserManageBasket( |
52 |
my $subperms = get_user_subpermissions( $res->{userid} ); |
55 |
$borrower, $basket, undef, assume_in_user_list => 1)) |
53 |
|
56 |
{ |
54 |
if( $perms->{superlibrarian} == 1 |
|
|
55 |
|| $perms->{acquisition} == 1 |
56 |
|| $subperms->{acquisition}->{'order_manage'} ) { |
57 |
my %row = ( |
57 |
my %row = ( |
58 |
borrowernumber => $res->{borrowernumber}, |
58 |
borrowernumber => $borrower->{borrowernumber}, |
59 |
cardnumber => $res->{cardnumber}, |
59 |
cardnumber => $borrower->{cardnumber}, |
60 |
surname => $res->{surname}, |
60 |
surname => $borrower->{surname}, |
61 |
firstname => $res->{firstname}, |
61 |
firstname => $borrower->{firstname}, |
62 |
categorycode => $res->{categorycode}, |
62 |
categorycode => $borrower->{categorycode}, |
63 |
branchcode => $res->{branchcode}, |
63 |
branchcode => $borrower->{branchcode}, |
64 |
); |
64 |
); |
65 |
push( @users_loop, \%row ); |
65 |
push( @users_loop, \%row ); |
66 |
$nresults ++; |
66 |
$nresults++; |
67 |
} |
67 |
} |
68 |
} |
68 |
} |
69 |
|
69 |
|
Lines 74-77
if( $op eq "do_search" ) {
Link Here
|
74 |
); |
74 |
); |
75 |
} |
75 |
} |
76 |
|
76 |
|
|
|
77 |
$template->param(basketno => $basketno); |
78 |
|
77 |
output_html_with_http_headers( $input, $cookie, $template->output ); |
79 |
output_html_with_http_headers( $input, $cookie, $template->output ); |