Index: l10n_community/l10n_community.install =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/l10n_server/l10n_community/Attic/l10n_community.install,v retrieving revision 1.1.2.11.2.13 diff -u -p -r1.1.2.11.2.13 l10n_community.install --- l10n_community/l10n_community.install 17 Nov 2009 17:34:32 -0000 1.1.2.11.2.13 +++ l10n_community/l10n_community.install 5 Dec 2009 13:48:38 -0000 @@ -598,3 +598,20 @@ function l10n_community_update_6008() { $ret[] = update_sql('UPDATE {l10n_community_translation} SET uid_approved = uid_entered, time_approved = time_entered WHERE is_suggestion = 0 AND uid_approved = 0'); return $ret; } + +/** + * Permission "submit translations and approve suggestions" split in two. + * + * Became "moderate suggestions from others" and "moderate own suggestions". + */ +function l10n_community_update_6009() { + $ret = array(); + $result = db_query("SELECT rid, perm FROM {permission} ORDER BY rid"); + while ($role = db_fetch_object($result)) { + $renamed_permission = preg_replace('/submit translations and approve suggestions/', 'moderate suggestions from others, moderate own suggestions', $role->perm); + if ($renamed_permission != $role->perm) { + $ret[] = update_sql("UPDATE {permission} SET perm = '$renamed_permission' WHERE rid = $role->rid"); + } + } + return $ret; +}