From: vincent@cubedesigners.com Date: Thu, 11 Aug 2011 08:18:19 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=71b08a2b953ae3de07edcf18e2e994bbc18ebd01;p=cubeextranet.git --- diff --git a/inc/commons/class.common.core.php b/inc/commons/class.common.core.php index 74a9986dd..3d4e90ae9 100644 --- a/inc/commons/class.common.core.php +++ b/inc/commons/class.common.core.php @@ -14,7 +14,7 @@ class commonCore extends cubeCore { cubeLang::set(); try { - $this->authentifie(); + $this->authentifie(); } catch (Exception $e) { } @@ -393,6 +393,13 @@ class commonCore extends cubeCore { // Clés $db->book_pages->primary('pk_book_pages', 'book_id', 'book_page'); // . + // Table versions de composition + $db->book_pages_versions->book_id('integer', 0, false); + $db->book_pages_versions->update('integer', 0, false); + $db->book_pages_versions->composition('text', 0, false); + // Clés + $db->book_pages_versions->primary('pk_book_pages_versions', 'book_id'); + $db->book_pages_versions->index('idx_book_pages_versions', 'BTREE', 'update'); // Table de cache des urls courtes $db->book_short_url->long_url('varchar', 255, false); $db->book_short_url->short_url('varchar', 64, false); @@ -472,7 +479,7 @@ class commonCore extends cubeCore { . 'SUM(f.total_ht) AS ca ' . 'FROM entreprises e LEFT JOIN impayes_entreprises i ON e.entreprise_id=i.entreprise LEFT JOIN utilisateurs u ON u.entreprise=e.entreprise_id AND u.grade=0 LEFT JOIN projets p ON p.client=u.utilisateur_id LEFT JOIN factures f ON f.projet=p.projet_id AND f.status IN(1,2) ' . 'GROUP BY u.utilisateur_id', 'TEMPTABLE'); - $this->views->createView('taches_books','SELECT tache,GROUP_CONCAT(book_id ORDER BY book_id ASC SEPARATOR ",") AS books FROM books WHERE tache>0 GROUP BY tache'); + $this->views->createView('taches_books', 'SELECT tache,GROUP_CONCAT(book_id ORDER BY book_id ASC SEPARATOR ",") AS books FROM books WHERE tache>0 GROUP BY tache'); $this->views->createView('taches_vue', 'SELECT taches.tache_id,taches.nom,taches.categorie,taches.type,taches.budget,taches.projet,taches.taux_journalier,tb.books, ' . '(SUM(timereport.heures)/' . JOURNEE . ') AS jours_consommes, ((SUM(timereport.heures)/' . JOURNEE . ')/(taches.budget/taches.taux_journalier))*100 AS progression,(taches.budget/taches.taux_journalier) AS jours_prevus ' . 'FROM taches LEFT JOIN timereport ON taches.tache_id=timereport.tache_id ' @@ -544,7 +551,7 @@ class commonCore extends cubeCore { . 'LEFT JOIN utilisateurs_entreprise r ON d.revendeur=r.utilisateur_id ' . 'LEFT JOIN utilisateurs_entreprise c ON d.utilisateur=c.utilisateur_id ' . 'LEFT JOIN utilisateurs a ON d.administrateur=a.utilisateur_id'); - cubeDb::mysqlConvert($this->con, 'UTF8', 'utf8_general_ci', 'MYISAM'); + cubeDb::mysqlConvert($this->con, 'UTF8', 'utf8_general_ci', 'MYISAM'); touch($cache); } diff --git a/inc/commons/class.common.page.php b/inc/commons/class.common.page.php index 50969bbe9..0af8d0b99 100644 --- a/inc/commons/class.common.page.php +++ b/inc/commons/class.common.page.php @@ -80,7 +80,7 @@ class commonPage { foreach ($onglets as $titre => $url) { // Si cet onglet correspond à la page active, on le place actif $active = ($args[0] == $url || (isset($supp[$args[0]]) && $supp[$args[0]] == $url)) ? ' active' : ''; - $res .= '' . $titre . ''; + $res .= '' . $titre . ''; } $res .= ''; return $res; @@ -137,34 +137,13 @@ class commonPage { return '
'; } - public static function bh($class = null) { - return '
'; - $class = is_null($class) ? ' class="b"' : ' class="b ' . $class . '"'; - - - - $res = ''; - $res .= ''; - $res .= ''; - $res .= ''; - $res .= ''; - $res .= '
'; - return $res; + public static function bh($class = '') { + $class = trim('b ' . $class); + return '
'; } public static function bf($max = false) { return '
'; - $res = '
'; - $res .= ''; - $res .= ''; - $res .= ''; - if ($max) { - $res .= cubeMedia::spacer(960, 1); - } - $res .= ''; - $res .= ''; - $res .= ''; - return $res; } public static function pager($current, $nb, $par_page, $url) { diff --git a/inc/commons/class.common.url.php b/inc/commons/class.common.url.php index d673ca050..89c0d8ade 100644 --- a/inc/commons/class.common.url.php +++ b/inc/commons/class.common.url.php @@ -55,7 +55,7 @@ class commonUrl { $res = commonPage::barre(); $res .= commonPage::tMain(); - $res .= commonPage::bh(); + $res .= commonPage::bh('login'); $res .= '
'; $res .= '
'; $res .= '

' . $core->typo->Titre(__('Veuillez vous identifier')) . '

'; diff --git a/inc/config.inc.php b/inc/config.inc.php index 3fad36306..9a9b95671 100644 --- a/inc/config.inc.php +++ b/inc/config.inc.php @@ -1,6 +1,8 @@ Output(ROOT . '/devis/' . $devis->devis_id . '.pdf'); // Restaure les paramètres de langue de l'utilisateur + global $core; cubeLang::set($core->user->lang); } diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index bb1cad291..b936bd3c3 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -263,7 +263,7 @@ class wsDAOBook extends commonDAO { public function insertDocument($book_id, $after_page, $document_id) { // Obtiens le book $book = $this->selectById($book_id); - $num = $book->numerotation; + $num = explode(',', $book->numerotation); // Obtiens le nombre de pages $r = $this->con->select('SELECT pages,numberSections FROM documents WHERE document_id=\'' . $this->con->escape($document_id) . '\''); // Décale les pages vers le bas @@ -282,11 +282,20 @@ class wsDAOBook extends commonDAO { // Mets à jour la liste des numéros des pages $before = array_slice($num, 0, $after_page); $after = array_slice($num, $after_page, count($num) - $after_page); - $between = explode(',', $r->numberSections); + + $newnum = $r->numberSections; + if (trim($newnum, ',') == '') { + // If no number detected, we create a numeric list from 1 + $between = range(1, $r->pages); + } else { + // Else, we use numbers detected at conversion + $between = explode(',', $r->numberSections); + } $num = array_merge($before, $between, $after); // Mets à jour la numerotation de la publication $c = $this->con->openCursor('books'); - $c->numerotation = json_encode($num); + $c->numerotation = implode(',', $num); + $c->composition_update=TIME; $c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\''); } @@ -516,14 +525,14 @@ class wsDAOBook extends commonDAO { if ($now != $ref) { $this->con->execute('DELETE FROM book_pages WHERE book_id=\'' . $this->con->escape($book_id) . '\''); - $c = $this->con->openCursor('book_pages'); - $c->book_id = $book_id; + $c1 = $this->con->openCursor('book_pages'); + $c1->book_id = $book_id; $i = 1; foreach ($pages as $p) { - $c->document_id = $p->document_id; - $c->document_page = $p->document_page; - $c->book_page = $i; - $c->insert(); + $c1->document_id = $p->document_id; + $c1->document_page = $p->document_page; + $c1->book_page = $i; + $c1->insert(); $i++; } $c->composition_update = TIME; diff --git a/style/common.css b/style/common.css index 9af7641d5..b729fddc0 100644 --- a/style/common.css +++ b/style/common.css @@ -20,6 +20,10 @@ margin-bottom: 10px; } +.b table{ + width:100%; +} + /* Top left */ .b table tr:first-child th:first-child{ border-radius:6px 0 0 0; @@ -34,6 +38,15 @@ border-radius:0 0 6px 0; } +.b h1{ + border-radius:6px 6px 0 0; +} + +.b.login{ + width:325px; + margin:0 auto; +} + .onglet{ background:url('onglet.png'); diff --git a/style/extranet/style.css b/style/extranet/style.css index 8eb36ee07..27a980cc7 100644 --- a/style/extranet/style.css +++ b/style/extranet/style.css @@ -300,7 +300,6 @@ input[type="text"],input[type="password"],select,textarea{ .dashboard .caption{ position:relative; left:20px; - top:10px; display:inline; cursor:move; } diff --git a/style/ws/style.css b/style/ws/style.css index 482a02744..15ccfdbce 100644 --- a/style/ws/style.css +++ b/style/ws/style.css @@ -320,7 +320,6 @@ input[type="text"],input[type="password"],select,textarea{ .dashboard .caption{ position:relative; left:20px; - top:10px; display:inline; cursor:move; }