[Koha-patches] [PATCH] added edit-items perm to en/fr userflags.sql, and updatedatabase patch
Mason James
mason.loves.sushi at gmail.com
Thu May 15 15:03:24 CEST 2008
Sorry about sending this one again, the mailer corrupted the french accented characters on my previous attempt to email this in.
---
installer/data/mysql/en/mandatory/userflags.sql | 3 ++-
.../data/mysql/fr-FR/1-Obligatoire/userflags.sql | 4 +++-
installer/data/mysql/updatedatabase.pl | 13 +++++++++++++
kohaversion.pl | 2 +-
4 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/installer/data/mysql/en/mandatory/userflags.sql b/installer/data/mysql/en/mandatory/userflags.sql
index 20b5d9a..15ae657 100644
--- a/installer/data/mysql/en/mandatory/userflags.sql
+++ b/installer/data/mysql/en/mandatory/userflags.sql
@@ -6,7 +6,7 @@ INSERT INTO `userflags` VALUES(4,'borrowers','Add or modify borrowers',0);
INSERT INTO `userflags` VALUES(5,'permissions','Set user permissions',0);
INSERT INTO `userflags` VALUES(6,'reserveforothers','Reserve books for patrons',0);
INSERT INTO `userflags` VALUES(7,'borrow','Borrow books',1);
-INSERT INTO `userflags` VALUES(9,'editcatalogue','Edit Catalogue (Modify bibliographic/holdings data)',0);
+INSERT INTO `userflags` VALUES(9,'editcatalogue','Edit Catalogue (Modify bibliographic-level data)',0);
INSERT INTO `userflags` VALUES(10,'updatecharges','Update borrower charges',0);
INSERT INTO `userflags` VALUES(11,'acquisition','Acquisition and/or suggestion management',0);
INSERT INTO `userflags` VALUES(12,'management','Set library management parameters',0);
@@ -15,3 +15,4 @@ INSERT INTO `userflags` VALUES(14,'editauthorities','allow to edit authorities',
INSERT INTO `userflags` VALUES(15,'serials','allow to manage serials subscriptions',0);
INSERT INTO `userflags` VALUES(16,'reports','allow to access to the reports module',0);
INSERT INTO `userflags` VALUES(17,'staffaccess','Modify login / permissions for staff users',0);
+INSERT INTO `userflags` VALUES(18,'edititems','Edit Items (Modify item-level data)',0);
diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/userflags.sql b/installer/data/mysql/fr-FR/1-Obligatoire/userflags.sql
index 2cd644f..10f3f2f 100755
--- a/installer/data/mysql/fr-FR/1-Obligatoire/userflags.sql
+++ b/installer/data/mysql/fr-FR/1-Obligatoire/userflags.sql
@@ -8,7 +8,7 @@ INSERT INTO `userflags` VALUES(4,'borrowers','Gestion des lecteurs',0);
INSERT INTO `userflags` VALUES(5,'permissions','Définition des habilitations',0);
INSERT INTO `userflags` VALUES(6,'reserveforothers','Gestion des réservations',0);
INSERT INTO `userflags` VALUES(7,'borrow','Circulation (inutile normalement)',1);
-INSERT INTO `userflags` VALUES(9,'editcatalogue','fonctions de catalogage',0);
+INSERT INTO `userflags` VALUES(9,'editcatalogue','Modifier Catalogue (Modifier bibliographiques données au niveau)',0);
INSERT INTO `userflags` VALUES(10,'updatecharges','Gestion des pénalités financières',0);
INSERT INTO `userflags` VALUES(11,'acquisition','Gestion des acquisitions',0);
INSERT INTO `userflags` VALUES(12,'management','Gestion des paramètres (inutile normalement)',0);
@@ -16,3 +16,5 @@ INSERT INTO `userflags` VALUES(13,'tools','Outils (export, import, impression de
INSERT INTO `userflags` VALUES(14,'editauthorities','Gestion des autorités',0);
INSERT INTO `userflags` VALUES(15,'serials','Gestion du module périodique',0);
INSERT INTO `userflags` VALUES(16,'reports','Accès aux statistiques',0);
+INSERT INTO `userflags` VALUES(17,'staffaccess','Modifier login / permissions utilisateurs pour le personnel',0);
+INSERT INTO `userflags` VALUES(18,'editcatalogue','Modifier les objets (Modifier point au niveau des données)',0);
diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index e6a23c4..ae2dfe6 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -19,6 +19,7 @@ use strict;
# CPAN modules
use DBI;
use Getopt::Long;
+
# Koha modules
use C4::Context;
@@ -1556,6 +1557,18 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
SetVersion ($DBversion);
}
+
+
+$DBversion = "3.00.00.084";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("UPDATE userflags set flagdesc = 'Edit Catalogue (Modify bibliographic-level data)' where bit = 10");
+ $dbh->do("INSERT INTO `userflags` VALUES (18,'edititems',' Edit Items (Modify item-level data)',0");
+ $dbh->do("UPDATE borrowers SET flags = flags | POW(2,18)
+ WHERE flags is NOT NULL AND POW(2,9) = (flags & POW(2,9))");
+ print "Upgrade to $DBversion done (Adding 'edittems' staff access permission, And granting existing staff accounts with new perm where applicable)\n";
+ SetVersion ($DBversion);
+}
+
=item DropAllForeignKeys($table)
Drop all foreign keys of the table $table
diff --git a/kohaversion.pl b/kohaversion.pl
index 8b3e02d..f1e6135 100644
--- a/kohaversion.pl
+++ b/kohaversion.pl
@@ -10,7 +10,7 @@
use strict;
sub kohaversion {
- our $VERSION = "3.00.00.083";
+ our $VERSION = "3.00.00.084";
# version needs to be set this way
# so that it can be picked up by Makefile.PL
# during install
--
1.5.4.2
More information about the Koha-patches
mailing list