From 58e4ab7823b04751caf350af01954501a5743836 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Wed, 9 Feb 2011 13:12:47 +0000 Subject: [PATCH] --- inc/commons/class.common.core.php | 26 +++++++++++++++++++++++--- inc/ws/Controlleur/class.ws.ajax.php | 14 ++++++++++++++ inc/ws/Controlleur/class.ws.url.php | 2 +- inc/ws/DAO/class.ws.dao.book.php | 11 +++++++++-- 4 files changed, 47 insertions(+), 6 deletions(-) diff --git a/inc/commons/class.common.core.php b/inc/commons/class.common.core.php index f7171d7ea..2ab8709db 100644 --- a/inc/commons/class.common.core.php +++ b/inc/commons/class.common.core.php @@ -95,7 +95,6 @@ class commonCore extends cubeCore { } } - public function dbSync() { $cache = ROOT . '/cache/DB_SYNC'; @@ -489,8 +488,13 @@ class commonCore extends cubeCore { . 'FROM projets_vue p, taches_vue t ' . 'WHERE t.projet=p.projet_id ' . 'GROUP BY t.categorie,p.annee_fin'); - $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 ' - . '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'); + $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 ' + . 'FROM books b ' + . 'LEFT JOIN utilisateurs_entreprise c ON b.proprietaire=c.utilisateur_id ' + . 'LEFT JOIN ws_users_tree t ON t.utilisateur_id=c.utilisateur_id ' + . 'LEFT JOIN utilisateurs_entreprise f ON t.facturable_id=f.utilisateur_id ' + . 'LEFT JOIN taches ta ON ta.tache_id=b.tache' , + 'TEMPTABLE'); $this->views->createView('themes_vue', 'SELECT t.*,COUNT(*) AS nb_books,GROUP_CONCAT(DISTINCT b.book_id) AS books ' . 'FROM themes t ' . 'LEFT JOIN books b ON t.theme_id=b.theme ' @@ -515,6 +519,22 @@ class commonCore extends cubeCore { $t = new wsUsersTree($this->con); $t->refreshWSUsersTree(); } + + public function loadExtranetClasses() + { + global $__autoload; + require_once(dirname(__FILE__) . '/../extranet/Metier/_common.php'); + require_once(dirname(__FILE__) . '/../extranet/Controlleur/_common.php'); + require_once(dirname(__FILE__) . '/../extranet/DAO/_common.php'); + } + + public function loadWSClasses() + { + global $__autoload; + require_once(dirname(__FILE__) . '/../ws/Metier/_common.php'); + require_once(dirname(__FILE__) . '/../ws/Controlleur/_common.php'); + require_once(dirname(__FILE__) . '/../ws/DAO/_common.php'); + } } ?> \ No newline at end of file diff --git a/inc/ws/Controlleur/class.ws.ajax.php b/inc/ws/Controlleur/class.ws.ajax.php index 76b7a2e1b..c346df2fe 100644 --- a/inc/ws/Controlleur/class.ws.ajax.php +++ b/inc/ws/Controlleur/class.ws.ajax.php @@ -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); } + public static function bookChooseTache($args, &$x) + { + $book_id = $_POST['book_id']; + $projet_id = $_POST['projet_id']; + + if ($_POST['book_tache'] == 0) { + $tache = 0; + } else { + $tache = $_POST['book_tache']; + } + + $x->addClosePopup(); + } + public static function changeLang($args, &$x) { $x->addContent('formLang', wsUrl::formLang($_POST['lang'])); diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index 160bea8b6..24bf79d9b 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -502,7 +502,7 @@ html{height:100%}' . "\n"; $projects[$r->projet_id . ' - ' . $r->nom] = $r->projet_id; } - $res = '' . __('Choisir un projet') . ' : ' . form::hidden('book_id', $book_id) . form::combo('book_project', $projects) . ''; + $res = '' . __('Choisir un projet') . ' : ' . form::hidden('book_id', $book_id) . form::combo('book_project', $projects,$book->projet) . ''; $res .= '' . __('ou créer un nouveau projet') . ' : ' . form::field('new_book_project_nom', 64, 1024) . ''; return $res; } diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index f690bbdf6..e1d7d6277 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -1,5 +1,11 @@ compiledate = $r->compiledate; $book->facturable = $r->facturable; $book->facturable_id = $r->facturable_id; + $book->tache = $r->tache; + $book->projet = $r->projet; return $book; } @@ -45,6 +53,7 @@ class wsDAOBook extends commonDAO { $book->date = TIME; $book->chapters = json_encode(array()); $book->parametres = new wsBookParametres(); + $book->tache=0; $book->pages = array(); return $book; } @@ -430,8 +439,6 @@ class wsDAOBook extends commonDAO { $c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\''); } - - public function touch($book_id) { $c = $this->con->openCursor('books'); -- 2.39.5