]> _ Git - cubeextranet.git/commitdiff
wip #3983 @1
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 22 Oct 2020 12:18:06 +0000 (12:18 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 22 Oct 2020 12:18:06 +0000 (12:18 +0000)
inc/commons/class.common.core.php
inc/ws/Controlleur/class.ws.maintenance.php

index c28bba1d4051750536e9aa6589b321f150c586d3..b9d2d3f845541e6390363c564f10d3cc6fa12350 100644 (file)
@@ -693,7 +693,6 @@ LEFT JOIN e2_u a ON ri.administrateur_id=a.utilisateur_id');
             . 'FROM projets_vue_hf p, clients_entreprise e '\r
             . 'WHERE p.client_id=e.utilisateur_id '\r
             . 'GROUP BY e.type, p.annee_fin');\r
-\r
         $this->views->createView('signatures', 'SELECT * FROM fluidbook_toolbox.signature');\r
         //cubeDb::mysqlConvert($this->con, 'UTF8', 'utf8_general_ci', 'MYISAM');\r
         touch($cache);\r
index 87c4d4d49b65e84fcbc2ea8f15afb3fdd3486672..1f553308db2d687636c5b424c621b0a92ed9a572 100644 (file)
@@ -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 . '\'');
+        }
+    }
 }