|
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 735-745
my $fa_branch = $input->param('branch');
Link Here
|
| 735 |
my $fa_stickyduedate = $input->param('stickyduedate'); |
735 |
my $fa_stickyduedate = $input->param('stickyduedate'); |
| 736 |
my $fa_duedatespec = $input->param('duedatespec'); |
736 |
my $fa_duedatespec = $input->param('duedatespec'); |
| 737 |
|
737 |
|
| 738 |
# getting userID |
|
|
| 739 |
my $sessionID = $input->cookie("CGISESSID") ; |
| 740 |
my $session = get_session($sessionID); |
| 741 |
my $userid = $session->param('id'); |
| 742 |
|
| 743 |
# getting validation variables |
738 |
# getting validation variables |
| 744 |
my $validation = C4::Context->preference('CatalogingValidation'); |
739 |
my $validation = C4::Context->preference('CatalogingValidation'); |
| 745 |
my $validationframework = C4::Context->preference('CatalogingValidationFramework'); |
740 |
my $validationframework = C4::Context->preference('CatalogingValidationFramework'); |
|
Lines 764-772
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Link Here
|
| 764 |
} |
759 |
} |
| 765 |
); |
760 |
); |
| 766 |
|
761 |
|
|
|
762 |
my $uid = GetMember( borrowernumber => $loggedinuser )->{userid} if ($loggedinuser); |
| 763 |
my $validationpermission = haspermission($uid, {'editcatalogue' => 'cataloging_validation_framework'}); |
| 764 |
|
| 767 |
# 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 |
765 |
# 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 |
| 768 |
# Avoid users to user validation framework adding the code to the URL |
766 |
# Avoid users to user validation framework adding the code to the URL |
| 769 |
$frameworkcode = '' if ($validation && ($frameworkcode eq $validationframework && !$validationusers{$userid})); |
767 |
$frameworkcode = '' if ($validation && ($frameworkcode eq $validationframework && !$validationpermission)); |
| 770 |
|
768 |
|
| 771 |
if ($frameworkcode eq 'FA'){ |
769 |
if ($frameworkcode eq 'FA'){ |
| 772 |
# We need to grab and set some variables in the template for use on the additems screen |
770 |
# We need to grab and set some variables in the template for use on the additems screen |
|
Lines 793-799
foreach my $thisframeworkcode ( keys %$frameworks ) {
Link Here
|
| 793 |
} |
791 |
} |
| 794 |
# Add the framework code if validation is off. |
792 |
# Add the framework code if validation is off. |
| 795 |
# 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 |
793 |
# 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 |
| 796 |
if (!$validation || ($validation && ($thisframeworkcode ne $validationframework || ($thisframeworkcode eq $validationframework && $validationusers{$userid})))) { |
794 |
if (!$validation || ($validation && ($thisframeworkcode ne $validationframework || ($thisframeworkcode eq $validationframework && $validationpermission)))) { |
| 797 |
push @frameworkcodeloop, \%row; |
795 |
push @frameworkcodeloop, \%row; |
| 798 |
} |
796 |
} |
| 799 |
} |
797 |
} |