From eeaf59a31ff33ec505fe86a3ef7278aed1733e25 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 7 Mar 2019 20:40:53 +0000 Subject: [PATCH] Bug 15774: DBRev 18.12.00.022 Signed-off-by: Nick Clemens --- Koha.pm | 2 +- ...774_add_additional_fields_permissions.perl | 18 ------------------ installer/data/mysql/updatedatabase.pl | 19 +++++++++++++++++++ 3 files changed, 20 insertions(+), 19 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/Bug_15774_add_additional_fields_permissions.perl diff --git a/Koha.pm b/Koha.pm index b9bd67ed72..e26aab8654 100644 --- a/Koha.pm +++ b/Koha.pm @@ -29,7 +29,7 @@ use vars qw{ $VERSION }; # - #4 : the developer version. The 4th number is the database subversion. # used by developers when the database changes. updatedatabase take care of the changes itself # and is automatically called by Auth.pm when needed. -$VERSION = "18.12.00.021"; +$VERSION = "18.12.00.022"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/Bug_15774_add_additional_fields_permissions.perl b/installer/data/mysql/atomicupdate/Bug_15774_add_additional_fields_permissions.perl deleted file mode 100644 index 314bfdc67a..0000000000 --- a/installer/data/mysql/atomicupdate/Bug_15774_add_additional_fields_permissions.perl +++ /dev/null @@ -1,18 +0,0 @@ -$DBversion = 'XXX'; -if( CheckVersion( $DBversion ) ) { - $dbh->do( q{ - INSERT IGNORE INTO permissions (module_bit,code,description) - VALUES - (3,'manage_additional_fields','Add, edit, or delete additional custom fields for baskets or subscriptions (also requires order_manage or edit_subscription permissions)') - }); - $dbh->do( q{ - INSERT INTO user_permissions (borrowernumber, module_bit, code) - SELECT borrowernumber, 3, 'manage_additional_fields' FROM borrowers WHERE borrowernumber IN (SELECT DISTINCT borrowernumber FROM user_permissions WHERE code = 'order_manage' OR code = 'edit_subscription'); - }); - $dbh->do( q{ - INSERT INTO user_permissions (borrowernumber, module_bit, code) - SELECT borrowernumber, 3, 'manage_additional_fields' FROM borrowers WHERE borrowernumber IN (SELECT borrowernumber FROM borrowers WHERE MOD(flags DIV POWER(2,11),2)=1 OR MOD(flags DIV POWER(2,15),2) =1); - }); - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug 15774 - Add permission for managing additional fields)\n"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 87db4ade79..b522311074 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -17571,6 +17571,25 @@ if ( CheckVersion($DBversion) ) { print "Upgrade to $DBversion done (Bug 20912 - Support granular rental charges)\n"; } +$DBversion = '18.12.00.022'; +if( CheckVersion( $DBversion ) ) { + $dbh->do( q{ + INSERT IGNORE INTO permissions (module_bit,code,description) + VALUES + (3,'manage_additional_fields','Add, edit, or delete additional custom fields for baskets or subscriptions (also requires order_manage or edit_subscription permissions)') + }); + $dbh->do( q{ + INSERT INTO user_permissions (borrowernumber, module_bit, code) + SELECT borrowernumber, 3, 'manage_additional_fields' FROM borrowers WHERE borrowernumber IN (SELECT DISTINCT borrowernumber FROM user_permissions WHERE code = 'order_manage' OR code = 'edit_subscription'); + }); + $dbh->do( q{ + INSERT INTO user_permissions (borrowernumber, module_bit, code) + SELECT borrowernumber, 3, 'manage_additional_fields' FROM borrowers WHERE borrowernumber IN (SELECT borrowernumber FROM borrowers WHERE MOD(flags DIV POWER(2,11),2)=1 OR MOD(flags DIV POWER(2,15),2) =1); + }); + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 15774 - Add permission for managing additional fields)\n"; +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 2.39.5