View | Details | Raw Unified | Return to bug 9163
Collapse All | Expand All

(-)a/cataloguing/addbiblio.pl (-2 / +23 lines)
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")){
(-)a/cataloguing/addbooks.pl (-1 / +15 lines)
Lines 27-33 Link Here
27
use strict;
27
use strict;
28
use warnings;
28
use warnings;
29
use CGI qw ( -utf8 );
29
use CGI qw ( -utf8 );
30
use C4::Auth;
30
use CGI::Session;
31
use C4::Auth qw/:DEFAULT get_session/;
31
use C4::Biblio;
32
use C4::Biblio;
32
use C4::Breeding;
33
use C4::Breeding;
33
use C4::Output;
34
use C4::Output;
Lines 36-41 use C4::Search; Link Here
36
37
37
my $input = new CGI;
38
my $input = new CGI;
38
39
40
# getting userID
41
my $sessionID = $input->cookie("CGISESSID");
42
my $session = get_session($sessionID);
43
my $userid = $session->param('id');
44
45
# getting validation variables
46
my $validation = C4::Context->preference('CatalogingValidation');
47
my $validationframework = C4::Context->preference('CatalogingValidationFramework');
48
my %validationusers = map { $_ => 1 } split(/,/,C4::Context->preference('CatalogingValidationUsers'));
49
39
my $success = $input->param('biblioitem');
50
my $success = $input->param('biblioitem');
40
my $query   = $input->param('q');
51
my $query   = $input->param('q');
41
my @value   = $input->param('value');
52
my @value   = $input->param('value');
Lines 58-63 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
58
my $frameworks = getframeworks;
69
my $frameworks = getframeworks;
59
my @frameworkcodeloop;
70
my @frameworkcodeloop;
60
foreach my $thisframeworkcode ( sort { uc($frameworks->{$a}->{'frameworktext'}) cmp uc($frameworks->{$b}->{'frameworktext'}) } keys %{$frameworks} ) {
71
foreach my $thisframeworkcode ( sort { uc($frameworks->{$a}->{'frameworktext'}) cmp uc($frameworks->{$b}->{'frameworktext'}) } keys %{$frameworks} ) {
72
    # Add the framework code if validation is off.
73
    # 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
74
    if (!$validation || ($validation && ($thisframeworkcode ne $validationframework || ($thisframeworkcode eq $validationframework && $validationusers{$userid})))) {
61
    push @frameworkcodeloop, {
75
    push @frameworkcodeloop, {
62
        value         => $thisframeworkcode,
76
        value         => $thisframeworkcode,
63
        frameworktext => $frameworks->{$thisframeworkcode}->{'frameworktext'},
77
        frameworktext => $frameworks->{$thisframeworkcode}->{'frameworktext'},
(-)a/installer/data/mysql/sysprefs.sql (+3 lines)
Lines 87-92 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
87
('casServerUrl','https://localhost:8443/cas','','URL of the cas server','Free'),
87
('casServerUrl','https://localhost:8443/cas','','URL of the cas server','Free'),
88
('CatalogModuleRelink','0',NULL,'If OFF the linker will never replace the authids that are set in the cataloging module.','YesNo'),
88
('CatalogModuleRelink','0',NULL,'If OFF the linker will never replace the authids that are set in the cataloging module.','YesNo'),
89
('CataloguingLog','1',NULL,'If ON, log edit/create/delete actions on bibliographic data. WARNING: this feature is very resource consuming.','YesNo'),
89
('CataloguingLog','1',NULL,'If ON, log edit/create/delete actions on bibliographic data. WARNING: this feature is very resource consuming.','YesNo'),
90
('CatalogingValidation','0',NULL,'Active cataloging validation','YesNo');
91
('CatalogingValidationFramework','',NULL,'Cataloging validation framework','long');
92
('CatalogingValidationUsers','',NULL,'Cataloging validation users','long');
90
('checkdigit','none','none|katipo','If ON, enable checks on patron cardnumber: none or \"Katipo\" style checks','Choice'),
93
('checkdigit','none','none|katipo','If ON, enable checks on patron cardnumber: none or \"Katipo\" style checks','Choice'),
91
('CircAutocompl','1',NULL,'If ON, autocompletion is enabled for the Circulation input','YesNo'),
94
('CircAutocompl','1',NULL,'If ON, autocompletion is enabled for the Circulation input','YesNo'),
92
('CircAutoPrintQuickSlip','qslip',NULL,'Choose what should happen when an empty barcode field is submitted in circulation: Display a print quick slip window, Display a print slip window or Clear the screen.','Choice'),
95
('CircAutoPrintQuickSlip','qslip',NULL,'Choose what should happen when an empty barcode field is submitted in circulation: Display a print quick slip window, Display a print slip window or Clear the screen.','Choice'),
(-)a/installer/data/mysql/updatedatabase.pl (+8 lines)
Lines 6697-6702 if ( CheckVersion($DBversion) ) { Link Here
6697
    ");
6697
    ");
6698
6698
6699
    print "Upgrade to $DBversion done (Bug 7804: Added plugin system.)\n";
6699
    print "Upgrade to $DBversion done (Bug 7804: Added plugin system.)\n";
6700
}
6701
6702
$DBversion = '3.11.00.XXX';
6703
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
6704
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CatalogingValidation', '0','Active cataloging validation',NULL,'YesNo');");
6705
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CatalogingValidationFramework','','Cataloging validation framework',NULL,'long');");
6706
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CatalogingValidationUsers', '','Cataloging validation users',NULL,'long');");
6707
    print "Upgrade to $DBversion done (Bug 9163 - Cataloguing validation workflow)\n";
6700
    SetVersion($DBversion);
6708
    SetVersion($DBversion);
6701
}
6709
}
6702
6710
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (-1 / +18 lines)
Lines 247-249 Cataloging: Link Here
247
            - "All values of repeating tags and subfields will be printed with the given RIS tag."
247
            - "All values of repeating tags and subfields will be printed with the given RIS tag."
248
            - "<br/>"
248
            - "<br/>"
249
            - "Use of TY ( record type ) as a key will <i>replace</i> the default TY with the field value of your choosing."
249
            - "Use of TY ( record type ) as a key will <i>replace</i> the default TY with the field value of your choosing."
250
- 
250
    Validation:
251
        -
252
            - pref: CatalogingValidation
253
              choices:
254
                  yes: Use
255
                  no: "Don't use"
256
            - "cataloging validation. This allows some users to use a special MARC framework (only visible to them) to validate and put the record online in OPAC.<br />"
257
            - "NOTE:<br /> - All MARC frameworks except the validation framework (set in CatalogingValidationFramework) needs to have the suppress subfield hidden.<br /> - The validation framework needs to have suppress subfield visible.<br />- The system preference OPACSuppresion needs to be on.<br /> - The users with access to the validation framework are set in CatalogingValidationUsers."
258
        -
259
            - "Code of the validation framework:"
260
            - pref: CatalogingValidationFramework
261
              class: long
262
            - "<br />NOTE:<br /> - CatalogingValidation needs to be on.<br /> - The framework needs to be created in the MARC frameworks administration panel.<br /> - The framework needs to have suppress subfield visible."
263
        -
264
            - "The following users (list comma separated) will have access to validation framework:"
265
            - pref: CatalogingValidationUsers
266
              class: long
267
            - "<br />NOTE:<br /> - CatalogingValidation needs to be on."

Return to bug 9163