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 735-745 my $fa_branch = $input->param('branch'); Link Here
735
my $fa_stickyduedate      = $input->param('stickyduedate');
735
my $fa_stickyduedate      = $input->param('stickyduedate');
736
my $fa_duedatespec        = $input->param('duedatespec');
736
my $fa_duedatespec        = $input->param('duedatespec');
737
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
738
# getting validation variables
744
my $validation = C4::Context->preference('CatalogingValidation');
739
my $validation = C4::Context->preference('CatalogingValidation');
745
my $validationframework = C4::Context->preference('CatalogingValidationFramework');
740
my $validationframework = C4::Context->preference('CatalogingValidationFramework');
Lines 764-772 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
764
    }
759
    }
765
);
760
);
766
761
762
my $uid = GetMember( borrowernumber => $loggedinuser )->{userid} if ($loggedinuser);
763
my $validationpermission = haspermission($uid,  {'editcatalogue' => 'cataloging_validation_framework'});
764
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
765
# 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
766
# Avoid users to user validation framework adding the code to the URL
769
$frameworkcode = '' if ($validation && ($frameworkcode eq $validationframework && !$validationusers{$userid}));
767
$frameworkcode = '' if ($validation && ($frameworkcode eq $validationframework && !$validationpermission));
770
768
771
if ($frameworkcode eq 'FA'){
769
if ($frameworkcode eq 'FA'){
772
    # We need to grab and set some variables in the template for use on the additems screen
770
    # We need to grab and set some variables in the template for use on the additems screen
Lines 793-799 foreach my $thisframeworkcode ( keys %$frameworks ) { Link Here
793
		}
791
		}
794
    # Add the framework code if validation is off.
792
    # 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
793
    # 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})))) {
794
    if (!$validation || ($validation && ($thisframeworkcode ne $validationframework || ($thisframeworkcode eq $validationframework && $validationpermission)))) {
797
        push @frameworkcodeloop, \%row;
795
        push @frameworkcodeloop, \%row;
798
    }
796
    }
799
} 
797
} 
(-)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 421-424 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( Link Here
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');
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');
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 (-1 / +1 lines)
Lines 6656-6662 $DBversion = '3.11.00.XXX'; Link Here
6656
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
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');");
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');");
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');");
6659
    $dbh->do("INSERT INTO permissions (module_bit, code, description) VALUES ( 9, 'cataloging_validation_framework', 'Access to the cataloguing validation framework');");
6660
    print "Upgrade to $DBversion done (Bug 9163 - Cataloguing validation workflow)\n";
6660
    print "Upgrade to $DBversion done (Bug 9163 - Cataloguing validation workflow)\n";
6661
    SetVersion($DBversion);
6661
    SetVersion($DBversion);
6662
}
6662
}
(-)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