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;
24
use CGI;
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 736-746 my $fa_branch = $input->param('branch'); Link Here
736
my $fa_stickyduedate      = $input->param('stickyduedate');
736
my $fa_stickyduedate      = $input->param('stickyduedate');
737
my $fa_duedatespec        = $input->param('duedatespec');
737
my $fa_duedatespec        = $input->param('duedatespec');
738
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
739
# getting validation variables
745
my $validation = C4::Context->preference('CatalogingValidation');
740
my $validation = C4::Context->preference('CatalogingValidation');
746
my $validationframework = C4::Context->preference('CatalogingValidationFramework');
741
my $validationframework = C4::Context->preference('CatalogingValidationFramework');
Lines 766-774 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
766
    }
761
    }
767
);
762
);
768
763
764
my $uid = GetMember( borrowernumber => $loggedinuser )->{userid} if ($loggedinuser);
765
my $validationpermission = haspermission($uid,  {'editcatalogue' => 'cataloging_validation_framework'});
766
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
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
770
# Avoid users to user validation framework adding the code to the URL
768
# Avoid users to user validation framework adding the code to the URL
771
$frameworkcode = '' if ($validation && ($frameworkcode eq $validationframework && !$validationusers{$userid}));
769
$frameworkcode = '' if ($validation && ($frameworkcode eq $validationframework && !$validationpermission));
772
770
773
if ($frameworkcode eq 'FA'){
771
if ($frameworkcode eq 'FA'){
774
    # 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
Lines 795-801 foreach my $thisframeworkcode ( keys %$frameworks ) { Link Here
795
		}
793
		}
796
    # Add the framework code if validation is off.
794
    # 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
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
798
    if (!$validation || ($validation && ($thisframeworkcode ne $validationframework || ($thisframeworkcode eq $validationframework && $validationusers{$userid})))) {
796
    if (!$validation || ($validation && ($thisframeworkcode ne $validationframework || ($thisframeworkcode eq $validationframework && $validationpermission)))) {
799
        push @frameworkcodeloop, \%row;
797
        push @frameworkcodeloop, \%row;
800
    }
798
    }
801
} 
799
} 
(-)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;
29
use CGI;
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/de-DE/mandatory/userpermissions.sql (+1 lines)
Lines 9-14 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
9
   ( 9, 'edit_catalogue', 'Katalogdaten bearbeiten (Titel- und Exemplardaten ändern)'),
9
   ( 9, 'edit_catalogue', 'Katalogdaten bearbeiten (Titel- und Exemplardaten ändern)'),
10
   ( 9, 'fast_cataloging', 'Schnellaufnahmen anlegen'),
10
   ( 9, 'fast_cataloging', 'Schnellaufnahmen anlegen'),
11
   ( 9, 'edit_items', 'Exemplare bearbeiten'),
11
   ( 9, 'edit_items', 'Exemplare bearbeiten'),
12
   ( 9, 'cataloging_validation_framework', 'Access to the cataloguing validation framework'),
12
   (11, 'vendors_manage', 'Lieferanten verwalten'),
13
   (11, 'vendors_manage', 'Lieferanten verwalten'),
13
   (11, 'contracts_manage', 'Vereinbarungen verwalten'),
14
   (11, 'contracts_manage', 'Vereinbarungen verwalten'),
14
   (11, 'period_manage', 'Etats verwalten'),
15
   (11, 'period_manage', 'Etats verwalten'),
(-)a/installer/data/mysql/en/mandatory/userpermissions.sql (+1 lines)
Lines 9-14 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
9
   ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'),
9
   ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'),
10
   ( 9, 'fast_cataloging', 'Fast cataloging'),
10
   ( 9, 'fast_cataloging', 'Fast cataloging'),
11
   ( 9, 'edit_items', 'Edit Items'),
11
   ( 9, 'edit_items', 'Edit Items'),
12
   ( 9, 'cataloging_validation_framework', 'Access to the cataloguing validation framework'),
12
   (11, 'vendors_manage', 'Manage vendors'),
13
   (11, 'vendors_manage', 'Manage vendors'),
13
   (11, 'contracts_manage', 'Manage contracts'),
14
   (11, 'contracts_manage', 'Manage contracts'),
14
   (11, 'period_manage', 'Manage periods'),
15
   (11, 'period_manage', 'Manage periods'),
(-)a/installer/data/mysql/es-ES/mandatory/userpermissions.sql (+1 lines)
Lines 9-14 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
9
   ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'),
9
   ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'),
10
   ( 9, 'fast_cataloging', 'Fast cataloging'),
10
   ( 9, 'fast_cataloging', 'Fast cataloging'),
11
   ( 9, 'edit_items', 'Edit Items'),
11
   ( 9, 'edit_items', 'Edit Items'),
12
   ( 9, 'cataloging_validation_framework', 'Access to the cataloguing validation framework'),
12
   (11, 'vendors_manage', 'Manage vendors'),
13
   (11, 'vendors_manage', 'Manage vendors'),
13
   (11, 'contracts_manage', 'Manage contracts'),
14
   (11, 'contracts_manage', 'Manage contracts'),
14
   (11, 'period_manage', 'Manage periods'),
15
   (11, 'period_manage', 'Manage periods'),
(-)a/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql (+1 lines)
Lines 9-14 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
9
   ( 9, 'edit_catalogue', 'Ajouter et modifier des notices au catalogue'),
9
   ( 9, 'edit_catalogue', 'Ajouter et modifier des notices au catalogue'),
10
   ( 9, 'fast_cataloging', 'Catalogage rapide'),
10
   ( 9, 'fast_cataloging', 'Catalogage rapide'),
11
   ( 9, 'edit_items', 'Modifier des exemplaires'),
11
   ( 9, 'edit_items', 'Modifier des exemplaires'),
12
   ( 9, 'cataloging_validation_framework', 'Access to the cataloguing validation framework'),
12
   (13, 'edit_news', 'Ecrire des nouvelles pour l''OPAC et l''interface professionnelle'),
13
   (13, 'edit_news', 'Ecrire des nouvelles pour l''OPAC et l''interface professionnelle'),
13
   (13, 'label_creator', 'Créer des étiquettes à partir des données du catalogues et des adhérents'),
14
   (13, 'label_creator', 'Créer des étiquettes à partir des données du catalogues et des adhérents'),
14
   (13, 'edit_calendar', 'Définir les jours de fermeture de la bibliothèque'),
15
   (13, 'edit_calendar', 'Définir les jours de fermeture de la bibliothèque'),
(-)a/installer/data/mysql/it-IT/necessari/userpermissions.sql (+1 lines)
Lines 11-16 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
11
   ( 9, 'edit_catalogue', 'Cataloga (crea/modifica dati bibliografici e di copia)'),
11
   ( 9, 'edit_catalogue', 'Cataloga (crea/modifica dati bibliografici e di copia)'),
12
   ( 9, 'fast_cataloging', 'Catalogazione veloce'),
12
   ( 9, 'fast_cataloging', 'Catalogazione veloce'),
13
   ( 9, 'edit_items', 'Crea/modifica copie'),
13
   ( 9, 'edit_items', 'Crea/modifica copie'),
14
   ( 9, 'cataloging_validation_framework', 'Access to the cataloguing validation framework'),
14
   (11, 'vendors_manage', 'Crea/modifica fornitori'),
15
   (11, 'vendors_manage', 'Crea/modifica fornitori'),
15
   (11, 'contracts_manage', 'Crea/modifica contratti'),
16
   (11, 'contracts_manage', 'Crea/modifica contratti'),
16
   (11, 'period_manage', 'Gestisci scadenze budgets'),
17
   (11, 'period_manage', 'Gestisci scadenze budgets'),
(-)a/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql (+1 lines)
Lines 29-34 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
29
   ( 9, 'edit_catalogue', 'Endre katalogen (Endre bibliografiske poster og eksemplaropplysninger)'),
29
   ( 9, 'edit_catalogue', 'Endre katalogen (Endre bibliografiske poster og eksemplaropplysninger)'),
30
   ( 9, 'fast_cataloging', 'Hurtigkatalogisering'),
30
   ( 9, 'fast_cataloging', 'Hurtigkatalogisering'),
31
   ( 9, 'edit_items', 'Endre eksmeplarer'),
31
   ( 9, 'edit_items', 'Endre eksmeplarer'),
32
   ( 9, 'cataloging_validation_framework', 'Access to the cataloguing validation framework'),
32
   (11, 'vendors_manage', 'Administrere leverandører'),
33
   (11, 'vendors_manage', 'Administrere leverandører'),
33
   (11, 'contracts_manage', 'Administrere kontrakter'),
34
   (11, 'contracts_manage', 'Administrere kontrakter'),
34
   (11, 'period_manage', 'Administrere perioder'),
35
   (11, 'period_manage', 'Administrere perioder'),
(-)a/installer/data/mysql/pl-PL/mandatory/userpermissions.sql (+1 lines)
Lines 9-14 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
9
   ( 9, 'edit_catalogue', 'Edit catalogue'),
9
   ( 9, 'edit_catalogue', 'Edit catalogue'),
10
   ( 9, 'fast_cataloging', 'Szybkie katalogowanie'),
10
   ( 9, 'fast_cataloging', 'Szybkie katalogowanie'),
11
   ( 9, 'edit_items', 'Edit Items'),
11
   ( 9, 'edit_items', 'Edit Items'),
12
   ( 9, 'cataloging_validation_framework', 'Access to the cataloguing validation framework'),
12
   (11, 'vendors_manage', 'Zarządzanei dostawcami'),
13
   (11, 'vendors_manage', 'Zarządzanei dostawcami'),
13
   (11, 'contracts_manage', 'Zarządzanie kontraktami'),
14
   (11, 'contracts_manage', 'Zarządzanie kontraktami'),
14
   (11, 'period_manage', 'Manage periods'),
15
   (11, 'period_manage', 'Manage periods'),
(-)a/installer/data/mysql/sysprefs.sql (-1 lines)
Lines 74-80 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
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');
75
('CatalogingValidation','0',NULL,'Active cataloging validation','YesNo');
76
('CatalogingValidationFramework','',NULL,'Cataloging validation framework','long');
76
('CatalogingValidationFramework','',NULL,'Cataloging validation framework','long');
77
('CatalogingValidationUsers','',NULL,'Cataloging validation users','long');
78
('checkdigit','none','none|katipo','If ON, enable checks on patron cardnumber: none or \"Katipo\" style checks','Choice'),
77
('checkdigit','none','none|katipo','If ON, enable checks on patron cardnumber: none or \"Katipo\" style checks','Choice'),
79
('CircAutocompl','1',NULL,'If ON, autocompletion is enabled for the Circulation input','YesNo'),
78
('CircAutocompl','1',NULL,'If ON, autocompletion is enabled for the Circulation input','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'),
79
('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 (-1 / +1 lines)
Lines 6657-6663 $DBversion = '3.11.00.XXX'; Link Here
6657
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
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');");
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');");
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');");
6660
    $dbh->do("INSERT INTO permissions (module_bit, code, description) VALUES ( 9, 'cataloging_validation_framework', 'Access to the cataloguing validation framework');");
6661
    print "Upgrade to $DBversion done (Bug 9163 - Cataloguing validation workflow)\n";
6661
    print "Upgrade to $DBversion done (Bug 9163 - Cataloguing validation workflow)\n";
6662
    SetVersion($DBversion);
6662
    SetVersion($DBversion);
6663
}
6663
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (-6 lines)
Lines 189-196 Cataloging: Link Here
189
            - pref: CatalogingValidationFramework
189
            - pref: CatalogingValidationFramework
190
              class: long
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."
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."
197
- 

Return to bug 9163