[Koha-patches] [PATCH] DB updates for bug-2170

Mason James mason.loves.sushi at gmail.com
Tue May 27 20:28:53 CEST 2008


---
 installer/data/mysql/en/mandatory/userflags.sql    |    3 ++-
 .../data/mysql/fr-FR/1-Obligatoire/userflags.sql   |    2 ++
 installer/data/mysql/updatedatabase.pl             |   13 +++++++++++++
 kohaversion.pl                                     |    2 +-
 4 files changed, 18 insertions(+), 2 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..7cb78f6 100755
--- a/installer/data/mysql/fr-FR/1-Obligatoire/userflags.sql
+++ b/installer/data/mysql/fr-FR/1-Obligatoire/userflags.sql
@@ -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,'edititems','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 d904e7e..c01ba1e 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -1603,6 +1603,19 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
 	SetVersion ($DBversion);
 }
 
+
+$DBversion = "3.00.00.087";
+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 c284f4b..9ab4c2c 100644
--- a/kohaversion.pl
+++ b/kohaversion.pl
@@ -10,7 +10,7 @@
 use strict;
 
 sub kohaversion {
-    our $VERSION = "3.00.00.086";
+    our $VERSION = "3.00.00.087";
     # 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