]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 12 Feb 2013 15:12:54 +0000 (15:12 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 12 Feb 2013 15:12:54 +0000 (15:12 +0000)
15 files changed:
inc/commons/Metier/class.common.utilisateur.php
inc/commons/class.common.ajax.php
inc/commons/class.common.core.php
inc/commons/class.common.url.php
inc/ws/Controlleur/class.ws.ajax.php
inc/ws/Controlleur/class.ws.droits.php
inc/ws/Controlleur/class.ws.stats.php
inc/ws/Controlleur/class.ws.url.php
inc/ws/DAO/_common.php
inc/ws/DAO/class.ws.dao.collection.php [new file with mode: 0644]
inc/ws/Metier/_common.php
inc/ws/Metier/class.ws.collection.php [new file with mode: 0644]
style/common.css
style/extranet/style.css
style/ws/style.css

index 9ac5ba8865a740f64fc8c9f400a5224fad91c6c5..8435967a2363fa36d4c4078f519a47dc219d80cc 100644 (file)
@@ -1,5 +1,7 @@
 <?php\r
+\r
 class commonUtilisateur extends cubeMetier {\r
+\r
        protected $utilisateur_id;\r
        protected $connected;\r
        protected $email;\r
@@ -32,19 +34,16 @@ class commonUtilisateur extends cubeMetier {
        protected $ws_domains;\r
        protected $enabled;\r
 \r
-       public function getEmail()\r
-       {\r
+       public function getEmail() {\r
                return trim($this->prenom . ' ' . $this->nom . '<' . $this->email . '>');\r
        }\r
 \r
-       public function changeSettings($rubrique, $element, $valeur)\r
-       {\r
+       public function changeSettings($rubrique, $element, $valeur) {\r
                $this->settings['search'][$rubrique][$element] = $valeur;\r
        }\r
 \r
-       public function getSettings($liste)\r
-       {\r
-               $cles = array('clients' => 'entreprise_id', 'clients_ws' => 'entreprise_id', 'equipiers' => 'utilisateur_id', 'devis' => 'devis_id', 'projets' => 'projet_id', 'factures' => 'facture_id', 'timereport' => 'projet_id', 'fichiers' => 'nom', 'books' => 'book_id', 'demandes' => 'demande_id','publications'=>'book_id');\r
+       public function getSettings($liste) {\r
+               $cles = array('clients' => 'entreprise_id', 'clients_ws' => 'entreprise_id', 'equipiers' => 'utilisateur_id', 'devis' => 'devis_id', 'projets' => 'projet_id', 'factures' => 'facture_id', 'timereport' => 'projet_id', 'fichiers' => 'nom', 'books' => 'book_id', 'demandes' => 'demande_id', 'publications' => 'book_id', 'collections' => 'collection_id');\r
                if (!isset($this->settings['search'][$liste]) || !is_array($this->settings['search'][$liste])) {\r
                        $this->settings['search'][$liste] = array();\r
                }\r
@@ -58,7 +57,7 @@ class commonUtilisateur extends cubeMetier {
                        $this->settings['search'][$liste]['page'] = 1;\r
                }\r
 \r
-               $this->settings['search'][$liste]['search'] = isset($_SESSION['q'])?$_SESSION['q']:null;\r
+               $this->settings['search'][$liste]['search'] = isset($_SESSION['q']) ? $_SESSION['q'] : null;\r
 \r
                if (!isset($this->settings['search'][$liste]['par_page'])) {\r
                        if ($liste == 'projets' || $liste == 'projets_timereport') {\r
@@ -72,10 +71,10 @@ class commonUtilisateur extends cubeMetier {
                }\r
 \r
                $page = $this->settings['search'][$liste]['page'];\r
-               $this->settings['search'][$liste]['page'] = $page?$page:1;\r
+               $this->settings['search'][$liste]['page'] = $page ? $page : 1;\r
                $par_page = $this->settings['search'][$liste]['par_page'];\r
                if ($par_page > 0) {\r
-                       $this->settings['search'][$liste]['limit'] = array(($page-1) * $par_page, $par_page);\r
+                       $this->settings['search'][$liste]['limit'] = array(($page - 1) * $par_page, $par_page);\r
                } else {\r
                        $this->settings['search'][$liste]['limit'] = null;\r
                }\r
@@ -84,28 +83,26 @@ class commonUtilisateur extends cubeMetier {
                return $this->settings['search'][$liste];\r
        }\r
 \r
-       public function getLastPrint()\r
-       {\r
+       public function getLastPrint() {\r
                if (!isset($this->settings['lastprint'])) {\r
                        $this->settings['lastprint'] = array('pages' => '', 'date' => 0);\r
                }\r
                return $this->settings['lastprint'];\r
        }\r
 \r
-       public function saveLastPrint($pages)\r
-       {\r
+       public function saveLastPrint($pages) {\r
                $this->settings['lastprint']['pages'] = $pages;\r
                $this->settings['lastprint']['date'] = TIME;\r
        }\r
-       \r
-       public function getWSSignatures(){\r
+\r
+       public function getWSSignatures() {\r
                return $this->ws_signatures;\r
        }\r
 \r
-       public function __toString()\r
-       {\r
+       public function __toString() {\r
                return trim($this->prenom . ' ' . $this->nom);\r
        }\r
+\r
 }\r
 \r
 ?>
\ No newline at end of file
index 4db036e23dd393b9f259ba86e1820fab3fec282c..fb8a3fc6e56d41acd78a12b63772b3d9185918f3 100644 (file)
@@ -12,7 +12,7 @@ class commonAjax {
                $res = commonPage::bh();\r
                $res .= '<form action="' . $action . '" method="post">';\r
                $res .= '<table class="form' . $class . '">';\r
-               $res .= '<tr><th' . $colspan . '><strong>' . $core->typo->Titre($titre) . '</strong></th><th class="right"><a href="#" class="closePopup">' . cubeMedia::image(IMG . '/close.png') . '</a></th></tr>';\r
+               $res .= '<tr><th' . $colspan . '><h1>' . $titre . '</h1></th><th class="right"><a href="#" class="closePopup">' . cubeMedia::image(IMG . '/close.png') . '</a></th></tr>';\r
                $res .= $form;\r
                if ($bouton) {\r
                        $res .= '<tr><td colspan="' . $cols . '" class="right"><a href="#" class="submit">' . $core->typo->BoutonOK($bouton) . '</a></td></tr>';\r
index 107d06fdf8518801d717e11d0efa188417990a9a..2fad698edfcaed055067ee2d1e0f72e8727be236 100644 (file)
@@ -563,6 +563,12 @@ 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
+\r
+               $this->views->createView('collections_vue', 'SELECT b.*,b.proprietaire AS proprietaire_id,'\r
+                               . 'CONCAT(c.rs,\' (\',c.prenom,\' \',c.nom,\')\') AS proprietaire_nom,'\r
+                               . 'CONCAT(c.prenom,\' \',c.nom) AS proprietaire_utilisateur '\r
+                               . 'FROM book_collection b '\r
+                               . 'LEFT JOIN utilisateurs_entreprise c ON b.proprietaire=c.utilisateur_id ');\r
                $this->views->createView('books_vue', 'SELECT b.*,b.proprietaire AS proprietaire_id,'\r
                                . 'CONCAT(c.rs,\' (\',c.prenom,\' \',c.nom,\')\') AS proprietaire_nom,'\r
                                . 'CONCAT(c.prenom,\' \',c.nom) AS proprietaire_utilisateur,c.ws_admin,'\r
index 54be110cdc6cd71bc8b4744681f268f066f85a9b..8547b6dc5201596acb0ca724322f946fa1d332e4 100644 (file)
@@ -66,7 +66,7 @@ class commonUrl {
                $res .= commonPage::bh('login');\r
                $res .= '<div class="form">';\r
                $res .= '<form action="' . $_SERVER['REQUEST_URI'] . '" method="post" class="notajax">';\r
-               $res .= '<h1>' . $core->typo->Titre(__('Veuillez vous identifier')) . '</h1>';\r
+               $res .= '<h1>' . __('Veuillez vous identifier') . '</h1>';\r
                $res .= $message;\r
                $res .= '<table>';\r
                $res .= '<tr><td>' . __('Votre e-mail ou login') . ' : </td><td>' . cubeForm::email('user_email', 20, 64, '') . '</td></tr>';\r
index 8e0647219ffaabc19127ff8ca8399a98fe3527ce..65798305ec9e3b3098670faa650e867d138dcb74 100644 (file)
@@ -100,6 +100,11 @@ class wsAjax extends cubeAjax {
                $x->addContent('listeClients', wsUrl::listeClients());\r
        }\r
 \r
+       public static function sortCollections($args, &$x) {\r
+               commonAjax::sort('collections', $args[1]);\r
+               $x->addContent('listeCollections', wsUrl::listeCollections());\r
+       }\r
+\r
        public static function pageClient($args, &$x) {\r
                commonAjax::page('clients_ws', $args[1]);\r
                $x->addContent('listeClients', wsUrl::listeClients());\r
@@ -151,10 +156,18 @@ class wsAjax extends cubeAjax {
                commonAjax::form('newBook', __("Créer une nouvelle publication à partir d'une existante"), wsUrl::chooseExistingBook(), __('Créer une nouvelle publication'), 3);\r
        }\r
 \r
+       public static function newCollectionForm($args, &$x) {\r
+               commonAjax::form('saveCollection', __("Créer une nouvelle collection"), wsUrl::formCollection(), __('Créer une nouvelle collection'), 3);\r
+       }\r
+\r
        public static function formChangeBookProprietaire($args, &$x) {\r
                commonAjax::form('changeBookProprietaire/' . $args[1], __("Modifier le propriétaire de la publication"), wsUrl::changeBookProprietaire($args[1]), __('Enregistrer'), 3);\r
        }\r
 \r
+       public static function formChangeCollectionProprietaire($args, &$x) {\r
+               commonAjax::form('changeCollectionProprietaire/' . $args[1], __("Modifier le propriétaire de la collection"), wsUrl::changeCollectionProprietaire($args[1]), __('Enregistrer'), 3);\r
+       }\r
+\r
        public static function filtreBooks($args, &$x) {\r
                if (isset($args[1]) && $args[1] == 'efface') {\r
                        commonAjax::filtre('books');\r
@@ -180,17 +193,45 @@ class wsAjax extends cubeAjax {
                $x->addTruePopup(SITE_PATH . 'editor/' . $book->book_id);\r
        }\r
 \r
+       public static function saveCollection($args, &$x) {\r
+               global $core;\r
+               $dao = new wsDAOCollection($core->con);\r
+               $dao->sauve($_POST);\r
+\r
+               $x->addClosePopup();\r
+               $x->addContent('listeCollections', wsUrl::listeCollections());\r
+       }\r
+\r
        public static function changeBookProprietaire($args, &$x) {\r
+               return self::_changeProprietaire('book', $args[1], $_POST['proprietaire'], $x);\r
+       }\r
+\r
+       public static function changeCollectionProprietaire($args, &$x) {\r
+               return self::_changeProprietaire('collection', $args[1], $_POST['proprietaire'], $x);\r
+       }\r
+\r
+       public static function _changeProprietaire($type, $id, $proprietaire, &$x) {\r
                global $core;\r
-               if ($_POST['proprietaire'] == '') {\r
+               if ($proprietaire == '') {\r
                        $x->addError('book_proprietaire');\r
-                       return;\r
+                       return false;\r
                }\r
                $x->addOk('book_proprietaire');\r
-               $dao = new wsDAOBook($core->con);\r
-               $dao->setProprietaire($args[1], $_POST['proprietaire']);\r
+\r
+               if ($type == "book") {\r
+                       $dao = new wsDAOBook($core->con);\r
+               } elseif ($type == "collection") {\r
+                       $dao = new wsDAOCollection($core->con);\r
+               }\r
+\r
+               $dao->setProprietaire($id, $proprietaire);\r
+\r
                $x->addClosePopup();\r
-               $x->addContent('listeBooks', wsUrl::listeBooks());\r
+               if ($type == 'book') {\r
+                       $x->addContent('listeBooks', wsUrl::listeBooks());\r
+               } elseif ($type == "collection") {\r
+                       $x->addContent('listeCollections', wsUrl::listeCollections());\r
+               }\r
        }\r
 \r
        public static function downbook($args, &$x) {\r
@@ -613,6 +654,11 @@ class wsAjax extends cubeAjax {
                $x->addContent('listeDemandes', wsUrl::listeDemandes());\r
        }\r
 \r
+       public static function parPageCollections($args, &$x) {\r
+               commonAjax::parPage('collections', $_POST['par_page']);\r
+               $x->addContent('listeCollections', wsUrl::listeCollections());\r
+       }\r
+\r
        public static function supprimeDemande($args, &$x) {\r
                global $core;\r
                $demande_id = $args[1];\r
index 026ecca3e4856be2d9a43cf3c2397732fcf5eab1..d292d8d76ec9cacf20581359aac473651c149903 100644 (file)
@@ -1,16 +1,17 @@
 <?php\r
+\r
 class wsDroits {\r
+\r
        public static $creation = array(2, 4, 5);\r
        public static $revendeur = 3;\r
        public static $admin = 5;\r
 \r
-       public static function navigation()\r
-       {\r
+       public static function navigation() {\r
                global $core;\r
 \r
                $nav = array();\r
-               \r
-               if(is_null($core->user)){\r
+\r
+               if (is_null($core->user)) {\r
                        return $nav;\r
                }\r
 \r
@@ -19,6 +20,9 @@ class wsDroits {
                }\r
 \r
                $nav[__('Publications')] = 'publications';\r
+               if ($core->user->ws_grade >= 5) {\r
+                       $nav[__('Collections')] = 'collections';\r
+               }\r
                if ($core->user->ws_grade >= 3) {\r
                        $nav[__('Clients')] = 'clients';\r
                }\r
@@ -32,8 +36,7 @@ class wsDroits {
                return $nav;\r
        }\r
 \r
-       public static function getDroits()\r
-       {\r
+       public static function getDroits() {\r
                $res = new stdClass();\r
                $res->creation = self::creation(false);\r
                $res->revendeur = self::revendeur(false);\r
@@ -41,23 +44,19 @@ class wsDroits {
                return $res;\r
        }\r
 \r
-       public static function creation($error = false)\r
-       {\r
+       public static function creation($error = false) {\r
                return self::gradeIn(self::$creation, $error);\r
        }\r
 \r
-       public static function revendeur($error = false)\r
-       {\r
+       public static function revendeur($error = false) {\r
                return commonDroits::min(self::$revendeur, $error);\r
        }\r
 \r
-       public static function admin($error = false)\r
-       {\r
+       public static function admin($error = false) {\r
                return commonDroits::min(self::$admin, $error);\r
        }\r
 \r
-       protected static function gradeIn($list, $error = false)\r
-       {\r
+       protected static function gradeIn($list, $error = false) {\r
                global $core;\r
                if (!in_array($core->user->ws_grade, $list)) {\r
                        if ($error) {\r
@@ -68,16 +67,15 @@ class wsDroits {
                return true;\r
        }\r
 \r
-       public static function getSignatures()\r
-       {\r
+       public static function getSignatures() {\r
                global $core;\r
 \r
-               if(is_null($core) || is_null($core->user)){\r
-                       $s='';\r
-               }else{\r
-                       $s=$core->user->getWSSignatures();\r
+               if (is_null($core) || is_null($core->user)) {\r
+                       $s = '';\r
+               } else {\r
+                       $s = $core->user->getWSSignatures();\r
                }\r
-               \r
+\r
                $mySignatures = explode(',', $s);\r
                $mySignatures[] = 1;\r
 \r
@@ -89,7 +87,7 @@ class wsDroits {
                        $GLOBALS['allSignatures'] = $dao->selectAll();\r
                }\r
                $res = array();\r
-               foreach($GLOBALS['allSignatures'] as $signature) {\r
+               foreach ($GLOBALS['allSignatures'] as $signature) {\r
                        if (!$admin && !in_array($signature->signature_id, $mySignatures)) {\r
                                continue;\r
                        }\r
@@ -97,6 +95,7 @@ class wsDroits {
                }\r
                return $res;\r
        }\r
+\r
 }\r
 \r
 ?>
\ No newline at end of file
index 954a3cf62a8057232ae2e358b3bfe973700b3abe..b7cde88bb6d7e6d6128e8f754290855949564fee 100644 (file)
@@ -317,7 +317,7 @@ class wsStats {
                }\r
                $res = '<table class="' . implode(' ', $class) . '">';\r
                // Titre\r
-               $res .= '<tr><th colspan="' . count($colsTitles) . '">' . $core->typo->Titre($title) . '</th></tr>';\r
+               $res .= '<tr><th colspan="' . count($colsTitles) . '"><h1>' . $title. '</h1></th></tr>';\r
                // Head\r
                if (implode('', $colsTitles) != '') {\r
                        $res .= '<tr>';\r
@@ -434,7 +434,7 @@ class wsStats {
                $res .= commonPage::bf();\r
                $res .= commonPage::bh();\r
                $res .= '<table class="liste max">';\r
-               $res .= '<tr><th>' . $core->typo->Titre(__('Détail par mois')) . '</th></tr>';\r
+               $res .= '<tr><th><h1>' . __('Détail par mois') . '</h1></th></tr>';\r
                $res .= '<tr><th>';\r
                $res .= '<div class="center" style="width:944px;margin:0 auto;position:relative;">';\r
                if (is_null($annee)) {\r
index ddace0738baca432853f5df4393121990f23e02c..ca254e516161a871ed8453d2e64d6bc19ce07f63 100644 (file)
@@ -175,6 +175,85 @@ class wsUrl {
                return $res;\r
        }\r
 \r
+       public static function collections() {\r
+               global $core;\r
+\r
+               if (isset($args[1])) {\r
+                       $_SESSION['q'] = $args[1];\r
+               }\r
+\r
+               $settings = $core->user->getSettings('collections');\r
+               $shortcuts = array();\r
+               if (wsDroits::creation()) {\r
+                       $shortcuts[] = '<a href="#" class="popup" rel="newCollectionForm">' . $core->typo->Ajouter(__('Créer une nouvelle collection')) . '</a>';\r
+               }\r
+\r
+               $filtres = array();\r
+\r
+               $res = commonPage::barre($filtres, 'filtreCollections', 'collections', $shortcuts);\r
+               $res .= commonPage::tMain(null);\r
+               $res .= commonPage::bh();\r
+               $res .= '<div id="listeCollections">';\r
+               $res .= self::listeCollections();\r
+               $res .= '</div>';\r
+               $res .= commonPage::bf();\r
+               $res .= commonPage::bMain();\r
+               return $res;\r
+       }\r
+\r
+       public static function listeCollections($dashboard = null, $settings = null) {\r
+               global $core;\r
+\r
+               cubePage::truePopup();\r
+               cubePage::autocomplete();\r
+               $droits = wsDroits::getDroits();\r
+\r
+               commonDroits::min(3);\r
+               $settings = is_null($settings) ? $core->user->getSettings('collections') : $settings;\r
+               $change = is_null($dashboard) ? 'Collections' : 'Dashboard/' . $dashboard;\r
+               $dao = new wsDAOCollection($core->con);\r
+               if (isset($settings['search']) && !is_null($settings['search'])) {\r
+                       $dao->setSearch($settings['search']);\r
+               }\r
+               $dao->setFiltres($settings['filtres']);\r
+               $liste = $dao->getListe($settings['orderby'], $settings['sens'], $settings['limit'], $core->user);\r
+\r
+               $res = '<table class="liste">';\r
+               $res .= '<tr><th>' . commonUrl::orderby('#', 'collection_id', $settings, 'sort' . $change) . '</th>';\r
+               $res .= '<th>' . commonUrl::orderby(__('Nom de la collection'), 'nom', $settings, 'sort' . $change) . '</th>';\r
+               $res .= '<th>' . commonUrl::orderby(__('Propriétaire'), 'proprietaire_nom', $settings, 'sort' . $change) . '</th>';\r
+               $res.='</tr>';\r
+\r
+               $i = 0;\r
+               foreach ($liste as $collection) {\r
+                       $odd = cubeMath::isOdd($i) ? ' class="odd"' : '';\r
+                       $res.='<tr>';\r
+                       $res.='<td>' . $collection->collection_id . '</td>';\r
+                       $res.='<td>' . $collection->nom . '</td>';\r
+                       if ($droits->revendeur) {\r
+                               $p = str_replace(" (", '<br /><em>', html::escapeHTML($collection->proprietaire_nom));\r
+                               $p = str_replace(')', '</em>', $p);\r
+                               $res .= '<td><a href="#" class="popup" rel="formChangeCollectionProprietaire/' . $collection->collection_id . '" title="' . __('Modifier le proprietaire') . '">' . $p . '</a></td>';\r
+                       } else {\r
+                               $res .= '<td>' . html::escapeHTML($collection->proprietaire_utilisateur) . '</td>';\r
+                       }\r
+                       $res.='</tr>';\r
+\r
+                       $i++;\r
+               }\r
+\r
+               if (!isset($settings['search']) || is_null($settings['search'])) {\r
+                       $odd = cubeMath::isOdd($i) ? ' class="odd"' : '';\r
+                       $res .= '<tr' . $odd . '><td colspan="3">';\r
+                       $res .= commonPage::pager($settings['page'], $dao->count($core->user), $settings['par_page'], 'page' . $change . '/%d');\r
+                       $res .= commonUrl::formParPage('parPage' . $change, $settings['par_page'], __('collections'), false);\r
+                       $res .= '</td></tr>';\r
+               }\r
+               $res .= '</table>';\r
+\r
+               return $res;\r
+       }\r
+\r
        public static function getFluidbookVersions($select = false) {\r
                $droits = wsDroits::getDroits();\r
 \r
@@ -1043,7 +1122,21 @@ html{height:100%}' . "\n";
                $dao = new wsDAOBook($core->con);\r
                $book = $dao->selectById($book_id);\r
 \r
-               $res = '<tr><td>' . __('Propriétaire actuel') . ' : </td><td>' . $book->proprietaire . '</td></tr>';\r
+               return self::_changeProprietaire($book->proprietaire);\r
+       }\r
+\r
+       public static function changeCollectionProprietaire($collection_id) {\r
+               global $core;\r
+               commonDroits::min(3);\r
+\r
+               $dao = new wsDAOCollection($core->con);\r
+               $collection = $dao->selectById($collection_id);\r
+\r
+               return self::_changeProprietaire($collection->proprietaire_nom);\r
+       }\r
+\r
+       protected static function _changeProprietaire($proprietaire) {\r
+               $res = '<tr><td>' . __('Propriétaire actuel') . ' : </td><td>' . $proprietaire . '</td></tr>';\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
@@ -1498,6 +1591,21 @@ html{height:100%}' . "\n";
                return $res;\r
        }\r
 \r
+       public static function formCollection($collection_id = 'new') {\r
+               global $core;\r
+               commonDroits::min(3);\r
+               $dao = new wsDAOCollection($core->con);\r
+               if ($collection_id != 'new') {\r
+                       $collection = $dao->selectById($collection_id);\r
+               } else {\r
+                       $collection = $dao->cree();\r
+               }\r
+\r
+               $res.='<tr><td>#</td><td>' . form::hidden('collection_id', $collection->collection_id) . $collection->collection_id . '</td></tr>';\r
+               $res .= '<tr><td>Nom de la collection</td><td>' . form::field('nom', 20, 64, $collection->nom) . '</td></tr>';\r
+               return $res;\r
+       }\r
+\r
        public static function formContact($client_id = 'new', $entreprise_id = null) {\r
                global $core;\r
                commonDroits::min(3);\r
@@ -1673,7 +1781,7 @@ html{height:100%}' . "\n";
                $res .= commonPage::tMain();\r
                $res .= commonPage::bh();\r
                $res .= '<div id="accepteDemandes">';\r
-               $res .= '<h2>' . $core->typo->Titre(__('Prendre en charge une demande de devis')) . '</h2>';\r
+               $res .= '<h1>' . __('Prendre en charge une demande de devis') . '</h1>';\r
                $res .= '<br /><br />';\r
 \r
                if ($demande->revendeur != $revendeur_id || $demande->revendeur != $core->user->utilisateur_id || $demande->status == 0) {\r
index 7d9299858c3db837b54d7154e24bfe0fdd22f9f2..80302254aca9a45dbdbf1c5db00509752d1376e8 100644 (file)
@@ -6,5 +6,6 @@ $__autoload['wsDAOIcone'] = dirname(__FILE__) . '/class.ws.dao.icone.php';
 $__autoload['wsDAOLang'] = dirname(__FILE__) . '/class.ws.dao.lang.php';\r
 $__autoload['wsDAOSignature'] = dirname(__FILE__) . '/class.ws.dao.signature.php';\r
 $__autoload['wsDAODemande'] = dirname(__FILE__) . '/class.ws.dao.demande.php';\r
+$__autoload['wsDAOCollection'] = dirname(__FILE__) . '/class.ws.dao.collection.php';\r
 \r
 ?>
\ No newline at end of file
diff --git a/inc/ws/DAO/class.ws.dao.collection.php b/inc/ws/DAO/class.ws.dao.collection.php
new file mode 100644 (file)
index 0000000..1a747d1
--- /dev/null
@@ -0,0 +1,88 @@
+<?php
+
+class wsDAOCollection extends commonDAO {
+
+       protected function singleton($r) {
+               $collection = new wsCollection();
+               $collection->collection_id = $r->collection_id;
+               $collection->nom = $r->nom;
+               $collection->proprietaire = $r->proprietaire;
+               $collection->proprietaire_nom = $r->proprietaire_nom;
+               $collection->proprietaire_utilisateur = $r->proprietaire_utilisateur;
+               return $collection;
+       }
+
+       public function cree() {
+               $collection = new wsCollection();
+               $collection->collection_id = 'new';
+               $collection->nom = '';
+               $collection->proprietaire = 0;
+               return $collection;
+       }
+
+       public function sauve($data, $createur = null) {
+               $c = $this->con->openCursor('book_collection');
+               $c->nom = $data['nom'];
+               if (!is_null($createur) && $data['collection_id'] == 'new') {
+                       $c->proprietaire = $createur;
+               }
+
+               if ($data['collection_id'] == 'new') {
+                       $r = $this->con->select('SELECT MAX(collection_id) AS collection_id FROM collections_vue');
+                       $c->collection_id = $r->collection_id + 1;
+                       $c->insert();
+               } else {
+                       $c->update('WHERE collection_id=\'' . $data['collection_id'] . '\'');
+               }
+       }
+
+       public function count() {
+               $r = $this->con->select('SELECT COUNT(*) AS nb FROM book_collection');
+               return $r->nb;
+       }
+
+       public function selectById($collection_id) {
+               $r = $this->con->select('SELECT * FROM collections_vue WHERE collection_id=\'' . $this->con->escape($collection_id) . '\'');
+               return $this->singleton($r);
+       }
+
+       public function getListe($orderby = null, $sens = null, $limit = null) {
+               if (!is_null($this->q)) {
+                       $where = '(';
+                       if ($this->search_id) {
+                               $where .= ' book_id=\'' . $this->con->escape($this->q) . '\' OR ';
+                       }
+
+                       if (!cubeMath::is_int($this->q)) {
+                               $where .= 'nom LIKE \'%' . $this->con->escape($this->q) . '%\'';
+                               $daoClient = new commonDAOClient($this->con);
+                               $where .= ' OR proprietaire_id IN(' . $daoClient->querySearchByName($this->q) . ') OR ';
+                       }
+                       $limit = null;
+                       $where .= '1=2)';
+               } else {
+                       $where = '(' . $this->makeWhereFromFiltres() . ')';
+               }
+
+               $orderby = is_null($orderby) ? 'collection_id' : $orderby;
+               $sens = is_null($sens) ? 'DESC' : $sens;
+               $limit = is_null($limit) ? '' : $this->con->limit($limit);
+
+               $sql = 'SELECT * FROM collections_vue WHERE ' . $where . ' ORDER BY ' . $orderby . ' ' . $sens . ' ' . $limit;
+               $r = $this->con->select($sql);
+               return $this->factory($r);
+       }
+
+       public function setProprietaire($collection_id, $proprietaire) {
+               $c = $this->con->openCursor('book_collection');
+               $c->proprietaire=$proprietaire;
+               $c->update('WHERE collection_id=\'' . $this->con->escape($collection_id) . '\'');
+       }
+
+       public function makeWhereFromFiltres() {
+               return '1=1';
+       }
+
+}
+
+?>
index 54c92156d957602086f042cea0c44b0a186e72d9..306fcd88c744df22d20155e1d4e989476a405ddf 100644 (file)
@@ -1,5 +1,7 @@
 <?php\r
+\r
 $__autoload['wsBook'] = dirname(__FILE__) . '/class.ws.book.php';\r
+$__autoload['wsCollection'] = dirname(__FILE__) . '/class.ws.collection.php';\r
 $__autoload['wsParametres'] = dirname(__FILE__) . '/class.ws.parametres.php';\r
 $__autoload['wsThemeParametres'] = dirname(__FILE__) . '/class.ws.theme.parametres.php';\r
 $__autoload['wsTheme'] = dirname(__FILE__) . '/class.ws.theme.php';\r
@@ -13,5 +15,4 @@ $__autoload['wsIcone'] = dirname(__FILE__) . '/class.ws.icone.php';
 $__autoload['wsLang'] = dirname(__FILE__) . '/class.ws.lang.php';\r
 $__autoload['wsSignature'] = dirname(__FILE__) . '/class.ws.signature.php';\r
 $__autoload['wsDemande'] = dirname(__FILE__) . '/class.ws.demande.php';\r
-\r
 ?>
\ No newline at end of file
diff --git a/inc/ws/Metier/class.ws.collection.php b/inc/ws/Metier/class.ws.collection.php
new file mode 100644 (file)
index 0000000..66d0485
--- /dev/null
@@ -0,0 +1,11 @@
+<?php
+
+class wsCollection extends cubeMetier {
+       protected $collection_id;
+       protected $nom;
+       protected $proprietaire;
+       protected $proprietaire_nom;
+       protected $proprietaire_utilisateur;
+}
+
+?>
index bc7f4ae42ace10c6b023dddd487728f86e9b8eda..e90fc90a4063860e2ecae431b2b02d9b81c0850b 100644 (file)
@@ -11,6 +11,14 @@ select{
        outline: none;
 }
 
+h1{
+       font-family: UniversCondensedBold;
+       font-weight: normal;
+       text-transform: uppercase;
+       font-size:16px;
+       padding:10px 0 5px;
+}
+
 @font-face {
     font-family: 'UniversCondensedBold';
     src: url('univers-condensedbold-webfont.eot');
@@ -56,10 +64,6 @@ select{
        border-radius: 0 !important;
 }
 
-.b h1{
-       border-radius:6px 6px 0 0;
-}
-
 .b.login{
        width:325px;
        margin:0 auto;
index 33fbf2d33d9062d21f2f861193a89c28e32ef8d4..249fa81fe9fd03e16c573442d2f735aa2dde517b 100644 (file)
@@ -18,15 +18,23 @@ a:hover{
 }\r
 \r
 abbr{cursor:help;border-bottom:1px dotted #fff;}\r
-\r
 td{height:30px;color:#333;}\r
 \r
+h1{\r
+       padding:6px 5px;\r
+}\r
+\r
+.login h1{\r
+       color:#5F6162;\r
+       padding: 10px 10px 5px;\r
+}\r
+\r
+\r
 input[type="text"],input[type="password"],input[type="email"],input[type="search"],select,textarea{\r
        color:#666;\r
 }\r
 \r
 .message{text-align:center;font-size:11px;color:#da4f24;background:#fff;}\r
-.closePopup img{margin-top:4px;}\r
 \r
 .content{\r
        width:990px;\r
@@ -123,9 +131,9 @@ input[type="text"],input[type="password"],input[type="email"],input[type="search
 .liste.light{width:100% !important;min-width:0px !important;}\r
 .liste.form{width:auto !important;min-width:0px !important;}\r
 .form h2,.form th,.form td,.liste th, .liste td{text-align:left;border-bottom:1px solid #fff;font-weight:normal;padding-left:10px;padding-right:10px;font-size:12px;}\r
-.form th,.form h1,.liste th,.liste h1{color:#fff;font-size:11px;height:31px;font-weight:normal;vertical-align:middle;background:#4e535b url(b-h.png) repeat-x;padding-left:10px;}\r
+.form th,.liste th,.liste h1{color:#fff;font-size:11px;height:31px;font-weight:normal;vertical-align:middle;background:#4e535b url(b-h.png) repeat-x;padding-left:10px;}\r
 .form tr.big th{height:40px;}\r
-.form h1,.form h2{padding-top:6px;height:26px;}\r
+.form h2{padding-top:6px;height:26px;}\r
 .form td{background:#fff;}\r
 .form h2,.liste td{color:#333;background:#dbdde2;vertical-align:middle;}\r
 .form tr.odd td,.liste tr.odd td{background:#ecedf0;}\r
index d5c8382a48182a01b7582fc8e998a1093cb91eca..335b02736d80e53ca1a9443b9e1037c7e7776288 100644 (file)
@@ -22,6 +22,10 @@ abbr{cursor:help;border-bottom:1px dotted #797D62;}
 \r
 td{height:30px;}\r
 \r
+h1{\r
+       color:#989b85;\r
+}\r
+\r
 input[type="text"],input[type="password"],input[type="email"],input[type="search"],select,textarea{\r
        color:#797D62;\r
 }\r
@@ -29,6 +33,10 @@ input[type="text"],input[type="password"],input[type="email"],input[type="search
 .message{text-align:center;font-size:11px;color:#da4f24;background:#fff;}\r
 .closePopup img{margin-top:4px;}\r
 \r
+.login h1{\r
+        padding: 10px 10px 5px;\r
+}\r
+\r
 .content{\r
        width:990px;\r
        margin:0 auto;\r
@@ -122,7 +130,6 @@ input[type="text"],input[type="password"],input[type="email"],input[type="search
        width:960px;\r
 }\r
 \r
-\r
 .popupOverlay{background:#a8aa95;opacity:0;position:fixed;display:none;top:0px;left:0px;width:100%;height:100%;}\r
 .popupWindow{display:none;opacity:1;position:fixed;}\r
 /*.popupWindow>table{width:600px;}*/\r
@@ -133,9 +140,9 @@ input[type="text"],input[type="password"],input[type="email"],input[type="search
 .liste.light{width:100% !important;min-width:0px !important;}\r
 .liste.form{width:auto !important;min-width:0px !important;}\r
 .form h2,.form th,.form td,.liste th, .liste td{text-align:left;border-bottom:1px solid #fff;font-weight:normal;padding-left:10px;padding-right:10px;font-size:12px;min-height:50px;height:38px;}\r
-.form th,.form h1,.liste th,.liste h1{font-size:12px;height:31px;font-weight:bold;vertical-align:middle;background:#fff;padding-left:10px;}\r
+.form th,.liste th,.liste h1{font-size:12px;height:31px;font-weight:bold;vertical-align:middle;background:#fff;padding-left:10px;}\r
 .form tr.big th{height:40px;}\r
-.form h1,.form h2{padding-top:6px;height:26px;}\r
+.form h2{padding-top:6px;height:26px;}\r
 .form td{background:#fff;}\r
 .form h2,.liste td{background:#eaeaea;vertical-align:middle;}\r
 .form tr.odd td,.liste tr.odd td{background:#f4f4f4;}\r