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

(-)a/cataloguing/addbiblio.pl (-10 / +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 719-733 my $dbh = C4::Context->dbh; Link Here
719
my $hostbiblionumber = $input->param('hostbiblionumber');
719
my $hostbiblionumber = $input->param('hostbiblionumber');
720
my $hostitemnumber = $input->param('hostitemnumber');
720
my $hostitemnumber = $input->param('hostitemnumber');
721
721
722
# getting userID
723
my $sessionID = $input->cookie("CGISESSID") ;
724
my $session = get_session($sessionID);
725
my $userid = $session->param('id');
726
727
# getting validation variables
722
# getting validation variables
728
my $validation = C4::Context->preference('CatalogingValidation');
723
my $validation = C4::Context->preference('CatalogingValidation');
729
my $validationframework = C4::Context->preference('CatalogingValidationFramework');
724
my $validationframework = C4::Context->preference('CatalogingValidationFramework');
730
my %validationusers = map { $_ => 1 } split(/,/,C4::Context->preference('CatalogingValidationUsers'));
731
 
725
 
732
my $userflags = 'edit_catalogue';
726
my $userflags = 'edit_catalogue';
733
if ($frameworkcode eq 'FA'){
727
if ($frameworkcode eq 'FA'){
Lines 748-756 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
748
    }
742
    }
749
);
743
);
750
744
745
my $uid = GetMember( borrowernumber => $loggedinuser )->{userid} if ($loggedinuser);
746
my $validationpermission = haspermission($uid,  {'editcatalogue' => 'cataloging_validation_framework'});
747
751
# 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
748
# 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
752
# Avoid users to user validation framework adding the code to the URL
749
# Avoid users to user validation framework adding the code to the URL
753
$frameworkcode = '' if ($validation && ($frameworkcode eq $validationframework && !$validationusers{$userid}));
750
$frameworkcode = '' if ($validation && ($frameworkcode eq $validationframework && !$validationpermission));
754
751
755
if ($frameworkcode eq 'FA'){
752
if ($frameworkcode eq 'FA'){
756
    # We need to grab and set some variables in the template for use on the additems screen
753
    # We need to grab and set some variables in the template for use on the additems screen
Lines 775-781 foreach my $thisframeworkcode ( keys %$frameworks ) { Link Here
775
		}
772
		}
776
	# Add the framework code if validation is off.
773
	# Add the framework code if validation is off.
777
	# 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
774
	# 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
778
	if (!$validation || ($validation && ($thisframeworkcode ne $validationframework || ($thisframeworkcode eq $validationframework && $validationusers{$userid})))) {
775
	if (!$validation || ($validation && ($thisframeworkcode ne $validationframework || ($thisframeworkcode eq $validationframework && $validationpermission)))) {
779
		push @frameworkcodeloop, \%row;
776
		push @frameworkcodeloop, \%row;
780
	}
777
	}
781
} 
778
} 
(-)a/cataloguing/addbooks.pl (-9 / +6 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-77 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 {$frameworks->{$a} cmp $frameworks->{$b}}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'},
(-)a/installer/data/mysql/de-DE/mandatory/userpermissions.sql (+1 lines)
Lines 8-13 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
8
   ( 9, 'edit_catalogue', 'Katalogdaten bearbeiten (Titel- und Exemplardaten ändern)'),
8
   ( 9, 'edit_catalogue', 'Katalogdaten bearbeiten (Titel- und Exemplardaten ändern)'),
9
   ( 9, 'fast_cataloging', 'Schnellaufnahmen anlegen'),
9
   ( 9, 'fast_cataloging', 'Schnellaufnahmen anlegen'),
10
   ( 9, 'edit_items', 'Exemplare bearbeiten'),
10
   ( 9, 'edit_items', 'Exemplare bearbeiten'),
11
   ( 9, 'cataloging_validation_framework', 'Access to the cataloguing validation framework'),
11
   (11, 'vendors_manage', 'Lieferanten verwalten'),
12
   (11, 'vendors_manage', 'Lieferanten verwalten'),
12
   (11, 'contracts_manage', 'Vereinbarungen verwalten'),
13
   (11, 'contracts_manage', 'Vereinbarungen verwalten'),
13
   (11, 'period_manage', 'Etats verwalten'),
14
   (11, 'period_manage', 'Etats verwalten'),
(-)a/installer/data/mysql/en/mandatory/userpermissions.sql (+1 lines)
Lines 8-13 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
8
   ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'),
8
   ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'),
9
   ( 9, 'fast_cataloging', 'Fast cataloging'),
9
   ( 9, 'fast_cataloging', 'Fast cataloging'),
10
   ( 9, 'edit_items', 'Edit Items'),
10
   ( 9, 'edit_items', 'Edit Items'),
11
   ( 9, 'cataloging_validation_framework', 'Access to the cataloguing validation framework'),
11
   (11, 'vendors_manage', 'Manage vendors'),
12
   (11, 'vendors_manage', 'Manage vendors'),
12
   (11, 'contracts_manage', 'Manage contracts'),
13
   (11, 'contracts_manage', 'Manage contracts'),
13
   (11, 'period_manage', 'Manage periods'),
14
   (11, 'period_manage', 'Manage periods'),
(-)a/installer/data/mysql/es-ES/mandatory/userpermissions.sql (+1 lines)
Lines 8-13 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
8
   ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'),
8
   ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'),
9
   ( 9, 'fast_cataloging', 'Fast cataloging'),
9
   ( 9, 'fast_cataloging', 'Fast cataloging'),
10
   ( 9, 'edit_items', 'Edit Items'),
10
   ( 9, 'edit_items', 'Edit Items'),
11
   ( 9, 'cataloging_validation_framework', 'Access to the cataloguing validation framework'),
11
   (11, 'vendors_manage', 'Manage vendors'),
12
   (11, 'vendors_manage', 'Manage vendors'),
12
   (11, 'contracts_manage', 'Manage contracts'),
13
   (11, 'contracts_manage', 'Manage contracts'),
13
   (11, 'period_manage', 'Manage periods'),
14
   (11, 'period_manage', 'Manage periods'),
(-)a/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql (+1 lines)
Lines 8-13 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
8
   ( 9, 'edit_catalogue', 'Ajouter et modifier des notices au catalogue'),
8
   ( 9, 'edit_catalogue', 'Ajouter et modifier des notices au catalogue'),
9
   ( 9, 'fast_cataloging', 'Catalogage rapide'),
9
   ( 9, 'fast_cataloging', 'Catalogage rapide'),
10
   ( 9, 'edit_items', 'Modifier des exemplaires'),
10
   ( 9, 'edit_items', 'Modifier des exemplaires'),
11
   ( 9, 'cataloging_validation_framework', 'Access to the cataloguing validation framework'),
11
   (13, 'edit_news', 'Ecrire des nouvelles pour l''OPAC et l''interface professionnelle'),
12
   (13, 'edit_news', 'Ecrire des nouvelles pour l''OPAC et l''interface professionnelle'),
12
   (13, 'label_creator', 'Créer des étiquettes à partir des données du catalogues et des adhérents'),
13
   (13, 'label_creator', 'Créer des étiquettes à partir des données du catalogues et des adhérents'),
13
   (13, 'edit_calendar', 'Définir les jours de fermeture de la bibliothèque'),
14
   (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 10-15 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
10
   ( 9, 'edit_catalogue', 'Cataloga (crea/modifica dati bibliografici e di copia)'),
10
   ( 9, 'edit_catalogue', 'Cataloga (crea/modifica dati bibliografici e di copia)'),
11
   ( 9, 'fast_cataloging', 'Catalogazione veloce'),
11
   ( 9, 'fast_cataloging', 'Catalogazione veloce'),
12
   ( 9, 'edit_items', 'Crea/modifica copie'),
12
   ( 9, 'edit_items', 'Crea/modifica copie'),
13
   ( 9, 'cataloging_validation_framework', 'Access to the cataloguing validation framework'),
13
   (11, 'vendors_manage', 'Crea/modifica fornitori'),
14
   (11, 'vendors_manage', 'Crea/modifica fornitori'),
14
   (11, 'contracts_manage', 'Crea/modifica contratti'),
15
   (11, 'contracts_manage', 'Crea/modifica contratti'),
15
   (11, 'period_manage', 'Gestisci scadenze budgets'),
16
   (11, 'period_manage', 'Gestisci scadenze budgets'),
(-)a/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql (+1 lines)
Lines 28-33 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
28
   ( 9, 'edit_catalogue', 'Endre katalogen (Endre bibliografiske poster og eksemplaropplysninger)'),
28
   ( 9, 'edit_catalogue', 'Endre katalogen (Endre bibliografiske poster og eksemplaropplysninger)'),
29
   ( 9, 'fast_cataloging', 'Hurtigkatalogisering'),
29
   ( 9, 'fast_cataloging', 'Hurtigkatalogisering'),
30
   ( 9, 'edit_items', 'Endre eksmeplarer'),
30
   ( 9, 'edit_items', 'Endre eksmeplarer'),
31
   ( 9, 'cataloging_validation_framework', 'Access to the cataloguing validation framework'),
31
   (11, 'vendors_manage', 'Administrere leverandører'),
32
   (11, 'vendors_manage', 'Administrere leverandører'),
32
   (11, 'contracts_manage', 'Administrere kontrakter'),
33
   (11, 'contracts_manage', 'Administrere kontrakter'),
33
   (11, 'period_manage', 'Administrere perioder'),
34
   (11, 'period_manage', 'Administrere perioder'),
(-)a/installer/data/mysql/pl-PL/mandatory/userpermissions.sql (+1 lines)
Lines 8-13 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
8
   ( 9, 'edit_catalogue', 'Edit catalogue'),
8
   ( 9, 'edit_catalogue', 'Edit catalogue'),
9
   ( 9, 'fast_cataloging', 'Szybkie katalogowanie'),
9
   ( 9, 'fast_cataloging', 'Szybkie katalogowanie'),
10
   ( 9, 'edit_items', 'Edit Items'),
10
   ( 9, 'edit_items', 'Edit Items'),
11
   ( 9, 'cataloging_validation_framework', 'Access to the cataloguing validation framework'),
11
   (11, 'vendors_manage', 'Zarządzanei dostawcami'),
12
   (11, 'vendors_manage', 'Zarządzanei dostawcami'),
12
   (11, 'contracts_manage', 'Zarządzanie kontraktami'),
13
   (11, 'contracts_manage', 'Zarządzanie kontraktami'),
13
   (11, 'period_manage', 'Manage periods'),
14
   (11, 'period_manage', 'Manage periods'),
(-)a/installer/data/mysql/sysprefs.sql (-1 lines)
Lines 389-392 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' Link Here
389
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z','Alphabet than can be expanded into browse links, e.g. on Home > Patrons',NULL,'free');
389
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z','Alphabet than can be expanded into browse links, e.g. on Home > Patrons',NULL,'free');
390
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CatalogingValidation', '0','Active cataloging validation',NULL,'YesNo');
390
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CatalogingValidation', '0','Active cataloging validation',NULL,'YesNo');
391
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CatalogingValidationFramework','','Cataloging validation framework',NULL,'long');
391
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CatalogingValidationFramework','','Cataloging validation framework',NULL,'long');
392
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 6087-6093 $DBversion = "XXX"; Link Here
6087
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
6087
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
6088
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CatalogingValidation', '0','Active cataloging validation',NULL,'YesNo');");
6088
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CatalogingValidation', '0','Active cataloging validation',NULL,'YesNo');");
6089
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CatalogingValidationFramework','','Cataloging validation framework',NULL,'long');");
6089
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CatalogingValidationFramework','','Cataloging validation framework',NULL,'long');");
6090
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CatalogingValidationUsers', '','Cataloging validation users',NULL,'long');");
6090
    $dbh->do("INSERT INTO permissions (module_bit, code, description) VALUES ( 9, 'cataloging_validation_framework', 'Access to the cataloguing validation framework');");
6091
    print "Upgrade to $DBversion done (Bug 9163 - Cataloguing validation workflow)\n";
6091
    print "Upgrade to $DBversion done (Bug 9163 - Cataloguing validation workflow)\n";
6092
    SetVersion($DBversion);
6092
    SetVersion($DBversion);
6093
}
6093
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (-6 lines)
Lines 169-176 Cataloging: Link Here
169
            - pref: CatalogingValidationFramework
169
            - pref: CatalogingValidationFramework
170
              class: long
170
              class: long
171
            - "<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."
171
            - "<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."
172
        -
173
            - "The following users (list comma separated) will have access to validation framework:"
174
            - pref: CatalogingValidationUsers
175
              class: long
176
            - "<br />NOTE:<br /> - CatalogingValidation needs to be on."
177
- 

Return to bug 9163