]> _ Git - cubeextranet.git/commitdiff
Correct some bugs on the VAT# and the DES
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 2 Feb 2015 13:16:43 +0000 (13:16 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 2 Feb 2015 13:16:43 +0000 (13:16 +0000)
inc/commons/class.common.core.php
inc/extranet/Controlleur/class.extranet.url.php
inc/extranet/Controlleur/url/class.extranet.url.client.php
inc/ws/Controlleur/class.ws.url.php

index 393de5b3b9fdacd3fdb47eae653c512d14345329..e3ecbdea333f8470258dafa8aa38f9cb16718c05 100644 (file)
@@ -164,7 +164,7 @@ class commonCore extends cubeCore {
                $db->entreprises->ville('varchar', 64, false);\r
                $db->entreprises->pays('varchar', 2, false);\r
                $db->entreprises->adresse_facturation('varchar', 512, false);\r
-               $db->entreprises->tva_intra('varchar', 14, false);\r
+               $db->entreprises->tva_intra('varchar', 64, false);\r
                $db->entreprises->ws_grade('integer', 0, false);\r
                $db->entreprises->ws_admin('integer', 0, false);\r
                $db->entreprises->date_creation('integer', 0, false);\r
index 84fe0eaf2be49acdd63093c46b025b0423fd763b..108ba241910f9b5d8c482daa5fd0671ecf1ebbd6 100644 (file)
@@ -160,7 +160,7 @@ class extranetUrl {
                $res .= '<tr><td>' . __('Pays') . '</td><td>' . form::combo('pays', cubeCountry::getList(), $client->pays) . '</td></tr>';
                $res .= '<tr><td>' . __('Adresse de facturaton') . '</td><td>' . form::textarea('adresse_facturation', 40, 3, $client->adresse_facturation) . '</td></tr>';
                $res .= '<tr><td>' . __('Site internet') . '</td><td>' . form::field('site', 30, 128, $client->site) . '</td></tr>';
-               $res .= '<tr><td>' . __('Numéro de TVA intracommunautaire') . '</td><td>' . form::field('tva_intra', 15, 13, $client->tva_intra) . '</td></tr>';
+               $res .= '<tr><td>' . __('Numéro de TVA intracommunautaire') . '</td><td>' . form::field('tva_intra', 15, 64, $client->tva_intra) . '</td></tr>';
                $res .= '<tr><td>' . __('Type de société') . '</td><td>' . form::combo('type', array_flip($core->client_type), $client->type) . '</td></tr>';
                $res .= '<tr class="light"><th colspan="2" class="light"><strong>' . __('Fluidbook Workshop') . '</strong></th></tr>';
                $res .= '<tr class="odd"><td>' . __('Grade') . '</td><td>' . form::combo('ws_grade', array_flip($core->ws_grades), $client->ws_grade) . '</td></tr>';
@@ -485,7 +485,7 @@ class extranetUrl {
                                }
                                $res .= '<td colspan="3">Fluidbooks # ' . implode(', ', $n) . '</td>';
                        } else {
-                               $res.='<td colspan="3"></td>';
+                               $res .= '<td colspan="3"></td>';
                        }
                        $res .= '<td>' . $tache->budget . '</td>';
 
index d47605e165b3d72ae5f213cfeee3dc22bb34cadd..b32e44ff52fa04179bbcac5d6167f57c8e401a60 100644 (file)
@@ -1,8 +1,7 @@
 <?php\r
 \r
-class extranetUrlClient{\r
-       public static function clients($args)\r
-       {\r
+class extranetUrlClient {\r
+       public static function clients($args) {\r
                global $core;\r
                cubePage::truePopup();\r
                cubePage::autoComplete();\r
@@ -26,12 +25,11 @@ class extranetUrlClient{
                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(1);\r
-               $settings = is_null($settings)?$core->user->getSettings('clients'):$settings;\r
-               $change = is_null($dashboard)?'Client':'Dashboard/' . $dashboard;\r
+               $settings = is_null($settings) ? $core->user->getSettings('clients') : $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
@@ -48,18 +46,18 @@ class extranetUrlClient{
                $res .= '<th>' . commonUrl::orderby('Impayés', 'impaye', $settings, 'sort' . $change) . '</th>';\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
                                fb($client);\r
                                continue;\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
@@ -87,9 +85,9 @@ class extranetUrlClient{
                        $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() , $settings['par_page'], 'page' . $change . '/%d');\r
+                       $res .= commonPage::pager($settings['page'], $dao->count(), $settings['par_page'], 'page' . $change . '/%d');\r
                        $res .= commonUrl::formParPage('parPage' . $change, $settings['par_page'], __('clients'));\r
                        $res .= '</td></tr>';\r
                }\r
@@ -97,23 +95,21 @@ class extranetUrlClient{
                return $res;\r
        }\r
 \r
-       public static function clientDetailCa($entreprise_id)\r
-       {\r
+       public static function clientDetailCa($entreprise_id) {\r
                global $core;\r
                $dao = new commonDAOEntreprise($core->con);\r
                $annees = $dao->getCaDetails($entreprise_id);\r
                $res = '';\r
                $i = 0;\r
-               foreach($annees as $annee => $ca) {\r
-                       $class = cubeMath::isOdd($i)?' class="odd"':'';\r
+               foreach ($annees as $annee => $ca) {\r
+                       $class = cubeMath::isOdd($i) ? ' class="odd"' : '';\r
                        $res .= '<tr' . $class . '><td><strong>' . $annee . '</strong></td><td>' . number_format($ca, 0, ',', ' ') . ' €</td></tr>';\r
                        $i++;\r
                }\r
                return $res;\r
        }\r
 \r
-       public static function clientDetailImpaye($entreprise_id)\r
-       {\r
+       public static function clientDetailImpaye($entreprise_id) {\r
                global $core;\r
                $dao = new extranetDAOFacture($core->con);\r
                $daoClient = new commonDAOEntreprise($core->con);\r
@@ -121,15 +117,15 @@ class extranetUrlClient{
                $client = $daoClient->selectById($entreprise_id);\r
                $res = '';\r
                $i = 0;\r
-               foreach($factures as $facture) {\r
-                       $class = cubeMath::isOdd($i)?' class="odd"':'';\r
+               foreach ($factures as $facture) {\r
+                       $class = cubeMath::isOdd($i) ? ' class="odd"' : '';\r
                        $res .= '<tr' . $class . '>';\r
                        $res .= '<td>' . $facture->facture_id . '</td>';\r
                        $res .= '<td>';\r
                        if ($facture->facture_id > 0) {\r
                                $res .= '<a href="' . SITE_PATH . 'voirfacture/' . $facture->facture_id . '" class="popupA4">' . $facture->nom . '</a>';\r
                        } else {\r
-                               $res .= $facture->nom ;\r
+                               $res .= $facture->nom;\r
                        }\r
                        $res .= '</td>';\r
                        $tva = cubeTaxes::tva($client->pays);\r
@@ -145,8 +141,7 @@ class extranetUrlClient{
                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(1);\r
                $dao = new commonDAOEntreprise($core->con);\r
@@ -155,7 +150,7 @@ class extranetUrlClient{
                        $client = $dao->cree();\r
                } else {\r
                        $client = $dao->selectById($entreprise_id);\r
-               } \r
+               }\r
 \r
                $res = '<tr><td>' . __('Numéro de client') . '</td><td>' . form::hidden('entreprise_id', $client->entreprise_id) . '' . $client->entreprise_id . '</td></tr>';\r
                $res .= '<tr><td>' . __('Raison sociale') . '</td><td>' . form::field('nom', 30, 128, $client->nom) . '</td></tr>';\r
@@ -164,8 +159,8 @@ class extranetUrlClient{
                $res .= '<tr><td>' . __('Ville') . '</td><td>' . form::field('ville', 30, 128, $client->ville) . '</td></tr>';\r
                $res .= '<tr><td>' . __('Pays') . '</td><td>' . form::combo('pays', cubeCountry::getList(), $client->pays) . '</td></tr>';\r
                $res .= '<tr><td>' . __('Adresse de facturation') . '</td><td>' . form::textarea('adresse_facturation', 40, 3, $client->adresse_facturation) . '</td></tr>';\r
-               $res .= '<tr><td>' . __('Numéro de TVA intracommunautaire') . '</td><td>' . form::field('tva_intra', 15, 13, $client->tva_intra) . '</td></tr>';\r
-               $res .= '<tr><td>' . __('Type de société') . '</td><td>' . form::combo('type', $core->client_type, $client->type). '</td></tr>';\r
+               $res .= '<tr><td>' . __('Numéro de TVA intracommunautaire') . '</td><td>' . form::field('tva_intra', 15, 64, $client->tva_intra) . '</td></tr>';\r
+               $res .= '<tr><td>' . __('Type de société') . '</td><td>' . form::combo('type', $core->client_type, $client->type) . '</td></tr>';\r
                $res .= '<tr class="light"><th colspan="2" class="light"><strong>' . __('Fluidbook Workshop') . '</strong></th></tr>';\r
                $res .= '<tr class="odd"><td>' . __('Grade') . '</td><td>' . form::combo('ws_grade', array_flip($core->ws_grades), $client->ws_grade) . '</td></tr>';\r
                if ($entreprise_id == 'new' || !$client->ws_admin) {\r
@@ -202,8 +197,7 @@ class extranetUrlClient{
                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(1);\r
                $dao = new commonDAOEntreprise($core->con);\r
@@ -212,8 +206,8 @@ class extranetUrlClient{
                $res = '<table class="liste light">';\r
                $res .= '<tr class="light"><th colspan="5"><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
@@ -225,8 +219,7 @@ class extranetUrlClient{
                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(1);\r
 \r
@@ -261,8 +254,7 @@ class extranetUrlClient{
                return $res;\r
        }\r
 \r
-       public static function formNotes($utilisateur_id)\r
-       {\r
+       public static function formNotes($utilisateur_id) {\r
                global $core;\r
                commonDroits::min(1);\r
                $dao = new commonDAOUtilisateur($core->con);\r
index 2cca5dbfcdef90bb71bf2760062936b0c58fd7b9..2769c450c72024587ee71c01fde86f476eb732bd 100644 (file)
@@ -105,7 +105,7 @@ class wsUrl {
                        $res .= '<td>' . mb_strtoupper($book->lang) . '</td>';
                        $res .= '<td>' . $book->parametres->pages . '</td>';
                        if ($droits->admin) {
-                               $res.='<td>' . $book->demo_counter . '</td>';
+                               $res .= '<td>' . $book->demo_counter . '</td>';
                        }
 
                        if ($droits->revendeur) {
@@ -128,7 +128,7 @@ class wsUrl {
                                } else {
                                        $res .= '<td>' . $core->books_status[1] . '</td>';
                                }
-                               $res.='<td>' . $book->version . '</td>';
+                               $res .= '<td>' . $book->version . '</td>';
                        }
                        if ($book->version > 1 || $droits->admin) {
                                if ($droits->admin) {
@@ -142,7 +142,7 @@ class wsUrl {
                                }
                                $res .= '<td class="bouton"><a class="popupFSBar edit btbook" rel="toolbar=yes" rev="editor_' . $book->book_id . '" href="' . SITE_PATH . 'editor/' . $book->book_id . '_' . $book->hash . '">' . $btEdit . '</a></td>';
                        } else {
-                               $res.='<td></td><td></td>';
+                               $res .= '<td></td><td></td>';
                        }
                        $res .= '<td class="bouton"><a href="' . SITE_PATH . 'stats/' . $book->book_id . '_' . $book->hash . '" class="normallink stats btbook">' . $btStats . '</a></td>';
                        if ($book->version > 1) {
@@ -152,12 +152,12 @@ class wsUrl {
                                        $res .= '<td class="bouton"><a href="#" class="openContextMenu download btbook" rel="' . $context_download_id . '" rev="' . $book->book_id . '">' . $btDownload . '</a></td>';
                                }
                        } else {
-                               $res.='<td></td>';
+                               $res .= '<td></td>';
                        }
                        if ($droits->creation && $book->status < 0) {
                                $res .= '<td class="bouton"><a href="#" rel="supprimeBook/' . $book->book_id . '" class="ajax suppr btbook" title="' . __('Êtes-vous certain de vouloir supprimer cette publication ?') . '">' . $btDel . '</a></td>';
                        } else {
-                               $res.='<td></td>';
+                               $res .= '<td></td>';
                        }
                        $res .= '</tr>';
                        $i++;
@@ -226,13 +226,13 @@ class wsUrl {
                global $core;
 
                $res = '<h1>Gestion de la collection &laquo; ' . $collection->nom . ' &raquo; <em># ' . $collection->collection_id . '</em></h1>';
-               $res.='<form method="post" action="saveCollectionComposition" enctype="multipart/form-data">';
-               $res.='<table class="max">';
-               $res.='<tr><td class="min nowrap">#</td><td>' . form::hidden('collection_id', $collection->collection_id) . $collection->collection_id . '</td></tr>';
-               $res.='<tr><td class="min nowrap">' . __('Nom de la collection') . '</td><td>' . form::field('nom', 20, 64, $collection->nom) . '</td></tr>';
-               $res.='</table>';
-               $res.='<h3>' . __('Composition') . '</h3>';
-               $res.='<a href="#" id="newGroup">' . $core->typo->Ajouter(__('Nouveau groupe')) . '</a><br /><br />';
+               $res .= '<form method="post" action="saveCollectionComposition" enctype="multipart/form-data">';
+               $res .= '<table class="max">';
+               $res .= '<tr><td class="min nowrap">#</td><td>' . form::hidden('collection_id', $collection->collection_id) . $collection->collection_id . '</td></tr>';
+               $res .= '<tr><td class="min nowrap">' . __('Nom de la collection') . '</td><td>' . form::field('nom', 20, 64, $collection->nom) . '</td></tr>';
+               $res .= '</table>';
+               $res .= '<h3>' . __('Composition') . '</h3>';
+               $res .= '<a href="#" id="newGroup">' . $core->typo->Ajouter(__('Nouveau groupe')) . '</a><br /><br />';
                $res .= '<ul>';
 
                $dao = new wsDAOCollection($core->con);
@@ -246,17 +246,17 @@ class wsUrl {
                foreach ($datas as $gid => $group) {
                        $class = 'group';
                        if ($gid && $gid == 'new_') {
-                               $class.=' empty';
+                               $class .= ' empty';
                        }
-                       $res.='<li class="' . $class . '" data-group="' . $gid . '">';
-                       $res.='<div class="g">';
-                       $res.='<a href="#" class="move"></a>';
+                       $res .= '<li class="' . $class . '" data-group="' . $gid . '">';
+                       $res .= '<div class="g">';
+                       $res .= '<a href="#" class="move"></a>';
                        $g = 'group[' . $gid . ']';
-                       $res.=__('Nom du groupe') . ' ' . form::field(array($g . '[label]'), 20, 64, $group['label']);
-                       $res.='<a href="#" class="delete"></a>';
-                       $res.='</div>';
-                       $res.='<ul>';
-                       $res.='<li style="height:2px;"></li>';
+                       $res .= __('Nom du groupe') . ' ' . form::field(array($g . '[label]'), 20, 64, $group['label']);
+                       $res .= '<a href="#" class="delete"></a>';
+                       $res .= '</div>';
+                       $res .= '<ul>';
+                       $res .= '<li style="height:2px;"></li>';
 
                        $publications = array_values($group['publications']);
                        foreach ($publications as $pid => $publication) {
@@ -264,7 +264,7 @@ class wsUrl {
                                        $pid = 'pnew_';
                                }
                                $p = $g . '[publications][' . $pid . ']';
-                               $res.='<li class="publication" data-publication="' . $pid . '"><div>';
+                               $res .= '<li class="publication" data-publication="' . $pid . '"><div>';
                                if (isset($books[$publication['id']])) {
                                        $book = $books[$publication['id']];
                                        $langs[] = $book->lang;
@@ -273,75 +273,75 @@ class wsUrl {
                                        $book->lang = '';
                                        $book->nom = '';
                                }
-                               $res.='<a href="#" class="move"></a>';
-                               $res.='<span class="lang">' . mb_strtoupper($book->lang) . '</span>';
-                               $res.='<span class="id"># ' . form::field(array($p . '[s]'), 64, 256, trim($publication['id'] . ' - ' . $book->nom, ' -'), 'publication_id') . form::hidden(array($p . '[id]'), $publication['id']) . '</span>';
-                               $res.='<span class="label">' . __('Label') . ' ' . form::field(array($p . '[label]'), 20, 64, $publication['label']) . '</span>';
-                               $res.='<a href="#" class="delete"></a>';
-                               $res.='<a href="#" class="add"></a>';
-                               $res.='<span class="online">' . form::checkbox(array($p . '[online]'), '1', $publication['online']) . '</span>';
-                               $res.='</div></li>';
+                               $res .= '<a href="#" class="move"></a>';
+                               $res .= '<span class="lang">' . mb_strtoupper($book->lang) . '</span>';
+                               $res .= '<span class="id"># ' . form::field(array($p . '[s]'), 64, 256, trim($publication['id'] . ' - ' . $book->nom, ' -'), 'publication_id') . form::hidden(array($p . '[id]'), $publication['id']) . '</span>';
+                               $res .= '<span class="label">' . __('Label') . ' ' . form::field(array($p . '[label]'), 20, 64, $publication['label']) . '</span>';
+                               $res .= '<a href="#" class="delete"></a>';
+                               $res .= '<a href="#" class="add"></a>';
+                               $res .= '<span class="online">' . form::checkbox(array($p . '[online]'), '1', $publication['online']) . '</span>';
+                               $res .= '</div></li>';
                        }
-                       $res.='</ul>';
-                       $res.='</li>';
+                       $res .= '</ul>';
+                       $res .= '</li>';
                }
 
                $langs = array_unique($langs);
 
-               $res.='</ul>';
+               $res .= '</ul>';
 
                foreach ($langs as $l) {
-                       $res.='<h3>' . __('Contenus') . ' [' . $l . ']</h3>';
-                       $res.='<table class="max">';
-                       $res.='<tr><td class="min nowrap">' . __('Titre') . '</td><td>' . form::field(array('contents[' . $l . '][titre]', 'contents_' . $l . '_titre'), 64, 64, $collection->contents[$l]['titre']) . '</td></tr>';
-                       $res.='<tr><td class="min nowrap">' . __("Titre sur l'écran d'accueil") . '</td><td>' . form::field(array('contents[' . $l . '][titrehome]', 'contents_' . $l . '_titrehome'), 64, 64, $collection->contents[$l]['titrehome']) . '</td></tr>';
-                       $res.='<tr><td class="min nowrap">' . __('A propos') . '</td><td>' . form::textarea(array('contents[' . $l . '][apropos]', 'contents_' . $l . '_apropos'), 60, 10, $collection->contents[$l]['apropos']) . '</td></tr>';
+                       $res .= '<h3>' . __('Contenus') . ' [' . $l . ']</h3>';
+                       $res .= '<table class="max">';
+                       $res .= '<tr><td class="min nowrap">' . __('Titre') . '</td><td>' . form::field(array('contents[' . $l . '][titre]', 'contents_' . $l . '_titre'), 64, 64, $collection->contents[$l]['titre']) . '</td></tr>';
+                       $res .= '<tr><td class="min nowrap">' . __("Titre sur l'écran d'accueil") . '</td><td>' . form::field(array('contents[' . $l . '][titrehome]', 'contents_' . $l . '_titrehome'), 64, 64, $collection->contents[$l]['titrehome']) . '</td></tr>';
+                       $res .= '<tr><td class="min nowrap">' . __('A propos') . '</td><td>' . form::textarea(array('contents[' . $l . '][apropos]', 'contents_' . $l . '_apropos'), 60, 10, $collection->contents[$l]['apropos']) . '</td></tr>';
                        //'splash' =>
-                       $res.='<tr><td class="min nowrap">' . __('Ecran de lancement') . ' (2048x2048px)</td><td><input type="file" name="splash_' . $l . '" />' . form::hidden(array('theme[splash_' . $l . ']', 'splash_' . $l), $collection->theme['splash_' . $l]) . '</td></tr>';
-                       $res.='<tr><td class="min nowrap">' . __('Panneau publicité') . ' (2048x2048px)</td><td><input type="file" name="ad_' . $l . '" />' . form::hidden(array('theme[ad_' . $l . ']', 'ad_' . $l), $collection->theme['ad_' . $l]) . '</td></tr>';
-                       $res.='<tr><td class="min nowrap">' . __('Lien publicité') . '</td><td>' . form::field(array('contents[' . $l . '][adlink]', 'adlink_' . $l), 64, 64, $collection->contents[$l]['adlink']) . '</td></tr>';
-                       $res.='</table>';
-               }
-
-               $res.='<h3>' . __('Paramètres avancés') . '</h3>';
-               $res.='<table class="max">';
-               $res.='<tr><td class="min nowrap">' . __('Activity') . '</td><td>' . form::field(array('settings[activity]', 'activity'), 20, 64, $collection->settings['activity']) . '</td></tr>';
-               $res.='<tr><td class="min nowrap">' . __('Build') . '</td><td>' . form::field(array('settings[build]', 'build'), 10, 64, $collection->settings['build']) . '</td></tr>';
-               $res.='<tr><td class="min nowrap">' . __('Version') . '</td><td>' . form::field(array('settings[version]', 'version'), 10, 64, $collection->settings['version']) . '</td></tr>';
-               $res.='<tr><td class="min nowrap">' . __('Orientation') . '</td><td>' . form::combo(array('settings[orientation]', 'orientation'), array(__('Portrait et Paysage') => 'unspecified', __('Portrait') => 'portrait', __('Paysage') => 'landscape'), $collection->settings['orientation']) . '</td></tr>';
-               $res.='<tr><td class="min nowrap">' . __('Full offline') . '</td><td>' . form::checkbox(array('settings[offline]', 'offline'), 1, $collection->settings['offline']) . '</td></tr>';
-               $res.='<tr><td class="min nowrap">' . __('Identifiant de l\'application') . '</td><td>' . form::field(array('settings[namespace]', 'namespace'), 64, 64, $collection->settings['namespace']) . '</td></tr>';
-               $res.='<tr><td class="min nowrap">' . __('Certificat APNS') . ' Dev (' . __('Fichier .pem') . ')</td><td><input type="file" name="apns_dev" /></td></tr>';
-               $res.='<tr><td class="min nowrap">' . __('Certificat APNS') . ' Prod (' . __('Fichier .pem') . ')</td><td><input type="file" name="apns_prod" /></td></tr>';
-               $res.='<tr><td class="min nowrap">' . __('Versions iOS') . '</td><td>' . form::field(array('settings[v_ios]', 'namespace'), 64, 64, $collection->settings['v_ios']) . '</td></tr>';
-               $res.='<tr><td class="min nowrap">' . __('Versions Android') . '</td><td>' . form::field(array('settings[v_android]', 'namespace'), 64, 64, $collection->settings['v_android']) . '</td></tr>';
-               $res.='</table>';
-
-               $res.='<h3>' . __('Applications offline') . '</h3>';
-               $res.='<table class="max">';
-               $res.='<tr><td class="min nowrap">' . __("Filtres d'exclusion") . '</td><td>' . form::textarea(array('settings[offline_exclude]', 'offline_exclude'), 30, 3, $collection->settings['offline_exclude']) . '</td></tr>';
-               $res.='<tr><td class="min nowrap">' . __("Synchronisations supplémentaires") . '</td><td>' . form::textarea(array('settings[offline_syncs]', 'offline_syncs'), 30, 3, $collection->settings['offline_syncs']) . '</td></tr>';
-               $res.='</table>';
-
-               $res.='<h3>' . __('Thème') . '</h3>';
-               $res.='<table class="max">';
+                       $res .= '<tr><td class="min nowrap">' . __('Ecran de lancement') . ' (2048x2048px)</td><td><input type="file" name="splash_' . $l . '" />' . form::hidden(array('theme[splash_' . $l . ']', 'splash_' . $l), $collection->theme['splash_' . $l]) . '</td></tr>';
+                       $res .= '<tr><td class="min nowrap">' . __('Panneau publicité') . ' (2048x2048px)</td><td><input type="file" name="ad_' . $l . '" />' . form::hidden(array('theme[ad_' . $l . ']', 'ad_' . $l), $collection->theme['ad_' . $l]) . '</td></tr>';
+                       $res .= '<tr><td class="min nowrap">' . __('Lien publicité') . '</td><td>' . form::field(array('contents[' . $l . '][adlink]', 'adlink_' . $l), 64, 64, $collection->contents[$l]['adlink']) . '</td></tr>';
+                       $res .= '</table>';
+               }
+
+               $res .= '<h3>' . __('Paramètres avancés') . '</h3>';
+               $res .= '<table class="max">';
+               $res .= '<tr><td class="min nowrap">' . __('Activity') . '</td><td>' . form::field(array('settings[activity]', 'activity'), 20, 64, $collection->settings['activity']) . '</td></tr>';
+               $res .= '<tr><td class="min nowrap">' . __('Build') . '</td><td>' . form::field(array('settings[build]', 'build'), 10, 64, $collection->settings['build']) . '</td></tr>';
+               $res .= '<tr><td class="min nowrap">' . __('Version') . '</td><td>' . form::field(array('settings[version]', 'version'), 10, 64, $collection->settings['version']) . '</td></tr>';
+               $res .= '<tr><td class="min nowrap">' . __('Orientation') . '</td><td>' . form::combo(array('settings[orientation]', 'orientation'), array(__('Portrait et Paysage') => 'unspecified', __('Portrait') => 'portrait', __('Paysage') => 'landscape'), $collection->settings['orientation']) . '</td></tr>';
+               $res .= '<tr><td class="min nowrap">' . __('Full offline') . '</td><td>' . form::checkbox(array('settings[offline]', 'offline'), 1, $collection->settings['offline']) . '</td></tr>';
+               $res .= '<tr><td class="min nowrap">' . __('Identifiant de l\'application') . '</td><td>' . form::field(array('settings[namespace]', 'namespace'), 64, 64, $collection->settings['namespace']) . '</td></tr>';
+               $res .= '<tr><td class="min nowrap">' . __('Certificat APNS') . ' Dev (' . __('Fichier .pem') . ')</td><td><input type="file" name="apns_dev" /></td></tr>';
+               $res .= '<tr><td class="min nowrap">' . __('Certificat APNS') . ' Prod (' . __('Fichier .pem') . ')</td><td><input type="file" name="apns_prod" /></td></tr>';
+               $res .= '<tr><td class="min nowrap">' . __('Versions iOS') . '</td><td>' . form::field(array('settings[v_ios]', 'namespace'), 64, 64, $collection->settings['v_ios']) . '</td></tr>';
+               $res .= '<tr><td class="min nowrap">' . __('Versions Android') . '</td><td>' . form::field(array('settings[v_android]', 'namespace'), 64, 64, $collection->settings['v_android']) . '</td></tr>';
+               $res .= '</table>';
+
+               $res .= '<h3>' . __('Applications offline') . '</h3>';
+               $res .= '<table class="max">';
+               $res .= '<tr><td class="min nowrap">' . __("Filtres d'exclusion") . '</td><td>' . form::textarea(array('settings[offline_exclude]', 'offline_exclude'), 30, 3, $collection->settings['offline_exclude']) . '</td></tr>';
+               $res .= '<tr><td class="min nowrap">' . __("Synchronisations supplémentaires") . '</td><td>' . form::textarea(array('settings[offline_syncs]', 'offline_syncs'), 30, 3, $collection->settings['offline_syncs']) . '</td></tr>';
+               $res .= '</table>';
+
+               $res .= '<h3>' . __('Thème') . '</h3>';
+               $res .= '<table class="max">';
                $images = array('back' => __('Image de fond'), 'etagere' => __("Image de l'étagère"), 'icon' => __("Icône de l'application") . ' (1024x1024px)');
                foreach ($images as $i => $label) {
-                       $res.='<tr><td class="min nowrap">' . $label . '</td><td><input type="file" name="' . $i . '" />' . form::hidden(array('theme[' . $i . ']', 'theme_' . $i), $collection->theme[$i]) . '</td></tr>';
+                       $res .= '<tr><td class="min nowrap">' . $label . '</td><td><input type="file" name="' . $i . '" />' . form::hidden(array('theme[' . $i . ']', 'theme_' . $i), $collection->theme[$i]) . '</td></tr>';
                }
-               $res.='<tr><td class="min nowrap">' . __('Couleur principale') . '</td><td>#' . form::field(array('settings[couleurA]', 'couleurA'), 6, 6, $collection->settings['couleurA']) . '</td></tr>';
-               $res.='<tr><td class="min nowrap">' . __('Couleur secondaire') . '</td><td>#' . form::field(array('settings[couleurB]', 'couleurB'), 6, 6, $collection->settings['couleurB']) . '</td></tr>';
-               $res.='<tr><td class="min nowrap">' . __('Couleur des textes') . '</td><td>#' . form::field(array('settings[couleurC]', 'couleurC'), 6, 6, $collection->settings['couleurC']) . '</td></tr>';
-               $res.='<tr><td class="min nowrap">' . __('Couleur de fond') . '</td><td>#' . form::field(array('settings[couleurD]', 'couleurD'), 6, 6, $collection->settings['couleurD']) . '</td></tr>';
+               $res .= '<tr><td class="min nowrap">' . __('Couleur principale') . '</td><td>#' . form::field(array('settings[couleurA]', 'couleurA'), 6, 6, $collection->settings['couleurA']) . '</td></tr>';
+               $res .= '<tr><td class="min nowrap">' . __('Couleur secondaire') . '</td><td>#' . form::field(array('settings[couleurB]', 'couleurB'), 6, 6, $collection->settings['couleurB']) . '</td></tr>';
+               $res .= '<tr><td class="min nowrap">' . __('Couleur des textes') . '</td><td>#' . form::field(array('settings[couleurC]', 'couleurC'), 6, 6, $collection->settings['couleurC']) . '</td></tr>';
+               $res .= '<tr><td class="min nowrap">' . __('Couleur de fond') . '</td><td>#' . form::field(array('settings[couleurD]', 'couleurD'), 6, 6, $collection->settings['couleurD']) . '</td></tr>';
 
-               $res.='</table>';
+               $res .= '</table>';
 
-               $res.='<a href="#" class="submit right">' . $core->typo->Ajouter(__('Enregistrer')) . '</a>';
-               $res.='</form>';
-               $res.='<p class="clear"></p>';
-               $res.='<h3>' . __('Versions') . '</h3>';
-               $res.='<form action="collectionVersionPublish/' . $collection->collection_id . '" method="post">';
-               $res.='<a href="#" class="ajax" rel="collectionVersionCreate/' . $collection->collection_id . '">' . $core->typo->Ajouter(__('Créer une version')) . '</a><br /><br />';
+               $res .= '<a href="#" class="submit right">' . $core->typo->Ajouter(__('Enregistrer')) . '</a>';
+               $res .= '</form>';
+               $res .= '<p class="clear"></p>';
+               $res .= '<h3>' . __('Versions') . '</h3>';
+               $res .= '<form action="collectionVersionPublish/' . $collection->collection_id . '" method="post">';
+               $res .= '<a href="#" class="ajax" rel="collectionVersionCreate/' . $collection->collection_id . '">' . $core->typo->Ajouter(__('Créer une version')) . '</a><br /><br />';
                $r = $core->con->select('SELECT * FROM book_collection_compile WHERE collection_id=\'' . $collection->collection_id . '\' ORDER BY compile_date DESC');
 
                $v_ios = self::getSelectVersions($collection->settings['v_ios']);
@@ -349,10 +349,10 @@ class wsUrl {
 
 
                if (!$r->count()) {
-                       $res.=__('Aucune version de la collection n\'a été crée');
+                       $res .= __('Aucune version de la collection n\'a été crée');
                } else {
-                       $res.='<table class="max">';
-                       $res.='<tr><th class="left">' . __('Date') . '</th><th class="left">iOS</th><th class="left">Android</th><th class="min nowrap"></th></tr>';
+                       $res .= '<table class="max">';
+                       $res .= '<tr><th class="left">' . __('Date') . '</th><th class="left">iOS</th><th class="left">Android</th><th class="min nowrap"></th></tr>';
                        while ($r->fetch()) {
 
                                if ($r->online_ios || $r->online_android) {
@@ -364,26 +364,26 @@ class wsUrl {
                                $pub_ios = form::combo('version[' . $r->compile_date . '][ios]', $v_ios, $r->online_ios);
                                $pub_android = form::combo('version[' . $r->compile_date . '][android]', $v_android, $r->online_android);
 
-                               $res.='<tr><td>' . date('Y-m-d H:i:s', $r->compile_date) . '</td><td>' . $pub_ios . '</td><td>' . $pub_android . '</td><td class="min nowrap">' . $del . '</td></tr>';
+                               $res .= '<tr><td>' . date('Y-m-d H:i:s', $r->compile_date) . '</td><td>' . $pub_ios . '</td><td>' . $pub_android . '</td><td class="min nowrap">' . $del . '</td></tr>';
                        }
-                       $res.='</table>';
-               }
-               $res.='<a href="#" class="submit right">' . $core->typo->Ajouter(__('Enregistrer')) . '</a>';
-               $res.='</form>';
-               $res.='<p class="clear"></p>';
-               $res.='<h3>' . __('Notifications') . '</h3>';
-               $res.='<p>' . __('Indiquez le texte de la notification à envoyer aux utilisateurs') . ' (' . __('Max 200 caractères') . ').<br />' . __('Laissez vide si vous souhaitez simplement afficher un badge') . '</p>';
-               $res.='<form method="post" action="publishCollection">';
-               $res.=form::hidden('collection', $collection->collection_id);
-               $res.='<table class="max">';
+                       $res .= '</table>';
+               }
+               $res .= '<a href="#" class="submit right">' . $core->typo->Ajouter(__('Enregistrer')) . '</a>';
+               $res .= '</form>';
+               $res .= '<p class="clear"></p>';
+               $res .= '<h3>' . __('Notifications') . '</h3>';
+               $res .= '<p>' . __('Indiquez le texte de la notification à envoyer aux utilisateurs') . ' (' . __('Max 200 caractères') . ').<br />' . __('Laissez vide si vous souhaitez simplement afficher un badge') . '</p>';
+               $res .= '<form method="post" action="publishCollection">';
+               $res .= form::hidden('collection', $collection->collection_id);
+               $res .= '<table class="max">';
                foreach ($langs as $lang) {
-                       $res.='<tr><td class="min nowrap">' . __('Notification') . '[' . $lang . ']</td><td class="pad">' . form::textArea(array('notification[' . $lang . ']'), 60, 3) . '</td></tr>';
+                       $res .= '<tr><td class="min nowrap">' . __('Notification') . '[' . $lang . ']</td><td class="pad">' . form::textArea(array('notification[' . $lang . ']'), 60, 3) . '</td></tr>';
                }
-               $res.='<tr><td colspan="2" class="right"></td><a href="#" class="submit">' . $core->typo->Ajouter(__('Publier et notifier les utilisateurs')) . '</a></tr>';
-               $res.='</table>';
-               $res.='</form>';
-               $res.='<h3>' . __('Export') . '</h3>';
-               $res.='<a href="#" class="right ajax" rel="exportCollection/' . $collection->collection_id . '/android">' . $core->typo->Ajouter(__('Exporter pour Android')) . '</a> <a href="#" class="right ajax" rel="exportCollection/' . $collection->collection_id . '/ios">' . $core->typo->Ajouter(__('Exporter pour iOS')) . '</a>';
+               $res .= '<tr><td colspan="2" class="right"></td><a href="#" class="submit">' . $core->typo->Ajouter(__('Publier et notifier les utilisateurs')) . '</a></tr>';
+               $res .= '</table>';
+               $res .= '</form>';
+               $res .= '<h3>' . __('Export') . '</h3>';
+               $res .= '<a href="#" class="right ajax" rel="exportCollection/' . $collection->collection_id . '/android">' . $core->typo->Ajouter(__('Exporter pour Android')) . '</a> <a href="#" class="right ajax" rel="exportCollection/' . $collection->collection_id . '/ios">' . $core->typo->Ajouter(__('Exporter pour iOS')) . '</a>';
 
                return $res;
        }
@@ -431,14 +431,14 @@ class wsUrl {
                $res .= '<th>' . commonUrl::orderby(__('Nom de la collection'), 'nom', $settings, 'sort' . $change) . '</th>';
                $res .= '<th>' . commonUrl::orderby(__('Propriétaire'), 'proprietaire_nom', $settings, 'sort' . $change) . '</th>';
                $res .= str_repeat('<th class="min"></th>', 4);
-               $res.='</tr>';
+               $res .= '</tr>';
 
                $i = 0;
                foreach ($liste as $collection) {
                        $odd = cubeMath::isOdd($i) ? ' class="odd"' : '';
-                       $res.='<tr>';
-                       $res.='<td>' . $collection->collection_id . '</td>';
-                       $res.='<td>' . $collection->nom . '</td>';
+                       $res .= '<tr>';
+                       $res .= '<td>' . $collection->collection_id . '</td>';
+                       $res .= '<td>' . $collection->nom . '</td>';
                        if ($droits->revendeur) {
                                $p = str_replace(" (", '<br /><em>', html::escapeHTML($collection->proprietaire_nom));
                                $p = str_replace(')', '</em>', $p);
@@ -452,7 +452,7 @@ class wsUrl {
                        $res .= '<td class="bouton"><!--<a href="#" class="normallink download btbook">' . $btDownload . '</a>--></td>';
                        $res .= '<td class="bouton"><!--<a href="#" class="normallink suppr btbook">' . $btDel . '</a>--></td>';
 
-                       $res.='</tr>';
+                       $res .= '</tr>';
 
                        $i++;
                }
@@ -571,11 +571,11 @@ class wsUrl {
 
                if (wsDroits::admin()) {
                        $viewers = array(array('version' => 'viewer', 'title' => __('Version Flash'), 'icon' => cubeMedia::image(IMG . '/flash.png')),
-                               array('version' => 'viewerh', 'title' => __('Version HTML5'), 'icon' => cubeMedia::image(IMG . '/html5.png')),
-                               array('version' => 'vieweru', 'title' => __('Version Flash') . ' (' . __('debuggage') . ')', 'icon' => cubeMedia::image(IMG . '/flashbug.png')),
-                               array('version' => 'viewerhu', 'title' => __('Version HTML5') . ' (' . __('debuggage') . ')', 'icon' => cubeMedia::image(IMG . '/html5bug.png')),
-                               //array('version' => 'viewerhu', 'title' => __('Widget HTML5'), 'icon' => cubeMedia::image(IMG . '/html5bug.png'), 'file' => 'widget.html', 'pattern' => '$1_$2_$3'),
-                               array('version' => 'viewer1', 'title' => __('Version 1'), 'icon' => cubeMedia::image(IMG . '/flash.png'))
+                                        array('version' => 'viewerh', 'title' => __('Version HTML5'), 'icon' => cubeMedia::image(IMG . '/html5.png')),
+                                        array('version' => 'vieweru', 'title' => __('Version Flash') . ' (' . __('debuggage') . ')', 'icon' => cubeMedia::image(IMG . '/flashbug.png')),
+                                        array('version' => 'viewerhu', 'title' => __('Version HTML5') . ' (' . __('debuggage') . ')', 'icon' => cubeMedia::image(IMG . '/html5bug.png')),
+                                        //array('version' => 'viewerhu', 'title' => __('Widget HTML5'), 'icon' => cubeMedia::image(IMG . '/html5bug.png'), 'file' => 'widget.html', 'pattern' => '$1_$2_$3'),
+                                        array('version' => 'viewer1', 'title' => __('Version 1'), 'icon' => cubeMedia::image(IMG . '/flash.png'))
                        );
                }
 
@@ -650,8 +650,8 @@ class wsUrl {
                $res = commonPage::bh();
                $res .= '<table class="liste">';
                $res .= '<tr><td><a href="' . SITE_PATH . 'exportLangAsExcel/' . $lang_id . '">' . __('Exporter au format Excel') . '</a>';
-               $res.=' | <a href="' . SITE_PATH . 'exportAllLangsAsExcel/' . $lang_id . '">' . __('Exporter toutes les langues au format Excel') . '</a>';
-               $res.='</td></tr>';
+               $res .= ' | <a href="' . SITE_PATH . 'exportAllLangsAsExcel/' . $lang_id . '">' . __('Exporter toutes les langues au format Excel') . '</a>';
+               $res .= '</td></tr>';
                $res .= '</table>';
                $res .= commonPage::bf();
 
@@ -858,41 +858,41 @@ html{height:100%}' . "\n";
                $res .= '</head>';
                $res .= '<body onload="this.focus();">';
                $res .= '<div id="restoreLinks">';
-               $res.='<div>';
-               $res.='<h2>' . __('Import') . '</h2>';
-               $res.='<div class="center">';
-               $res.='<form action="importLinksAsExcel/' . $book_id . '" method="post" enctype="multipart/form-data" class="notajax" id="importLinksAsExcel">';
-               $res.=__("Importer des liens à partir d'un fichier Excel") . ' : <input type="file" name="file" accept="*.xlsx" />';
-               $res.='<input type="submit" value="' . __('Importer') . '" />';
-               $res.='</form>';
-               $res.='</div>';
-               $res.='</div>';
-               $res.='<hr />';
-
-               $res.='<div id="linksOffset">';
-               $res.='<h2>' . __('Décalage de pages') . '</h2>';
-               $res.='<form action="offsetLinks/' . $book_id . '" method="post" id="offsetLinks">';
+               $res .= '<div>';
+               $res .= '<h2>' . __('Import') . '</h2>';
+               $res .= '<div class="center">';
+               $res .= '<form action="importLinksAsExcel/' . $book_id . '" method="post" enctype="multipart/form-data" class="notajax" id="importLinksAsExcel">';
+               $res .= __("Importer des liens à partir d'un fichier Excel") . ' : <input type="file" name="file" accept="*.xlsx" />';
+               $res .= '<input type="submit" value="' . __('Importer') . '" />';
+               $res .= '</form>';
+               $res .= '</div>';
+               $res .= '</div>';
+               $res .= '<hr />';
+
+               $res .= '<div id="linksOffset">';
+               $res .= '<h2>' . __('Décalage de pages') . '</h2>';
+               $res .= '<form action="offsetLinks/' . $book_id . '" method="post" id="offsetLinks">';
                $offset = form::field('offset', 3, 5);
                $from = form::field('from', 3, 5);
-               $res.=sprintf(__('Décaler les liens de %s pages à partir de la page %s'), $offset, $from) . '<br />';
-               $res.='<label>' . form::checkbox('internal', 1, true) . ' ' . __('Appliquer le décalages sur les numéros de pages dans les liens internes') . '</label><br />';
-               $res.='<input type="submit" value="' . __('Procéder au décalage') . '" />';
-               $res.='</form>';
-               $res.='</div>';
-               $res.='<hr />';
-
-               $res.='<h2>' . __('Réimporter les liens du fichier PDF') . '</h2>';
-               $res.='<a class="restoreLink" rel="' . $book_id . '/pdf" href="#">Restaurer</a>';
-               $res.='<hr />';
-
-               $res.='<h2>' . __('Historique') . '</h2>';
+               $res .= sprintf(__('Décaler les liens de %s pages à partir de la page %s'), $offset, $from) . '<br />';
+               $res .= '<label>' . form::checkbox('internal', 1, true) . ' ' . __('Appliquer le décalages sur les numéros de pages dans les liens internes') . '</label><br />';
+               $res .= '<input type="submit" value="' . __('Procéder au décalage') . '" />';
+               $res .= '</form>';
+               $res .= '</div>';
+               $res .= '<hr />';
+
+               $res .= '<h2>' . __('Réimporter les liens du fichier PDF') . '</h2>';
+               $res .= '<a class="restoreLink" rel="' . $book_id . '/pdf" href="#">Restaurer</a>';
+               $res .= '<hr />';
+
+               $res .= '<h2>' . __('Historique') . '</h2>';
                $res .= '<table class="liste" style="width:100%;min-width:0;">';
                $res .= '<tr>';
                $res .= '<th>' . __('Date') . '</th>';
                $res .= '<th class="center">' . __('Liens') . '</th>';
                $res .= '<th class="center">' . __('Règles') . '</th>';
-               $res.='<th class="center">' . __('Utilisateur') . '</th>';
-               $res.='<th class="center">' . __('Informations') . '</th>';
+               $res .= '<th class="center">' . __('Utilisateur') . '</th>';
+               $res .= '<th class="center">' . __('Informations') . '</th>';
                $res .= '<th class="min"></th>';
                $res .= '<th class="min"></th>';
                $res .= '</tr>';
@@ -903,8 +903,8 @@ html{height:100%}' . "\n";
                        $res .= '<td>' . date('Y-m-d H:i:s', $time) . '</td>';
                        $res .= '<td class="center">' . $infos['links'] . '</td>';
                        $res .= '<td class="center">' . $infos['rulers'] . '</td>';
-                       $res.='<td class="center">' . $infos['user'] . '</td>';
-                       $res.='<td class="center">' . $infos['comments'] . '</td>';
+                       $res .= '<td class="center">' . $infos['user'] . '</td>';
+                       $res .= '<td class="center">' . $infos['comments'] . '</td>';
                        $res .= '<td><a href="#" rel="' . $book_id . '/' . $time . '" class="restoreLink">' . __('Restaurer') . '</a></td>';
                        $res .= '<td><a href="' . SITE_PATH . 'exportLinksAsExcel/' . $book_id . '/' . $time . '">' . str_replace(' ', '&nbsp;', __('Export Excel')) . '</a></td>';
                        $res .= '</tr>';
@@ -944,9 +944,9 @@ html{height:100%}' . "\n";
        public static function editComposition($book_id, $hash) {
 
                $fv = array(session_name() => session_id(),
-                       'book_id' => $book_id,
-                       'hash' => $hash,
-                       'url' => '/');
+                           'book_id' => $book_id,
+                           'hash' => $hash,
+                           'url' => '/');
 
                $mtime = filemtime(ROOT . '/swf/composer.swf');
                return cubeMedia::flash2(WEBROOT . '/swf/composer.swf?junk=' . $mtime, '100%', '100%', $fv, 'composerSwf', 'swfPanel', 10, '#d2d3c7', '', 'false', 'noscale', 'normal', array(), false, true, false);
@@ -1260,7 +1260,7 @@ html{height:100%}' . "\n";
                        $dao->addDemoCount($book_id);
                }
 
-               $dao->compile($book_id, (string) $version);
+               $dao->compile($book_id, (string)$version);
 
                $daoTheme = new wsDAOTheme($core->con);
                $theme = $daoTheme->selectById($book->theme, 'themes');
@@ -1288,8 +1288,8 @@ html{height:100%}' . "\n";
                $res = '<html>';
                $res .= '<head>';
                $res .= '<title>' . $book->parametres->title . '</title>';
-               $res.='<meta name="google" value="notranslate">';
-               $res.='<style type="text/css" media="print">*{ visibility: hidden; display: none }</style>';
+               $res .= '<meta name="google" value="notranslate">';
+               $res .= '<style type="text/css" media="print">*{ visibility: hidden; display: none }</style>';
                // Entêtes Facebook
                if ($book->parametres->facebook) {
                        $meta['og:title'] = ($book->parametres->facebook_title == '') ? $book->parametres->title : $book->parametres->facebook_title;
@@ -1313,16 +1313,16 @@ html{height:100%}' . "\n";
                $res .= '<body style="background-color:#' . $theme->parametres->loadingBackColor . '" onload="this.focus();">';
                $res .= '<div id="fluidbook"><div style="width:734px;margin:100px auto;"><a href="http://get.adobe.com/flashplayer/" target="_blank"></a></div></div>';
                $res .= "\n" . '<script type="text/javascript">' . "\n";
-               $res.='if(isMobile()){' . "\n";
-               $res.="\t" . $redirectMobile . "\n";
-               $res.='} else if(isBadMobile()) {' . "\n";
-               $res.="\t" . $redirectPDF . "\n";
-               $res.='} else {' . "\n";
+               $res .= 'if(isMobile()){' . "\n";
+               $res .= "\t" . $redirectMobile . "\n";
+               $res .= '} else if(isBadMobile()) {' . "\n";
+               $res .= "\t" . $redirectPDF . "\n";
+               $res .= '} else {' . "\n";
                $res .= "\t" . 'swfobject.embedSWF("index.swf", "fluidbook", "100%", "100%", "' . $flashVersion . '",';
                $res .= '"", ' . json_encode($fv) . ',';
                $res .= '{"allowScriptAccess":"always","quality":"high","scale":"noscale","wmode":getWmode(),"allowFullScreen":"true","allowFullScreenInteractive":"true"},{"bgcolor":"#' . $theme->parametres->loadingBackColor . '"}';
                $res .= ');' . "\n";
-               $res.='}' . "\n";
+               $res .= '}' . "\n";
                $res .= '</script>';
                $js = array('fluidbook.js');
                $jsvar = array();
@@ -1452,12 +1452,12 @@ html{height:100%}' . "\n";
                        $res .= '<tr class="new"><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>';
                } else {
                        $res .= '<tr><td>' . __('Créer une tâche') . ' : </td><td>'
-                                       . form::hidden('book_id', $book_id)
-                                       . form::hidden('projet_id', $projet_id)
-                                       . form::hidden('tache', '0')
-                                       . form::field('nom', 32, 1024, 'Fluidbook #' . $book->book_id . ' : ' . $book->nom)
-                                       . ' ' . __('ayant le budget suivant')
-                                       . ' ' . form::field('budget', 6, 6) . '</td></tr>';
+                               . form::hidden('book_id', $book_id)
+                               . form::hidden('projet_id', $projet_id)
+                               . form::hidden('tache', '0')
+                               . form::field('nom', 32, 1024, 'Fluidbook #' . $book->book_id . ' : ' . $book->nom)
+                               . ' ' . __('ayant le budget suivant')
+                               . ' ' . form::field('budget', 6, 6) . '</td></tr>';
                }
 
                return $res;
@@ -1495,7 +1495,7 @@ html{height:100%}' . "\n";
                }
 
                $res = '<tr><td>' . __("Dossier d'installation") . '</td><td><em>' . $s . '</em> ' . form::field('dir', 60, 128, $dir) . '</td></tr>';
-               $res.='<tr><td colspan="2">' . __("A l'issue de l'installation, vous serez dirigé vers le serveur sur lequel la publication a été installée") . '</td></tr>';
+               $res .= '<tr><td colspan="2">' . __("A l'issue de l'installation, vous serez dirigé vers le serveur sur lequel la publication a été installée") . '</td></tr>';
                return $res;
        }
 
@@ -1592,7 +1592,6 @@ html{height:100%}' . "\n";
                ob_clean();
 
 
-
                $extractor = new wsPDFFontExtractor(WS_DOCS . '/' . $documentId);
                $extractor->extract();
 
@@ -1621,16 +1620,16 @@ html{height:100%}' . "\n";
 
                $res = commonPage::barre();
                $res .= commonPage::tMain();
-               $res.=commonPage::bh();
-               $res.='<table class="liste">';
-               $res.= self::formatHelp($theme->getHelp());
-               $res.='</table>';
-               $res.=commonPage::bf();
-               $res.=commonPage::bh();
-               $res.='<table class="liste">';
-               $res.= self::formatHelp($book->getHelp());
-               $res.='</table>';
-               $res.=commonPage::bf();
+               $res .= commonPage::bh();
+               $res .= '<table class="liste">';
+               $res .= self::formatHelp($theme->getHelp());
+               $res .= '</table>';
+               $res .= commonPage::bf();
+               $res .= commonPage::bh();
+               $res .= '<table class="liste">';
+               $res .= self::formatHelp($book->getHelp());
+               $res .= '</table>';
+               $res .= commonPage::bf();
                $res .= commonPage::bMain();
 
                return $res;
@@ -1641,16 +1640,16 @@ html{height:100%}' . "\n";
 
                $res = '';
                foreach ($rubriques as $label => $fields) {
-                       $res.='<tr class="odd"><th colspan="5">' . $label . '</th></tr>';
+                       $res .= '<tr class="odd"><th colspan="5">' . $label . '</th></tr>';
                        foreach ($fields as $name => $t) {
                                if (is_string($t) && $t == '|') {
                                        $res .= '<tr class="odd"><th></th></tr>';
                                } else {
-                                       $res.= '<tr>';
+                                       $res .= '<tr>';
                                        foreach ($t as $tt) {
-                                               $res.='<td>' . $tt . '</td>';
+                                               $res .= '<td>' . $tt . '</td>';
                                        }
-                                       $res.='</tr>';
+                                       $res .= '</tr>';
                                }
                        }
                }
@@ -1786,7 +1785,7 @@ html{height:100%}' . "\n";
                $res .= '<tr><td>' . __('Site internet') . '</td><td>' . form::field('site', 30, 128, $client->site) . '</td></tr>';
                if (wsDroits::admin(false)) {
                        $res .= '<tr><td>' . __('Adresse de facturation') . '</td><td>' . form::textarea('adresse_facturation', 40, 3, $client->adresse_facturation) . '</td></tr>';
-                       $res .= '<tr><td>' . __('Numéro de TVA intracommunautaire') . '</td><td>' . form::field('tva_intra', 15, 13, $client->tva_intra) . '</td></tr>';
+                       $res .= '<tr><td>' . __('Numéro de TVA intracommunautaire') . '</td><td>' . form::field('tva_intra', 15, 64, $client->tva_intra) . '</td></tr>';
                }
                // Bloc Fluidbook Workshop
                if (wsDroits::admin(false)) {
@@ -1869,7 +1868,7 @@ html{height:100%}' . "\n";
                        $collection = $dao->cree();
                }
 
-               $res.='<tr><td>#</td><td>' . form::hidden('collection_id', $collection->collection_id) . $collection->collection_id . '</td></tr>';
+               $res .= '<tr><td>#</td><td>' . form::hidden('collection_id', $collection->collection_id) . $collection->collection_id . '</td></tr>';
                $res .= '<tr><td>Nom de la collection</td><td>' . form::field('nom', 20, 64, $collection->nom) . '</td></tr>';
                return $res;
        }
@@ -2052,11 +2051,11 @@ html{height:100%}' . "\n";
                $res .= '<br /><br />';
 
                if ($demande->revendeur != $revendeur_id || $demande->revendeur != $core->user->utilisateur_id || $demande->status == 0) {
-                       $res.='<p class="center">' . __('Cette demande de devis ne vous est pas adressée.') . '</p>';
+                       $res .= '<p class="center">' . __('Cette demande de devis ne vous est pas adressée.') . '</p>';
                } else if ($demande->status == 2) {
-                       $res.='<p class="center">' . __('Merci ! Nous avons bien pris en compte votre réponse.') . '<br /><br />';
-                       $res.='<a href="' . $dao->getMailto($demande_id) . '">' . __("Ouvrir l'email de réponse") . '</a>';
-                       $res.='</p>';
+                       $res .= '<p class="center">' . __('Merci ! Nous avons bien pris en compte votre réponse.') . '<br /><br />';
+                       $res .= '<a href="' . $dao->getMailto($demande_id) . '">' . __("Ouvrir l'email de réponse") . '</a>';
+                       $res .= '</p>';
                } else {
                        $res .= '<p>' . __('Si vous acceptez de traiter la demande suivante, veuillez cliquer sur le bouton "Accepter la demande" situé à droite de la description.');
                        $res .= ' ' . __('Vous avez également la possibilité de décliner la demande en cliquant sur le bouton "Décliner la demande"') . "</p>";
@@ -2071,7 +2070,7 @@ html{height:100%}' . "\n";
                        $res .= '<tr><td>' . __('Client') . ' / ' . __('Prospect') . '</td><td><a href="#" class="popup" rel="formClient/' . $demande->entreprise . '">' . $demande->utilisateur_nom . '</a></td></tr>';
                        $res .= '<tr><td>' . __('Nombre de pages') . '</td><td>' . $demande->pages . '</td>';
                        $res .= '<td>' . '<a href="#" class="ajax suppr btbook" rel="reponseDemande/' . $demande_id . '/' . $revendeur_id . '/0"><div></div><span>' . __('Décliner la demande') . '</span></a>' . '</td>';
-                       $res .='</tr>';
+                       $res .= '</tr>';
                        $res .= '<tr><td>' . __('Nombre de liens') . '</td><td>' . $demande->liens . '</td></tr>';
                        $res .= '<tr><td>' . __('Nombre de langues') . '</td><td>' . $demande->langues . '</td></tr>';
                        $res .= '<tr><td>' . __('Détails') . '</td><td>' . $demande->details . '</td></tr>';