From ec6b3d18348189461b3d7587cb055394962255b6 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 17 Apr 2019 12:22:45 +0000 Subject: [PATCH] Bug 20128: DBRev 18.12.00.054 Signed-off-by: Nick Clemens --- Koha.pm | 2 +- ...ug20128_add_permission_for_advanced_editor.perl | 16 ---------------- installer/data/mysql/updatedatabase.pl | 17 +++++++++++++++++ 3 files changed, 18 insertions(+), 17 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug20128_add_permission_for_advanced_editor.perl diff --git a/Koha.pm b/Koha.pm index ec82e4d..0523841 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.053"; +$VERSION = "18.12.00.054"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug20128_add_permission_for_advanced_editor.perl b/installer/data/mysql/atomicupdate/bug20128_add_permission_for_advanced_editor.perl deleted file mode 100644 index c383eec..0000000 --- a/installer/data/mysql/atomicupdate/bug20128_add_permission_for_advanced_editor.perl +++ /dev/null @@ -1,16 +0,0 @@ -$DBversion = 'XXX'; -if( CheckVersion( $DBversion ) ) { - $dbh->do(q{ - INSERT IGNORE permissions (module_bit, code, description) - VALUES - (9,'advanced_editor','Use the advanced cataloging editor') - }); - if( C4::Context->preference('EnableAdvancedCatalogingEditor') ){ - $dbh->do(q{ - INSERT INTO user_permissions (borrowernumber, module_bit, code) - SELECT borrowernumber, 9, 'advanced_editor' FROM borrowers WHERE borrowernumber IN (SELECT DISTINCT borrowernumber FROM user_permissions WHERE code = 'edit_catalogue'); - }); - } - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug 20128: Add permission for Advanced Cataloging Editor)\n"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index ad0e007..1d2feb4 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -18085,6 +18085,23 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 17171 - Add a syspref to allow currently issued items to be issued to a new patron without staff confirmation)\n"; } +$DBversion = '18.12.00.054'; +if( CheckVersion( $DBversion ) ) { + $dbh->do(q{ + INSERT IGNORE permissions (module_bit, code, description) + VALUES + (9,'advanced_editor','Use the advanced cataloging editor') + }); + if( C4::Context->preference('EnableAdvancedCatalogingEditor') ){ + $dbh->do(q{ + INSERT INTO user_permissions (borrowernumber, module_bit, code) + SELECT borrowernumber, 9, 'advanced_editor' FROM borrowers WHERE borrowernumber IN (SELECT DISTINCT borrowernumber FROM user_permissions WHERE code = 'edit_catalogue'); + }); + } + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 20128: Add permission for Advanced Cataloging Editor)\n"; +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 1.7.2.5