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 734-739
my $fa_branch = $input->param('branch');
Link Here
|
734 |
my $fa_stickyduedate = $input->param('stickyduedate'); |
735 |
my $fa_stickyduedate = $input->param('stickyduedate'); |
735 |
my $fa_duedatespec = $input->param('duedatespec'); |
736 |
my $fa_duedatespec = $input->param('duedatespec'); |
736 |
|
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 |
744 |
my $validation = C4::Context->preference('CatalogingValidation'); |
745 |
my $validationframework = C4::Context->preference('CatalogingValidationFramework'); |
746 |
my %validationusers = map { $_ => 1 } split(/,/,C4::Context->preference('CatalogingValidationUsers')); |
747 |
|
737 |
my $userflags = 'edit_catalogue'; |
748 |
my $userflags = 'edit_catalogue'; |
738 |
if ($frameworkcode eq 'FA'){ |
749 |
if ($frameworkcode eq 'FA'){ |
739 |
$userflags = 'fast_cataloging'; |
750 |
$userflags = 'fast_cataloging'; |
Lines 753-758
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Link Here
|
753 |
} |
764 |
} |
754 |
); |
765 |
); |
755 |
|
766 |
|
|
|
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 |
768 |
# Avoid users to user validation framework adding the code to the URL |
769 |
$frameworkcode = '' if ($validation && ($frameworkcode eq $validationframework && !$validationusers{$userid})); |
770 |
|
756 |
if ($frameworkcode eq 'FA'){ |
771 |
if ($frameworkcode eq 'FA'){ |
757 |
# We need to grab and set some variables in the template for use on the additems screen |
772 |
# We need to grab and set some variables in the template for use on the additems screen |
758 |
$template->param( |
773 |
$template->param( |
Lines 776-782
foreach my $thisframeworkcode ( keys %$frameworks ) {
Link Here
|
776 |
if ($frameworkcode eq $thisframeworkcode){ |
791 |
if ($frameworkcode eq $thisframeworkcode){ |
777 |
$row{'selected'} = 1; |
792 |
$row{'selected'} = 1; |
778 |
} |
793 |
} |
779 |
push @frameworkcodeloop, \%row; |
794 |
# 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 |
796 |
if (!$validation || ($validation && ($thisframeworkcode ne $validationframework || ($thisframeworkcode eq $validationframework && $validationusers{$userid})))) { |
797 |
push @frameworkcodeloop, \%row; |
798 |
} |
780 |
} |
799 |
} |
781 |
$template->param( frameworkcodeloop => \@frameworkcodeloop, |
800 |
$template->param( frameworkcodeloop => \@frameworkcodeloop, |
782 |
breedingid => $breedingid ); |
801 |
breedingid => $breedingid ); |
Lines 870-875
if ( $op eq "addbiblio" ) {
Link Here
|
870 |
ModBiblio( $record, $biblionumber, $frameworkcode ); |
889 |
ModBiblio( $record, $biblionumber, $frameworkcode ); |
871 |
} |
890 |
} |
872 |
else { |
891 |
else { |
|
|
892 |
# force 942$n = 1 when validation is on and isn't validation framework |
893 |
$record->field('942')->update('n' => '1') if ($validation && ($frameworkcode ne $validationframework)); |
873 |
( $biblionumber, $oldbibitemnum ) = AddBiblio( $record, $frameworkcode ); |
894 |
( $biblionumber, $oldbibitemnum ) = AddBiblio( $record, $frameworkcode ); |
874 |
} |
895 |
} |
875 |
if ($redirect eq "items" || ($mode ne "popup" && !$is_a_modif && $redirect ne "view")){ |
896 |
if ($redirect eq "items" || ($mode ne "popup" && !$is_a_modif && $redirect ne "view")){ |