Lines 22-28
use CGI qw ( -utf8 );
Link Here
|
22 |
|
22 |
|
23 |
use C4::Context; |
23 |
use C4::Context; |
24 |
use C4::Output qw( output_html_with_http_headers ); |
24 |
use C4::Output qw( output_html_with_http_headers ); |
25 |
use C4::Auth qw( get_template_and_user get_session ); |
25 |
use C4::Auth qw( get_template_and_user get_session haspermission ); |
26 |
use Koha::BiblioFrameworks; |
26 |
use Koha::BiblioFrameworks; |
27 |
use Koha::Cash::Registers; |
27 |
use Koha::Cash::Registers; |
28 |
use Koha::Libraries; |
28 |
use Koha::Libraries; |
Lines 49-55
my $userenv_register_id = C4::Context->userenv->{'register_id'} || '';
Link Here
|
49 |
my @updated; |
49 |
my @updated; |
50 |
|
50 |
|
51 |
# $session lines here are doing the updating |
51 |
# $session lines here are doing the updating |
52 |
if ( $branch and my $library = Koha::Libraries->find($branch) and ( $flags->{loggedinlibrary} == 1 or $flags->{superlibrarian} == 1 ) ) { |
52 |
if ( $branch and my $library = Koha::Libraries->find($branch) and ( C4::Auth::haspermission(C4::Context->userenv->{'id'}, { 'loggedinlibrary' => 1 }) or C4::Context::IsSuperLibraian() ) ) { |
53 |
if ( !$userenv_branch or $userenv_branch ne $branch ) { |
53 |
if ( !$userenv_branch or $userenv_branch ne $branch ) { |
54 |
my $branchname = $library->branchname; |
54 |
my $branchname = $library->branchname; |
55 |
$session->param('branchname', $branchname); # update sesssion in DB |
55 |
$session->param('branchname', $branchname); # update sesssion in DB |