Lines 22-30
Link Here
|
22 |
use strict; |
22 |
use strict; |
23 |
#use warnings; FIXME - Bug 2505 |
23 |
#use warnings; FIXME - Bug 2505 |
24 |
use CGI; |
24 |
use CGI; |
25 |
use CGI::Session; |
25 |
use C4::Members; |
26 |
use C4::Output; |
26 |
use C4::Output; |
27 |
use C4::Auth qw/:DEFAULT get_session/; |
27 |
use C4::Auth; |
28 |
use C4::Biblio; |
28 |
use C4::Biblio; |
29 |
use C4::Search; |
29 |
use C4::Search; |
30 |
use C4::AuthoritiesMarc; |
30 |
use C4::AuthoritiesMarc; |
Lines 719-733
my $dbh = C4::Context->dbh;
Link Here
|
719 |
my $hostbiblionumber = $input->param('hostbiblionumber'); |
719 |
my $hostbiblionumber = $input->param('hostbiblionumber'); |
720 |
my $hostitemnumber = $input->param('hostitemnumber'); |
720 |
my $hostitemnumber = $input->param('hostitemnumber'); |
721 |
|
721 |
|
722 |
# getting userID |
|
|
723 |
my $sessionID = $input->cookie("CGISESSID") ; |
724 |
my $session = get_session($sessionID); |
725 |
my $userid = $session->param('id'); |
726 |
|
727 |
# getting validation variables |
722 |
# getting validation variables |
728 |
my $validation = C4::Context->preference('CatalogingValidation'); |
723 |
my $validation = C4::Context->preference('CatalogingValidation'); |
729 |
my $validationframework = C4::Context->preference('CatalogingValidationFramework'); |
724 |
my $validationframework = C4::Context->preference('CatalogingValidationFramework'); |
730 |
my %validationusers = map { $_ => 1 } split(/,/,C4::Context->preference('CatalogingValidationUsers')); |
|
|
731 |
|
725 |
|
732 |
my $userflags = 'edit_catalogue'; |
726 |
my $userflags = 'edit_catalogue'; |
733 |
if ($frameworkcode eq 'FA'){ |
727 |
if ($frameworkcode eq 'FA'){ |
Lines 748-756
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Link Here
|
748 |
} |
742 |
} |
749 |
); |
743 |
); |
750 |
|
744 |
|
|
|
745 |
my $uid = GetMember( borrowernumber => $loggedinuser )->{userid} if ($loggedinuser); |
746 |
my $validationpermission = haspermission($uid, {'editcatalogue' => 'cataloging_validation_framework'}); |
747 |
|
751 |
# Clear the framework code if validation is on and the framework code is equal to validation framework but the user is not authorized to use it |
748 |
# Clear the framework code if validation is on and the framework code is equal to validation framework but the user is not authorized to use it |
752 |
# Avoid users to user validation framework adding the code to the URL |
749 |
# Avoid users to user validation framework adding the code to the URL |
753 |
$frameworkcode = '' if ($validation && ($frameworkcode eq $validationframework && !$validationusers{$userid})); |
750 |
$frameworkcode = '' if ($validation && ($frameworkcode eq $validationframework && !$validationpermission)); |
754 |
|
751 |
|
755 |
if ($frameworkcode eq 'FA'){ |
752 |
if ($frameworkcode eq 'FA'){ |
756 |
# We need to grab and set some variables in the template for use on the additems screen |
753 |
# We need to grab and set some variables in the template for use on the additems screen |
Lines 775-781
foreach my $thisframeworkcode ( keys %$frameworks ) {
Link Here
|
775 |
} |
772 |
} |
776 |
# Add the framework code if validation is off. |
773 |
# Add the framework code if validation is off. |
777 |
# Add the framework code if validation is on, the framework code is equal to validation framework and the user is not authorized to use it |
774 |
# Add the framework code if validation is on, the framework code is equal to validation framework and the user is not authorized to use it |
778 |
if (!$validation || ($validation && ($thisframeworkcode ne $validationframework || ($thisframeworkcode eq $validationframework && $validationusers{$userid})))) { |
775 |
if (!$validation || ($validation && ($thisframeworkcode ne $validationframework || ($thisframeworkcode eq $validationframework && $validationpermission)))) { |
779 |
push @frameworkcodeloop, \%row; |
776 |
push @frameworkcodeloop, \%row; |
780 |
} |
777 |
} |
781 |
} |
778 |
} |