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 718-724
my $dbh = C4::Context->dbh;
Link Here
|
718 |
my $hostbiblionumber = $input->param('hostbiblionumber'); |
719 |
my $hostbiblionumber = $input->param('hostbiblionumber'); |
719 |
my $hostitemnumber = $input->param('hostitemnumber'); |
720 |
my $hostitemnumber = $input->param('hostitemnumber'); |
720 |
|
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 |
728 |
my $validation = C4::Context->preference('CatalogingValidation'); |
729 |
my $validationframework = C4::Context->preference('CatalogingValidationFramework'); |
730 |
my %validationusers = map { $_ => 1 } split(/,/,C4::Context->preference('CatalogingValidationUsers')); |
731 |
|
722 |
my $userflags = 'edit_catalogue'; |
732 |
my $userflags = 'edit_catalogue'; |
723 |
if ($frameworkcode eq 'FA'){ |
733 |
if ($frameworkcode eq 'FA'){ |
724 |
$userflags = 'fast_cataloging'; |
734 |
$userflags = 'fast_cataloging'; |
Lines 738-743
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Link Here
|
738 |
} |
748 |
} |
739 |
); |
749 |
); |
740 |
|
750 |
|
|
|
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 |
752 |
# Avoid users to user validation framework adding the code to the URL |
753 |
$frameworkcode = '' if ($validation && ($frameworkcode eq $validationframework && !$validationusers{$userid})); |
754 |
|
741 |
if ($frameworkcode eq 'FA'){ |
755 |
if ($frameworkcode eq 'FA'){ |
742 |
# We need to grab and set some variables in the template for use on the additems screen |
756 |
# We need to grab and set some variables in the template for use on the additems screen |
743 |
$template->{VARS}->{'circborrowernumber'} = $input->param('borrowernumber'); |
757 |
$template->{VARS}->{'circborrowernumber'} = $input->param('borrowernumber'); |
Lines 759-765
foreach my $thisframeworkcode ( keys %$frameworks ) {
Link Here
|
759 |
if ($frameworkcode eq $thisframeworkcode){ |
773 |
if ($frameworkcode eq $thisframeworkcode){ |
760 |
$row{'selected'} = 1; |
774 |
$row{'selected'} = 1; |
761 |
} |
775 |
} |
762 |
push @frameworkcodeloop, \%row; |
776 |
# 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 |
778 |
if (!$validation || ($validation && ($thisframeworkcode ne $validationframework || ($thisframeworkcode eq $validationframework && $validationusers{$userid})))) { |
779 |
push @frameworkcodeloop, \%row; |
780 |
} |
763 |
} |
781 |
} |
764 |
$template->param( frameworkcodeloop => \@frameworkcodeloop, |
782 |
$template->param( frameworkcodeloop => \@frameworkcodeloop, |
765 |
breedingid => $breedingid ); |
783 |
breedingid => $breedingid ); |
Lines 853-858
if ( $op eq "addbiblio" ) {
Link Here
|
853 |
ModBiblio( $record, $biblionumber, $frameworkcode ); |
871 |
ModBiblio( $record, $biblionumber, $frameworkcode ); |
854 |
} |
872 |
} |
855 |
else { |
873 |
else { |
|
|
874 |
# force 942$n = 1 when validation is on and isn't validation framework |
875 |
$record->field('942')->update('n' => '1') if ($validation && ($frameworkcode ne $validationframework)); |
856 |
( $biblionumber, $oldbibitemnum ) = AddBiblio( $record, $frameworkcode ); |
876 |
( $biblionumber, $oldbibitemnum ) = AddBiblio( $record, $frameworkcode ); |
857 |
} |
877 |
} |
858 |
if ($redirect eq "items" || ($mode ne "popup" && !$is_a_modif && $redirect ne "view")){ |
878 |
if ($redirect eq "items" || ($mode ne "popup" && !$is_a_modif && $redirect ne "view")){ |