]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 18 Jan 2011 18:31:13 +0000 (18:31 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 18 Jan 2011 18:31:13 +0000 (18:31 +0000)
12 files changed:
inc/commons/DAO/class.common.dao.equipier.php
inc/commons/class.common.core.php
inc/commons/class.common.droits.php
inc/commons/class.common.page.php
inc/ws/Controlleur/class.ws.droits.php
inc/ws/Controlleur/class.ws.url.php
inc/ws/DAO/class.ws.dao.book.php
inc/ws/Metier/class.ws.book.parametres.php
inc/ws/Metier/class.ws.book.php
style/extranet/style.css
style/ws/style.css
typo/ws/desc.xml

index 9b41a00d86f1cbc18e22fad9ad3ddbb0f7668998..f76cbcb85cdabc2339f99827c8ea533166d55fe6 100644 (file)
@@ -16,9 +16,9 @@ class commonDAOEquipier extends commonDAOUtilisateur {
                return parent::cree($utilisateur);\r
        }\r
 \r
-       public function selectById($equipier_id)\r
+       public function selectById($equipier_id,$table='equipiers')\r
        {\r
-               $r = $this->con->select('SELECT * FROM equipiers WHERE utilisateur_id=' . $this->core->con->escape($equipier_id) . ' LIMIT 1');\r
+               $r = $this->con->select('SELECT * FROM '.$table.' WHERE utilisateur_id=' . $this->core->con->escape($equipier_id) . ' LIMIT 1');\r
                return $this->singleton($r);\r
        }\r
 \r
index 0628abf937881c4668533b417611915de8ddbb85..aed22372344c002598213d003638822d02eccbf0 100644 (file)
@@ -476,8 +476,8 @@ 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,c.rs AS proprietaire_nom,c.ws_admin '\r
-                        . 'FROM books b, utilisateurs_entreprise c WHERE b.proprietaire=c.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 '\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('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
index d613bb525a6c7a8f17b0fd5e408f7940099458ae..62a1269b6794b3d62185a79117e7c7dc202d82b5 100644 (file)
@@ -19,6 +19,7 @@ class commonDroits {
                        }\r
                        commonDroits::error();\r
                }\r
+               return true;\r
        }\r
 \r
        public static function dashboard($error = true)\r
@@ -62,12 +63,6 @@ class commonDroits {
 \r
        public static function error()\r
        {\r
-               try {\r
-                       throw new Exception('Authorisation');\r
-               }\r
-               catch(Exception $e) {\r
-                       fb($e);\r
-               }\r
                http::head(403);\r
                ob_end_clean();\r
                exit;\r
index 80d3401b41b4ba7b0b531687f783d12330d34d28..a48e2dba62945bcc00115b3be6085893c120137b 100644 (file)
@@ -74,11 +74,13 @@ class commonPage {
                                $onglets = wsDroits::navigation();\r
                        }\r
                }\r
+\r
+               fb($args);\r
                $res = '<div id="nav">';\r
                foreach($onglets as $titre => $url) {\r
                        // Si cet onglet correspond à la page active, on le place actif\r
                        $active = ($args[0] == $url)?' class="active"':'';\r
-                       $res .= '<a href="' . SITE_PATH . $url . '">' . cubeMedia::cssRollover($core->typo->Onglet($titre, '', false)) . '</a>';\r
+                       $res .= '<a href="' . SITE_PATH . $url . '"'.$active.'>' . cubeMedia::cssRollover($core->typo->Onglet($titre, '', false)) . '</a>';\r
                }\r
                $res .= '</div>';\r
                return $res;\r
index e0e9c2075abdbe3143bd844caf1e073b53754ada..b3c885a24f8df53fea077ee1d1121723723d47a8 100644 (file)
@@ -27,7 +27,7 @@ class wsDroits {
                return $nav;\r
        }\r
 \r
-       public static function getRights()\r
+       public static function getDroits()\r
        {\r
                $res = new stdClass();\r
                $res->creation = self::creation(false);\r
index 0fe3fb0c121dbbd95ebb8a5c627d716dda76c96f..c82a79a2346d5906bdce7f21060e6866285f2c16 100644 (file)
@@ -31,7 +31,7 @@ class wsUrl {
                cubePage::truePopup();\r
                cubePage::autocomplete();\r
 \r
-               $creation = wsDroits::creation();\r
+               $droits = wsDroits::getDroits();\r
 \r
                commonDroits::min(1);\r
                $settings = is_null($settings)?$core->user->getSettings('books'):$settings;\r
@@ -48,19 +48,26 @@ class wsUrl {
                $res .= '<th>' . commonUrl::orderby(__('Titre de la publication'), 'nom', $settings, 'sort' . $change) . '</th>';\r
                $res .= '<th>' . commonUrl::orderby(__(''), 'lang', $settings, 'sort' . $change) . '</th>';\r
                $res .= '<th>' . __('Pages') . '</th>';\r
-               $res .= '<th>' . commonUrl::orderby(__('Proprietaire'), 'proprietaire_nom', $settings, 'sort' . $change) . '</th>';\r
-               $res .= '<th>' ./*commonUrl::orderby(__('Facturation'), 'facturable', $settings, 'sort' . $change) .*/ '</th>';\r
+               if ($droits->revendeur) {\r
+                       $res .= '<th>' . commonUrl::orderby(__('Proprietaire'), 'proprietaire_nom', $settings, 'sort' . $change) . '</th>';\r
+               } else {\r
+                       $res .= '<th>' . commonUrl::orderby(__('Proprietaire'), 'proprietaire_utilisateur', $settings, 'sort' . $change) . '</th>';\r
+               }\r
+               if ($droits->admin) {\r
+                       $res .= '<th>' . commonUrl::orderby(__('Facturation'), 'facturable', $settings, 'sort' . $change) . '</th>';\r
+               }\r
                $res .= '<th>' . commonUrl::orderby(__('Status'), 'status', $settings, 'sort' . $change) . '</th>';\r
+\r
                $res .= '<th class="min"></th><th class="min"></th><th class="min"></th><th class="min"></th><th class="min"></th></tr>';\r
                $i = 0;\r
 \r
                $btVoir = cubeMedia::cssRollover($core->typo->Voir('voir', '', false));\r
-               if ($creation) {\r
+               if ($droits->creation) {\r
                        $btEdit = cubeMedia::cssRollover($core->typo->Editer('éditer', '', false));\r
                }\r
                $btStats = cubeMedia::cssRollover($core->typo->Stats('stats', '', false));\r
-               $btDownload = cubeMedia::cssRollover($core->typo->Telecharger('télécharger', '', false));\r
-               if ($creation) {\r
+               $btDownload = cubeMedia::cssRollover($core->typo->BookTelecharger('télécharger', '', false));\r
+               if ($droits->creation) {\r
                        $btDel = cubeMedia::cssRollover($core->typo->Supprimer('suppr.', '', false));\r
                }\r
 \r
@@ -71,17 +78,23 @@ class wsUrl {
                        $res .= '<td>' . $book->nom . '</td>';\r
                        $res .= '<td>' . mb_strtoupper($book->lang) . '</td>';\r
                        $res .= '<td>' . $book->parametres->pages . '</td>';\r
-                       $res .= '<td><a href="#" class="popup" rel="formChangeBookProprietaire/' . $book->book_id . '" title="' . __('Mofifier le proprietaire') . '">' . $book->proprietaire . '</a></td>';\r
-                       // $f = $book->facturable;\r
-                       $res .= '<td>' ./* $f .*/ '</td>';\r
+\r
+                       if ($droits->revendeur) {\r
+                               $res .= '<td><a href="#" class="popup" rel="formChangeBookProprietaire/' . $book->book_id . '" title="' . __('Mofifier le proprietaire') . '">' . $book->proprietaire . '</a></td>';\r
+                       } else {\r
+                               $res .= '<td>' . $book->proprietaire_utilisateur . '</td>';\r
+                       }\r
+                       if ($droits->admin) {\r
+                               $res .= '<td>' . $book->facturable . '</td>';\r
+                       }\r
                        $res .= '<td>' . $core->books_status[$book->status] . '</td>';\r
                        $res .= '<td class="bouton"><a class="popupFS" rev="viewer_' . $book->book_id . '" href="' . SITE_PATH . 'viewer/' . $book->book_id . '_' . $book->hash . '/">' . $btVoir . '</a></td>';\r
-                       if ($creation) {\r
+                       if ($droits->creation) {\r
                                $res .= '<td class="bouton"><a class="popupFS" rev="editor_' . $book->book_id . '" href="' . SITE_PATH . 'editor/' . $book->book_id . '">' . $btEdit . '</a></td>';\r
                        }\r
                        $res .= '<td class="bouton"><a href="' . SITE_PATH . 'stats/' . $book->book_id . '">' . $btStats . '</a></td>';\r
                        $res .= '<td class="bouton"><a href="' . SITE_PATH . 'supprimebook/' . $book->book_id . '">' . $btDownload . '</a></td>';\r
-                       if ($creation) {\r
+                       if ($droits->creation) {\r
                                $res .= '<td class="bouton"><a href="#" rel="supprimeBook/' . $book->book_id . '" class="ajax" title="' . __('Êtes-vous certain de vouloir supprimer cette publication ?') . '">' . $btDel . '</a></td>';\r
                        }\r
                        $res .= '</tr>';\r
@@ -102,6 +115,8 @@ class wsUrl {
        {\r
                global $core;\r
 \r
+               commonDroits::min(5);\r
+\r
                if (count($args) < 2) {\r
                        $args[1] = 'fr';\r
                }\r
@@ -144,6 +159,7 @@ class wsUrl {
 \r
        public static function formLang($lang_id)\r
        {\r
+               commonDroits::min(5);\r
                global $core;\r
                $dao = new wsDAOLang($core->con);\r
                $lang = $dao->selectById($lang_id);\r
@@ -192,6 +208,8 @@ class wsUrl {
 \r
        public static function editor($args)\r
        {\r
+               wsDroits::creation(true);\r
+\r
                global $core;\r
 \r
                $args = cubePage::getArgs($args);\r
@@ -250,8 +268,7 @@ html{height:100%}' . "\n";
                $book_id = $e[0];\r
                $book = $dao->selectById($book_id);\r
                if ($book->hash != $e[1]) {\r
-                       http::head(401);\r
-                       exit;\r
+                       commonDroits::error();\r
                }\r
 \r
                if (!$dao->isUpToDate($book_id)) {\r
@@ -289,7 +306,6 @@ html{height:100%}' . "\n";
 \r
                $res .= '</head>';\r
                $res .= '<body style="background-color:#' . $theme->parametres->loadingBackColor . '" onload="this.focus();">';\r
-               fb($theme);\r
                $res .= cubeMedia::flash2('index.swf', '100%', '100%', $fv, 'fluidbook', '', 10, '#' . $theme->parametres->loadingBackColor, '', 'true', 'noscale', 'gpu', array('allowScriptAccess' => 'always'));\r
 \r
                $gacodes = array(GA);\r
@@ -311,6 +327,7 @@ html{height:100%}' . "\n";
 \r
        public static function editComposition($args)\r
        {\r
+               wsDroits::creation(true);\r
                $fv = array(session_name() => session_id(),\r
                        'book_id' => $args[0]);\r
                $res = cubeMedia::flash2(WEBROOT . '/swf/composer.swf?junk=' . TIME, '100%', '100%', $fv, 'composerSwf', 'swfPanel', 10, '#d2d3c7', '', 'false', 'noscale', 'normal', array(), false, true, true);\r
@@ -319,6 +336,7 @@ html{height:100%}' . "\n";
 \r
        public static function chooseExistingBook()\r
        {\r
+               wsDroits::creation(true);\r
                $res = '<tr><td colspan="2"><p style="width:600px;text-align:justify;"><em>' . __("Si votre nouvelle publication a des paramètres en commun avec une publication existante, veuillez rechercher cette publication afin d'attribuer par défaut à votre nouvelle publication les paramètres de l'existante") . '</em></p></td></tr>';\r
                $res .= '<tr><td>' . __('Rechercher une publication') . ' : </td><td>' . form::field('book_nom', 64, 1024) . form::hidden('book', '') . '</td></tr>';\r
                // $res .= '<tr><td colspan="2"><hr /></td></tr>';\r
@@ -328,6 +346,7 @@ html{height:100%}' . "\n";
 \r
        public static function changeBookProprietaire()\r
        {\r
+               commonDroits::min(3);\r
                $res = '<tr><td>' . __('Rechercher un utilisateur') . ' : </td><td>' . form::field('book_proprietaire', 64, 1024) . form::hidden('proprietaire', '') . '</td></tr>';\r
                return $res;\r
        }\r
@@ -335,6 +354,7 @@ html{height:100%}' . "\n";
        public static function testAS($args)\r
        {\r
                global $core;\r
+               commonDroits::min(5);\r
                if (!isset($args[1])) {\r
                        $args[1] = 2964;\r
                }\r
@@ -348,6 +368,8 @@ html{height:100%}' . "\n";
 \r
        public static function getParamsHelp()\r
        {\r
+               commonDroits::min(5);\r
+\r
                $res = '';\r
 \r
                $theme = new wsThemeParametres(new wsTheme());\r
@@ -364,6 +386,8 @@ html{height:100%}' . "\n";
 \r
        public static function formatHelp($rubriques)\r
        {\r
+               commonDroits::min(5);\r
+\r
                $res = '';\r
                foreach($rubriques as $label => $fields) {\r
                        $res .= "\n" . '-------------------------' . "\n" ;\r
@@ -386,7 +410,7 @@ html{height:100%}' . "\n";
                cubePage::truePopup();\r
                cubePage::autoComplete();\r
                cubePage::emptyfield();\r
-               commonDroits::min(1);\r
+               commonDroits::min(3);\r
                $settings = $core->user->getSettings('clients');\r
 \r
                $shortcuts = array();\r
@@ -408,7 +432,7 @@ html{height:100%}' . "\n";
        public static function listeClients($dashboard = null, $settings = null)\r
        {\r
                global $core;\r
-               commonDroits::min(1);\r
+               commonDroits::min(3);\r
                $settings = is_null($settings)?$core->user->getSettings('clients'):$settings;\r
                $change = is_null($dashboard)?'Client':'Dashboard/' . $dashboard;\r
                $dao = new commonDAOEntreprise($core->con);\r
@@ -460,7 +484,7 @@ html{height:100%}' . "\n";
        public static function formClient($entreprise_id = 'new')\r
        {\r
                global $core;\r
-               commonDroits::min(1);\r
+               commonDroits::min(3);\r
                $dao = new commonDAOEntreprise($core->con);\r
                $daoUtilisateur = new commonDAOUtilisateur($core->con);\r
                if ($entreprise_id == 'new') {\r
@@ -516,7 +540,7 @@ html{height:100%}' . "\n";
        public static function listeContacts($entreprise_id)\r
        {\r
                global $core;\r
-               commonDroits::min(1);\r
+               commonDroits::min(3);\r
                $dao = new commonDAOEntreprise($core->con);\r
                $contacts = $dao->getContacts($entreprise_id);\r
 \r
@@ -539,7 +563,7 @@ html{height:100%}' . "\n";
        public static function formContact($client_id = 'new', $entreprise_id = null)\r
        {\r
                global $core;\r
-               commonDroits::min(1);\r
+               commonDroits::min(3);\r
 \r
                $dao = new commonDAOClient($core->con);\r
                if ($client_id == 'new') {\r
@@ -574,7 +598,7 @@ html{height:100%}' . "\n";
        public static function formNotes($utilisateur_id)\r
        {\r
                global $core;\r
-               commonDroits::min(1);\r
+               commonDroits::min(5);\r
                $dao = new commonDAOUtilisateur($core->con);\r
                $utilisateur = $dao->selectById($utilisateur_id);\r
                $res = '<tr><td colspan="2">' . form::hidden('utilisateur_id', $utilisateur_id) . '</td></tr>';\r
index b422cffca57ca79c1dde7d6f1a0cbd68db8a9cf6..124a834286487edd88c9d3fd7a5641ab95527cd1 100644 (file)
@@ -9,6 +9,7 @@ class wsDAOBook extends commonDAO {
                $book->theme = $r->theme;\r
                $book->proprietaire = $r->proprietaire_nom;\r
                $book->proprietaire_id = $r->proprietaire_id;\r
+               $book->proprietaire_utilisateur = $r->proprietaire_utilisateur;\r
                $book->hash = $r->hash;\r
                $book->compteur_visites = $r->compteur_visites;\r
                $book->status = $r->status;\r
@@ -22,6 +23,8 @@ class wsDAOBook extends commonDAO {
                $book->numerotation = $r->numerotation;\r
                $book->changedate = $r->changedate;\r
                $book->compiledate = $r->compiledate;\r
+               $book->facturable = $r->facturable;\r
+               $book->facturable_id = $r->facturable_id;\r
 \r
                return $book;\r
        }\r
index 84ca2d4855df014ce1ada6c6c8a5add303faf06f..a9bbc33deee161f3f0b985d547c2c152832711c8 100644 (file)
@@ -51,7 +51,7 @@ class wsBookParametres extends wsParametres {
                                __('Mode 2D (caméra fixe et pages à plat)') => '1',\r
                                __("Laisser le choix à l'utilisateur (mode 3D par défaut)") => '2',\r
                                __("Laisser le choix à l'utilisateur (mode 2D par défaut)") => '3'));\r
-               $this->fields['pagesBaseAngle'] = array('type' => 'integer', 'default' => 2, 'editable' => true, 'label' => __('Angle de base entre les pages'), 'extra' => true, grade => 1,\r
+               $this->fields['pagesBaseAngle'] = array('type' => 'integer', 'default' => 2, 'editable' => true, 'label' => __('Angle de base entre les pages'), 'extra' => true, 'grade' => 1,\r
                        'hint' => __("0 : Publication à plat") . "\n" . __('2 : Valeur par défaut'));\r
                $this->forms['3d_mode'] = array('label' => __('Visualisation en 3D'),\r
                        'fieldsnames' => array('visualisationMode', 'pagesBaseAngle'));\r
index 8c3c8ea77c3a9eeef80829c657be6b2d68e2a3e7..729cf258b6261ec89a8c80014c6008c23721bdc2 100644 (file)
@@ -9,8 +9,10 @@ class wsBook extends cubeMetier {
 \r
        protected $proprietaire;\r
        protected $proprietaire_id;\r
-       // protected $facturable;\r
-       // protected $facturable_id;\r
+       protected $proprietaire_utilisateur;\r
+\r
+       protected $facturable;\r
+       protected $facturable_id;\r
        protected $hash;\r
        protected $compteur_visites;\r
 \r
index 6cd155e8e911c564bb69ec331eaf28c412fdbea8..437208de4637740475c241ff104f7a55b1c22b7c 100644 (file)
@@ -124,15 +124,16 @@ input[type="text"],input[type="password"],select,textarea{
        text-indent:-6667px;\r
 }\r
 \r
-#nav a:hover{\r
+#nav a:hover span{\r
        background-position:bottom left;\r
 }\r
 \r
-#nav a.active{\r
+#nav a.active span{\r
        background-position:bottom left;\r
 }\r
 \r
 \r
+\r
 /* Cadre */\r
 .b{margin:0 auto;}\r
 .b-c{overflow:hidden;}\r
index 7b1e5667a680daf1f8645b0173e4adde86a57f1b..50ebfd107737436472a93230bcfff390eac3f4f3 100644 (file)
@@ -131,11 +131,11 @@ input[type="text"],input[type="password"],select,textarea{
        text-indent:-6667px;\r
 }\r
 \r
-#nav a:hover{\r
+#nav a:hover span{\r
        background-position:bottom left;\r
 }\r
 \r
-#nav a.active{\r
+#nav a.active span{\r
        background-position:bottom left;\r
 }\r
 \r
index 1abdcef8d643ba6f084dbb7f3f914bdc3d222f9f..b26bf8f0bfbd862a8fb87454b06cc164f0af33ee 100644 (file)
                </layer>\r
        </template>\r
        <template>\r
-               <name>Telecharger</name>\r
+               <name>BookTelecharger</name>\r
                <width>auto</width>\r
                <height>54</height>\r
                <layer>\r
                        <top>2</top>\r
                        <left>0</left>\r
                        <repeat>no-repeat</repeat>\r
-               </layer> \r
+               </layer>\r
                <layer>\r
                        <name>centre</name>\r
                        <type>image</type>\r
                        <file>small-m.png</file>\r
                        <top>2</top>\r
-                       <left>33</left> \r
+                       <left>33</left>\r
                        <repeat>repeat-x</repeat>\r
                        <width>-12</width>\r
                </layer>\r
                        <texte>$texte</texte>\r
                </layer>\r
 \r
+       </template>\r
+               <template>\r
+               <name>Telecharger</name>\r
+               <width>auto</width>\r
+               <height>26</height>\r
+               <layer>\r
+                       <name>gauche</name>\r
+                       <type>image</type>\r
+                       <file>small-l.png</file>\r
+                       <top>2</top>\r
+                       <left>0</left>\r
+                       <repeat>no-repeat</repeat>\r
+               </layer>\r
+               <layer>\r
+                       <name>centre</name>\r
+                       <type>image</type>\r
+                       <file>small-m.png</file>\r
+                       <top>2</top>\r
+                       <left>11</left>\r
+                       <repeat>repeat-x</repeat>\r
+                       <width>-28</width>\r
+               </layer>\r
+               <layer>\r
+                       <name>droit</name>\r
+                       <type>image</type>\r
+                       <file>small-r-download.png</file>\r
+                       <top>2</top>\r
+                       <right>0</right>\r
+                       <repeat>no-repeat</repeat>\r
+               </layer>\r
+               <layer>\r
+                       <name>texte</name>\r
+                       <type>font</type>\r
+                       <font_family>Univers-CondensedBold.ttf</font_family>\r
+                       <font_size>10</font_size>\r
+                       <color>999999</color>\r
+                       <top>5.5</top>\r
+                       <left>14.5</left>\r
+                       <texte>$texte</texte>\r
+               </layer>\r
+               <layer>\r
+                       <name>texte</name>\r
+                       <type>font</type>\r
+                       <font_family>Univers-CondensedBold.ttf</font_family>\r
+                       <font_size>10</font_size>\r
+                       <color>ffffff</color>\r
+                       <top>5</top>\r
+                       <left>14</left>\r
+                       <right>34</right>\r
+                       <dim>1</dim>\r
+                       <texte>$texte</texte>\r
+               </layer>\r
        </template>\r
 </theme>
\ No newline at end of file