. '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
} 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
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
}\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
$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
\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
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