]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 16 Sep 2010 11:58:24 +0000 (11:58 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 16 Sep 2010 11:58:24 +0000 (11:58 +0000)
inc/extranet/Controlleur/class.extranet.core.php

index d5cecedd64ba7909cd71d8e2ccc165e33bf47f26..59a07ed908bff59c2f75a1bf67ff3817607e712c 100644 (file)
@@ -392,6 +392,8 @@ class extranetCore extends cubeCore {
                         . ' FROM entreprises_inter e LEFT JOIN impayes_entreprises i ON e.entreprise_id=i.entreprise');\r
                $this->views->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->views->createView('utilisateurs_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');\r
                $this->views->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
@@ -418,14 +420,14 @@ class extranetCore extends cubeCore {
                         . 'IF(YEAR(FROM_UNIXTIME(projets.date_fin))=1970,YEAR(NOW()),YEAR(FROM_UNIXTIME(projets.date_fin))) AS annee_fin,'\r
                         . 'clients.rs AS client,equipiers.prenom AS chef,equipiers.utilisateur_id AS chef_id,clients.utilisateur_id AS client_id '\r
                         . 'FROM projets,clients_entreprise clients,equipiers '\r
-                        . 'WHERE clients.utilisateur_id=projets.client AND equipiers.utilisateur_id=projets.chef','TEMPTABLE');\r
+                        . 'WHERE clients.utilisateur_id=projets.client AND equipiers.utilisateur_id=projets.chef', 'TEMPTABLE');\r
                $this->views->createView('projets_inter1', 'SELECT projets.*,taches.jours_prevus,taches.jours_consommes,taches.progression,taches.budget AS budget, '\r
                         . 'IF(taches.budget>0,SUM(factures_valides.total_ht)/taches.budget,1) AS rapport_facturation, '\r
                         . 'SUM(factures_valides.total_ht) AS montant_facture '\r
                         . 'FROM projets_inter projets '\r
                         . 'LEFT JOIN taches_projet taches ON taches.projet=projets.projet_id '\r
                         . 'LEFT JOIN factures_valides ON factures_valides.projet=projets.projet_id '\r
-                        . 'GROUP BY projets.projet_id,factures_valides.projet','TEMPTABLE');\r
+                        . 'GROUP BY projets.projet_id,factures_valides.projet', 'TEMPTABLE');\r
                $this->views->createView('projets_vue', 'SELECT p.*,SUM(f.total_ht) AS montant_paye, '\r
                         . 'IF(p.budget>0,SUM(f.total_ht)/p.budget,1) AS rapport_paiement '\r
                         . 'FROM projets_inter1 p '\r
@@ -450,7 +452,7 @@ class extranetCore extends cubeCore {
                         . '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,c.rs AS proprietaire_nom,c.ws_admin '\r
-                        . 'FROM books b, clients_entreprise c WHERE b.proprietaire=c.utilisateur_id', 'TEMPTABLE');\r
+                        . 'FROM books b, utilisateurs_entreprise c WHERE b.proprietaire=c.utilisateur_id', '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