Lines 425-431
if (not defined $userflags) {
Link Here
|
425 |
$userflags = ($frameworkcode eq 'FA') ? "fast_cataloging" : "edit_items"; |
425 |
$userflags = ($frameworkcode eq 'FA') ? "fast_cataloging" : "edit_items"; |
426 |
} |
426 |
} |
427 |
|
427 |
|
428 |
my ($template, $loggedinuser, $cookie) |
428 |
my ($template, $borrowernumber, $cookie) |
429 |
= get_template_and_user({template_name => "cataloguing/additem.tt", |
429 |
= get_template_and_user({template_name => "cataloguing/additem.tt", |
430 |
query => $input, |
430 |
query => $input, |
431 |
type => "intranet", |
431 |
type => "intranet", |
Lines 434-443
my ($template, $loggedinuser, $cookie)
Link Here
|
434 |
|
434 |
|
435 |
|
435 |
|
436 |
# Does the user have a restricted item editing permission? |
436 |
# Does the user have a restricted item editing permission? |
437 |
my $uid = Koha::Patrons->find( $loggedinuser )->userid; |
437 |
my $logged_in_patron = Koha::Patrons->find( $borrowernumber ); |
|
|
438 |
my $is_superlibrarian = $logged_in_patron->is_superlibrarian; |
439 |
my $uid = $logged_in_patron->userid; |
438 |
my $restrictededition = $uid ? haspermission($uid, {'editcatalogue' => 'edit_items_restricted'}) : undef; |
440 |
my $restrictededition = $uid ? haspermission($uid, {'editcatalogue' => 'edit_items_restricted'}) : undef; |
439 |
# In case user is a superlibrarian, editing is not restricted |
441 |
# In case user is a superlibrarian, editing is not restricted |
440 |
$restrictededition = 0 if ($restrictededition != 0 && C4::Context->IsSuperLibrarian()); |
442 |
$restrictededition = 0 if ($restrictededition != 0 && $is_superlibrarian); |
441 |
# In case user has fast cataloging permission (and we're in fast cataloging), editing is not restricted |
443 |
# In case user has fast cataloging permission (and we're in fast cataloging), editing is not restricted |
442 |
$restrictededition = 0 if ($restrictededition != 0 && $frameworkcode eq 'FA' && haspermission($uid, {'editcatalogue' => 'fast_cataloging'})); |
444 |
$restrictededition = 0 if ($restrictededition != 0 && $frameworkcode eq 'FA' && haspermission($uid, {'editcatalogue' => 'fast_cataloging'})); |
443 |
|
445 |
|
Lines 855-861
foreach my $field (@fields) {
Link Here
|
855 |
if (($field->tag eq $branchtagfield) && ($subfieldcode eq $branchtagsubfield) && C4::Context->preference("IndependentBranches")) { |
857 |
if (($field->tag eq $branchtagfield) && ($subfieldcode eq $branchtagsubfield) && C4::Context->preference("IndependentBranches")) { |
856 |
#verifying rights |
858 |
#verifying rights |
857 |
my $userenv = C4::Context->userenv(); |
859 |
my $userenv = C4::Context->userenv(); |
858 |
unless (C4::Context->IsSuperLibrarian() or (($userenv->{'branch'} eq $subfieldvalue))){ |
860 |
unless ($is_super_librarian or (($userenv->{'branch'} eq $subfieldvalue))){ |
859 |
$this_row{'nomod'} = 1; |
861 |
$this_row{'nomod'} = 1; |
860 |
} |
862 |
} |
861 |
} |
863 |
} |