]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 9 Feb 2011 13:12:47 +0000 (13:12 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 9 Feb 2011 13:12:47 +0000 (13:12 +0000)
inc/commons/class.common.core.php
inc/ws/Controlleur/class.ws.ajax.php
inc/ws/Controlleur/class.ws.url.php
inc/ws/DAO/class.ws.dao.book.php

index f7171d7ea7b898e278f15ff5243d1a13f40874bc..2ab8709dbf13e1b008d2f47c76a3fc6fec7f6947 100644 (file)
@@ -95,7 +95,6 @@ class commonCore extends cubeCore {
                }\r
        }\r
 \r
-\r
        public function dbSync()\r
        {\r
                $cache = ROOT . '/cache/DB_SYNC';\r
@@ -489,8 +488,13 @@ class commonCore extends cubeCore {
                         . 'FROM projets_vue p, taches_vue t '\r
                         . 'WHERE t.projet=p.projet_id '\r
                         . 'GROUP BY t.categorie,p.annee_fin');\r
-               $this->views->createView('books_vue', 'SELECT b.*,b.proprietaire AS proprietaire_id,CONCAT(c.rs,\' (\',c.prenom,\' \',c.nom,\')\') AS proprietaire_nom, CONCAT(c.prenom,\' \',c.nom) AS proprietaire_utilisateur,c.ws_admin, f.rs AS facturable, t.facturable_id AS facturable_id '\r
-                        . 'FROM books b, utilisateurs_entreprise c, ws_users_tree t, utilisateurs_entreprise f WHERE b.proprietaire=c.utilisateur_id AND t.utilisateur_id=c.utilisateur_id AND t.facturable_id=f.utilisateur_id', 'TEMPTABLE');\r
+               $this->views->createView('books_vue', 'SELECT b.*,b.proprietaire AS proprietaire_id,CONCAT(c.rs,\' (\',c.prenom,\' \',c.nom,\')\') AS proprietaire_nom, CONCAT(c.prenom,\' \',c.nom) AS proprietaire_utilisateur,c.ws_admin, f.rs AS facturable, t.facturable_id AS facturable_id, ta.projet AS projet '\r
+                        . 'FROM books b '\r
+                        . 'LEFT JOIN utilisateurs_entreprise c ON b.proprietaire=c.utilisateur_id '\r
+                        . 'LEFT JOIN ws_users_tree t ON t.utilisateur_id=c.utilisateur_id '\r
+                        . 'LEFT JOIN utilisateurs_entreprise f ON t.facturable_id=f.utilisateur_id '\r
+                        . 'LEFT JOIN taches ta ON ta.tache_id=b.tache' ,\r
+                       'TEMPTABLE');\r
                $this->views->createView('themes_vue', 'SELECT t.*,COUNT(*) AS nb_books,GROUP_CONCAT(DISTINCT b.book_id) AS books '\r
                         . 'FROM themes t '\r
                         . 'LEFT JOIN books b ON t.theme_id=b.theme '\r
@@ -515,6 +519,22 @@ class commonCore extends cubeCore {
                $t = new wsUsersTree($this->con);\r
                $t->refreshWSUsersTree();\r
        }\r
+\r
+       public function loadExtranetClasses()\r
+       {\r
+               global $__autoload;\r
+               require_once(dirname(__FILE__) . '/../extranet/Metier/_common.php');\r
+               require_once(dirname(__FILE__) . '/../extranet/Controlleur/_common.php');\r
+               require_once(dirname(__FILE__) . '/../extranet/DAO/_common.php');\r
+       }\r
+\r
+       public function loadWSClasses()\r
+       {\r
+               global $__autoload;\r
+               require_once(dirname(__FILE__) . '/../ws/Metier/_common.php');\r
+               require_once(dirname(__FILE__) . '/../ws/Controlleur/_common.php');\r
+               require_once(dirname(__FILE__) . '/../ws/DAO/_common.php');\r
+       }\r
 }\r
 \r
 ?>
\ No newline at end of file
index 76b7a2e1b5a0e2365806e34c6e26d6f50b0a52df..c346df2fea55874a00528076640e759d9f447393 100644 (file)
@@ -268,6 +268,20 @@ class wsAjax extends cubeAjax {
                return commonAjax::form('bookChooseTache', __("Selection d'une tâche"), wsUrl::chooseBookTache($book_id, $project), __('Enregistrer'), 3, '', '', true);\r
        }\r
 \r
+       public static function bookChooseTache($args, &$x)\r
+       {\r
+               $book_id = $_POST['book_id'];\r
+               $projet_id = $_POST['projet_id'];\r
+\r
+               if ($_POST['book_tache'] == 0) {\r
+                       $tache = 0;\r
+               } else {\r
+                       $tache = $_POST['book_tache'];\r
+               }\r
+\r
+               $x->addClosePopup();\r
+       }\r
+\r
        public static function changeLang($args, &$x)\r
        {\r
                $x->addContent('formLang', wsUrl::formLang($_POST['lang']));\r
index 160bea8b620a3f083e2591df7d1a7611d1fe678a..24bf79d9be8064ed29654adc0aae7fcee375f348 100644 (file)
@@ -502,7 +502,7 @@ html{height:100%}' . "\n";
                        $projects[$r->projet_id . ' - ' . $r->nom] = $r->projet_id;\r
                }\r
 \r
-               $res = '<tr><td>' . __('Choisir un projet') . ' : </td><td>' . form::hidden('book_id', $book_id) . form::combo('book_project', $projects) . '</td></tr>';\r
+               $res = '<tr><td>' . __('Choisir un projet') . ' : </td><td>' . form::hidden('book_id', $book_id) . form::combo('book_project', $projects,$book->projet) . '</td></tr>';\r
                $res .= '<tr><td>' . __('ou créer un nouveau projet') . ' : </td><td>' . form::field('new_book_project_nom', 64, 1024) . '</td></tr>';\r
                return $res;\r
        }\r
index f690bbdf6bd1641cc81255fd0e7ff7228b61104c..e1d7d6277ba10190d3c28050cba6d175de98d9a3 100644 (file)
@@ -1,5 +1,11 @@
 <?php\r
 class wsDAOBook extends commonDAO {\r
+       /**\r
+        * wsDAOBook::singleton()\r
+        *\r
+        * @param mixed $r\r
+        * @return\r
+        */\r
        protected function singleton($r)\r
        {\r
                $book = new wsBook();\r
@@ -25,6 +31,8 @@ class wsDAOBook extends commonDAO {
                $book->compiledate = $r->compiledate;\r
                $book->facturable = $r->facturable;\r
                $book->facturable_id = $r->facturable_id;\r
+               $book->tache = $r->tache;\r
+               $book->projet = $r->projet;\r
 \r
                return $book;\r
        }\r
@@ -45,6 +53,7 @@ class wsDAOBook extends commonDAO {
                $book->date = TIME;\r
                $book->chapters = json_encode(array());\r
                $book->parametres = new wsBookParametres();\r
+               $book->tache=0;\r
                $book->pages = array();\r
                return $book;\r
        }\r
@@ -430,8 +439,6 @@ class wsDAOBook extends commonDAO {
                $c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
        }\r
 \r
-\r
-\r
        public function touch($book_id)\r
        {\r
                $c = $this->con->openCursor('books');\r