From 8a6ce608706b72a208417e743e844db85498ffad Mon Sep 17 00:00:00 2001 From: Liz Rea Date: Tue, 5 Mar 2013 11:39:54 +1300 Subject: [PATCH] Bug 9745 - don't nuke translated strings in permissions on DB upgrade To test: (this is best done by someone who has a database with translated strings for user permissions - I'm looking towards Katrin. :)) Get a 3.6-3.8 era database loaded as test data - also please use a low value test database. Translate or change the strings in the database for the user permissions that follow in mysql client (for those who didn't install with a different language that has translated files at install time) - update userflags set flagdesc="Translated text 1" where flag IN('catalogue','editauthorities','reports','management','serials','updatecharges','circulate','parameters','borrowers','tools','staffaccess','edit_patrons'); (you will notice that this changes all of the permission labels in the interface to "translated text 1" for the affected permission flags. This is why I don't want you to use a high value test database.) Update that to master + this patch - your "translations" should be intact. Blow that database away, and make a brand new one 3.6-3.8 era with the english database definitions. Run the update again with this patch, the strings should be updated correctly. --- installer/data/mysql/updatedatabase.pl | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 7e5e243..2db047c 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -6349,44 +6349,44 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $DBversion = "3.11.00.016"; if ( CheckVersion($DBversion) ) { - $dbh->do(q{ - UPDATE userflags SET flagdesc="Required for staff login. Staff access, allows viewing of catalogue in staff client." where flag="catalogue"; + $dbh->do{(q{ + UPDATE userflags SET flagdesc="Required for staff login. Staff access, allows viewing of catalogue in staff client." where flagdesc="Modify login / permissions for staff users"; }); $dbh->do(q{ - UPDATE userflags SET flagdesc="Edit Authorities" where flag="editauthorities"; + UPDATE userflags SET flagdesc="Edit Authorities" where flagdesc="Allow to edit authorities"; }); $dbh->do(q{ - UPDATE userflags SET flagdesc="Allow access to the reports module" where flag="reports"; + UPDATE userflags SET flagdesc="Allow access to the reports module" where flagdesc="Allow to access to the reports module"; }); $dbh->do(q{ - UPDATE userflags SET flagdesc="Set library management parameters (deprecated)" where flag="management"; + UPDATE userflags SET flagdesc="Set library management parameters (deprecated)" where flagdesc="Set library management parameters"; }); $dbh->do(q{ - UPDATE userflags SET flagdesc="Manage serial subscriptions" where flag="serials"; + UPDATE userflags SET flagdesc="Manage serial subscriptions" where flagdesc="Allow to manage serials subscriptions"; }); $dbh->do(q{ - UPDATE userflags SET flagdesc="Manage patrons fines and fees" where flag="updatecharges"; + UPDATE userflags SET flagdesc="Manage patrons fines and fees" where flagdesc="Update borrower charges"; }); $dbh->do(q{ - UPDATE userflags SET flagdesc="Check out and check in items" where flag="circulate"; + UPDATE userflags SET flagdesc="Check out and check in items" where flagdesc="Circulate books"; }); $dbh->do(q{ - UPDATE userflags SET flagdesc="Manage Koha system settings (Administration panel)" where flag="parameters"; + UPDATE userflags SET flagdesc="Manage Koha system settings (Administration panel)" where flagdesc="Set Koha system parameters"; }); $dbh->do(q{ - UPDATE userflags SET flagdesc="Add or modify patrons" where flag="borrowers"; + UPDATE userflags SET flagdesc="Add or modify patrons" where flagdesc="Add or modify borrowers"; }); $dbh->do(q{ - UPDATE userflags SET flagdesc="Use all tools (expand for granular tools permissions)" where flag="tools"; + UPDATE userflags SET flagdesc="Use all tools (expand for granular tools permissions)" where flagdesc="Use tools (export, import, barcodes)"; }); $dbh->do(q{ - UPDATE userflags SET flagdesc="Allow staff members to modify permissions for other staff members" where flag="staffaccess"; + UPDATE userflags SET flagdesc="Allow staff members to modify permissions for other staff members" where flagdesc="Set user permissions"; }); $dbh->do(q{ - UPDATE userflags SET flagdesc="Perform batch modification of patrons" where flag="edit_patrons"; + UPDATE userflags SET flagdesc="Perform batch modification of patrons" where flagdesc="Perform batch modifivation of patrons"; }); - print "Upgrade to $DBversion done (Bug 9382 - refresh permission descriptions to make more sense)\n"; + print "Upgrade to $DBversion done (Bug 9382 (updated with bug 9745) - refresh permission descriptions to make more sense)\n"; SetVersion ($DBversion); } -- 1.7.9.5