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 q(-utf8); |
24 |
use CGI q(-utf8); |
|
|
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 709-714
my $fa_branch = $input->param('branch');
Link Here
|
709 |
my $fa_stickyduedate = $input->param('stickyduedate'); |
710 |
my $fa_stickyduedate = $input->param('stickyduedate'); |
710 |
my $fa_duedatespec = $input->param('duedatespec'); |
711 |
my $fa_duedatespec = $input->param('duedatespec'); |
711 |
|
712 |
|
|
|
713 |
# getting userID |
714 |
my $sessionID = $input->cookie("CGISESSID") ; |
715 |
my $session = get_session($sessionID); |
716 |
my $userid = $session->param('id'); |
717 |
|
718 |
# getting validation variables |
719 |
my $validation = C4::Context->preference('CatalogingValidation'); |
720 |
my $validationframework = C4::Context->preference('CatalogingValidationFramework'); |
721 |
my %validationusers = map { $_ => 1 } split(/,/,C4::Context->preference('CatalogingValidationUsers')); |
722 |
|
712 |
my $userflags = 'edit_catalogue'; |
723 |
my $userflags = 'edit_catalogue'; |
713 |
|
724 |
|
714 |
my $changed_framework = $input->param('changed_framework'); |
725 |
my $changed_framework = $input->param('changed_framework'); |
Lines 730-735
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Link Here
|
730 |
} |
741 |
} |
731 |
); |
742 |
); |
732 |
|
743 |
|
|
|
744 |
# 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 |
745 |
# Avoid users to user validation framework adding the code to the URL |
746 |
$frameworkcode = '' if ($validation && ($frameworkcode eq $validationframework && !$validationusers{$userid})); |
747 |
|
733 |
if ($frameworkcode eq 'FA'){ |
748 |
if ($frameworkcode eq 'FA'){ |
734 |
# We need to grab and set some variables in the template for use on the additems screen |
749 |
# We need to grab and set some variables in the template for use on the additems screen |
735 |
$template->param( |
750 |
$template->param( |
Lines 759-765
foreach my $thisframeworkcode ( keys %$frameworks ) {
Link Here
|
759 |
if ($frameworkcode eq $thisframeworkcode){ |
774 |
if ($frameworkcode eq $thisframeworkcode){ |
760 |
$row{'selected'} = 1; |
775 |
$row{'selected'} = 1; |
761 |
} |
776 |
} |
762 |
push @frameworkcodeloop, \%row; |
777 |
# Add the framework code if validation is off. |
|
|
778 |
# 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 |
779 |
if (!$validation || ($validation && ($thisframeworkcode ne $validationframework || ($thisframeworkcode eq $validationframework && $validationusers{$userid})))) { |
780 |
push @frameworkcodeloop, \%row; |
781 |
} |
763 |
} |
782 |
} |
764 |
$template->param( frameworkcodeloop => \@frameworkcodeloop, |
783 |
$template->param( frameworkcodeloop => \@frameworkcodeloop, |
765 |
breedingid => $breedingid ); |
784 |
breedingid => $breedingid ); |
Lines 855-860
if ( $op eq "addbiblio" ) {
Link Here
|
855 |
ModBiblio( $record, $biblionumber, $frameworkcode ); |
874 |
ModBiblio( $record, $biblionumber, $frameworkcode ); |
856 |
} |
875 |
} |
857 |
else { |
876 |
else { |
|
|
877 |
# force 942$n = 1 when validation is on and isn't validation framework |
878 |
$record->field('942')->update('n' => '1') if ($validation && ($frameworkcode ne $validationframework)); |
858 |
( $biblionumber, $oldbibitemnum ) = AddBiblio( $record, $frameworkcode ); |
879 |
( $biblionumber, $oldbibitemnum ) = AddBiblio( $record, $frameworkcode ); |
859 |
} |
880 |
} |
860 |
if ($redirect eq "items" || ($mode ne "popup" && !$is_a_modif && $redirect ne "view" && $redirect ne "just_save")){ |
881 |
if ($redirect eq "items" || ($mode ne "popup" && !$is_a_modif && $redirect ne "view" && $redirect ne "just_save")){ |