]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 26 Apr 2010 17:48:02 +0000 (17:48 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 26 Apr 2010 17:48:02 +0000 (17:48 +0000)
inc/extranet/Controlleur/class.extranet.core.php
inc/ws/Controlleur/class.ws.flash.php
inc/ws/Controlleur/class.ws.url.php
inc/ws/DAO/class.ws.dao.theme.php
inc/ws/Metier/class.ws.theme.php
swf/_src/wsComposer.fla

index 0f025a9179f19cd234747be427f2a9acfde7df39..6ada40178ecd3418695e15d5d5c814f724dc7f2f 100644 (file)
@@ -452,11 +452,10 @@ class extranetCore extends cubeCore {
                         . 'GROUP BY t.categorie,p.annee_fin');\r
                $this->createView('books_vue', 'SELECT b.*,b.proprietaire AS proprietaire_id,c.rs AS proprietaire_nom,c.ws_admin,c.facturable_id,c.facturable '\r
                         . 'FROM books b, ws_clients c WHERE b.proprietaire=c.utilisateur_id');\r
-               $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 '\r
+               $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 '\r
                         . 'FROM themes t '\r
-                        . 'LEFT JOIN themes_droits d ON t.theme_id=d.theme_id '\r
                         . 'LEFT JOIN books b ON t.theme_id=b.theme '\r
-                        . 'GROUP BY b.theme, d.theme_id');\r
+                        . 'GROUP BY t.theme_id');\r
                // cubeDb::mysqlConvert($this->con);\r
                touch($cache);\r
        }\r
index e0fdfa587dadf89cbd591db2b12292ec4c47ff24..6f2f133ba906a56c1c818c95972973ad2c243c78 100644 (file)
@@ -164,9 +164,8 @@ class wsFlash extends cubeFlashGateway {
                        } else {\r
                                $right = '-';\r
                        }\r
-                       $t->addAttribute('right', $right);\r
-                       $t->addAttribute('books', count($theme->books));\r
-                       $t->addAttribute('utilisateurs', count($theme->utilisateurs));\r
+                       $t->addAttribute('right', rand(0,1)?'w':'r'/*$right*/);\r
+                       $t->addAttribute('books', $theme->nbBooks);\r
                }\r
        }\r
 \r
index c25b876f26b23d06142344d2888747419594db12..b30cc70fe2e4c0a67e84b91f37bf247b149ddc8b 100644 (file)
@@ -87,7 +87,7 @@ class wsUrl {
                        http::redirect(SITE_PATH . 'editbook/' . $book->book_id);\r
                }\r
 \r
-               $step = isset($args[2])?$args[2]:1;\r
+               /*$step = isset($args[2])?$args[2]:1;\r
 \r
                $shortcuts = array();\r
 \r
@@ -115,9 +115,9 @@ class wsUrl {
                        }\r
                        $shortcuts[] = $as . $core->typo->$template($i . '. ' . $n, $class, -1) . $ae;\r
                        $i++;\r
-               }\r
+               }*/\r
 \r
-               $res = extranetPage::barre(null , null, null, $shortcuts);\r
+               $res = extranetPage::barre(null , null, null, null);\r
                $res .= extranetPage::tMain(null, true);\r
                $res .= extranetPage::bh();\r
                $res .= '<div id="listeBooks">';\r
index dc4021e96768d2f253fafd0112fabdd2a2ce4c31..463432291f84da89471b6d5ee9917074dad37d0d 100644 (file)
@@ -7,8 +7,8 @@ class wsDAOTheme extends extranetDAO {
                $theme->nom = $r->nom;\r
                $theme->date = $r->date;\r
                $theme->proprietaire = $r->proprietaire;\r
-               $theme->utilisateurs = explode(',', $r->utilisateurs);\r
                $theme->books = explode(',', $r->books);\r
+               $theme->nbBooks=$r->nb_books;\r
                $theme->signature = $r->signature;\r
                $theme->icones = $r->icones;\r
                $p = unserialize($r->parametres);\r
@@ -30,17 +30,16 @@ class wsDAOTheme extends extranetDAO {
 \r
        public function getThemeOfBook($book_id)\r
        {\r
-               $r = $this->con->select('SELECT * FROM themes_vue WHERE FIND_IN_SET(\'' . $this->con->escape($book_id) . '\'books) LIMIT 1');\r
+               $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');\r
                return $this->singleton($r);\r
        }\r
 \r
        public function getAllThemes($user, $order = '')\r
        {\r
-               fb($user);\r
                if ($user->ws_grade >= 3) {\r
                        $sql = 'SELECT * FROM themes_vue';\r
                } else if ($user->ws_grade == 2) {\r
-                       $sql = 'SELECT * FROM themes_vue WHERE FIND_IN_SET(utilisateurs,\'' . $core->con->escape($user->utilisateur_id) . '\')';\r
+                       $sql = 'SELECT * FROM themes_vue WHERE theme_id IN (SELECT theme_id FROM themes_droits WHERE utilisateur_id=\'' . $user->utilisateur_id . '\')';\r
                } else {\r
                        return array();\r
                }\r
index 71e8fda7398f51336319120cbf5ee079f78ac0d8..55f95a08880377c899117acc7acd7e7d49cd066f 100644 (file)
@@ -14,8 +14,8 @@ class wsTheme extends cubeMetier {
        protected $nom;\r
        protected $date;\r
        protected $parametres;\r
-       protected $utilisateurs;\r
        protected $books;\r
+       protected $nbBooks;\r
 }\r
 \r
 ?>
\ No newline at end of file
index c811efa8696f122c0913db298e5fc9db00c1de4b..f880a180ca9dc1382900403db92c4580d447e092 100644 (file)
Binary files a/swf/_src/wsComposer.fla and b/swf/_src/wsComposer.fla differ