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;
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")){
(-)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;
29
use CGI;
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 72-77 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
72
('casServerUrl','https://localhost:8443/cas','','URL of the cas server','Free'),
72
('casServerUrl','https://localhost:8443/cas','','URL of the cas server','Free'),
73
('CatalogModuleRelink','0',NULL,'If OFF the linker will never replace the authids that are set in the cataloging module.','YesNo'),
73
('CatalogModuleRelink','0',NULL,'If OFF the linker will never replace the authids that are set in the cataloging module.','YesNo'),
74
('CataloguingLog','1',NULL,'If ON, log edit/create/delete actions on bibliographic data. WARNING: this feature is very resource consuming.','YesNo'),
74
('CataloguingLog','1',NULL,'If ON, log edit/create/delete actions on bibliographic data. WARNING: this feature is very resource consuming.','YesNo'),
75
('CatalogingValidation','0',NULL,'Active cataloging validation','YesNo');
76
('CatalogingValidationFramework','',NULL,'Cataloging validation framework','long');
77
('CatalogingValidationUsers','',NULL,'Cataloging validation users','long');
75
('checkdigit','none','none|katipo','If ON, enable checks on patron cardnumber: none or \"Katipo\" style checks','Choice'),
78
('checkdigit','none','none|katipo','If ON, enable checks on patron cardnumber: none or \"Katipo\" style checks','Choice'),
76
('CircAutocompl','1',NULL,'If ON, autocompletion is enabled for the Circulation input','YesNo'),
79
('CircAutocompl','1',NULL,'If ON, autocompletion is enabled for the Circulation input','YesNo'),
77
('CircAutoPrintQuickSlip','1',NULL,'Choose what should happen when an empty barcode field is submitted in circulation: Display a print quick slip window or Clear the screen.','YesNo'),
80
('CircAutoPrintQuickSlip','1',NULL,'Choose what should happen when an empty barcode field is submitted in circulation: Display a print quick slip window or Clear the screen.','YesNo'),
(-)a/installer/data/mysql/updatedatabase.pl (+8 lines)
Lines 6651-6656 if ( CheckVersion($DBversion) ) { Link Here
6651
    ");
6651
    ");
6652
6652
6653
    print "Upgrade to $DBversion done (Bug 7804: Added plugin system.)\n";
6653
    print "Upgrade to $DBversion done (Bug 7804: Added plugin system.)\n";
6654
}
6655
6656
$DBversion = '3.11.00.XXX';
6657
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
6658
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CatalogingValidation', '0','Active cataloging validation',NULL,'YesNo');");
6659
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CatalogingValidationFramework','','Cataloging validation framework',NULL,'long');");
6660
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CatalogingValidationUsers', '','Cataloging validation users',NULL,'long');");
6661
    print "Upgrade to $DBversion done (Bug 9163 - Cataloguing validation workflow)\n";
6654
    SetVersion($DBversion);
6662
    SetVersion($DBversion);
6655
}
6663
}
6656
6664
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (-1 / +18 lines)
Lines 176-178 Cataloging: Link Here
176
            - pref: NotesBlacklist
176
            - pref: NotesBlacklist
177
              class: multi
177
              class: multi
178
            - note fields in title notes separator (OPAC record details) and in the description separator (Staff client record details). The fields should appear separated with commas and according with the Koha MARC format (eg 3.. for UNIMARC, 5.. for MARC21)
178
            - note fields in title notes separator (OPAC record details) and in the description separator (Staff client record details). The fields should appear separated with commas and according with the Koha MARC format (eg 3.. for UNIMARC, 5.. for MARC21)
179
- 
179
    Validation:
180
        -
181
            - pref: CatalogingValidation
182
              choices:
183
                  yes: Use
184
                  no: "Don't use"
185
            - "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 />"
186
            - "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."
187
        -
188
            - "Code of the validation framework:"
189
            - pref: CatalogingValidationFramework
190
              class: long
191
            - "<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."
192
        -
193
            - "The following users (list comma separated) will have access to validation framework:"
194
            - pref: CatalogingValidationUsers
195
              class: long
196
            - "<br />NOTE:<br /> - CatalogingValidation needs to be on."

Return to bug 9163