From: vincent@cubedesigners.com Date: Mon, 26 Apr 2010 17:48:02 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=3b192c1b296ea955f6fccfe9fb04403275140d0f;p=cubeextranet.git --- diff --git a/inc/extranet/Controlleur/class.extranet.core.php b/inc/extranet/Controlleur/class.extranet.core.php index 0f025a917..6ada40178 100644 --- a/inc/extranet/Controlleur/class.extranet.core.php +++ b/inc/extranet/Controlleur/class.extranet.core.php @@ -452,11 +452,10 @@ class extranetCore extends cubeCore { . 'GROUP BY t.categorie,p.annee_fin'); $this->createView('books_vue', 'SELECT b.*,b.proprietaire AS proprietaire_id,c.rs AS proprietaire_nom,c.ws_admin,c.facturable_id,c.facturable ' . 'FROM books b, ws_clients c WHERE b.proprietaire=c.utilisateur_id'); - $this->createView('themes_vue', 'SELECT t.*,GROUP_CONCAT(b.book_id ORDER BY b.book_id ASC) AS books, GROUP_CONCAT(DISTINCT d.utilisateur_id ORDER BY d.utilisateur_id ASC) AS utilisateurs ' + $this->createView('themes_vue', 'SELECT t.*,COUNT(b.book_id) AS nb_books,GROUP_CONCAT(DISTINCT b.book_id ORDER BY b.book_id ASC) AS books ' . 'FROM themes t ' - . 'LEFT JOIN themes_droits d ON t.theme_id=d.theme_id ' . 'LEFT JOIN books b ON t.theme_id=b.theme ' - . 'GROUP BY b.theme, d.theme_id'); + . 'GROUP BY t.theme_id'); // cubeDb::mysqlConvert($this->con); touch($cache); } diff --git a/inc/ws/Controlleur/class.ws.flash.php b/inc/ws/Controlleur/class.ws.flash.php index e0fdfa587..6f2f133ba 100644 --- a/inc/ws/Controlleur/class.ws.flash.php +++ b/inc/ws/Controlleur/class.ws.flash.php @@ -164,9 +164,8 @@ class wsFlash extends cubeFlashGateway { } else { $right = '-'; } - $t->addAttribute('right', $right); - $t->addAttribute('books', count($theme->books)); - $t->addAttribute('utilisateurs', count($theme->utilisateurs)); + $t->addAttribute('right', rand(0,1)?'w':'r'/*$right*/); + $t->addAttribute('books', $theme->nbBooks); } } diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index c25b876f2..b30cc70fe 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -87,7 +87,7 @@ class wsUrl { http::redirect(SITE_PATH . 'editbook/' . $book->book_id); } - $step = isset($args[2])?$args[2]:1; + /*$step = isset($args[2])?$args[2]:1; $shortcuts = array(); @@ -115,9 +115,9 @@ class wsUrl { } $shortcuts[] = $as . $core->typo->$template($i . '. ' . $n, $class, -1) . $ae; $i++; - } + }*/ - $res = extranetPage::barre(null , null, null, $shortcuts); + $res = extranetPage::barre(null , null, null, null); $res .= extranetPage::tMain(null, true); $res .= extranetPage::bh(); $res .= '
'; diff --git a/inc/ws/DAO/class.ws.dao.theme.php b/inc/ws/DAO/class.ws.dao.theme.php index dc4021e96..463432291 100644 --- a/inc/ws/DAO/class.ws.dao.theme.php +++ b/inc/ws/DAO/class.ws.dao.theme.php @@ -7,8 +7,8 @@ class wsDAOTheme extends extranetDAO { $theme->nom = $r->nom; $theme->date = $r->date; $theme->proprietaire = $r->proprietaire; - $theme->utilisateurs = explode(',', $r->utilisateurs); $theme->books = explode(',', $r->books); + $theme->nbBooks=$r->nb_books; $theme->signature = $r->signature; $theme->icones = $r->icones; $p = unserialize($r->parametres); @@ -30,17 +30,16 @@ class wsDAOTheme extends extranetDAO { public function getThemeOfBook($book_id) { - $r = $this->con->select('SELECT * FROM themes_vue WHERE FIND_IN_SET(\'' . $this->con->escape($book_id) . '\'books) LIMIT 1'); + $r = $this->con->select('SELECT * FROM themes_vue WHERE theme_id IN (SELECT theme FROM books WHERE book_id=\'' . $this->con->escape($book_id) . '\') LIMIT 1'); return $this->singleton($r); } public function getAllThemes($user, $order = '') { - fb($user); if ($user->ws_grade >= 3) { $sql = 'SELECT * FROM themes_vue'; } else if ($user->ws_grade == 2) { - $sql = 'SELECT * FROM themes_vue WHERE FIND_IN_SET(utilisateurs,\'' . $core->con->escape($user->utilisateur_id) . '\')'; + $sql = 'SELECT * FROM themes_vue WHERE theme_id IN (SELECT theme_id FROM themes_droits WHERE utilisateur_id=\'' . $user->utilisateur_id . '\')'; } else { return array(); } diff --git a/inc/ws/Metier/class.ws.theme.php b/inc/ws/Metier/class.ws.theme.php index 71e8fda73..55f95a088 100644 --- a/inc/ws/Metier/class.ws.theme.php +++ b/inc/ws/Metier/class.ws.theme.php @@ -14,8 +14,8 @@ class wsTheme extends cubeMetier { protected $nom; protected $date; protected $parametres; - protected $utilisateurs; protected $books; + protected $nbBooks; } ?> \ No newline at end of file diff --git a/swf/_src/wsComposer.fla b/swf/_src/wsComposer.fla index c811efa86..f880a180c 100644 Binary files a/swf/_src/wsComposer.fla and b/swf/_src/wsComposer.fla differ