diff --git a/module/bug/model.php b/module/bug/model.php index 8cfa5e97a6..c1f181ec42 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -633,6 +633,7 @@ class bugModel extends model ->join('openedBuild', ',') ->join('mailto', ',') ->join('linkBug', ',') + ->setIF(count($this->post->mailto) == 1 and !$this->post->mailto[0], 'mailto', '') ->setIF($this->post->assignedTo != $oldBug->assignedTo, 'assignedDate', $now) ->setIF($this->post->resolvedBy != '' and $this->post->resolvedDate == '', 'resolvedDate', $now) ->setIF($this->post->resolution != '' and $this->post->resolvedDate == '', 'resolvedDate', $now) diff --git a/module/doc/model.php b/module/doc/model.php index dc172cd17f..9e264b3401 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -2275,7 +2275,7 @@ EOT; if($startModule) $startModulePath = $startModule->path . '%'; } - $docs = $this->dao->select('*')->from(TABLE_DOC) + $docs = $this->dao->select('*')->from(TABLE_DOC) ->where('lib')->eq($rootID) ->andWhere('deleted')->eq(0) ->fetchAll(); @@ -2363,7 +2363,7 @@ EOT; else { if(!$docID and $currentMethod != 'tablecontents') $docID = $doc->id; - $treeMenu[$module->id] .= 'id == $docID ? ' class="active"' : ' class="doc"') . '>'; + $treeMenu[$module->id] .= 'id == $docID ? ' class="active"' : ' class="doc"') . " data-id=$doc->id>"; if($currentMethod == 'tablecontents') { @@ -2399,7 +2399,7 @@ EOT; } else { - $li = "
" . $module->name . ''; + $li = "
" . $module->name . ''; $li .= "
"; $li .= html::a(helper::createLink('tree', 'edit', "module=$module->id&type=doc"), "", '', "data-toggle='modal' title={$this->lang->doc->editType}"); $li .= html::a(helper::createLink('tree', 'browse', "rootID=$libID&type=doc&module=$module->id", '', 1), "", '', "class='iframe' title={$this->lang->doc->editType}"); @@ -2433,7 +2433,7 @@ EOT; } } - $treeMenu[$module->parent] .= '
  • ' . $li . '
  • '; + $treeMenu[$module->parent] .= '
  • ' . $li . '
  • '; } /** diff --git a/module/doc/view/side.html.php b/module/doc/view/side.html.php index 7fb9591fa0..c89419bff8 100644 --- a/module/doc/view/side.html.php +++ b/module/doc/view/side.html.php @@ -79,7 +79,7 @@ $sideWidth = common::checkNotCN() ? '270' : '238'; /* Make modules tree sortable */ $('#modules').sortable( { - trigger: '.module-name>a', + trigger: '.module-name>a.sort-module', dropToClass: 'sort-to', stopPropagation: true, nested: true, @@ -97,7 +97,19 @@ $sideWidth = common::checkNotCN() ? '270' : '238'; { if(!e.changed) return; - /* TODO(@sunguangming): console.log('sort.finish', e); */ + var orders = {}; + $('#modules').find('li.has-list').each(function() + { + var $li = $(this); + + var item = $li.data(); + orders['orders[' + item.id + ']'] = $li.attr('data-order') || item.order; + }); + + $.post('createLink('tree', 'updateOrder');?>', orders, function(data){}).error(function() + { + bootbox.alert(lang.timeout); + }); } }); }); diff --git a/module/project/css/kanban.css b/module/project/css/kanban.css index 555f60c248..bc7972ce01 100644 --- a/module/project/css/kanban.css +++ b/module/project/css/kanban.css @@ -20,3 +20,4 @@ table th, td {border: 2px solid #fff !important;} #kanban {padding-bottom: 10px} +.kanban-col[data-type='closedProject'] .count {display: none}