]> _ Git - cubeextranet.git/commitdiff
done #1343 @4
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 12 Apr 2017 16:08:29 +0000 (16:08 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 12 Apr 2017 16:08:29 +0000 (16:08 +0000)
inc/ws/Controlleur/class.ws.maintenance.php
inc/ws/Metier/class.ws.book.parametres.php
inc/ws/Util/html5/class.ws.html5.compiler.php

index a16fa44cc9ead591f9ff4fb6a753a12544dc6e81..b758b543d4881ea355cd74b91b5f50e245cff0ba 100644 (file)
@@ -858,9 +858,41 @@ class wsMaintenance {
        }
 
        public static function updateHTML5Sources($args = array(), $externals = true) {
-               $svn = new cubeCommandLine('updatewshtml5prod');
-               $svn->setPath(CONVERTER_PATH);
-               $svn->execute();
+               $branchesDir = WS_COMPILE_ASSETS . '/player/branches/';
+               $git = new CubeIT_CommandLine_Git($branchesDir . 'fluidbook-html5');
+               echo '<pre>';
+               echo $git->executeCmd('pull --all');
+               $git = new CubeIT_CommandLine_Git($branchesDir . 'fluidbook-html5');
+               $b = $git->executeCmd('branch -r');
+               echo $b;
+               $bb = explode("\n", $b);
+               $branches = array();
+               foreach ($bb as $item) {
+                       $item = trim($item);
+                       if ($item == '') {
+                               continue;
+                       }
+                       $e = explode('->', $item);
+                       if (count($e) == 2) {
+                               $item = $e[1];
+                       } else {
+                               $item = $e[0];
+                       }
+                       $e = explode("/", $item);
+                       $branches[trim($e[1])] = true;
+               }
+               $branches = array_keys($branches);
+               foreach ($branches as $b) {
+                       echo '<b>' . $b . '</b>' . "\n";
+                       if (!file_exists($branchesDir . $b)) {
+                               $git = new CubeIT_CommandLine_Git($branchesDir);
+                               echo $git->executeCmd('clone -b ' . $b . ' --single-branch git@git.cubedesigners.com:fluidbook-html5.git ' . $b);
+                       }
+                       $git = new CubeIT_CommandLine_Git($branchesDir . $b);
+                       echo $git->executeCmd('pull');
+               }
+               echo '</pre>';
+               file_put_contents(WS_CACHE . '/activebranches', json_encode($branches));
        }
 
        public static function cleanDownload($args) {
index 40bbdecbfae83f4eca4f108ed14b8e12a4f8a61d..2026f118cea12c51f99c05dd9c4ae840325939fc 100644 (file)
@@ -321,9 +321,17 @@ class wsBookParametres extends wsParametres {
 
                $this->fields['navOrderH'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('Ordre des icônes dans la nav') . ' (' . __('Si différente') . ')', 'grade' => 3);
 
-               $this->fields['mobileLVersion'] = array('type' => 'combo', 'default' => 'stable', 'editable' => true, 'label' => __('Version logicielle'), 'grade' =>1,
-                                                       'datas' => array(__('Stable') => 'stable',
-                                                                        __('En cours de développement') => 'dev')
+
+               $branches = array(__('Stable') => 'stable',
+                                 __('En cours de développement') => 'dev');
+               $gitbranches = json_decode(file_get_contents(WS_CACHE . '/activebranches'));
+               foreach ($gitbranches as $b) {
+                       $branches['Branch ' . $b] = 'branch:' . $b;
+               }
+
+               $this->fields['mobileLVersion'] = array('type' => 'combo', 'default' => 'stable', 'editable' => true,
+                                                       'label' => __('Version logicielle'), 'grade' => 1,
+                                                       'datas' => $branches
                );
 
                $this->fields['mobileTransitions'] = array('type' => 'combo', 'default' => 'flip', 'editable' => true, 'label' => __('Transitions entre les pages'), 'grade' => 3,
index 5d72f815f5d76d2b624ce70ebc73d3736f0ff37b..ead2b1353b0f385b2613f076644654bcd96c5b46 100644 (file)
@@ -11,10 +11,11 @@ class wsHTML5Compiler {
                }
 
                if ($version == 'stable') {
-                       return new wsHTML5Compiler($book_id, 'stable', $phonegap, $phonegapVersion, $dir, $standalone, $appcache, $home);
+                       $class = 'wsHTML5Compiler';
                } else {
-                       return new wsHTML5CompilerDev($book_id, 'dev', $phonegap, $phonegapVersion, $dir, $standalone, $appcache, $home);
+                       $class = 'wsHTML5CompilerDev';
                }
+               return new $class($book_id, $version, $phonegap, $phonegapVersion, $dir, $standalone, $appcache, $home);
        }
 
        protected static $resolutions = array(150, 300);
@@ -523,7 +524,6 @@ class wsHTML5Compiler {
                        $script .= '<script type="text/javascript" charset="utf-8" src="' . $p . '"></script>' . "\n";
                }
                $script .= $iscript;
-
                $description = '<meta name="description" content="' . html::escapeHTML(isset($this->book->parametres->seoDescription) && $this->book->parametres->seoDescription ? $this->book->parametres->seoDescription : $titre . ' - Powered by Fluidbook') . '">';