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

(-)a/cataloguing/addbiblio.pl (-9 / +7 lines)
Lines 22-30 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::Members;
26
use C4::Output;
26
use C4::Output;
27
use C4::Auth qw/:DEFAULT get_session/;
27
use C4::Auth;
28
use C4::Biblio;
28
use C4::Biblio;
29
use C4::Search;
29
use C4::Search;
30
use C4::AuthoritiesMarc;
30
use C4::AuthoritiesMarc;
Lines 710-720 my $fa_branch = $input->param('branch'); Link Here
710
my $fa_stickyduedate      = $input->param('stickyduedate');
710
my $fa_stickyduedate      = $input->param('stickyduedate');
711
my $fa_duedatespec        = $input->param('duedatespec');
711
my $fa_duedatespec        = $input->param('duedatespec');
712
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
713
# getting validation variables
719
my $validation = C4::Context->preference('CatalogingValidation');
714
my $validation = C4::Context->preference('CatalogingValidation');
720
my $validationframework = C4::Context->preference('CatalogingValidationFramework');
715
my $validationframework = C4::Context->preference('CatalogingValidationFramework');
Lines 741-749 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
741
    }
736
    }
742
);
737
);
743
738
739
my $uid = GetMember( borrowernumber => $loggedinuser )->{userid} if ($loggedinuser);
740
my $validationpermission = haspermission($uid,  {'editcatalogue' => 'cataloging_validation_framework'});
741
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
742
# 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
743
# Avoid users to user validation framework adding the code to the URL
746
$frameworkcode = '' if ($validation && ($frameworkcode eq $validationframework && !$validationusers{$userid}));
744
$frameworkcode = '' if ($validation && ($frameworkcode eq $validationframework && !$validationpermission));
747
745
748
if ($frameworkcode eq 'FA'){
746
if ($frameworkcode eq 'FA'){
749
    # We need to grab and set some variables in the template for use on the additems screen
747
    # We need to grab and set some variables in the template for use on the additems screen
Lines 776-782 foreach my $thisframeworkcode ( keys %$frameworks ) { Link Here
776
		}
774
		}
777
    # Add the framework code if validation is off.
775
    # 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
776
    # 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})))) {
777
    if (!$validation || ($validation && ($thisframeworkcode ne $validationframework || ($thisframeworkcode eq $validationframework && $validationpermission)))) {
780
        push @frameworkcodeloop, \%row;
778
        push @frameworkcodeloop, \%row;
781
    }
779
    }
782
} 
780
} 
(-)a/cataloguing/addbooks.pl (-14 / +12 lines)
Lines 27-34 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 CGI::Session;
30
use C4::Members;
31
use C4::Auth qw/:DEFAULT get_session/;
31
use C4::Auth;
32
use C4::Biblio;
32
use C4::Biblio;
33
use C4::Breeding;
33
use C4::Breeding;
34
use C4::Output;
34
use C4::Output;
Lines 37-51 use C4::Search; Link Here
37
37
38
my $input = new CGI;
38
my $input = new CGI;
39
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
40
# getting validation variables
46
my $validation = C4::Context->preference('CatalogingValidation');
41
my $validation = C4::Context->preference('CatalogingValidation');
47
my $validationframework = C4::Context->preference('CatalogingValidationFramework');
42
my $validationframework = C4::Context->preference('CatalogingValidationFramework');
48
my %validationusers = map { $_ => 1 } split(/,/,C4::Context->preference('CatalogingValidationUsers'));
49
43
50
my $success = $input->param('biblioitem');
44
my $success = $input->param('biblioitem');
51
my $query   = $input->param('q');
45
my $query   = $input->param('q');
Lines 65-81 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
65
    }
59
    }
66
);
60
);
67
61
62
my $uid = GetMember( borrowernumber => $loggedinuser )->{userid} if ($loggedinuser);
63
my $validationpermission = haspermission($uid,  {'editcatalogue' => 'cataloging_validation_framework'});
64
68
# get framework list
65
# get framework list
69
my $frameworks = getframeworks;
66
my $frameworks = getframeworks;
70
my @frameworkcodeloop;
67
my @frameworkcodeloop;
71
foreach my $thisframeworkcode ( sort { uc($frameworks->{$a}->{'frameworktext'}) cmp uc($frameworks->{$b}->{'frameworktext'}) } keys %{$frameworks} ) {
68
foreach my $thisframeworkcode ( sort {$frameworks->{$a} cmp $frameworks->{$b}}keys %{$frameworks} ) {
72
    # Add the framework code if validation is off.
69
    # 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
70
    # 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})))) {
71
    if (!$validation || ($validation && ($thisframeworkcode ne $validationframework || ($thisframeworkcode eq $validationframework && $validationpermission)))) {
75
    push @frameworkcodeloop, {
72
        push @frameworkcodeloop, {
76
        value         => $thisframeworkcode,
73
            value         => $thisframeworkcode,
77
        frameworktext => $frameworks->{$thisframeworkcode}->{'frameworktext'},
74
            frameworktext => $frameworks->{$thisframeworkcode}->{'frameworktext'},
78
    };
75
        };
76
    }
79
}
77
}
80
78
81
79
(-)a/installer/data/mysql/sysprefs.sql (-1 lines)
Lines 89-95 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
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');
90
('CatalogingValidation','0',NULL,'Active cataloging validation','YesNo');
91
('CatalogingValidationFramework','',NULL,'Cataloging validation framework','long');
91
('CatalogingValidationFramework','',NULL,'Cataloging validation framework','long');
92
('CatalogingValidationUsers','',NULL,'Cataloging validation users','long');
93
('checkdigit','none','none|katipo','If ON, enable checks on patron cardnumber: none or \"Katipo\" style checks','Choice'),
92
('checkdigit','none','none|katipo','If ON, enable checks on patron cardnumber: none or \"Katipo\" style checks','Choice'),
94
('CircAutocompl','1',NULL,'If ON, autocompletion is enabled for the Circulation input','YesNo'),
93
('CircAutocompl','1',NULL,'If ON, autocompletion is enabled for the Circulation input','YesNo'),
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'),
94
('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 (-1 / +1 lines)
Lines 6703-6709 $DBversion = '3.11.00.XXX'; Link Here
6703
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
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');");
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');");
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');");
6706
    $dbh->do("INSERT INTO permissions (module_bit, code, description) VALUES ( 9, 'cataloging_validation_framework', 'Access to the cataloguing validation framework');");
6707
    print "Upgrade to $DBversion done (Bug 9163 - Cataloguing validation workflow)\n";
6707
    print "Upgrade to $DBversion done (Bug 9163 - Cataloguing validation workflow)\n";
6708
    SetVersion($DBversion);
6708
    SetVersion($DBversion);
6709
}
6709
}
(-)a/installer/data/mysql/userpermissions.sql (+1 lines)
Lines 14-19 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
14
   ( 9, 'edit_items', 'Edit items'),
14
   ( 9, 'edit_items', 'Edit items'),
15
   ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'),
15
   ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'),
16
   ( 9, 'delete_all_items', 'Delete all items at once'),
16
   ( 9, 'delete_all_items', 'Delete all items at once'),
17
   ( 9, 'cataloging_validation_framework', 'Access to the cataloguing validation framework'),
17
   (10, 'writeoff', 'Write off fines and fees'),
18
   (10, 'writeoff', 'Write off fines and fees'),
18
   (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'),
19
   (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'),
19
   (11, 'vendors_manage', 'Manage vendors'),
20
   (11, 'vendors_manage', 'Manage vendors'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (-6 lines)
Lines 260-267 Cataloging: Link Here
260
            - pref: CatalogingValidationFramework
260
            - pref: CatalogingValidationFramework
261
              class: long
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."
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."
268
- 

Return to bug 9163