From: vincent@cubedesigners.com Date: Fri, 15 Feb 2013 15:52:30 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=d648171dbc76268e39233384155e867023979503;p=cubeextranet.git --- diff --git a/images/ws/online-offline.png b/images/ws/online-offline.png new file mode 100644 index 000000000..36d1b56cf Binary files /dev/null and b/images/ws/online-offline.png differ diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index bfec654c9..bb7fd0c6f 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -206,14 +206,14 @@ class wsUrl { public static function collection($args) { global $core; commonDroits::min(1); + cubePage::ui('Sortable'); + //cubePage::checkbox(); $dao = new wsDAOCollection($core->con); $collection = $dao->selectById($args[1]); - $shortcuts = array(); - $shortcuts[] = '
Gestion de la collection « ' . $collection->nom . ' » # ' . $collection->collection_id . '
'; - $shortcuts[] = '' . $core->typo->Ajouter('Nouveau groupe') . ''; + $shortcuts[] = '' . $core->typo->Ajouter('Nouveau groupe') . ''; $res = commonPage::barre(null, null, null, $shortcuts); $res .= commonPage::tMain(); @@ -229,28 +229,49 @@ class wsUrl { public static function collectionEdit($collection) { global $core; - $res = ''; + $res = ''; + $res.=''; } + $res.=''; return $res; } diff --git a/inc/ws/DAO/class.ws.dao.collection.php b/inc/ws/DAO/class.ws.dao.collection.php index b85710ec5..d8080918e 100644 --- a/inc/ws/DAO/class.ws.dao.collection.php +++ b/inc/ws/DAO/class.ws.dao.collection.php @@ -30,7 +30,7 @@ class wsDAOCollection extends commonDAO { return array($this->_emptyGroup()); } - protected function _emptyGroup() { + public function _emptyGroup() { return array('label' => '', 'publications' => array($this->_emptyPublication())); } @@ -109,8 +109,8 @@ class wsDAOCollection extends commonDAO { $ids = array(); foreach ($collection->datas as $group) { foreach ($group['publications'] as $publication) { - if ($publication->id != '') { - $ids[] = $publication->id; + if ($publication['id'] != '') { + $ids[] = $publication['id']; } } } diff --git a/js/common.js b/js/common.js index 9fafe7fc2..b56a7c697 100644 --- a/js/common.js +++ b/js/common.js @@ -15,7 +15,11 @@ function load_common_extranet() { $('meta[name="viewport"]').attr('content', 'width=' + viewportWidth + 'px,initial-scale=' + is + ',maximum-scale:2.0'); if ($(".dashboard").length >= 1 && $("#dash").length >= 1) { - $("#dash").sortable('destroy'); + try { + $("#dash").sortable('destroy'); + } catch (err) { + + } if (FIRST_LOAD) { FIRST_LOAD = false; } else { diff --git a/js/extranet.js b/js/extranet.js index f460d6f00..f5beba03b 100644 --- a/js/extranet.js +++ b/js/extranet.js @@ -1,62 +1,69 @@ -TO_LOAD[TO_LOAD.length]='load_extranet();'; -FIRST_LOAD=true; -function load_extranet(){ - - if($("#devisAdresse #client_nom").length>0){ - $("#devisAdresse #client_nom").autocomplete(SITE_PATH+'autocomplete/client',{ - cacheLength : 0, - maxItemsToShow : 15, - onFindValue : findClient, - onItemSelect : findClient +TO_LOAD[TO_LOAD.length] = 'load_extranet();'; +FIRST_LOAD = true; +function load_extranet() { + + if ($("#devisAdresse #client_nom").length > 0) { + $("#devisAdresse #client_nom").autocomplete(SITE_PATH + 'autocomplete/client', { + cacheLength: 0, + maxItemsToShow: 15, + onFindValue: findClient, + onItemSelect: findClient }); } - if($("#factureAdresse #projet_nom").length>0){ - $("#factureAdresse #projet_nom").autocomplete(SITE_PATH+'autocomplete/projet',{ - cacheLength : 0, - maxItemsToShow : 15, - onFindValue : findProjet, - onItemSelect : findProjet + if ($("#factureAdresse #projet_nom").length > 0) { + $("#factureAdresse #projet_nom").autocomplete(SITE_PATH + 'autocomplete/projet', { + cacheLength: 0, + maxItemsToShow: 15, + onFindValue: findProjet, + onItemSelect: findProjet }); } - if($("#devisLignes").length>=1){ - $("#devisLignes").sortable('destroy'); + if ($("#devisLignes").length >= 1) { + try { + $("#devisLignes").sortable('destroy'); + } catch (err) { + } $("#devisLignes").sortable({ - opacity : 0.6, - axis : "y" + opacity: 0.6, + axis: "y" }); } } -function findClient(li){ - var client=li.selectValue.split(' - '); - if(client.length<=1){ +function findClient(li) { + var client = li.selectValue.split(' - '); + if (client.length <= 1) { return; } - var client_id=parseInt(client[0]); + var client_id = parseInt(client[0]); $("#client").val(client_id); $.ajax({ - url : SITE_PATH+'ajax/getAdresseForDevis/'+client_id, - success : function(data){MyAjax(data);} + url: SITE_PATH + 'ajax/getAdresseForDevis/' + client_id, + success: function(data) { + MyAjax(data); + } }); } -function findProjet(li){ - var projet=li.selectValue.split(' - '); - if(projet.length<=1){ +function findProjet(li) { + var projet = li.selectValue.split(' - '); + if (projet.length <= 1) { return; } - var projet_id=parseInt(projet[0]); + var projet_id = parseInt(projet[0]); $("#projet").val(projet_id); $.ajax({ - url : SITE_PATH+'ajax/getAdresseForFacture/'+projet_id, - success : function(data){MyAjax(data);} + url: SITE_PATH + 'ajax/getAdresseForFacture/' + projet_id, + success: function(data) { + MyAjax(data); + } }); } diff --git a/js/ws.js b/js/ws.js index e11bb4271..a1c76a2b9 100644 --- a/js/ws.js +++ b/js/ws.js @@ -3,11 +3,26 @@ TO_LOAD_ONCE[TO_LOAD_ONCE.length] = 'load_ws_once();'; FIRST_LOAD = true; function load_ws_once() { - $('form[action="exportbook"] select, form[action="exportbookExe"] select').live('change', function() { + $('form[action="exportbook"] select, form[action="exportbookExe"] select').on('change', function() { var form = $(this).parents('form'); $(form).find('#changed').val($(this).attr('name')); $(form).attr('action', 'exportbook').submit().attr('action', 'exportbookExe'); }); + + if ($("#collection").length > 0) { + $("#collection>ul").sortable({ + cancel: 'h3,input', + axis: 'y', + handle: '.move' + }); + + $("#collection>ul ul").sortable({ + cancel: 'h3,input', + axis: 'y', + handle: '.move', + connectWith: '#collection>ul ul' + }); + } } function load_ws() { diff --git a/style/ws/style.css b/style/ws/style.css index 9818fb181..b68df4486 100644 --- a/style/ws/style.css +++ b/style/ws/style.css @@ -537,7 +537,7 @@ th.stats_col{ font-family: UniversCondensedBold; text-decoration: none; text-transform: uppercase; - white-space: nowrap; + white-space: nowrap; -moz-box-shadow: 0px 0px 2px rgba(0,0,0,0.25); @@ -582,4 +582,76 @@ th.stats_col{ .liste .bouton a.btbook.edit>div{ background-image: url("../../images/ws/btedit.png"); +} + + + + +/* Page tree */ + +#collection{ + padding:5px; +} + +#collection h1{ + margin:5px 0 10px; + padding:0; +} + +#collection h3{margin:10px 0 10px 0 !important;} +#collection .group, +#collection .publication{ + padding:5px;border:1px solid #ccc;margin:2px 0;background-color:#eee; +} + +#collection .publication{ + background-color:#fff; +} + +#collection ul{ + list-style: none; +} + +#collection div{ + height:20px; +} + +#collection div span, +#collection div a{ + display:block; + height:16px; + float:left; +} + +#collection div .move, +#collection div .add, +#collection div .delete +{ + width:16px; +} + + +#collection div img{vertical-align:bottom;} +#collection div .move{margin-right:10px;background-image: url("/images/ws/tango16/actions/mail-send-receive.png")} +#collection div .add{float:right;margin-right:10px;background-image: url("/images/ws/tango16/actions/list-add.png")} +#collection div .online{float:right;margin-right:10px;} +#collection div .online .checkbox{ + background-image:url("/CubeIT/images/online-offline.png"); + background-repeat: no-repeat; + background-position: 0 100%; + width:16px; + height:16px; + cursor:pointer; +} +#collection div .online .checkbox[checked]{ + background-position: 0 0; +} + +#collection div .delete{float:right;margin-right:10px;background-image: url("/images/ws/tango16/actions/list-remove.png")} +#collection div .id{font-weight:bold;margin-right:10px;} +#collection div .name{margin-right:10px;} + +#collection input, +#collection select{ + width:auto; } \ No newline at end of file