From: vincent@cubedesigners.com Date: Tue, 18 Jan 2011 18:31:13 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=34a7bfee8aaf50f6fc117f588d78e1660cd54ab4;p=cubeextranet.git --- diff --git a/inc/commons/DAO/class.common.dao.equipier.php b/inc/commons/DAO/class.common.dao.equipier.php index 9b41a00d8..f76cbcb85 100644 --- a/inc/commons/DAO/class.common.dao.equipier.php +++ b/inc/commons/DAO/class.common.dao.equipier.php @@ -16,9 +16,9 @@ class commonDAOEquipier extends commonDAOUtilisateur { return parent::cree($utilisateur); } - public function selectById($equipier_id) + public function selectById($equipier_id,$table='equipiers') { - $r = $this->con->select('SELECT * FROM equipiers WHERE utilisateur_id=' . $this->core->con->escape($equipier_id) . ' LIMIT 1'); + $r = $this->con->select('SELECT * FROM '.$table.' WHERE utilisateur_id=' . $this->core->con->escape($equipier_id) . ' LIMIT 1'); return $this->singleton($r); } diff --git a/inc/commons/class.common.core.php b/inc/commons/class.common.core.php index 0628abf93..aed223723 100644 --- a/inc/commons/class.common.core.php +++ b/inc/commons/class.common.core.php @@ -476,8 +476,8 @@ 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,c.rs AS proprietaire_nom,c.ws_admin ' - . 'FROM books b, utilisateurs_entreprise c WHERE b.proprietaire=c.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 ' + . '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('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 ' diff --git a/inc/commons/class.common.droits.php b/inc/commons/class.common.droits.php index d613bb525..62a1269b6 100644 --- a/inc/commons/class.common.droits.php +++ b/inc/commons/class.common.droits.php @@ -19,6 +19,7 @@ class commonDroits { } commonDroits::error(); } + return true; } public static function dashboard($error = true) @@ -62,12 +63,6 @@ class commonDroits { public static function error() { - try { - throw new Exception('Authorisation'); - } - catch(Exception $e) { - fb($e); - } http::head(403); ob_end_clean(); exit; diff --git a/inc/commons/class.common.page.php b/inc/commons/class.common.page.php index 80d3401b4..a48e2dba6 100644 --- a/inc/commons/class.common.page.php +++ b/inc/commons/class.common.page.php @@ -74,11 +74,13 @@ class commonPage { $onglets = wsDroits::navigation(); } } + + fb($args); $res = ''; return $res; diff --git a/inc/ws/Controlleur/class.ws.droits.php b/inc/ws/Controlleur/class.ws.droits.php index e0e9c2075..b3c885a24 100644 --- a/inc/ws/Controlleur/class.ws.droits.php +++ b/inc/ws/Controlleur/class.ws.droits.php @@ -27,7 +27,7 @@ class wsDroits { return $nav; } - public static function getRights() + public static function getDroits() { $res = new stdClass(); $res->creation = self::creation(false); diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index 0fe3fb0c1..c82a79a23 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -31,7 +31,7 @@ class wsUrl { cubePage::truePopup(); cubePage::autocomplete(); - $creation = wsDroits::creation(); + $droits = wsDroits::getDroits(); commonDroits::min(1); $settings = is_null($settings)?$core->user->getSettings('books'):$settings; @@ -48,19 +48,26 @@ class wsUrl { $res .= '' . commonUrl::orderby(__('Titre de la publication'), 'nom', $settings, 'sort' . $change) . ''; $res .= '' . commonUrl::orderby(__(''), 'lang', $settings, 'sort' . $change) . ''; $res .= '' . __('Pages') . ''; - $res .= '' . commonUrl::orderby(__('Proprietaire'), 'proprietaire_nom', $settings, 'sort' . $change) . ''; - $res .= '' ./*commonUrl::orderby(__('Facturation'), 'facturable', $settings, 'sort' . $change) .*/ ''; + if ($droits->revendeur) { + $res .= '' . commonUrl::orderby(__('Proprietaire'), 'proprietaire_nom', $settings, 'sort' . $change) . ''; + } else { + $res .= '' . commonUrl::orderby(__('Proprietaire'), 'proprietaire_utilisateur', $settings, 'sort' . $change) . ''; + } + if ($droits->admin) { + $res .= '' . commonUrl::orderby(__('Facturation'), 'facturable', $settings, 'sort' . $change) . ''; + } $res .= '' . commonUrl::orderby(__('Status'), 'status', $settings, 'sort' . $change) . ''; + $res .= ''; $i = 0; $btVoir = cubeMedia::cssRollover($core->typo->Voir('voir', '', false)); - if ($creation) { + if ($droits->creation) { $btEdit = cubeMedia::cssRollover($core->typo->Editer('éditer', '', false)); } $btStats = cubeMedia::cssRollover($core->typo->Stats('stats', '', false)); - $btDownload = cubeMedia::cssRollover($core->typo->Telecharger('télécharger', '', false)); - if ($creation) { + $btDownload = cubeMedia::cssRollover($core->typo->BookTelecharger('télécharger', '', false)); + if ($droits->creation) { $btDel = cubeMedia::cssRollover($core->typo->Supprimer('suppr.', '', false)); } @@ -71,17 +78,23 @@ class wsUrl { $res .= '' . $book->nom . ''; $res .= '' . mb_strtoupper($book->lang) . ''; $res .= '' . $book->parametres->pages . ''; - $res .= '' . $book->proprietaire . ''; - // $f = $book->facturable; - $res .= '' ./* $f .*/ ''; + + if ($droits->revendeur) { + $res .= '' . $book->proprietaire . ''; + } else { + $res .= '' . $book->proprietaire_utilisateur . ''; + } + if ($droits->admin) { + $res .= '' . $book->facturable . ''; + } $res .= '' . $core->books_status[$book->status] . ''; $res .= '' . $btVoir . ''; - if ($creation) { + if ($droits->creation) { $res .= '' . $btEdit . ''; } $res .= '' . $btStats . ''; $res .= '' . $btDownload . ''; - if ($creation) { + if ($droits->creation) { $res .= '' . $btDel . ''; } $res .= ''; @@ -102,6 +115,8 @@ class wsUrl { { global $core; + commonDroits::min(5); + if (count($args) < 2) { $args[1] = 'fr'; } @@ -144,6 +159,7 @@ class wsUrl { public static function formLang($lang_id) { + commonDroits::min(5); global $core; $dao = new wsDAOLang($core->con); $lang = $dao->selectById($lang_id); @@ -192,6 +208,8 @@ class wsUrl { public static function editor($args) { + wsDroits::creation(true); + global $core; $args = cubePage::getArgs($args); @@ -250,8 +268,7 @@ html{height:100%}' . "\n"; $book_id = $e[0]; $book = $dao->selectById($book_id); if ($book->hash != $e[1]) { - http::head(401); - exit; + commonDroits::error(); } if (!$dao->isUpToDate($book_id)) { @@ -289,7 +306,6 @@ html{height:100%}' . "\n"; $res .= ''; $res .= ''; - fb($theme); $res .= cubeMedia::flash2('index.swf', '100%', '100%', $fv, 'fluidbook', '', 10, '#' . $theme->parametres->loadingBackColor, '', 'true', 'noscale', 'gpu', array('allowScriptAccess' => 'always')); $gacodes = array(GA); @@ -311,6 +327,7 @@ html{height:100%}' . "\n"; public static function editComposition($args) { + wsDroits::creation(true); $fv = array(session_name() => session_id(), 'book_id' => $args[0]); $res = cubeMedia::flash2(WEBROOT . '/swf/composer.swf?junk=' . TIME, '100%', '100%', $fv, 'composerSwf', 'swfPanel', 10, '#d2d3c7', '', 'false', 'noscale', 'normal', array(), false, true, true); @@ -319,6 +336,7 @@ html{height:100%}' . "\n"; public static function chooseExistingBook() { + wsDroits::creation(true); $res = '

' . __("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") . '

'; $res .= '' . __('Rechercher une publication') . ' : ' . form::field('book_nom', 64, 1024) . form::hidden('book', '') . ''; // $res .= '
'; @@ -328,6 +346,7 @@ html{height:100%}' . "\n"; public static function changeBookProprietaire() { + commonDroits::min(3); $res = '' . __('Rechercher un utilisateur') . ' : ' . form::field('book_proprietaire', 64, 1024) . form::hidden('proprietaire', '') . ''; return $res; } @@ -335,6 +354,7 @@ html{height:100%}' . "\n"; public static function testAS($args) { global $core; + commonDroits::min(5); if (!isset($args[1])) { $args[1] = 2964; } @@ -348,6 +368,8 @@ html{height:100%}' . "\n"; public static function getParamsHelp() { + commonDroits::min(5); + $res = ''; $theme = new wsThemeParametres(new wsTheme()); @@ -364,6 +386,8 @@ html{height:100%}' . "\n"; public static function formatHelp($rubriques) { + commonDroits::min(5); + $res = ''; foreach($rubriques as $label => $fields) { $res .= "\n" . '-------------------------' . "\n" ; @@ -386,7 +410,7 @@ html{height:100%}' . "\n"; cubePage::truePopup(); cubePage::autoComplete(); cubePage::emptyfield(); - commonDroits::min(1); + commonDroits::min(3); $settings = $core->user->getSettings('clients'); $shortcuts = array(); @@ -408,7 +432,7 @@ html{height:100%}' . "\n"; public static function listeClients($dashboard = null, $settings = null) { global $core; - commonDroits::min(1); + commonDroits::min(3); $settings = is_null($settings)?$core->user->getSettings('clients'):$settings; $change = is_null($dashboard)?'Client':'Dashboard/' . $dashboard; $dao = new commonDAOEntreprise($core->con); @@ -460,7 +484,7 @@ html{height:100%}' . "\n"; public static function formClient($entreprise_id = 'new') { global $core; - commonDroits::min(1); + commonDroits::min(3); $dao = new commonDAOEntreprise($core->con); $daoUtilisateur = new commonDAOUtilisateur($core->con); if ($entreprise_id == 'new') { @@ -516,7 +540,7 @@ html{height:100%}' . "\n"; public static function listeContacts($entreprise_id) { global $core; - commonDroits::min(1); + commonDroits::min(3); $dao = new commonDAOEntreprise($core->con); $contacts = $dao->getContacts($entreprise_id); @@ -539,7 +563,7 @@ html{height:100%}' . "\n"; public static function formContact($client_id = 'new', $entreprise_id = null) { global $core; - commonDroits::min(1); + commonDroits::min(3); $dao = new commonDAOClient($core->con); if ($client_id == 'new') { @@ -574,7 +598,7 @@ html{height:100%}' . "\n"; public static function formNotes($utilisateur_id) { global $core; - commonDroits::min(1); + commonDroits::min(5); $dao = new commonDAOUtilisateur($core->con); $utilisateur = $dao->selectById($utilisateur_id); $res = '' . form::hidden('utilisateur_id', $utilisateur_id) . ''; diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index b422cffca..124a83428 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -9,6 +9,7 @@ class wsDAOBook extends commonDAO { $book->theme = $r->theme; $book->proprietaire = $r->proprietaire_nom; $book->proprietaire_id = $r->proprietaire_id; + $book->proprietaire_utilisateur = $r->proprietaire_utilisateur; $book->hash = $r->hash; $book->compteur_visites = $r->compteur_visites; $book->status = $r->status; @@ -22,6 +23,8 @@ class wsDAOBook extends commonDAO { $book->numerotation = $r->numerotation; $book->changedate = $r->changedate; $book->compiledate = $r->compiledate; + $book->facturable = $r->facturable; + $book->facturable_id = $r->facturable_id; return $book; } diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index 84ca2d485..a9bbc33de 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -51,7 +51,7 @@ class wsBookParametres extends wsParametres { __('Mode 2D (caméra fixe et pages à plat)') => '1', __("Laisser le choix à l'utilisateur (mode 3D par défaut)") => '2', __("Laisser le choix à l'utilisateur (mode 2D par défaut)") => '3')); - $this->fields['pagesBaseAngle'] = array('type' => 'integer', 'default' => 2, 'editable' => true, 'label' => __('Angle de base entre les pages'), 'extra' => true, grade => 1, + $this->fields['pagesBaseAngle'] = array('type' => 'integer', 'default' => 2, 'editable' => true, 'label' => __('Angle de base entre les pages'), 'extra' => true, 'grade' => 1, 'hint' => __("0 : Publication à plat") . "\n" . __('2 : Valeur par défaut')); $this->forms['3d_mode'] = array('label' => __('Visualisation en 3D'), 'fieldsnames' => array('visualisationMode', 'pagesBaseAngle')); diff --git a/inc/ws/Metier/class.ws.book.php b/inc/ws/Metier/class.ws.book.php index 8c3c8ea77..729cf258b 100644 --- a/inc/ws/Metier/class.ws.book.php +++ b/inc/ws/Metier/class.ws.book.php @@ -9,8 +9,10 @@ class wsBook extends cubeMetier { protected $proprietaire; protected $proprietaire_id; - // protected $facturable; - // protected $facturable_id; + protected $proprietaire_utilisateur; + + protected $facturable; + protected $facturable_id; protected $hash; protected $compteur_visites; diff --git a/style/extranet/style.css b/style/extranet/style.css index 6cd155e8e..437208de4 100644 --- a/style/extranet/style.css +++ b/style/extranet/style.css @@ -124,15 +124,16 @@ input[type="text"],input[type="password"],select,textarea{ text-indent:-6667px; } -#nav a:hover{ +#nav a:hover span{ background-position:bottom left; } -#nav a.active{ +#nav a.active span{ background-position:bottom left; } + /* Cadre */ .b{margin:0 auto;} .b-c{overflow:hidden;} diff --git a/style/ws/style.css b/style/ws/style.css index 7b1e5667a..50ebfd107 100644 --- a/style/ws/style.css +++ b/style/ws/style.css @@ -131,11 +131,11 @@ input[type="text"],input[type="password"],select,textarea{ text-indent:-6667px; } -#nav a:hover{ +#nav a:hover span{ background-position:bottom left; } -#nav a.active{ +#nav a.active span{ background-position:bottom left; } diff --git a/typo/ws/desc.xml b/typo/ws/desc.xml index 1abdcef8d..b26bf8f0b 100644 --- a/typo/ws/desc.xml +++ b/typo/ws/desc.xml @@ -234,7 +234,7 @@ + \ No newline at end of file