From: vincent@cubedesigners.com Date: Tue, 12 Feb 2013 15:12:54 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=5de21cd90fe8ff2d05c4687acd45417eaebeda83;p=cubeextranet.git --- diff --git a/inc/commons/Metier/class.common.utilisateur.php b/inc/commons/Metier/class.common.utilisateur.php index 9ac5ba886..8435967a2 100644 --- a/inc/commons/Metier/class.common.utilisateur.php +++ b/inc/commons/Metier/class.common.utilisateur.php @@ -1,5 +1,7 @@ prenom . ' ' . $this->nom . '<' . $this->email . '>'); } - public function changeSettings($rubrique, $element, $valeur) - { + public function changeSettings($rubrique, $element, $valeur) { $this->settings['search'][$rubrique][$element] = $valeur; } - public function getSettings($liste) - { - $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'); + public function getSettings($liste) { + $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'); if (!isset($this->settings['search'][$liste]) || !is_array($this->settings['search'][$liste])) { $this->settings['search'][$liste] = array(); } @@ -58,7 +57,7 @@ class commonUtilisateur extends cubeMetier { $this->settings['search'][$liste]['page'] = 1; } - $this->settings['search'][$liste]['search'] = isset($_SESSION['q'])?$_SESSION['q']:null; + $this->settings['search'][$liste]['search'] = isset($_SESSION['q']) ? $_SESSION['q'] : null; if (!isset($this->settings['search'][$liste]['par_page'])) { if ($liste == 'projets' || $liste == 'projets_timereport') { @@ -72,10 +71,10 @@ class commonUtilisateur extends cubeMetier { } $page = $this->settings['search'][$liste]['page']; - $this->settings['search'][$liste]['page'] = $page?$page:1; + $this->settings['search'][$liste]['page'] = $page ? $page : 1; $par_page = $this->settings['search'][$liste]['par_page']; if ($par_page > 0) { - $this->settings['search'][$liste]['limit'] = array(($page-1) * $par_page, $par_page); + $this->settings['search'][$liste]['limit'] = array(($page - 1) * $par_page, $par_page); } else { $this->settings['search'][$liste]['limit'] = null; } @@ -84,28 +83,26 @@ class commonUtilisateur extends cubeMetier { return $this->settings['search'][$liste]; } - public function getLastPrint() - { + public function getLastPrint() { if (!isset($this->settings['lastprint'])) { $this->settings['lastprint'] = array('pages' => '', 'date' => 0); } return $this->settings['lastprint']; } - public function saveLastPrint($pages) - { + public function saveLastPrint($pages) { $this->settings['lastprint']['pages'] = $pages; $this->settings['lastprint']['date'] = TIME; } - - public function getWSSignatures(){ + + public function getWSSignatures() { return $this->ws_signatures; } - public function __toString() - { + public function __toString() { return trim($this->prenom . ' ' . $this->nom); } + } ?> \ No newline at end of file diff --git a/inc/commons/class.common.ajax.php b/inc/commons/class.common.ajax.php index 4db036e23..fb8a3fc6e 100644 --- a/inc/commons/class.common.ajax.php +++ b/inc/commons/class.common.ajax.php @@ -12,7 +12,7 @@ class commonAjax { $res = commonPage::bh(); $res .= '
'; $res .= ''; - $res .= '' . $core->typo->Titre($titre) . ''; + $res .= '

' . $titre . '

'; $res .= $form; if ($bouton) { $res .= ''; diff --git a/inc/commons/class.common.core.php b/inc/commons/class.common.core.php index 107d06fdf..2fad698ed 100644 --- a/inc/commons/class.common.core.php +++ b/inc/commons/class.common.core.php @@ -563,6 +563,12 @@ 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('collections_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 ' + . 'FROM book_collection b ' + . 'LEFT JOIN utilisateurs_entreprise c ON b.proprietaire=c.utilisateur_id '); $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,' diff --git a/inc/commons/class.common.url.php b/inc/commons/class.common.url.php index 54be110cd..8547b6dc5 100644 --- a/inc/commons/class.common.url.php +++ b/inc/commons/class.common.url.php @@ -66,7 +66,7 @@ class commonUrl { $res .= commonPage::bh('login'); $res .= '
'; $res .= ''; - $res .= '

' . $core->typo->Titre(__('Veuillez vous identifier')) . '

'; + $res .= '

' . __('Veuillez vous identifier') . '

'; $res .= $message; $res .= '
' . cubeMedia::image(IMG . '/close.png') . '
' . cubeMedia::image(IMG . '/close.png') . '
' . $core->typo->BoutonOK($bouton) . '
'; $res .= ''; diff --git a/inc/ws/Controlleur/class.ws.ajax.php b/inc/ws/Controlleur/class.ws.ajax.php index 8e0647219..65798305e 100644 --- a/inc/ws/Controlleur/class.ws.ajax.php +++ b/inc/ws/Controlleur/class.ws.ajax.php @@ -100,6 +100,11 @@ class wsAjax extends cubeAjax { $x->addContent('listeClients', wsUrl::listeClients()); } + public static function sortCollections($args, &$x) { + commonAjax::sort('collections', $args[1]); + $x->addContent('listeCollections', wsUrl::listeCollections()); + } + public static function pageClient($args, &$x) { commonAjax::page('clients_ws', $args[1]); $x->addContent('listeClients', wsUrl::listeClients()); @@ -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); } + public static function newCollectionForm($args, &$x) { + commonAjax::form('saveCollection', __("Créer une nouvelle collection"), wsUrl::formCollection(), __('Créer une nouvelle collection'), 3); + } + public static function formChangeBookProprietaire($args, &$x) { commonAjax::form('changeBookProprietaire/' . $args[1], __("Modifier le propriétaire de la publication"), wsUrl::changeBookProprietaire($args[1]), __('Enregistrer'), 3); } + public static function formChangeCollectionProprietaire($args, &$x) { + commonAjax::form('changeCollectionProprietaire/' . $args[1], __("Modifier le propriétaire de la collection"), wsUrl::changeCollectionProprietaire($args[1]), __('Enregistrer'), 3); + } + public static function filtreBooks($args, &$x) { if (isset($args[1]) && $args[1] == 'efface') { commonAjax::filtre('books'); @@ -180,17 +193,45 @@ class wsAjax extends cubeAjax { $x->addTruePopup(SITE_PATH . 'editor/' . $book->book_id); } + public static function saveCollection($args, &$x) { + global $core; + $dao = new wsDAOCollection($core->con); + $dao->sauve($_POST); + + $x->addClosePopup(); + $x->addContent('listeCollections', wsUrl::listeCollections()); + } + public static function changeBookProprietaire($args, &$x) { + return self::_changeProprietaire('book', $args[1], $_POST['proprietaire'], $x); + } + + public static function changeCollectionProprietaire($args, &$x) { + return self::_changeProprietaire('collection', $args[1], $_POST['proprietaire'], $x); + } + + public static function _changeProprietaire($type, $id, $proprietaire, &$x) { global $core; - if ($_POST['proprietaire'] == '') { + if ($proprietaire == '') { $x->addError('book_proprietaire'); - return; + return false; } $x->addOk('book_proprietaire'); - $dao = new wsDAOBook($core->con); - $dao->setProprietaire($args[1], $_POST['proprietaire']); + + if ($type == "book") { + $dao = new wsDAOBook($core->con); + } elseif ($type == "collection") { + $dao = new wsDAOCollection($core->con); + } + + $dao->setProprietaire($id, $proprietaire); + $x->addClosePopup(); - $x->addContent('listeBooks', wsUrl::listeBooks()); + if ($type == 'book') { + $x->addContent('listeBooks', wsUrl::listeBooks()); + } elseif ($type == "collection") { + $x->addContent('listeCollections', wsUrl::listeCollections()); + } } public static function downbook($args, &$x) { @@ -613,6 +654,11 @@ class wsAjax extends cubeAjax { $x->addContent('listeDemandes', wsUrl::listeDemandes()); } + public static function parPageCollections($args, &$x) { + commonAjax::parPage('collections', $_POST['par_page']); + $x->addContent('listeCollections', wsUrl::listeCollections()); + } + public static function supprimeDemande($args, &$x) { global $core; $demande_id = $args[1]; diff --git a/inc/ws/Controlleur/class.ws.droits.php b/inc/ws/Controlleur/class.ws.droits.php index 026ecca3e..d292d8d76 100644 --- a/inc/ws/Controlleur/class.ws.droits.php +++ b/inc/ws/Controlleur/class.ws.droits.php @@ -1,16 +1,17 @@ user)){ + + if (is_null($core->user)) { return $nav; } @@ -19,6 +20,9 @@ class wsDroits { } $nav[__('Publications')] = 'publications'; + if ($core->user->ws_grade >= 5) { + $nav[__('Collections')] = 'collections'; + } if ($core->user->ws_grade >= 3) { $nav[__('Clients')] = 'clients'; } @@ -32,8 +36,7 @@ class wsDroits { return $nav; } - public static function getDroits() - { + public static function getDroits() { $res = new stdClass(); $res->creation = self::creation(false); $res->revendeur = self::revendeur(false); @@ -41,23 +44,19 @@ class wsDroits { return $res; } - public static function creation($error = false) - { + public static function creation($error = false) { return self::gradeIn(self::$creation, $error); } - public static function revendeur($error = false) - { + public static function revendeur($error = false) { return commonDroits::min(self::$revendeur, $error); } - public static function admin($error = false) - { + public static function admin($error = false) { return commonDroits::min(self::$admin, $error); } - protected static function gradeIn($list, $error = false) - { + protected static function gradeIn($list, $error = false) { global $core; if (!in_array($core->user->ws_grade, $list)) { if ($error) { @@ -68,16 +67,15 @@ class wsDroits { return true; } - public static function getSignatures() - { + public static function getSignatures() { global $core; - if(is_null($core) || is_null($core->user)){ - $s=''; - }else{ - $s=$core->user->getWSSignatures(); + if (is_null($core) || is_null($core->user)) { + $s = ''; + } else { + $s = $core->user->getWSSignatures(); } - + $mySignatures = explode(',', $s); $mySignatures[] = 1; @@ -89,7 +87,7 @@ class wsDroits { $GLOBALS['allSignatures'] = $dao->selectAll(); } $res = array(); - foreach($GLOBALS['allSignatures'] as $signature) { + foreach ($GLOBALS['allSignatures'] as $signature) { if (!$admin && !in_array($signature->signature_id, $mySignatures)) { continue; } @@ -97,6 +95,7 @@ class wsDroits { } return $res; } + } ?> \ No newline at end of file diff --git a/inc/ws/Controlleur/class.ws.stats.php b/inc/ws/Controlleur/class.ws.stats.php index 954a3cf62..b7cde88bb 100644 --- a/inc/ws/Controlleur/class.ws.stats.php +++ b/inc/ws/Controlleur/class.ws.stats.php @@ -317,7 +317,7 @@ class wsStats { } $res = '
' . __('Votre e-mail ou login') . ' : ' . cubeForm::email('user_email', 20, 64, '') . '
'; // Titre - $res .= ''; + $res .= ''; // Head if (implode('', $colsTitles) != '') { $res .= ''; @@ -434,7 +434,7 @@ class wsStats { $res .= commonPage::bf(); $res .= commonPage::bh(); $res .= '
' . $core->typo->Titre($title) . '

' . $title. '

'; - $res .= ''; + $res .= ''; $res .= ''; + return self::_changeProprietaire($book->proprietaire); + } + + public static function changeCollectionProprietaire($collection_id) { + global $core; + commonDroits::min(3); + + $dao = new wsDAOCollection($core->con); + $collection = $dao->selectById($collection_id); + + return self::_changeProprietaire($collection->proprietaire_nom); + } + + protected static function _changeProprietaire($proprietaire) { + $res = ''; $res .= ''; return $res; } @@ -1498,6 +1591,21 @@ html{height:100%}' . "\n"; return $res; } + public static function formCollection($collection_id = 'new') { + global $core; + commonDroits::min(3); + $dao = new wsDAOCollection($core->con); + if ($collection_id != 'new') { + $collection = $dao->selectById($collection_id); + } else { + $collection = $dao->cree(); + } + + $res.=''; + $res .= ''; + return $res; + } + public static function formContact($client_id = 'new', $entreprise_id = null) { global $core; commonDroits::min(3); @@ -1673,7 +1781,7 @@ html{height:100%}' . "\n"; $res .= commonPage::tMain(); $res .= commonPage::bh(); $res .= '
'; - $res .= '

' . $core->typo->Titre(__('Prendre en charge une demande de devis')) . '

'; + $res .= '

' . __('Prendre en charge une demande de devis') . '

'; $res .= '

'; if ($demande->revendeur != $revendeur_id || $demande->revendeur != $core->user->utilisateur_id || $demande->status == 0) { diff --git a/inc/ws/DAO/_common.php b/inc/ws/DAO/_common.php index 7d9299858..80302254a 100644 --- a/inc/ws/DAO/_common.php +++ b/inc/ws/DAO/_common.php @@ -6,5 +6,6 @@ $__autoload['wsDAOIcone'] = dirname(__FILE__) . '/class.ws.dao.icone.php'; $__autoload['wsDAOLang'] = dirname(__FILE__) . '/class.ws.dao.lang.php'; $__autoload['wsDAOSignature'] = dirname(__FILE__) . '/class.ws.dao.signature.php'; $__autoload['wsDAODemande'] = dirname(__FILE__) . '/class.ws.dao.demande.php'; +$__autoload['wsDAOCollection'] = dirname(__FILE__) . '/class.ws.dao.collection.php'; ?> \ 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 index 000000000..1a747d1cd --- /dev/null +++ b/inc/ws/DAO/class.ws.dao.collection.php @@ -0,0 +1,88 @@ +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'; + } + +} + +?> diff --git a/inc/ws/Metier/_common.php b/inc/ws/Metier/_common.php index 54c92156d..306fcd88c 100644 --- a/inc/ws/Metier/_common.php +++ b/inc/ws/Metier/_common.php @@ -1,5 +1,7 @@ \ 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 index 000000000..66d04851c --- /dev/null +++ b/inc/ws/Metier/class.ws.collection.php @@ -0,0 +1,11 @@ + diff --git a/style/common.css b/style/common.css index bc7f4ae42..e90fc90a4 100644 --- a/style/common.css +++ b/style/common.css @@ -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; diff --git a/style/extranet/style.css b/style/extranet/style.css index 33fbf2d33..249fa81fe 100644 --- a/style/extranet/style.css +++ b/style/extranet/style.css @@ -18,15 +18,23 @@ a:hover{ } abbr{cursor:help;border-bottom:1px dotted #fff;} - td{height:30px;color:#333;} +h1{ + padding:6px 5px; +} + +.login h1{ + color:#5F6162; + padding: 10px 10px 5px; +} + + input[type="text"],input[type="password"],input[type="email"],input[type="search"],select,textarea{ color:#666; } .message{text-align:center;font-size:11px;color:#da4f24;background:#fff;} -.closePopup img{margin-top:4px;} .content{ width:990px; @@ -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;} .liste.form{width:auto !important;min-width:0px !important;} .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;} -.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;} +.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;} .form tr.big th{height:40px;} -.form h1,.form h2{padding-top:6px;height:26px;} +.form h2{padding-top:6px;height:26px;} .form td{background:#fff;} .form h2,.liste td{color:#333;background:#dbdde2;vertical-align:middle;} .form tr.odd td,.liste tr.odd td{background:#ecedf0;} diff --git a/style/ws/style.css b/style/ws/style.css index d5c8382a4..335b02736 100644 --- a/style/ws/style.css +++ b/style/ws/style.css @@ -22,6 +22,10 @@ abbr{cursor:help;border-bottom:1px dotted #797D62;} td{height:30px;} +h1{ + color:#989b85; +} + input[type="text"],input[type="password"],input[type="email"],input[type="search"],select,textarea{ color:#797D62; } @@ -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;} .closePopup img{margin-top:4px;} +.login h1{ + padding: 10px 10px 5px; +} + .content{ width:990px; margin:0 auto; @@ -122,7 +130,6 @@ input[type="text"],input[type="password"],input[type="email"],input[type="search width:960px; } - .popupOverlay{background:#a8aa95;opacity:0;position:fixed;display:none;top:0px;left:0px;width:100%;height:100%;} .popupWindow{display:none;opacity:1;position:fixed;} /*.popupWindow>table{width:600px;}*/ @@ -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;} .liste.form{width:auto !important;min-width:0px !important;} .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;} -.form th,.form h1,.liste th,.liste h1{font-size:12px;height:31px;font-weight:bold;vertical-align:middle;background:#fff;padding-left:10px;} +.form th,.liste th,.liste h1{font-size:12px;height:31px;font-weight:bold;vertical-align:middle;background:#fff;padding-left:10px;} .form tr.big th{height:40px;} -.form h1,.form h2{padding-top:6px;height:26px;} +.form h2{padding-top:6px;height:26px;} .form td{background:#fff;} .form h2,.liste td{background:#eaeaea;vertical-align:middle;} .form tr.odd td,.liste tr.odd td{background:#f4f4f4;}
' . $core->typo->Titre(__('Détail par mois')) . '

' . __('Détail par mois') . '

'; $res .= '
'; if (is_null($annee)) { diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index ddace0738..ca254e516 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -175,6 +175,85 @@ class wsUrl { return $res; } + public static function collections() { + global $core; + + if (isset($args[1])) { + $_SESSION['q'] = $args[1]; + } + + $settings = $core->user->getSettings('collections'); + $shortcuts = array(); + if (wsDroits::creation()) { + $shortcuts[] = '' . $core->typo->Ajouter(__('Créer une nouvelle collection')) . ''; + } + + $filtres = array(); + + $res = commonPage::barre($filtres, 'filtreCollections', 'collections', $shortcuts); + $res .= commonPage::tMain(null); + $res .= commonPage::bh(); + $res .= '
'; + $res .= self::listeCollections(); + $res .= '
'; + $res .= commonPage::bf(); + $res .= commonPage::bMain(); + return $res; + } + + public static function listeCollections($dashboard = null, $settings = null) { + global $core; + + cubePage::truePopup(); + cubePage::autocomplete(); + $droits = wsDroits::getDroits(); + + commonDroits::min(3); + $settings = is_null($settings) ? $core->user->getSettings('collections') : $settings; + $change = is_null($dashboard) ? 'Collections' : 'Dashboard/' . $dashboard; + $dao = new wsDAOCollection($core->con); + if (isset($settings['search']) && !is_null($settings['search'])) { + $dao->setSearch($settings['search']); + } + $dao->setFiltres($settings['filtres']); + $liste = $dao->getListe($settings['orderby'], $settings['sens'], $settings['limit'], $core->user); + + $res = ''; + $res .= ''; + $res .= ''; + $res .= ''; + $res.=''; + + $i = 0; + foreach ($liste as $collection) { + $odd = cubeMath::isOdd($i) ? ' class="odd"' : ''; + $res.=''; + $res.=''; + $res.=''; + if ($droits->revendeur) { + $p = str_replace(" (", '
', html::escapeHTML($collection->proprietaire_nom)); + $p = str_replace(')', '', $p); + $res .= ''; + } else { + $res .= ''; + } + $res.=''; + + $i++; + } + + if (!isset($settings['search']) || is_null($settings['search'])) { + $odd = cubeMath::isOdd($i) ? ' class="odd"' : ''; + $res .= ''; + } + $res .= '
' . commonUrl::orderby('#', 'collection_id', $settings, 'sort' . $change) . '' . commonUrl::orderby(__('Nom de la collection'), 'nom', $settings, 'sort' . $change) . '' . commonUrl::orderby(__('Propriétaire'), 'proprietaire_nom', $settings, 'sort' . $change) . '
' . $collection->collection_id . '' . $collection->nom . '' . $p . '' . html::escapeHTML($collection->proprietaire_utilisateur) . '
'; + $res .= commonPage::pager($settings['page'], $dao->count($core->user), $settings['par_page'], 'page' . $change . '/%d'); + $res .= commonUrl::formParPage('parPage' . $change, $settings['par_page'], __('collections'), false); + $res .= '
'; + + return $res; + } + public static function getFluidbookVersions($select = false) { $droits = wsDroits::getDroits(); @@ -1043,7 +1122,21 @@ html{height:100%}' . "\n"; $dao = new wsDAOBook($core->con); $book = $dao->selectById($book_id); - $res = '
' . __('Propriétaire actuel') . ' : ' . $book->proprietaire . '
' . __('Propriétaire actuel') . ' : ' . $proprietaire . '
' . __('Rechercher un utilisateur') . ' : ' . form::field('book_proprietaire', 64, 1024) . form::hidden('proprietaire', '') . '
#' . form::hidden('collection_id', $collection->collection_id) . $collection->collection_id . '
Nom de la collection' . form::field('nom', 20, 64, $collection->nom) . '