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 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")){
(-)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 419-421 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' Link Here
419
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('FinesIncludeGracePeriod','1','If enabled, fines calculations will include the grace period.',NULL,'YesNo');
419
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('FinesIncludeGracePeriod','1','If enabled, fines calculations will include the grace period.',NULL,'YesNo');
420
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('UNIMARCAuthorsFacetsSeparator',', ', 'UNIMARC authors facets separator', NULL, 'short');
420
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('UNIMARCAuthorsFacetsSeparator',', ', 'UNIMARC authors facets separator', NULL, 'short');
421
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UseKohaPlugins','1','Enable or disable the ability to use Koha Plugins.','','YesNo');
421
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UseKohaPlugins','1','Enable or disable the ability to use Koha Plugins.','','YesNo');
422
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CatalogingValidation', '0','Active cataloging validation',NULL,'YesNo');
423
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CatalogingValidationFramework','','Cataloging validation framework',NULL,'long');
424
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CatalogingValidationUsers', '','Cataloging validation users',NULL,'long');
(-)a/installer/data/mysql/updatedatabase.pl (+6 lines)
Lines 6652-6657 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
6652
    ");
6652
    ");
6653
6653
6654
    print "Upgrade to $DBversion done (Bug 7804: Added plugin system.)\n";
6654
    print "Upgrade to $DBversion done (Bug 7804: Added plugin system.)\n";
6655
$DBversion = '3.11.00.XXX';
6656
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
6657
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CatalogingValidation', '0','Active cataloging validation',NULL,'YesNo');");
6658
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CatalogingValidationFramework','','Cataloging validation framework',NULL,'long');");
6659
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CatalogingValidationUsers', '','Cataloging validation users',NULL,'long');");
6660
    print "Upgrade to $DBversion done (Bug 9163 - Cataloguing validation workflow)\n";
6655
    SetVersion($DBversion);
6661
    SetVersion($DBversion);
6656
}
6662
}
6657
6663
(-)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