]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 14 Sep 2010 12:37:48 +0000 (12:37 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 14 Sep 2010 12:37:48 +0000 (12:37 +0000)
inc/extranet/Controlleur/class.extranet.core.php
inc/ws/Controlleur/class.ws.url.php
inc/ws/DAO/class.ws.dao.book.php
inc/ws/Metier/class.ws.book.php

index 9b2a8d8e9427b80711cbbc4b0c2de287cdcbcd78..af5c2bb77faedf7d58093cd64099273875c2e3e0 100644 (file)
@@ -26,7 +26,7 @@ class extranetCore extends cubeCore {
                        2 => __('Design Web'), 3 => __('Design Industriel'), 4 => __('Print'),\r
                        5 => __('Newsletter'), 6 => __('Développement PHP'), 7 => __('Développement Flash'),\r
                        8 => __('Fluidbook'), 9 => __('Formation'), 10 => __('Administratif'), 11 => __('Divers'),\r
-                       12 => __('Intégration HTML'), 13 => __('Motion design'), 14 => __('Design graphique'), 15 => __('Bandeaux de pub'),16=>__('Applications mobiles'));\r
+                       12 => __('Intégration HTML'), 13 => __('Motion design'), 14 => __('Design graphique'), 15 => __('Bandeaux de pub'), 16 => __('Applications mobiles'));\r
                $this->projets_status = array(0 => __('En cours'), 1 => __('Terminé'));\r
                $this->devis_status = array(0 => __('Brouillon'), 1 => __('Envoyé'),\r
                        2 => __('Validé'), 3 => __('Refusé'));\r
@@ -146,7 +146,7 @@ class extranetCore extends cubeCore {
                $db->entreprises->code_postal('varchar', 20, false);\r
                $db->entreprises->ville('varchar', 64, false);\r
                $db->entreprises->pays('varchar', 2, false);\r
-               $db->entreprises->adresse_facturation('varchar',512,false);\r
+               $db->entreprises->adresse_facturation('varchar', 512, false);\r
                $db->entreprises->tva_intra('varchar', 14, false);\r
                $db->entreprises->date_creation('integer', 0, false);\r
                $db->entreprises->notes('text', 0, false);\r
@@ -286,12 +286,12 @@ class extranetCore extends cubeCore {
                $db->themes->reference('fk_themes_signature', 'signature', 'signatures', 'signature_id');\r
                $db->themes->reference('fk_themes_proprietaires', 'proprietaire', 'utilisateurs', 'utilisateur_id');\r
                // Table des droits des themes\r
-               //$db->themes_droits->theme_id('integer', 0, false);\r
-               //$db->themes_droits->utilisateur_id('integer', 0, false);\r
+               // $db->themes_droits->theme_id('integer', 0, false);\r
+               // $db->themes_droits->utilisateur_id('integer', 0, false);\r
                // Clés\r
-       //      $db->themes_droits->primary('pk_themes_droits', 'theme_id', 'utilisateur_id');\r
-               //$db->themes_droits->reference('fk_themes_droits_theme_id', 'theme_id', 'themes', 'theme_id');\r
-               //$db->themes_droits->reference('fk_themes_droits_utilisateur_id', 'utilisateur_id', 'utilisateurs', 'utilisateur_id');\r
+               // $db->themes_droits->primary('pk_themes_droits', 'theme_id', 'utilisateur_id');\r
+               // $db->themes_droits->reference('fk_themes_droits_theme_id', 'theme_id', 'themes', 'theme_id');\r
+               // $db->themes_droits->reference('fk_themes_droits_utilisateur_id', 'utilisateur_id', 'utilisateurs', 'utilisateur_id');\r
                // Table des langues\r
                $db->langues->lang_id('varchar', 20, false);\r
                $db->langues->nom('varchar', 256, false);\r
@@ -346,7 +346,7 @@ class extranetCore extends cubeCore {
                $db->books->extras('text', 0, false);\r
                $db->books->traductions('text', 0, false);\r
                $db->books->date('integer', 0, false);\r
-               $db->books->numerotation('text',0,false);\r
+               $db->books->numerotation('text', 0, false);\r
                // Clés\r
                $db->books->primary('pk_books', 'book_id');\r
                $db->books->index('index_books_nom', 'BTREE', 'nom');\r
@@ -375,17 +375,9 @@ class extranetCore extends cubeCore {
 \r
                $this->createView('equipiers', 'SELECT * FROM utilisateurs WHERE grade>=1');\r
                $this->createView('gerants', 'SELECT * FROM utilisateurs WHERE grade=2');\r
-               $this->createView('ws_top_revendeurs', 'SELECT * FROM utilisateurs WHERE ws_grade=3 AND ws_admin IN(SELECT utilisateur_id FROM equipiers)');\r
+               // $this->createView('ws_top_revendeurs', 'SELECT * FROM utilisateurs WHERE ws_grade=3 AND ws_admin IN(SELECT utilisateur_id FROM equipiers)');\r
                $this->createView('ws_revendeurs', 'SELECT * FROM utilisateurs WHERE ws_grade=3');\r
                $this->createView('ws_facturables', 'SELECT * FROM utilisateurs WHERE ws_grade BETWEEN 0 AND 3 AND ws_admin IN(SELECT utilisateur_id FROM equipiers)');\r
-               $this->createView('ws_utilisateurs', 'SELECT *,utilisateur_id AS facturable_id FROM ws_facturables'\r
-                        . ' UNION '\r
-                        . 'SELECT u.*,f.utilisateur_id AS facturable_id FROM utilisateurs u, ws_facturables f WHERE u.ws_admin=f.utilisateur_id AND u.ws_grade!=-1 '\r
-                        . ' UNION '\r
-                        . 'SELECT u.*,f.utilisateur_id AS facturable_id FROM utilisateurs u,ws_facturables f,ws_revendeurs r '\r
-                        . 'WHERE u.ws_admin=r.utilisateur_id AND r.ws_admin=f.utilisateur_id '\r
-                        . ' UNION '\r
-                        . ' SELECT *,utilisateur_id AS facturable_id FROM utilisateurs WHERE ws_grade=4');\r
                $this->createView('impayes_entreprises', 'SELECT SUM(total_ht) AS impaye, u.entreprise AS entreprise '\r
                         . 'FROM utilisateurs u LEFT JOIN projets p ON u.utilisateur_id=p.client LEFT JOIN factures f ON f.projet=p.projet_id '\r
                         . 'WHERE f.status=1 GROUP BY u.entreprise');\r
@@ -397,13 +389,12 @@ class extranetCore extends cubeCore {
                         . 'GROUP BY e.entreprise_id');\r
                $this->createView('entreprises_vue', 'SELECT e.*,i.impaye AS impaye'\r
                         . ' FROM entreprises_inter e LEFT JOIN impayes_entreprises i ON e.entreprise_id=i.entreprise');\r
+               $this->createView('clients_entreprise', 'SELECT u.*,e.nom AS rs, e.adresse_facturation AS adresse_facturation '\r
+                        . 'FROM entreprises e LEFT JOIN utilisateurs u ON u.entreprise=e.entreprise_id AND u.grade=0');\r
                $this->createView('clients', 'SELECT u.*,e.nom AS rs, e.adresse_facturation AS adresse_facturation, i.impaye, '\r
                         . 'SUM(f.total_ht) AS ca '\r
                         . 'FROM entreprises e LEFT JOIN impayes_entreprises i ON e.entreprise_id=i.entreprise LEFT JOIN utilisateurs u ON u.entreprise=e.entreprise_id AND u.grade=0 LEFT JOIN projets p ON p.client=u.utilisateur_id LEFT JOIN factures f ON f.projet=p.projet_id AND f.status IN(1,2) '\r
                         . 'GROUP BY u.utilisateur_id');\r
-               $this->createView('ws_clients', 'SELECT u.*,e.nom AS rs, e1.nom as facturable '\r
-                        . 'FROM ws_utilisateurs u, entreprises e, entreprises e1,ws_utilisateurs u1  '\r
-                        . 'WHERE u.entreprise=e.entreprise_id AND u1.entreprise=e1.entreprise_id AND u.facturable_id=u1.utilisateur_id');\r
                $this->createView('taches_vue', 'SELECT taches.tache_id,taches.nom,taches.categorie,taches.type,taches.budget,taches.projet,taches.taux_journalier, '\r
                         . '(SUM(timereport.heures)/' . JOURNEE . ') AS jours_consommes, ((SUM(timereport.heures)/' . JOURNEE . ')/(taches.budget/taches.taux_journalier))*100 AS progression,(taches.budget/taches.taux_journalier) AS jours_prevus '\r
                         . 'FROM taches LEFT JOIN timereport ON taches.tache_id=timereport.tache_id '\r
@@ -457,8 +448,8 @@ class extranetCore 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->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('books_vue', 'SELECT b.*,b.proprietaire AS proprietaire_id,c.rs AS proprietaire_nom,c.ws_admin '\r
+                        . 'FROM books b, clients_entreprise c WHERE b.proprietaire=c.utilisateur_id');\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 books b ON t.theme_id=b.theme '\r
index f436f159b55937adfd819711641adde3000983b5..d6e88e2284f46e9c0b58f88a7d47b3a40c112883 100644 (file)
@@ -56,8 +56,8 @@ class wsUrl {
                        $res .= '<td>' . $book->nom . '</td>';\r
                        $res .= '<td>' . mb_strtoupper($book->lang) . '</td>';\r
                        $res .= '<td>' . $book->proprietaire . '</td>';\r
-                       $f = $book->facturable;\r
-                       $res .= '<td>' . $f . '</td>';\r
+                       // $f = $book->facturable;\r
+                       $res .= '<td>' ./* $f .*/ '</td>';\r
                        $res .= '<td>' . $core->books_status[$book->status] . '</td>';\r
                        $res .= '<td class="bouton"><a href="' . SITE_PATH . 'voirbook/' . $book->book_id . '_' . $book->hash . '_' . TIME . '/" class="popupFS">' . cubeMedia::cssRollover($core->typo->Voir('voir', '', false)) . '</a></td>';\r
                        $res .= '<td class="bouton"><a class="popupFS" href="' . SITE_PATH . 'editbook/' . $book->book_id . '">' . cubeMedia::cssRollover($core->typo->Editer('éditer', '', false)) . '</a></td>';\r
@@ -128,7 +128,7 @@ html{height:100%}' . "\n";
                $dao = new wsDAOBook($core->con);\r
                header('Content-type: text/plain');\r
                ob_clean();\r
-               echo $dao->compile(2963, 3,false);\r
+               echo $dao->compile(2963, 3, false);\r
                exit;\r
        }\r
 \r
@@ -142,7 +142,6 @@ html{height:100%}' . "\n";
                $book = new wsBookParametres(new wsBook());\r
                $res .= self::formatHelp($book->getHelp());\r
 \r
-\r
                header('Content-type: text/plain; charset=UTF-8');\r
                ob_clean();\r
                echo $res;\r
index b98f39a395943490bc245b65f9ef65dd78f6c17f..125c21428f1a3f2dd2290015eb0e624f1f16cac0 100644 (file)
@@ -9,8 +9,8 @@ class wsDAOBook extends extranetDAO {
                $book->theme = $r->theme;\r
                $book->proprietaire = $r->proprietaire_nom;\r
                $book->proprietaire_id = $r->proprietaire_id;\r
-               $book->facturable = $r->facturable;\r
-               $book->facturable_id = $r->facturable_id;\r
+               //$book->facturable = $r->facturable;\r
+               //$book->facturable_id = $r->facturable_id;\r
                $book->hash = $r->hash;\r
                $book->compteur_visites = $r->compteur_visites;\r
                $book->status = $r->status;\r
@@ -37,8 +37,8 @@ class wsDAOBook extends extranetDAO {
                $book->theme = 1;\r
                $book->proprietaire = '';\r
                $book->proprietaire_id = 0;\r
-               $book->facturable = '';\r
-               $book->facturable_id = 0;\r
+               //$book->facturable = '';\r
+               //$book->facturable_id = 0;\r
                $book->hash = '';\r
                $book->compteur_visites = 20;\r
                $book->status = 0;\r
@@ -121,6 +121,7 @@ class wsDAOBook extends extranetDAO {
                $c->theme = $r->theme;\r
                $book_id = $c->book_id = $this->getNextId();\r
                $c->insert();\r
+\r
                return $this->selectById($book_id);\r
        }\r
 \r
@@ -149,7 +150,7 @@ class wsDAOBook extends extranetDAO {
 \r
        public function count()\r
        {\r
-               $r = $this->con->select('SELECT COUNT(*) AS nb FROM books_vue WHERE ' . $this->makeWhereFromFiltres());\r
+               $r = $this->con->select('SELECT COUNT(*) AS nb FROM books WHERE ' . $this->makeWhereFromFiltres());\r
                return $r->nb;\r
        }\r
 \r
index bb8f03a5a88427aacc816729b275183aadb21a39..851f341df9bbe2c8346cc734078a8c82f799b42c 100644 (file)
@@ -10,8 +10,8 @@ class wsBook extends cubeMetier {
        protected $proprietaire;\r
        protected $proprietaire_id;\r
 \r
-       protected $facturable;\r
-       protected $facturable_id;\r
+       //protected $facturable;\r
+       //protected $facturable_id;\r
 \r
        protected $hash;\r
        protected $compteur_visites;\r