Lines 22-29
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::Output; |
26 |
use C4::Output; |
26 |
use C4::Auth; |
27 |
use C4::Auth qw/:DEFAULT get_session/; |
27 |
use C4::Biblio; |
28 |
use C4::Biblio; |
28 |
use C4::Search; |
29 |
use C4::Search; |
29 |
use C4::AuthoritiesMarc; |
30 |
use C4::AuthoritiesMarc; |
Lines 735-740
my $fa_branch = $input->param('branch');
Link Here
|
735 |
my $fa_stickyduedate = $input->param('stickyduedate'); |
736 |
my $fa_stickyduedate = $input->param('stickyduedate'); |
736 |
my $fa_duedatespec = $input->param('duedatespec'); |
737 |
my $fa_duedatespec = $input->param('duedatespec'); |
737 |
|
738 |
|
|
|
739 |
# getting userID |
740 |
my $sessionID = $input->cookie("CGISESSID") ; |
741 |
my $session = get_session($sessionID); |
742 |
my $userid = $session->param('id'); |
743 |
|
744 |
# getting validation variables |
745 |
my $validation = C4::Context->preference('CatalogingValidation'); |
746 |
my $validationframework = C4::Context->preference('CatalogingValidationFramework'); |
747 |
my %validationusers = map { $_ => 1 } split(/,/,C4::Context->preference('CatalogingValidationUsers')); |
748 |
|
738 |
my $userflags = 'edit_catalogue'; |
749 |
my $userflags = 'edit_catalogue'; |
739 |
if ($frameworkcode eq 'FA'){ |
750 |
if ($frameworkcode eq 'FA'){ |
740 |
$userflags = 'fast_cataloging'; |
751 |
$userflags = 'fast_cataloging'; |
Lines 755-760
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Link Here
|
755 |
} |
766 |
} |
756 |
); |
767 |
); |
757 |
|
768 |
|
|
|
769 |
# 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 |
770 |
# Avoid users to user validation framework adding the code to the URL |
771 |
$frameworkcode = '' if ($validation && ($frameworkcode eq $validationframework && !$validationusers{$userid})); |
772 |
|
758 |
if ($frameworkcode eq 'FA'){ |
773 |
if ($frameworkcode eq 'FA'){ |
759 |
# We need to grab and set some variables in the template for use on the additems screen |
774 |
# We need to grab and set some variables in the template for use on the additems screen |
760 |
$template->param( |
775 |
$template->param( |
Lines 778-784
foreach my $thisframeworkcode ( keys %$frameworks ) {
Link Here
|
778 |
if ($frameworkcode eq $thisframeworkcode){ |
793 |
if ($frameworkcode eq $thisframeworkcode){ |
779 |
$row{'selected'} = 1; |
794 |
$row{'selected'} = 1; |
780 |
} |
795 |
} |
781 |
push @frameworkcodeloop, \%row; |
796 |
# Add the framework code if validation is off. |
|
|
797 |
# 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 |
798 |
if (!$validation || ($validation && ($thisframeworkcode ne $validationframework || ($thisframeworkcode eq $validationframework && $validationusers{$userid})))) { |
799 |
push @frameworkcodeloop, \%row; |
800 |
} |
782 |
} |
801 |
} |
783 |
$template->param( frameworkcodeloop => \@frameworkcodeloop, |
802 |
$template->param( frameworkcodeloop => \@frameworkcodeloop, |
784 |
breedingid => $breedingid ); |
803 |
breedingid => $breedingid ); |
Lines 872-877
if ( $op eq "addbiblio" ) {
Link Here
|
872 |
ModBiblio( $record, $biblionumber, $frameworkcode ); |
891 |
ModBiblio( $record, $biblionumber, $frameworkcode ); |
873 |
} |
892 |
} |
874 |
else { |
893 |
else { |
|
|
894 |
# force 942$n = 1 when validation is on and isn't validation framework |
895 |
$record->field('942')->update('n' => '1') if ($validation && ($frameworkcode ne $validationframework)); |
875 |
( $biblionumber, $oldbibitemnum ) = AddBiblio( $record, $frameworkcode ); |
896 |
( $biblionumber, $oldbibitemnum ) = AddBiblio( $record, $frameworkcode ); |
876 |
} |
897 |
} |
877 |
if ($redirect eq "items" || ($mode ne "popup" && !$is_a_modif && $redirect ne "view" && $redirect ne "just_save")){ |
898 |
if ($redirect eq "items" || ($mode ne "popup" && !$is_a_modif && $redirect ne "view" && $redirect ne "just_save")){ |