From 38e6c9cc577cdc4c85f2ea2340afc3a70351ed87 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Oct 2016 22:47:37 +0200 Subject: [PATCH] Fix multientity on overwritting translation not yet supported. --- htdocs/admin/translation.php | 16 ++++++++++------ htdocs/install/mysql/migration/4.0.0-5.0.0.sql | 2 ++ .../install/mysql/tables/llx_overwrite_trans.sql | 1 + 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index bf313be16c2..1ecd204be98 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -222,7 +222,7 @@ if ($mode == 'overwrite') print ''; print ''; // Limit to superadmin - if (! empty($conf->multicompany->enabled) && !$user->entity) + /*if (! empty($conf->multicompany->enabled) && !$user->entity) { print ''; print ''; @@ -230,10 +230,10 @@ if ($mode == 'overwrite') print ''; } else - { + {*/ print ''; print ''; - } + //} print ''; print "\n"; print ''; @@ -388,15 +388,15 @@ if ($mode == 'searchkey') print ''; print ''; // Limit to superadmin - if (! empty($conf->multicompany->enabled) && !$user->entity) + /*if (! empty($conf->multicompany->enabled) && !$user->entity) { print ''; print ''; } else - { + {*/ print ''; - } + //} print ''; // Action column print ''; @@ -427,6 +427,10 @@ if ($mode == 'searchkey') $htmltext = $langs->trans("OriginalValueWas", $newlangfileonly->tab_translate[$key]); print $form->textwithpicto('', $htmltext, 1, 'warning'); } + if (! empty($conf->multicompany->enabled) && !$user->entity) + { + print $val; + } print ''."\n"; } diff --git a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql index 1685ed5ad3a..098b91bb760 100644 --- a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql +++ b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql @@ -173,3 +173,5 @@ ALTER TABLE llx_bank_account ADD COLUMN note_public text; ALTER TABLE llx_bank_account ADD COLUMN model_pdf varchar(255); ALTER TABLE llx_bank_account ADD COLUMN import_key varchar(14); +ALTER TABLE llx_overwrite_trans ADD COLUMN integer DEFAULT 1 NOT NULL; + diff --git a/htdocs/install/mysql/tables/llx_overwrite_trans.sql b/htdocs/install/mysql/tables/llx_overwrite_trans.sql index 152fe5e7a0c..a42144cde6f 100644 --- a/htdocs/install/mysql/tables/llx_overwrite_trans.sql +++ b/htdocs/install/mysql/tables/llx_overwrite_trans.sql @@ -19,6 +19,7 @@ create table llx_overwrite_trans ( rowid integer AUTO_INCREMENT PRIMARY KEY, + entity integer DEFAULT 1 NOT NULL, -- multi company id lang varchar(5), -- en_US, fr_FR ... transkey varchar(128), transvalue text