diff --git a/config/zentaopms.php b/config/zentaopms.php index 6f0ba59987..34ee5b8713 100644 --- a/config/zentaopms.php +++ b/config/zentaopms.php @@ -407,4 +407,4 @@ $config->maxPriValue = '256'; $config->importWhiteList = array('user', 'task', 'story', 'bug', 'testcase', 'feedback', 'ticket'); $config->dtable = new stdclass(); -$config->dtable->colVars = array('width', 'type', 'flex', 'fixed'); +$config->dtable->colVars = array('width', 'type', 'flex', 'fixed', 'sortType', 'checkbox'); diff --git a/module/program/config.php b/module/program/config.php index 82617bc9a5..a1fc04c086 100644 --- a/module/program/config.php +++ b/module/program/config.php @@ -60,27 +60,32 @@ $config->program->dtable->fieldList['name']['title'] = $lang->nameAB; $config->program->dtable->fieldList['name']['type'] = 'html'; $config->program->dtable->fieldList['name']['flex'] = 1; -$config->program->dtable->fieldList['status']['name'] = 'status'; -$config->program->dtable->fieldList['status']['title'] = $lang->program->status; -$config->program->dtable->fieldList['status']['width'] = 65; -$config->program->dtable->fieldList['status']['type'] = 'html'; +$config->program->dtable->fieldList['status']['name'] = 'status'; +$config->program->dtable->fieldList['status']['title'] = $lang->program->status; +$config->program->dtable->fieldList['status']['width'] = 65; +$config->program->dtable->fieldList['status']['type'] = 'html'; +$config->program->dtable->fieldList['status']['sortType'] = 1; -$config->program->dtable->fieldList['pm']['name'] = 'pm'; -$config->program->dtable->fieldList['pm']['title'] = $lang->program->PM; -$config->program->dtable->fieldList['pm']['width'] = 100; -$config->program->dtable->fieldList['pm']['type'] = 'html'; +$config->program->dtable->fieldList['pm']['name'] = 'pm'; +$config->program->dtable->fieldList['pm']['title'] = $lang->program->PM; +$config->program->dtable->fieldList['pm']['width'] = 100; +$config->program->dtable->fieldList['pm']['type'] = 'html'; +$config->program->dtable->fieldList['pm']['sortType'] = 1; -$config->program->dtable->fieldList['budget']['name'] = 'budget'; -$config->program->dtable->fieldList['budget']['title'] = $lang->program->budget; -$config->program->dtable->fieldList['budget']['width'] = 100; +$config->program->dtable->fieldList['budget']['name'] = 'budget'; +$config->program->dtable->fieldList['budget']['title'] = $lang->program->budget; +$config->program->dtable->fieldList['budget']['width'] = 100; +$config->program->dtable->fieldList['budget']['sortType'] = 1; -$config->program->dtable->fieldList['begin']['name'] = 'begin'; -$config->program->dtable->fieldList['begin']['title'] = $lang->program->begin; -$config->program->dtable->fieldList['begin']['width'] = 100; +$config->program->dtable->fieldList['begin']['name'] = 'begin'; +$config->program->dtable->fieldList['begin']['title'] = $lang->program->begin; +$config->program->dtable->fieldList['begin']['width'] = 100; +$config->program->dtable->fieldList['begin']['sortType'] = 1; -$config->program->dtable->fieldList['end']['name'] = 'end'; -$config->program->dtable->fieldList['end']['title'] = $lang->program->end; -$config->program->dtable->fieldList['end']['width'] = 100; +$config->program->dtable->fieldList['end']['name'] = 'end'; +$config->program->dtable->fieldList['end']['title'] = $lang->program->end; +$config->program->dtable->fieldList['end']['width'] = 100; +$config->program->dtable->fieldList['end']['sortType'] = 1; $config->program->dtable->fieldList['progress']['name'] = 'progress'; $config->program->dtable->fieldList['progress']['title'] = $lang->program->progressAB; diff --git a/module/program/js/browse.js b/module/program/js/browse.js index 1e159d9da6..b8d9613c40 100644 --- a/module/program/js/browse.js +++ b/module/program/js/browse.js @@ -6,8 +6,15 @@ $(function() $.cookie('editProject', editProject, {expires:config.cookieLife, path:config.webRoot}); showEditCheckbox(editProject); }); + if($.cookie('editProject') == 1) $('input#editProject1').prop('checked', 'true'); - if($('input#editProject1').prop('checked')) showEditCheckbox(true); + if($('input#editProject1').prop('checked')) + { + setTimeout(function() + { + showEditCheckbox(true); + }, 100); + } $(document).on('click', ":checkbox[name^='projectIdList']", function() { @@ -79,23 +86,23 @@ function showEditCheckbox(show) { $('.icon-project,.icon-waterfall,.icon-scrum,.icon-kanban').each(function() { - var $this = $(this); - var $tr = $(this).closest('dtable-row'); - var projectID = $tr.attr('data-id'); - var $firstDiv = $tr.find('.dtable-flexable div:first'); + var $this = $(this); + var $row = $(this).closest('.dtable-row'); + var projectID = $row.attr('data-id'); + var $firstCell = $row.find('.dtable-flexable .dtable-cell-content').first().find('.dtable-cell-html'); if(show) { - var marginLeft = $firstDiv.find('span.table-nest-icon').css('margin-left'); + var marginLeft = $firstCell.find('span.table-nest-icon').css('margin-left'); - $firstDiv.prepend("
"); - $firstDiv.find('.checkbox-primary').css('margin-left', marginLeft).css('width', '14'); - $firstDiv.find('span.table-nest-icon').css('margin-left', '0'); + $firstCell.prepend(""); + $firstCell.find('.checkbox-primary').css('margin-left', marginLeft).css('width', '14'); + $firstCell.find('span.table-nest-icon').css('margin-left', '0'); } else { - var marginLeft = $firstDiv.find('.checkbox-primary').css('margin-left'); - $firstDiv.find('span.table-nest-icon').css('margin-left', marginLeft); - $firstDiv.find('[name^="projectIdList"]').parent().remove(); + var marginLeft = $firstCell.find('.checkbox-primary').css('margin-left'); + $firstCell.find('span.table-nest-icon').css('margin-left', marginLeft); + $firstCell.find('[name^="projectIdList"]').parent().remove(); } }); diff --git a/module/program/ui/browse.html.php b/module/program/ui/browse.html.php index c269cfde6c..6e40494d5a 100644 --- a/module/program/ui/browse.html.php +++ b/module/program/ui/browse.html.php @@ -45,6 +45,7 @@ foreach($programs as $program) $row->$fieldName = $this->program->buildCell($field, $program, $users, $usersAvatar, $userIdPairs, $PMList, $progressList); } + $row->id = $program->id; $row->parent = $program->parent; $rows[] = $row; } diff --git a/zin/wg/dtable/v1.php b/zin/wg/dtable/v1.php index c9a9bd215e..557f0ab253 100644 --- a/zin/wg/dtable/v1.php +++ b/zin/wg/dtable/v1.php @@ -38,6 +38,24 @@ class column return $this; } + /** + * Set sortType. + * + * @param string|bool $type up|down|true|false + * @access public + * @return void + */ + public function sortType($type) + { + $this->sortType = $type; + return $this; + } + + public function checkbox() + { + $this->checkbox = 1; + return $this; + } } class dtable @@ -153,7 +171,7 @@ class dtable if(!empty($this->footer)) $html .= $this->footer; if(!empty($this->form)) $html .= ''; - $html .= ''; + $html .= ''; return $html; }