]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 16 Mar 2011 09:13:54 +0000 (09:13 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 16 Mar 2011 09:13:54 +0000 (09:13 +0000)
inc/ws/Controlleur/class.ws.flash.php
inc/ws/Controlleur/class.ws.maintenance.php
inc/ws/DAO/class.ws.dao.theme.php

index c604a51222481e66e7a18a0e1c2d5277abbbe388..ee79600d6539b2348a2e7d8ee3b462c3f9cb9f5e 100644 (file)
@@ -284,7 +284,6 @@ class wsFlash extends cubeFlashGateway {
                } else {\r
                        $theme = $dao->getThemeOfBook($this->args['book_id']);\r
                }\r
-\r
                $this->_themeToXML($theme);\r
        }\r
 \r
@@ -398,6 +397,7 @@ class wsFlash extends cubeFlashGateway {
                global $core;\r
                $dao = new wsDAOTheme($core->con);\r
                $theme = $dao->selectById($this->args['theme_id']);\r
+\r
                foreach($theme->parametres->getForms() as $name) {\r
                        $f = $this->xml->addChild('form', json_encode($theme->parametres->getForm($name)));\r
                        $f->addAttribute('name', $name);\r
index d8e938a4a0374662f61b574245746c620da825c9..933e838c3160d7957b1b9678cdf736fccb3f9fec 100644 (file)
@@ -102,7 +102,12 @@ class wsMaintenance {
 \r
        public static function importThemes($oldBooks)\r
        {\r
-               global $core;\r
+               global $core, $signatures;\r
+\r
+               $r = $core->con->select('SELECT tid,sigid FROM theme');\r
+               while ($r->fetch()) {\r
+                       $signatures[$r->tid] = $r->sigid;\r
+               }\r
 \r
                $r = $core->con->select('SELECT MAX(theme_id) AS theme_id FROM themes WHERE theme_id<1000');\r
                $lastImported = $r->theme_id;\r
@@ -120,7 +125,7 @@ class wsMaintenance {
 \r
                        $parametres = new wsThemeParametres($theme);\r
                        $parametres->fromRecord($r);\r
-                       $c->icones = self::_oldIconesToColor($r->iid, $parametres);\r
+                       self::_oldIconesToColor($r->iid, $parametres);\r
                        $c->parametres = serialize($parametres);\r
                        $c->insert();\r
 \r
@@ -166,7 +171,7 @@ class wsMaintenance {
 \r
        public static function importBooks($oldBooks)\r
        {\r
-               global $core, $allTrads;\r
+               global $core, $allTrads, $signatures;\r
                // Importe les fluidbooks\r
                $r = $core->con->select('SELECT * FROM ws.book WHERE bid ' . self::_sqlIn($oldBooks) . ' ORDER BY bid');\r
                if (!$r->count()) {\r
@@ -211,7 +216,7 @@ class wsMaintenance {
                        }\r
                        $c->numerotation = implode(',', $n);\r
 \r
-                       $parametres->signature =/*$signatures[$r->tid]*/ 1;\r
+                       $parametres->signature = $signatures[$r->tid];\r
                        $parametres->title = $r->titre;\r
                        $parametres->visualisationMode = '0';\r
                        $c->parametres = serialize($parametres);\r
@@ -240,15 +245,13 @@ class wsMaintenance {
                        $parametres->menuHeight = 39;\r
                        $parametres->colorizeIcons = false;\r
                        $parametres->couleurI = 'ffffff';\r
-                       return $line['iid'];\r
+               } else {\r
+                       $parametres->iconSet = 1;\r
+                       $parametres->colorizeIcons = 1;\r
+                       $parametres->iconsHMargin = 20;\r
+                       $parametres->menuHeight = 39;\r
+                       $parametres->couleurI = $line['color'];\r
                }\r
-               $parametres->iconSet = 1;\r
-               $parametres->colorizeIcons = 1;\r
-               $parametres->iconsHMargin = 20;\r
-               $parametres->menuHeight = 39;\r
-               $parametres->couleurI = $line['color'];\r
-\r
-               return 1;\r
        }\r
 \r
        protected static function _getWsUser($oldid)\r
index ab336a0256ff75c4d8a7f448dd0b4dcf6c960559..82bb9b3ac62870ead564bfb19a5568a9ddabe796 100644 (file)
@@ -29,9 +29,6 @@ class wsDAOTheme extends commonDAO {
        public function selectById($theme_id, $table = 'themes_vue')\r
        {\r
                $r = $this->con->select('SELECT * FROM ' . $table . ' WHERE theme_id=\'' . $this->con->escape($theme_id) . '\' LIMIT 1');\r
-               if ($r->theme_id < 1000) {\r
-                       return 1000;\r
-               }\r
                return $this->singleton($r);\r
        }\r
 \r
@@ -79,6 +76,9 @@ class wsDAOTheme extends commonDAO {
        protected function getNextId()\r
        {\r
                $r = $this->con->select('SELECT MAX(theme_id) AS theme_id FROM themes');\r
+               if ($r->theme_id < 1000) {\r
+                       return 1000;\r
+               }\r
                return $r->theme_id + 1;\r
        }\r
 \r