From faf060b1dab2c47570c9be0eea275ccbc5d7c131 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Thu, 22 Oct 2020 12:18:06 +0000 Subject: [PATCH] wip #3983 @1 --- inc/commons/class.common.core.php | 1 - inc/ws/Controlleur/class.ws.maintenance.php | 24 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/inc/commons/class.common.core.php b/inc/commons/class.common.core.php index c28bba1d4..b9d2d3f84 100644 --- a/inc/commons/class.common.core.php +++ b/inc/commons/class.common.core.php @@ -693,7 +693,6 @@ LEFT JOIN e2_u a ON ri.administrateur_id=a.utilisateur_id'); . 'FROM projets_vue_hf p, clients_entreprise e ' . 'WHERE p.client_id=e.utilisateur_id ' . 'GROUP BY e.type, p.annee_fin'); - $this->views->createView('signatures', 'SELECT * FROM fluidbook_toolbox.signature'); //cubeDb::mysqlConvert($this->con, 'UTF8', 'utf8_general_ci', 'MYISAM'); touch($cache); diff --git a/inc/ws/Controlleur/class.ws.maintenance.php b/inc/ws/Controlleur/class.ws.maintenance.php index 87c4d4d49..1f553308d 100644 --- a/inc/ws/Controlleur/class.ws.maintenance.php +++ b/inc/ws/Controlleur/class.ws.maintenance.php @@ -1344,6 +1344,30 @@ class wsMaintenance { file_get_contents('https://workshop.fluidbook.com/services/facebook_thumbnail?cid=' . $cid . '&j=' . TIME); } + + public static function mergeLangs() + { + global $core; + $r = $core->con->select('SELECT * FROM extranet_a.langues'); + $langs = []; + while ($r->fetch()) { + $langs[$r->lang_id] = json_decode($r->traductions, true); + } + + $r = $core->con->select('SELECT * FROM langues'); + while ($r->fetch()) { + if (!isset($langs[$r->lang_id])) { + $langs[$r->lang_id] = []; + } + $langs[$r->lang_id] = array_merge($langs[$r->lang_id], json_decode($r->traductions, true)); + } + + foreach ($langs as $lang => $traductions) { + $cursor = $core->con->openCursor('langues'); + $cursor->traductions = json_encode($traductions); + $cursor->update('WHERE lang_id=\'' . $lang . '\''); + } + } } -- 2.39.5