]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 10 May 2011 08:58:06 +0000 (08:58 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 10 May 2011 08:58:06 +0000 (08:58 +0000)
fluidbook/compile/_js/fluidbook.js
fluidbook/compile/index.html
inc/ws/Controlleur/class.ws.url.php

index dd619994bf7cf24082963fda08e68838c27a08b3..7ad69ac650ebb97396c697c599cdad7e434e49c7 100644 (file)
@@ -91,12 +91,18 @@ function handleWheel(delta){
        }\r
 }\r
 \r
-function testIpadIphone(){\r
+function isMobile(){\r
        var ua=navigator.userAgent;\r
+       var devices = ['iphone', 'ipad', 'ipod', 'android', 'blackberry', 'mobile', 'symbian', 'phone', 'nintendo', 'playstation'];\r
+       var pattern;\r
 \r
-       if(ua.search(/iphone/i)>-1 || ua.search(/ipad/i)>-1 || ua.search(/android/i)>-1){\r
-               window.location='data/document.pdf';\r
+       for(i=0;i<devices.length;i++){\r
+               pattern=new RegExp(devices[i],'i');\r
+               if(ua.search(pattern)>-1){\r
+                       return true;\r
+               }\r
        }\r
+       return false;\r
 }\r
 \r
 function wheel(event){\r
index a085481c475b96c2e5b484195c63e815a3d9947d..327b7bf0b1751bd21d54d9edde4e1f11056198a7 100644 (file)
@@ -14,7 +14,12 @@ $redirectScript
 <div style="padding:20px;text-align:center;"><a href="http://get.adobe.com/flashplayer/" target="_blank"><img style="border:0;" src="$pathToGetflash" alt="" width="734" height="409" /></a></div>\r
 <div style="padding:20px;">$alt</div>\r
 </div>\r
-<script type="text/javascript">swfobject.embedSWF("$pathToIndex", "fluidbook", "100%", "100%", "10.0.0","", parseGet(),        {"allowScriptAccess":"always","quality":"high","scale":"noscale","wmode":getWmode(),"allowFullScreen":"true"},{"bgcolor":"#$bgcolor"});\r
+<script type="text/javascript">\r
+if(isMobile()){\r
+       window.location='data/document.pdf';\r
+}else{\r
+       swfobject.embedSWF("$pathToIndex", "fluidbook", "100%", "100%", "10.0.0","", parseGet(),        {"allowScriptAccess":"always","quality":"high","scale":"noscale","wmode":getWmode(),"allowFullScreen":"true"},{"bgcolor":"#$bgcolor"});\r
+}\r
 </script>\r
 $ga\r
 </body>\r
index dac30e8b027a6c987aee49d9af1d8d6b7c49d218..a93eabf522bb8c183d8efb5063eceacdb3ba837e 100644 (file)
@@ -1,7 +1,8 @@
 <?php\r
+\r
 class wsUrl {\r
-       public static function publications($args)\r
-       {\r
+\r
+       public static function publications($args) {\r
                global $core;\r
 \r
                $settings = $core->user->getSettings('books');\r
@@ -18,7 +19,7 @@ class wsUrl {
                if (wsDroits::admin()) {\r
                        $filtres[] = new commonFiltre(__('Administrateur'), 'admin_book', $settings['filtres']);\r
                }\r
-               $res = commonPage::barre($filtres , 'filtreBooks', 'books', $shortcuts);\r
+               $res = commonPage::barre($filtres, 'filtreBooks', 'books', $shortcuts);\r
                $res .= commonPage::tMain(null, wsDroits::admin());\r
                $res .= commonPage::bh();\r
                $res .= '<div id="listeBooks">';\r
@@ -29,8 +30,7 @@ class wsUrl {
                return $res;\r
        }\r
 \r
-       public static function listeBooks($dashboard = null, $settings = null)\r
-       {\r
+       public static function listeBooks($dashboard = null, $settings = null) {\r
                global $core;\r
                cubePage::truePopup();\r
                cubePage::autocomplete();\r
@@ -39,11 +39,11 @@ class wsUrl {
                $droits = wsDroits::getDroits();\r
 \r
                commonDroits::min(1);\r
-               $settings = is_null($settings)?$core->user->getSettings('books'):$settings;\r
-               $change = is_null($dashboard)?'Books':'Dashboard/' . $dashboard;\r
+               $settings = is_null($settings) ? $core->user->getSettings('books') : $settings;\r
+               $change = is_null($dashboard) ? 'Books' : 'Dashboard/' . $dashboard;\r
                $dao = new wsDAOBook($core->con);\r
-               $context_download_id = is_null($dashboard)?'contextDownloadBook':'contextDashboard_Download' . $dashboard;\r
-               $context_status_id = is_null($dashboard)?'contextStatusBook':'contextDashboard_Status' . $dashboard;\r
+               $context_download_id = is_null($dashboard) ? 'contextDownloadBook' : 'contextDashboard_Download' . $dashboard;\r
+               $context_status_id = is_null($dashboard) ? 'contextStatusBook' : 'contextDashboard_Status' . $dashboard;\r
 \r
                if (isset($settings['search']) && !is_null($settings['search'])) {\r
                        $dao->setSearch($settings['search']);\r
@@ -72,7 +72,7 @@ class wsUrl {
                if ($droits->revendeur) {\r
                        $res .= '<th>' . commonUrl::orderby(__('Status'), 'status', $settings, 'sort' . $change) . '</th>';\r
                }\r
-               $res .= str_repeat('<th class="min"></th>', $droits->creation?5:4);\r
+               $res .= str_repeat('<th class="min"></th>', $droits->creation ? 5 : 4);\r
                $res .= '</tr>';\r
                $i = 0;\r
 \r
@@ -84,8 +84,8 @@ class wsUrl {
                        $btDel = cubeMedia::cssRollover($core->typo->Supprimer('suppr.', '', false));\r
                }\r
 \r
-               foreach($liste as $id => $book) {\r
-                       $odd = cubeMath::isOdd($i)?' class="odd"':'';\r
+               foreach ($liste as $id => $book) {\r
+                       $odd = cubeMath::isOdd($i) ? ' class="odd"' : '';\r
                        $res .= '<tr' . $odd . '>';\r
                        $res .= '<td>' . $book->book_id . '</td>';\r
                        $res .= '<td>' . html::escapeHTML($book->nom) . '</td>';\r
@@ -125,9 +125,9 @@ class wsUrl {
                        $i++;\r
                }\r
                if (!isset($settings['search']) || is_null($settings['search'])) {\r
-                       $odd = cubeMath::isOdd($i)?' class="odd"':'';\r
+                       $odd = cubeMath::isOdd($i) ? ' class="odd"' : '';\r
                        $res .= '<tr' . $odd . '><td colspan="12">';\r
-                       $res .= commonPage::pager($settings['page'], $dao->count($core->user) , $settings['par_page'], 'page' . $change . '/%d');\r
+                       $res .= commonPage::pager($settings['page'], $dao->count($core->user), $settings['par_page'], 'page' . $change . '/%d');\r
                        $res .= commonUrl::formParPage('parPage' . $change, $settings['par_page'], __('publications'), false);\r
                        $res .= '</td></tr>';\r
                }\r
@@ -135,8 +135,7 @@ class wsUrl {
                return $res;\r
        }\r
 \r
-       public static function contextBookDownload($id)\r
-       {\r
+       public static function contextBookDownload($id) {\r
                global $core;\r
 \r
                $versions = array();\r
@@ -152,15 +151,14 @@ class wsUrl {
                $res = '<div class="contextMenu downbookContextMenu" id="' . $id . '">';\r
                $res .= '<ul>';\r
                $res .= '<li class="head">' . __("Sélectionnez une version") . '</li>';\r
-               foreach($versions as $k => $v) {\r
+               foreach ($versions as $k => $v) {\r
                        $res .= '<li><a href="#" rel="downbook/$1/' . $k . '" class="ajax">' . $v['icon'] . $v['title'] . '</a></li>';\r
                }\r
                $res .= '</ul></div>';\r
                return $res;\r
        }\r
 \r
-       public static function contextBookStatus($id)\r
-       {\r
+       public static function contextBookStatus($id) {\r
                global $core;\r
 \r
                if (wsDroits::admin()) {\r
@@ -175,15 +173,14 @@ class wsUrl {
                $res = '<div class="contextMenu statusbookContextMenu" id="' . $id . '">';\r
                $res .= '<ul>';\r
                $res .= '<li class="head">' . __("Changer le status de la publication") . '</li>';\r
-               foreach($status as $s => $title) {\r
+               foreach ($status as $s => $title) {\r
                        $res .= '<li><a href="#" rel="statusBook/$1/' . $s . '" class="ajax">' . $title . '</a></li>';\r
                }\r
                $res .= '</ul></div>';\r
                return $res;\r
        }\r
 \r
-       public static function traductions($args)\r
-       {\r
+       public static function traductions($args) {\r
                global $core;\r
 \r
                commonDroits::min(5);\r
@@ -197,7 +194,7 @@ class wsUrl {
 \r
                $dao = new wsDAOLang($core->con);\r
                $langs = $dao->selectAll();\r
-               foreach($langs as $lang) {\r
+               foreach ($langs as $lang) {\r
                        if (!isset($allLangs[$lang->lang_id])) {\r
                                continue;\r
                        }\r
@@ -227,8 +224,7 @@ class wsUrl {
                return $res;\r
        }\r
 \r
-       public static function formLang($lang_id)\r
-       {\r
+       public static function formLang($lang_id) {\r
                commonDroits::min(5);\r
                global $core;\r
                $dao = new wsDAOLang($core->con);\r
@@ -246,14 +242,13 @@ class wsUrl {
                $res .= commonPage::bf();\r
 \r
                $res .= commonPage::bh();\r
-               $res .= cubeLang::translationForm(PLAYER_SOURCES, $lang_id , null, 'liste', array(), '<a href="#" class="submit">' . $core->typo->Ajouter(__('Enregistrer')) . '</a>', $lang->traductions);\r
+               $res .= cubeLang::translationForm(PLAYER_SOURCES, $lang_id, null, 'liste', array(), '<a href="#" class="submit">' . $core->typo->Ajouter(__('Enregistrer')) . '</a>', $lang->traductions);\r
                $res .= commonPage::bf();\r
                $res .= '</form>';\r
                return $res;\r
        }\r
 \r
-       public static function getFonts()\r
-       {\r
+       public static function getFonts() {\r
                $formats = array('ttf', 'otf', 'TTF', 'OTF');\r
 \r
                $dr = opendir(FONT_PATH);\r
@@ -267,18 +262,16 @@ class wsUrl {
                return $fonts;\r
        }\r
 \r
-       protected static function getCharsets()\r
-       {\r
+       protected static function getCharsets() {\r
                $sets = cubeFlexFontAsset::getSets();\r
                $res = array();\r
-               foreach($sets as $k => $v) {\r
+               foreach ($sets as $k => $v) {\r
                        $res[$k] = $k;\r
                }\r
                return $res;\r
        }\r
 \r
-       protected static function getNSISLangs()\r
-       {\r
+       protected static function getNSISLangs() {\r
                $res = array();\r
                $dir = WS_FILES . '/nsislangs';\r
                $dr = opendir($dir);\r
@@ -294,8 +287,7 @@ class wsUrl {
                return $res;\r
        }\r
 \r
-       public static function editor($args)\r
-       {\r
+       public static function editor($args) {\r
                commonDroits::min(1);\r
 \r
                global $core;\r
@@ -333,8 +325,7 @@ html{height:100%}' . "\n";
         * @param mixed $args\r
         * @return\r
         */\r
-       public static function restoreLinks($args)\r
-       {\r
+       public static function restoreLinks($args) {\r
                commonDroits::min(1);\r
 \r
                global $core;\r
@@ -359,8 +350,8 @@ html{height:100%}' . "\n";
                $res .= '<th class="min"></th>';\r
                $res .= '</tr>';\r
                $i = 0;\r
-               foreach($updates as $time => $infos) {\r
-                       $odd = cubeMath::isOdd($i)?' class="odd"':'';\r
+               foreach ($updates as $time => $infos) {\r
+                       $odd = cubeMath::isOdd($i) ? ' class="odd"' : '';\r
                        $res .= '<tr' . $odd . '>';\r
                        $res .= '<td>' . date('Y-m-d H:i:s', $time) . '</td>';\r
                        $res .= '<td class="center">' . $infos['links'] . '</td>';\r
@@ -378,8 +369,7 @@ html{height:100%}' . "\n";
                echo $res;\r
        }\r
 \r
-       public static function editComposition($args)\r
-       {\r
+       public static function editComposition($args) {\r
                $fv = array(session_name() => session_id(),\r
                        'book_id' => $args[0]);\r
 \r
@@ -389,22 +379,20 @@ html{height:100%}' . "\n";
                return $res;\r
        }\r
 \r
-       public static function stats($args)\r
-       {\r
-               $bid = (isset($args[1]))?$args[1]:null;\r
-               $annee = (isset($args[2]))?$args[2]:null;\r
-               $mois = (isset($args[3]))?$args[3]:null;\r
+       public static function stats($args) {\r
+               $bid = (isset($args[1])) ? $args[1] : null;\r
+               $annee = (isset($args[2])) ? $args[2] : null;\r
+               $mois = (isset($args[3])) ? $args[3] : null;\r
                return wsStats::display($bid, $annee, $mois);\r
        }\r
 \r
-       public static function viewerp($args)\r
-       {\r
+       public static function viewerp($args) {\r
                commonDroits::min(5);\r
 \r
                $args = cubePage::getArgs($args);\r
 \r
                $e = explode('_', $args[0]);\r
-               if (count($e) == 2 || $e[2] < TIME-10) {\r
+               if (count($e) == 2 || $e[2] < TIME - 10) {\r
                        $e[2] = TIME;\r
                        http::redirect(SITE_PATH . 'viewerp/' . implode('_', $e) . '/');\r
                        exit;\r
@@ -417,14 +405,13 @@ html{height:100%}' . "\n";
                echo self::commonViewer($book_id, $e[1], true);\r
        }\r
 \r
-       public static function vieweru($args)\r
-       {\r
+       public static function vieweru($args) {\r
                commonDroits::min(5);\r
 \r
                $args = cubePage::getArgs($args);\r
 \r
                $e = explode('_', $args[0]);\r
-               if (count($e) == 2 || $e[2] < TIME-10) {\r
+               if (count($e) == 2 || $e[2] < TIME - 10) {\r
                        $e[2] = TIME;\r
                        http::redirect(SITE_PATH . 'vieweru/' . implode('_', $e) . '/');\r
                        exit;\r
@@ -437,14 +424,13 @@ html{height:100%}' . "\n";
                echo self::commonViewer($book_id, $e[1]);\r
        }\r
 \r
-       public static function viewer($args)\r
-       {\r
+       public static function viewer($args) {\r
                $args = cubePage::getArgs($args);\r
 \r
-               $wmode = isset($args[1])?$args[1]:'';\r
+               $wmode = isset($args[1]) ? $args[1] : '';\r
 \r
                $e = explode('_', $args[0]);\r
-               if (count($e) == 2 || $e[2] < TIME-10) {\r
+               if (count($e) == 2 || $e[2] < TIME - 10) {\r
                        $e[2] = TIME;\r
                        http::redirect(SITE_PATH . 'viewer/' . implode('_', $e) . '/' . $wmode);\r
                        exit;\r
@@ -452,7 +438,7 @@ html{height:100%}' . "\n";
 \r
                $book_id = $e[0];\r
 \r
-               $wmode = $wmode != ''?$wmode:'default';\r
+               $wmode = $wmode != '' ? $wmode : 'default';\r
 \r
                self::checkDocumentVersionOfBook($book_id);\r
                wsSecureSWF::checkProtectedSWF();\r
@@ -460,8 +446,7 @@ html{height:100%}' . "\n";
                echo self::commonViewer($book_id, $e[1], false, $wmode);\r
        }\r
 \r
-       public static function commonViewer($book_id, $hash, $standalone = false, $wmode = 'default')\r
-       {\r
+       public static function commonViewer($book_id, $hash, $standalone = false, $wmode = 'default') {\r
                if (!defined('MINIMIZE_JS')) {\r
                        define('MINIMIZE_JS', false);\r
                }\r
@@ -511,11 +496,11 @@ html{height:100%}' . "\n";
                $res .= '<title>' . $book->parametres->title . '</title>';\r
                // Entêtes Facebook\r
                if ($book->parametres->facebook) {\r
-                       $meta['og:title'] = ($book->parametres->facebook_title == '')?$book->parametres->title:$book->parametres->facebook_title;\r
+                       $meta['og:title'] = ($book->parametres->facebook_title == '') ? $book->parametres->title : $book->parametres->facebook_title;\r
                        if ($book->parametres->facebook_description != '') {\r
                                $meta['og:description'] = $book->parametres->facebook_description;\r
                        }\r
-                       $meta['og:image'] = 'http://dev.ws.fluidbook.com/services/facebook_thumbnail?id=' . $book->book_id ;\r
+                       $meta['og:image'] = 'http://dev.ws.fluidbook.com/services/facebook_thumbnail?id=' . $book->book_id;\r
                }\r
 \r
                $alt = '<div style="width:734px;margin:100px auto;"><a href="http://get.adobe.com/flashplayer/" target="_blank">' . cubeMedia::image($webcompile . 'getflash.gif', 734, 409, '') . '</a></div>';\r
@@ -524,10 +509,14 @@ html{height:100%}' . "\n";
                $res .= '<body style="background-color:#' . $theme->parametres->loadingBackColor . '" onload="this.focus();">';\r
                $res .= '<div id="fluidbook"><div style="width:734px;margin:100px auto;"><a href="http://get.adobe.com/flashplayer/" target="_blank"><img src="http://static.workshop.fluidbook.com/fluidbook/compile/getflash.gif" alt="" width="734" height="409"/></a></div></div>';\r
                $res .= '<script type="text/javascript">';\r
-               $res .= 'swfobject.embedSWF("index.swf", "fluidbook", "100%", "100%", "10.0.0",';\r
+               $res.='if(isMobile()){' . "\n";\r
+               $res.="\t" . 'window.location="data/document.pdf"' . "\n";\r
+               $res.='} else {' . "\n";\r
+               $res .= "\t" . 'swfobject.embedSWF("index.swf", "fluidbook", "100%", "100%", "10.0.0",';\r
                $res .= '"", [],';\r
                $res .= '{"allowScriptAccess":"always","quality":"high","scale":"noscale","wmode":getWmode(),"allowFullScreen":"true"},{"bgcolor":"#' . $theme->parametres->loadingBackColor . '"}';\r
-               $res .= ');';\r
+               $res .= ');' . "\n";\r
+               $res.='}' . "\n";\r
                $res .= '</script>';\r
                $js = array('fluidbook.js');\r
                $jsvar = array();\r
@@ -543,14 +532,12 @@ html{height:100%}' . "\n";
                return $res;\r
        }\r
 \r
-       public static function statsxls($args)\r
-       {\r
-               $bid = (isset($args[1]))?$args[1]:null;\r
+       public static function statsxls($args) {\r
+               $bid = (isset($args[1])) ? $args[1] : null;\r
                wsStats::exportXLS($bid);\r
        }\r
 \r
-       public static function chooseExistingBook()\r
-       {\r
+       public static function chooseExistingBook() {\r
                wsDroits::creation(true);\r
                $res = '<tr><td colspan="2"><p style="width:600px;text-align:justify;"><em>' . __("Si votre nouvelle publication a des paramètres en commun avec une publication existante, veuillez rechercher cette publication afin d'attribuer par défaut à votre nouvelle publication les paramètres de l'existante") . '</em></p></td></tr>';\r
                $res .= '<tr><td>' . __('Rechercher une publication') . ' : </td><td>' . form::field('book_nom', 64, 1024) . form::hidden('book', '') . '</td></tr>';\r
@@ -559,8 +546,7 @@ html{height:100%}' . "\n";
                return $res;\r
        }\r
 \r
-       public static function changeBookProprietaire($book_id)\r
-       {\r
+       public static function changeBookProprietaire($book_id) {\r
                global $core;\r
                commonDroits::min(3);\r
 \r
@@ -572,8 +558,7 @@ html{height:100%}' . "\n";
                return $res;\r
        }\r
 \r
-       public static function chooseBookProject($book_id)\r
-       {\r
+       public static function chooseBookProject($book_id) {\r
                global $core;\r
 \r
                wsDroits::admin(true);\r
@@ -592,8 +577,7 @@ html{height:100%}' . "\n";
                return $res;\r
        }\r
 \r
-       public static function chooseBookTache($book_id, $projet_id)\r
-       {\r
+       public static function chooseBookTache($book_id, $projet_id) {\r
                global $core;\r
                wsDroits::admin(true);\r
 \r
@@ -613,19 +597,18 @@ html{height:100%}' . "\n";
                        $res .= '<tr><td>' . __('ou créer une nouvelle tâche') . ' : </td><td>' . form::field('nom', 32, 1024, 'Fluidbook #' . $book->book_id . ' : ' . $book->nom) . ' ' . __('ayant le budget suivant') . ' ' . form::field('budget', 6, 6) . '</td></tr>';\r
                } else {\r
                        $res .= '<tr><td>' . __('Créer une tâche') . ' : </td><td>'\r
-                        . form::hidden('book_id', $book_id)\r
-                        . form::hidden('projet_id', $projet_id)\r
-                        . form::hidden('tache', '0')\r
-                        . form::field('nom', 32, 1024, 'Fluidbook #' . $book->book_id . ' : ' . $book->nom)\r
-                        . ' ' . __('ayant le budget suivant')\r
-                        . ' ' . form::field('budget', 6, 6) . '</td></tr>';\r
+                                       . form::hidden('book_id', $book_id)\r
+                                       . form::hidden('projet_id', $projet_id)\r
+                                       . form::hidden('tache', '0')\r
+                                       . form::field('nom', 32, 1024, 'Fluidbook #' . $book->book_id . ' : ' . $book->nom)\r
+                                       . ' ' . __('ayant le budget suivant')\r
+                                       . ' ' . form::field('budget', 6, 6) . '</td></tr>';\r
                }\r
 \r
                return $res;\r
        }\r
 \r
-       public static function valideDownload()\r
-       {\r
+       public static function valideDownload() {\r
                global $core;\r
 \r
                $res .= '<tr><td>' . __("Le téléchargement du fluidbook implique qu'il a été testé et définitivement validé.") . '<br />' . __("Si vous le téléchargez, il vous sera facturé selon les conditions stipulées dans votre contrat.") . '</td></tr>';\r
@@ -634,8 +617,7 @@ html{height:100%}' . "\n";
                return $res;\r
        }\r
 \r
-       public static function testAS($args)\r
-       {\r
+       public static function testAS($args) {\r
                global $core;\r
                commonDroits::min(5);\r
                if (!isset($args[1])) {\r
@@ -650,8 +632,7 @@ html{height:100%}' . "\n";
                exit;\r
        }\r
 \r
-       public static function testLinksCSV($args)\r
-       {\r
+       public static function testLinksCSV($args) {\r
                global $core;\r
                commonDroits::min(5);\r
 \r
@@ -661,21 +642,20 @@ html{height:100%}' . "\n";
                echo $dao->putLinksFromCSV($args[1]);\r
        }\r
 \r
-       protected static function checkDocumentVersionOfBook($book_id)\r
-       {\r
+       protected static function checkDocumentVersionOfBook($book_id) {\r
                global $core;\r
                cubePHP::neverStop();\r
                $dao = new wsDAOBook($core->con);\r
                $pages = $dao->getPagesOfBook($book_id);\r
                $toUpdate = array();\r
-               foreach($pages as $p => $infos) {\r
+               foreach ($pages as $p => $infos) {\r
                        if ($infos['version'] < 2) {\r
                                $toUpdate[] = $infos['document_id'];\r
                        }\r
                }\r
 \r
                $toUpdate = array_unique($toUpdate);\r
-               foreach($toUpdate as $document_id) {\r
+               foreach ($toUpdate as $document_id) {\r
                        self::updateDocument($document_id);\r
                }\r
 \r
@@ -686,15 +666,13 @@ html{height:100%}' . "\n";
                }\r
        }\r
 \r
-       public static function testOldLink($args)\r
-       {\r
+       public static function testOldLink($args) {\r
                global $core;\r
                $daoDoc = new wsDAODocument($core->con);\r
                $daoDoc->setLinksFromOldFluidbook($args[1]);\r
        }\r
 \r
-       protected static function updateDocument($document_id)\r
-       {\r
+       protected static function updateDocument($document_id) {\r
                global $core;\r
 \r
                $dao = new wsDAODocument($core->con);\r
@@ -703,7 +681,7 @@ html{height:100%}' . "\n";
                $doc->copyOriginalFromOlderVersion();\r
                $doc->globalOperations();\r
 \r
-               for($i = 1;$i <= $doc->generalInfos['pages'];$i++) {\r
+               for ($i = 1; $i <= $doc->generalInfos['pages']; $i++) {\r
                        $doc->processOnePage($i);\r
                }\r
 \r
@@ -711,8 +689,7 @@ html{height:100%}' . "\n";
                $dao->updateFromObject($doc);\r
        }\r
 \r
-       public static function getParamsHelp()\r
-       {\r
+       public static function getParamsHelp() {\r
                commonDroits::min(5);\r
 \r
                $res = '';\r
@@ -729,16 +706,15 @@ html{height:100%}' . "\n";
                exit;\r
        }\r
 \r
-       public static function formatHelp($rubriques)\r
-       {\r
+       public static function formatHelp($rubriques) {\r
                commonDroits::min(5);\r
 \r
                $res = '';\r
-               foreach($rubriques as $label => $fields) {\r
-                       $res .= "\n" . '-------------------------' . "\n" ;\r
+               foreach ($rubriques as $label => $fields) {\r
+                       $res .= "\n" . '-------------------------' . "\n";\r
                        $res .= $label . "\n";\r
                        $res .= '-------------------------' . "\n\n";\r
-                       foreach($fields as $name => $label) {\r
+                       foreach ($fields as $name => $label) {\r
                                if ($label == '|') {\r
                                        $res .= '--' . "\n";\r
                                } else {\r
@@ -749,8 +725,7 @@ html{height:100%}' . "\n";
                return $res;\r
        }\r
 \r
-       public static function clients($args)\r
-       {\r
+       public static function clients($args) {\r
                global $core;\r
                cubePage::truePopup();\r
                cubePage::autoComplete();\r
@@ -778,12 +753,11 @@ html{height:100%}' . "\n";
                return $res;\r
        }\r
 \r
-       public static function listeClients($dashboard = null, $settings = null)\r
-       {\r
+       public static function listeClients($dashboard = null, $settings = null) {\r
                global $core;\r
                commonDroits::min(3);\r
-               $settings = is_null($settings)?$core->user->getSettings('clients_ws'):$settings;\r
-               $change = is_null($dashboard)?'Client':'Dashboard/' . $dashboard;\r
+               $settings = is_null($settings) ? $core->user->getSettings('clients_ws') : $settings;\r
+               $change = is_null($dashboard) ? 'Client' : 'Dashboard/' . $dashboard;\r
                $dao = new commonDAOEntreprise($core->con);\r
                if (isset($settings['search']) && !is_null($settings['search'])) {\r
                        $dao->setSearch($settings['search']);\r
@@ -809,25 +783,25 @@ html{height:100%}' . "\n";
                }\r
                $res .= '<th class="min"></th><th class="min"></th></tr>';\r
                $i = 0;\r
-               foreach($liste as $id => $client) {\r
+               foreach ($liste as $id => $client) {\r
                        if (!is_array($client->contacts)) {\r
                                $client->contacts = array();\r
                        }\r
-                       $odd = cubeMath::isOdd($i)?' class="odd"':'';\r
+                       $odd = cubeMath::isOdd($i) ? ' class="odd"' : '';\r
                        $res .= '<tr' . $odd . '>';\r
                        $res .= '<td>' . $client->entreprise_id . '</td>';\r
                        $res .= '<td>' . $client->nom . '</td>';\r
                        $contacts = array();\r
 \r
-                       foreach($client->contacts as $c) {\r
+                       foreach ($client->contacts as $c) {\r
                                $contacts[] = '<a href="#" class="popup" rel="formContact/' . $c->utilisateur_id . '">' . $c->prenom . ' ' . $c->nom . '</a>';\r
                        }\r
 \r
                        $res .= '<td id="contacts_' . $client->entreprise_id . '">' . implode(', ', $contacts) . '</td>';\r
 \r
                        if ($admin) {\r
-                               $rev = $client->ws_revendeur == ''?'-':$client->ws_revendeur;\r
-                               $adm = $client->ws_administrateur == ''?'-':$client->ws_administrateur;\r
+                               $rev = $client->ws_revendeur == '' ? '-' : $client->ws_revendeur;\r
+                               $adm = $client->ws_administrateur == '' ? '-' : $client->ws_administrateur;\r
 \r
                                $res .= '<td>' . $core->ws_grades[$client->ws_grade] . '</td>';\r
                                $res .= '<td>' . $rev . '</td>';\r
@@ -841,12 +815,12 @@ html{height:100%}' . "\n";
                        $i++;\r
                }\r
                if (!isset($settings['search']) || is_null($settings['search'])) {\r
-                       $odd = cubeMath::isOdd($i)?' class="odd"':'';\r
+                       $odd = cubeMath::isOdd($i) ? ' class="odd"' : '';\r
                        $res .= '<tr' . $odd . '><td colspan="10">';\r
                        if ($admin) {\r
-                               $res .= commonPage::pager($settings['page'], $dao->count(null, 'entreprises_ws') , $settings['par_page'], 'page' . $change . '/%d');\r
+                               $res .= commonPage::pager($settings['page'], $dao->count(null, 'entreprises_ws'), $settings['par_page'], 'page' . $change . '/%d');\r
                        } else {\r
-                               $res .= commonPage::pager($settings['page'], $dao->count($core->user, 'entreprises_ws') , $settings['par_page'], 'page' . $change . '/%d');\r
+                               $res .= commonPage::pager($settings['page'], $dao->count($core->user, 'entreprises_ws'), $settings['par_page'], 'page' . $change . '/%d');\r
                        }\r
                        $res .= commonUrl::formParPage('parPage' . $change, $settings['par_page'], __('clients'));\r
                        $res .= '</td></tr>';\r
@@ -855,8 +829,7 @@ html{height:100%}' . "\n";
                return $res;\r
        }\r
 \r
-       public static function formClient($entreprise_id = 'new')\r
-       {\r
+       public static function formClient($entreprise_id = 'new') {\r
                global $core;\r
                commonDroits::min(3);\r
                $dao = new commonDAOEntreprise($core->con);\r
@@ -904,7 +877,7 @@ html{height:100%}' . "\n";
                        $signaturesList = $daoSignature->selectAll();\r
 \r
                        $signatures = array();\r
-                       foreach($signaturesList as $s) {\r
+                       foreach ($signaturesList as $s) {\r
                                $signatures[$s->nom] = $s->signature_id;\r
                        }\r
 \r
@@ -926,8 +899,7 @@ html{height:100%}' . "\n";
                return $res;\r
        }\r
 \r
-       public static function listeContacts($entreprise_id)\r
-       {\r
+       public static function listeContacts($entreprise_id) {\r
                global $core;\r
                commonDroits::min(3);\r
                $dao = new commonDAOEntreprise($core->con);\r
@@ -936,8 +908,8 @@ html{height:100%}' . "\n";
                $res = '<table class="liste light">';\r
                $res .= '<tr class="light"><th colspan="4"><a href="" class="popup" rel="formContact/new/' . $entreprise_id . '">' . $core->typo->Contact('Ajouter un contact') . '</a></th></tr>';\r
                $i = 0;\r
-               foreach($contacts as $contact) {\r
-                       $odd = cubeMath::isOdd($i)?' class="odd"':'';\r
+               foreach ($contacts as $contact) {\r
+                       $odd = cubeMath::isOdd($i) ? ' class="odd"' : '';\r
                        $res .= '<tr' . $odd . '><td>' . trim($contact->prenom . ' ' . $contact->nom) . '</td>';\r
                        $res .= '<td><a href="mailto:' . trim($contact->prenom . ' ' . $contact->nom) . '<' . $contact->email . '>">' . $contact->email . '</a></td>';\r
                        $res .= '<td class="min"><a href="' . SITE_PATH . 'fichiers/' . $contact->utilisateur_id . '">FTP</a></td>';\r
@@ -949,8 +921,7 @@ html{height:100%}' . "\n";
                return $res;\r
        }\r
 \r
-       public static function formContact($client_id = 'new', $entreprise_id = null)\r
-       {\r
+       public static function formContact($client_id = 'new', $entreprise_id = null) {\r
                global $core;\r
                commonDroits::min(3);\r
 \r
@@ -984,8 +955,7 @@ html{height:100%}' . "\n";
                return $res;\r
        }\r
 \r
-       public static function demandes()\r
-       {\r
+       public static function demandes() {\r
                global $core;\r
                cubePage::truePopup();\r
                cubePage::autoComplete();\r
@@ -1010,12 +980,11 @@ html{height:100%}' . "\n";
                return $res;\r
        }\r
 \r
-       public static function listeDemandes($dashboard = null, $settings = null)\r
-       {\r
+       public static function listeDemandes($dashboard = null, $settings = null) {\r
                global $core;\r
                commonDroits::min(5);\r
-               $settings = is_null($settings)?$core->user->getSettings('demandes'):$settings;\r
-               $change = is_null($dashboard)?'Demandes':'Dashboard/' . $dashboard;\r
+               $settings = is_null($settings) ? $core->user->getSettings('demandes') : $settings;\r
+               $change = is_null($dashboard) ? 'Demandes' : 'Dashboard/' . $dashboard;\r
                $dao = new wsDAODemande($core->con);\r
                if (isset($settings['search']) && !is_null($settings['search'])) {\r
                        $dao->setSearch($settings['search']);\r
@@ -1025,24 +994,24 @@ html{height:100%}' . "\n";
 \r
                $res = '<table class="liste">';\r
                $res .= '<tr><th>' . commonUrl::orderby('#', 'demande_id', $settings, 'sort' . $change) . '</th>';\r
-               $res .= '<th>' . commonUrl::orderby(__('Date') , 'date', $settings, 'sort' . $change) . '</th>';\r
-               $res .= '<th>' . commonUrl::orderby(__('Type') , 'type', $settings, 'sort' . $change) . '</th>';\r
+               $res .= '<th>' . commonUrl::orderby(__('Date'), 'date', $settings, 'sort' . $change) . '</th>';\r
+               $res .= '<th>' . commonUrl::orderby(__('Type'), 'type', $settings, 'sort' . $change) . '</th>';\r
                $res .= '<th>' . commonUrl::orderby(__('Prospect') . '/' . __('Client'), 'utilisateur_nom', $settings, 'sort' . $change) . '</th>';\r
                $res .= '<th>' . commonUrl::orderby(__('Confiée à'), 'revendeur_nom', $settings, 'sort' . $change) . '</th>';\r
                $res .= '<th>' . commonUrl::orderby(__('Gérée par'), 'administrateur_nom', $settings, 'sort' . $change) . '</th>';\r
                $res .= '<th>' . commonUrl::orderby(__('Statut'), 'status', $settings, 'sort' . $change) . '</th>';\r
                $res .= '<th class="min"></th><th class="min"></th></tr>';\r
                $i = 0;\r
-               foreach($liste as $id => $demande) {\r
-                       $odd = cubeMath::isOdd($i)?' class="odd"':'';\r
+               foreach ($liste as $id => $demande) {\r
+                       $odd = cubeMath::isOdd($i) ? ' class="odd"' : '';\r
                        $res .= '<tr' . $odd . '>';\r
                        $res .= '<td>' . $demande->demande_id . '</td>';\r
                        $res .= '<td>' . date(__('d/m/Y H:i'), $demande->date) . '</td>';\r
                        $res .= '<td>' . $core->demandes_type[$demande->type] . '</td>';\r
                        $res .= '<td><a href="#" class="popup" rel="formClient/' . $demande->entreprise . '">' . $demande->utilisateur_nom . '</a></td>';\r
-                       $revendeur = $demande->revendeur == 0?'-':$demande->revendeur_nom;\r
+                       $revendeur = $demande->revendeur == 0 ? '-' : $demande->revendeur_nom;\r
                        $res .= '<td>' . $revendeur . '</td>';\r
-                       $administrateur = $demande->administrateur == 0?'-':$demande->administrateur_nom;\r
+                       $administrateur = $demande->administrateur == 0 ? '-' : $demande->administrateur_nom;\r
                        $res .= '<td>' . $administrateur . '</td>';\r
                        // Affichage du status\r
                        // Si non traitée ou traitée, pas la possibilité de changer le status\r
@@ -1071,9 +1040,9 @@ html{height:100%}' . "\n";
                        $i++;\r
                }\r
                if (!isset($settings['search']) || is_null($settings['search'])) {\r
-                       $odd = cubeMath::isOdd($i)?' class="odd"':'';\r
+                       $odd = cubeMath::isOdd($i) ? ' class="odd"' : '';\r
                        $res .= '<tr' . $odd . '><td colspan="10">';\r
-                       $res .= commonPage::pager($settings['page'], $dao->count($core->user) , $settings['par_page'], 'page' . $change . '/%d');\r
+                       $res .= commonPage::pager($settings['page'], $dao->count($core->user), $settings['par_page'], 'page' . $change . '/%d');\r
                        $res .= commonUrl::formParPage('parPage' . $change, $settings['par_page'], __('demandes'));\r
                        $res .= '</td></tr>';\r
                }\r
@@ -1081,8 +1050,7 @@ html{height:100%}' . "\n";
                return $res;\r
        }\r
 \r
-       public static function formDemande($demande_id = 'new')\r
-       {\r
+       public static function formDemande($demande_id = 'new') {\r
                global $core;\r
                commonDroits::min(5);\r
                $dao = new wsDAODemande($core->con);\r
@@ -1108,7 +1076,7 @@ html{height:100%}' . "\n";
                } else {\r
                        $liste = $daoUtilisateur->selectWSRevendeursFacturables();\r
                        $revendeurs = array();\r
-                       foreach($liste as $revendeur) {\r
+                       foreach ($liste as $revendeur) {\r
                                $revendeurs[$revendeur->rs . '(' . $revendeur->prenom . ' ' . $revendeur->nom . ')'] = $revendeur->utilisateur_id;\r
                        }\r
 \r
@@ -1130,8 +1098,7 @@ html{height:100%}' . "\n";
                return $res;\r
        }\r
 \r
-       public static function reponseDemande($args)\r
-       {\r
+       public static function reponseDemande($args) {\r
                global $core;\r
 \r
                commonDroits::min(3);\r
@@ -1180,6 +1147,7 @@ html{height:100%}' . "\n";
                $res .= commonPage::bMain();\r
                return $res;\r
        }\r
+\r
 }\r
 \r
 ?>
\ No newline at end of file