' data-key='' data-fixed='' data-width=''>
diff --git a/module/execution/config.php b/module/execution/config.php
index 51e1f94d58..539a500680 100644
--- a/module/execution/config.php
+++ b/module/execution/config.php
@@ -184,94 +184,105 @@ else
$config->execution->datatable->defaultField = array('id', 'name', 'project', 'PM', 'status', 'progress', 'begin', 'end', 'estimate', 'consumed', 'left', 'burn');
}
-
$config->execution->datatable->fieldList['id']['title'] = 'idAB';
$config->execution->datatable->fieldList['id']['fixed'] = 'left';
$config->execution->datatable->fieldList['id']['width'] = '70';
$config->execution->datatable->fieldList['id']['required'] = 'yes';
+$config->execution->datatable->fieldList['id']['sortType'] = true;
+$config->execution->datatable->fieldList['id']['checkbox'] = true;
-$config->execution->datatable->fieldList['name']['title'] = 'execName';
-$config->execution->datatable->fieldList['name']['fixed'] = 'left';
-$config->execution->datatable->fieldList['name']['width'] = 'auto';
-$config->execution->datatable->fieldList['name']['required'] = 'yes';
-
-
-$config->execution->datatable->fieldList['project']['title'] = 'project';
-$config->execution->datatable->fieldList['project']['fixed'] = 'no';
-$config->execution->datatable->fieldList['project']['width'] = '128';
-$config->execution->datatable->fieldList['project']['required'] = 'no';
+$config->execution->datatable->fieldList['name']['name'] = 'name';
+$config->execution->datatable->fieldList['name']['title'] = $lang->execution->name;
+$config->execution->datatable->fieldList['name']['width'] = '356';
+$config->execution->datatable->fieldList['name']['type'] = 'html';
+$config->execution->datatable->fieldList['name']['fixed'] = 'left';
+$config->execution->datatable->fieldList['name']['nestedToggle'] = true;
+$config->execution->datatable->fieldList['name']['iconRender'] = true;
+$config->execution->datatable->fieldList['name']['required'] = 'yes';
if(!isset($config->setCode) or $config->setCode == 1)
{
$config->execution->datatable->fieldList['code']['title'] = 'execCode';
- $config->execution->datatable->fieldList['code']['fixed'] = 'no';
- $config->execution->datatable->fieldList['code']['width'] = '95';
+ $config->execution->datatable->fieldList['code']['width'] = '140';
+ $config->execution->datatable->fieldList['code']['fixed'] = 'left';
$config->execution->datatable->fieldList['code']['required'] = 'no';
}
+$config->execution->datatable->fieldList['project']['title'] = 'project';
+$config->execution->datatable->fieldList['project']['width'] = '200';
+$config->execution->datatable->fieldList['project']['flex'] = 1;
+$config->execution->datatable->fieldList['project']['fixed'] = 'no';
+$config->execution->datatable->fieldList['project']['required'] = 'no';
+
$config->execution->datatable->fieldList['status']['title'] = 'execStatus';
-$config->execution->datatable->fieldList['status']['fixed'] = 'no';
+$config->execution->datatable->fieldList['status']['type'] = 'status';
+$config->execution->datatable->fieldList['status']['sortType'] = 'true';
$config->execution->datatable->fieldList['status']['width'] = '100';
$config->execution->datatable->fieldList['status']['required'] = 'no';
+$config->execution->datatable->fieldList['status']['fixed'] = 'no';
$config->execution->datatable->fieldList['PM']['title'] = 'owner';
-$config->execution->datatable->fieldList['PM']['fixed'] = 'no';
$config->execution->datatable->fieldList['PM']['width'] = '70';
$config->execution->datatable->fieldList['PM']['required'] = 'no';
+$config->execution->datatable->fieldList['PM']['fixed'] = 'no';
$config->execution->datatable->fieldList['openedDate']['title'] = 'openedDate';
-$config->execution->datatable->fieldList['openedDate']['fixed'] = 'no';
$config->execution->datatable->fieldList['openedDate']['width'] = '85';
+$config->execution->datatable->fieldList['openedDate']['sortType'] = 'true';
$config->execution->datatable->fieldList['openedDate']['required'] = 'no';
+$config->execution->datatable->fieldList['openedDate']['fixed'] = 'no';
$config->execution->datatable->fieldList['begin']['title'] = 'begin';
-$config->execution->datatable->fieldList['begin']['fixed'] = 'no';
$config->execution->datatable->fieldList['begin']['width'] = '100';
+$config->execution->datatable->fieldList['begin']['sortType'] = 'true';
$config->execution->datatable->fieldList['begin']['required'] = 'no';
+$config->execution->datatable->fieldList['begin']['fixed'] = 'no';
$config->execution->datatable->fieldList['end']['title'] = 'end';
-$config->execution->datatable->fieldList['end']['fixed'] = 'no';
$config->execution->datatable->fieldList['end']['width'] = '90';
$config->execution->datatable->fieldList['end']['required'] = 'no';
+$config->execution->datatable->fieldList['end']['sortType'] = 'true';
+$config->execution->datatable->fieldList['end']['fixed'] = 'no';
$config->execution->datatable->fieldList['realBegan']['title'] = 'realBegan';
-$config->execution->datatable->fieldList['realBegan']['fixed'] = 'no';
-$config->execution->datatable->fieldList['realBegan']['width'] = '90';
+$config->execution->datatable->fieldList['realBegan']['width'] = '100';
$config->execution->datatable->fieldList['realBegan']['required'] = 'no';
-$config->execution->datatable->fieldList['realBegan']['sort'] = 'no';
+$config->execution->datatable->fieldList['realBegan']['sortType'] = 'true';
+$config->execution->datatable->fieldList['realBegan']['fixed'] = 'no';
$config->execution->datatable->fieldList['realEnd']['title'] = 'realEnd';
-$config->execution->datatable->fieldList['realEnd']['fixed'] = 'no';
-$config->execution->datatable->fieldList['realEnd']['width'] = '90';
+$config->execution->datatable->fieldList['realEnd']['width'] = '100';
$config->execution->datatable->fieldList['realEnd']['required'] = 'no';
-$config->execution->datatable->fieldList['realEnd']['sort'] = 'no';
+$config->execution->datatable->fieldList['realEnd']['sortType'] = 'true';
+$config->execution->datatable->fieldList['realEnd']['fixed'] = 'no';
$config->execution->datatable->fieldList['estimate']['title'] = 'estimate';
-$config->execution->datatable->fieldList['estimate']['fixed'] = 'no';
$config->execution->datatable->fieldList['estimate']['width'] = '70';
$config->execution->datatable->fieldList['estimate']['required'] = 'no';
$config->execution->datatable->fieldList['estimate']['sort'] = 'no';
+$config->execution->datatable->fieldList['estimate']['fixed'] = 'no';
$config->execution->datatable->fieldList['consumed']['title'] = 'consumed';
-$config->execution->datatable->fieldList['consumed']['fixed'] = 'no';
$config->execution->datatable->fieldList['consumed']['width'] = '75';
$config->execution->datatable->fieldList['consumed']['required'] = 'no';
$config->execution->datatable->fieldList['consumed']['sort'] = 'no';
+$config->execution->datatable->fieldList['consumed']['fixed'] = 'no';
$config->execution->datatable->fieldList['left']['title'] = 'left';
-$config->execution->datatable->fieldList['left']['fixed'] = 'no';
$config->execution->datatable->fieldList['left']['width'] = '70';
$config->execution->datatable->fieldList['left']['required'] = 'no';
$config->execution->datatable->fieldList['left']['sort'] = 'no';
+$config->execution->datatable->fieldList['left']['fixed'] = 'no';
$config->execution->datatable->fieldList['progress']['title'] = 'progress';
-$config->execution->datatable->fieldList['progress']['fixed'] = 'no';
+$config->execution->datatable->fieldList['progress']['type'] = 'circleProgress';
$config->execution->datatable->fieldList['progress']['width'] = '70';
$config->execution->datatable->fieldList['progress']['required'] = 'no';
$config->execution->datatable->fieldList['progress']['sort'] = 'no';
+$config->execution->datatable->fieldList['progress']['fixed'] = 'no';
$config->execution->datatable->fieldList['burn']['title'] = 'burn';
-$config->execution->datatable->fieldList['burn']['fixed'] = 'no';
$config->execution->datatable->fieldList['burn']['width'] = '80';
$config->execution->datatable->fieldList['burn']['required'] = 'no';
$config->execution->datatable->fieldList['burn']['sort'] = 'no';
+$config->execution->datatable->fieldList['burn']['fixed'] = 'no';
diff --git a/module/execution/control.php b/module/execution/control.php
index fa2a631688..6d700cdccf 100644
--- a/module/execution/control.php
+++ b/module/execution/control.php
@@ -2212,16 +2212,15 @@ class execution extends control
$rdUsers = $this->user->getPairs('noclosed|nodeleted|devfirst', $appendRdUsers, $this->config->maxCount);
if(!empty($this->config->user->moreLink)) $this->config->moreLinks["RD"] = $this->config->user->moreLink;
- $this->view->title = $this->lang->execution->batchEdit;
- $this->view->position[] = $this->lang->execution->batchEdit;
- $this->view->executionIDList = $executionIDList;
- $this->view->executions = $executions;
- $this->view->allProjects = $allProjects;
- $this->view->pmUsers = $pmUsers;
- $this->view->poUsers = $poUsers;
- $this->view->qdUsers = $qdUsers;
- $this->view->rdUsers = $rdUsers;
- $this->view->from = $this->app->tab;
+ $this->view->title = $this->lang->execution->batchEdit;
+ $this->view->position[] = $this->lang->execution->batchEdit;
+ $this->view->executions = $executions;
+ $this->view->allProjects = $allProjects;
+ $this->view->pmUsers = $pmUsers;
+ $this->view->poUsers = $poUsers;
+ $this->view->qdUsers = $qdUsers;
+ $this->view->rdUsers = $rdUsers;
+ $this->view->from = $this->app->tab;
$this->display();
}
diff --git a/module/execution/css/all.css b/module/execution/css/all.css
index a9bb635b20..e32de269f5 100644
--- a/module/execution/css/all.css
+++ b/module/execution/css/all.css
@@ -44,3 +44,7 @@ canvas {height: 28px;}
.table thead .c-left.text-right {padding-right: 8px;}
#executionsForm td.c-name {padding-right: 5px;}
#executionsForm td.c-name.delay {padding-right: 55px;}
+#myTable .dtable-header, #executionsForm .dtable-rows {z-index: 4;}
+#executionsForm .table-header .btn-toolbar {background: rgb(241, 245, 249); right: -3px;}
+
+.table-footer .pager{z-index: 10}
diff --git a/module/execution/js/all.js b/module/execution/js/all.js
index c2b21b9a93..959742346f 100644
--- a/module/execution/js/all.js
+++ b/module/execution/js/all.js
@@ -1,121 +1,21 @@
$(function()
{
$("#" + status + "Tab").addClass('btn-active-text');
- $(document).on('click', '.plan-toggle', function(e)
+ $('.table-footer .check-all').on('click', function()
{
- var id = $(this).data('id');
- var $toggle = $(this);
- var isCollapsed = $toggle.toggleClass('collapsed').hasClass('collapsed');
- $toggle.closest('#executionsForm').find('tr.parent-' + id).toggle(!isCollapsed);
-
- e.stopPropagation();
- e.preventDefault();
- });
-
- if($('#executionList thead th.c-name').width() < 260) $('#executionList thead th.c-name').width(260);
-
- $('#executionTableList').on('sort.sortable', function(e, data)
- {
- var list = '';
- for(i = 0; i < data.list.length; i++) list += $(data.list[i].item).attr('data-id') + ',';
- $.post(createLink('execution', 'updateOrder'), {'executions' : list, 'orderBy' : orderBy});
- });
-
- var nameWidth = $('#executionsForm thead th.c-name').width();
- if(isCNLang && nameWidth < 150 && !useDatatable) $('#executionsForm thead th.c-name').css('width', '150px');
- if(!isCNLang && nameWidth < 200 && !useDatatable) $('#executionsForm thead th.c-name').css('width', '200px');
-
- toggleFold('#executionsForm', unfoldExecutions, 0, 'execution');
-
- $('.table td.has-child > .plan-toggle').each(function()
- {
- var fold = $(this).hasClass('collapsed');
- var parentID = $(this).closest('tr').attr('data-id');
- if(fold)
+ if($(this).hasClass('checked'))
{
- $('.parent-' + parentID).hide();
- $(this).closest('td').removeClass('parent');
+ $(this).removeClass('checked');
+ $('.dtable-row').click().removeClass('is-checked');
+ $('.has-checkbox input[type="checkbox"]').prop('checked', false);
}
else
{
- $('.parent-' + parentID).show();
- $(this).closest('td').addClass('parent');
- }
- });
-
- /* Expand and fold substages. */
- $('.table td.has-child > .plan-toggle').click(function()
- {
- var parentID = $(this).closest('tr').attr('data-id');
- $('.parent-' + parentID).toggle();
-
- if($('.parent-' + parentID).css('display') == 'none')
- {
- $(this).closest('td').removeClass('parent');
- }
- else
- {
- $(this).closest('td').addClass('parent');
- }
- });
-
- $(document).on('click', "#toggleFold", function()
- {
- var fold = $(this).hasClass('collapsed');
- if(fold)
- {
- $('.has-child.c-name.flex').removeClass('parent');
- $('.table td.has-child > .plan-toggle').addClass('collapsed');
- }
- else
- {
- $('.has-child.c-name.flex').addClass('parent');
- $('.table td.has-child > .plan-toggle').removeClass('collapsed');
- }
- });
-
- /* Update table summary text. */
- $('#executionsForm').table(
- {
- statisticCreator: function(table)
- {
- var $table = table.getTable();
- var $checkedRows = $table.find(table.isDataTable ? '.datatable-row-left.checked' : 'tbody>tr.checked');
- var $originTable = table.isDataTable ? table.$.find('.datatable-origin') : null;
- var checkedTotal = $checkedRows.length;
- var $rows = checkedTotal ? $checkedRows : $table.find(table.isDataTable ? '.datatable-rows .datatable-row-left' : 'tbody>tr');
-
- var checkedWait = 0;
- var checkedDoing = 0;
- var executionIDList = [];
- $rows.each(function()
- {
- var $row = $(this);
- if($originTable) $row = $originTable.find('tbody>tr[data-id="' + $row.data('id') + '"]');
-
- var data = $row.data();
- executionIDList.push(data.id);
-
- if(data.status === 'wait') checkedWait++;
- if(data.status === 'doing') checkedDoing++;
- });
-
- if(status != 'all') return (checkedTotal ? checkedExecutions : executionSummary).replace('%s', $rows.length);
- return (checkedTotal ? checkedSummary : pageSummary).replace('%total%', $rows.length).replace('%wait%', checkedWait).replace('%doing%', checkedDoing);
+ $(this).addClass('checked');
+ $('.dtable-row').click().addClass('is-checked');
+ $('.has-checkbox input[type="checkbox"]').prop('checked', true);
}
})
-
- $('input[name^="showEdit"]').click(function()
- {
- $.cookie('showExecutionBatchEdit', $(this).is(':checked') ? 1 : 0, {expires: config.cookieLife, path: config.webRoot});
- setCheckbox();
- });
- setCheckbox();
-
- $('#executionTableList tr').on('click', function(e)
- {
- if($.cookie('showExecutionBatchEdit') != 1) e.stopPropagation();
- });
});
/**
@@ -131,18 +31,3 @@ function byProduct(productID, projectID, status)
{
location.href = createLink('project', 'all', "status=" + status + "&project=" + projectID + "&orderBy=" + orderBy + '&productID=' + productID);
}
-
-/**
- * Set batch edit checkbox.
- *
- * @access public
- * @return void
- */
-function setCheckbox()
-{
- $('#executionsForm .checkbox-primary').hide();
- $('.check-all, .sortable tr').removeClass('checked');
- $(":checkbox[name^='executionIDList']").prop('checked', false);
- $('#executionsForm').removeClass('has-row-checked');
- if($.cookie('showExecutionBatchEdit') == 1) $('#executionsForm .checkbox-primary').show();
-}
diff --git a/module/execution/js/all.js.bak b/module/execution/js/all.js.bak
new file mode 100644
index 0000000000..c2b21b9a93
--- /dev/null
+++ b/module/execution/js/all.js.bak
@@ -0,0 +1,148 @@
+$(function()
+{
+ $("#" + status + "Tab").addClass('btn-active-text');
+ $(document).on('click', '.plan-toggle', function(e)
+ {
+ var id = $(this).data('id');
+ var $toggle = $(this);
+ var isCollapsed = $toggle.toggleClass('collapsed').hasClass('collapsed');
+ $toggle.closest('#executionsForm').find('tr.parent-' + id).toggle(!isCollapsed);
+
+ e.stopPropagation();
+ e.preventDefault();
+ });
+
+ if($('#executionList thead th.c-name').width() < 260) $('#executionList thead th.c-name').width(260);
+
+ $('#executionTableList').on('sort.sortable', function(e, data)
+ {
+ var list = '';
+ for(i = 0; i < data.list.length; i++) list += $(data.list[i].item).attr('data-id') + ',';
+ $.post(createLink('execution', 'updateOrder'), {'executions' : list, 'orderBy' : orderBy});
+ });
+
+ var nameWidth = $('#executionsForm thead th.c-name').width();
+ if(isCNLang && nameWidth < 150 && !useDatatable) $('#executionsForm thead th.c-name').css('width', '150px');
+ if(!isCNLang && nameWidth < 200 && !useDatatable) $('#executionsForm thead th.c-name').css('width', '200px');
+
+ toggleFold('#executionsForm', unfoldExecutions, 0, 'execution');
+
+ $('.table td.has-child > .plan-toggle').each(function()
+ {
+ var fold = $(this).hasClass('collapsed');
+ var parentID = $(this).closest('tr').attr('data-id');
+ if(fold)
+ {
+ $('.parent-' + parentID).hide();
+ $(this).closest('td').removeClass('parent');
+ }
+ else
+ {
+ $('.parent-' + parentID).show();
+ $(this).closest('td').addClass('parent');
+ }
+ });
+
+ /* Expand and fold substages. */
+ $('.table td.has-child > .plan-toggle').click(function()
+ {
+ var parentID = $(this).closest('tr').attr('data-id');
+ $('.parent-' + parentID).toggle();
+
+ if($('.parent-' + parentID).css('display') == 'none')
+ {
+ $(this).closest('td').removeClass('parent');
+ }
+ else
+ {
+ $(this).closest('td').addClass('parent');
+ }
+ });
+
+ $(document).on('click', "#toggleFold", function()
+ {
+ var fold = $(this).hasClass('collapsed');
+ if(fold)
+ {
+ $('.has-child.c-name.flex').removeClass('parent');
+ $('.table td.has-child > .plan-toggle').addClass('collapsed');
+ }
+ else
+ {
+ $('.has-child.c-name.flex').addClass('parent');
+ $('.table td.has-child > .plan-toggle').removeClass('collapsed');
+ }
+ });
+
+ /* Update table summary text. */
+ $('#executionsForm').table(
+ {
+ statisticCreator: function(table)
+ {
+ var $table = table.getTable();
+ var $checkedRows = $table.find(table.isDataTable ? '.datatable-row-left.checked' : 'tbody>tr.checked');
+ var $originTable = table.isDataTable ? table.$.find('.datatable-origin') : null;
+ var checkedTotal = $checkedRows.length;
+ var $rows = checkedTotal ? $checkedRows : $table.find(table.isDataTable ? '.datatable-rows .datatable-row-left' : 'tbody>tr');
+
+ var checkedWait = 0;
+ var checkedDoing = 0;
+ var executionIDList = [];
+ $rows.each(function()
+ {
+ var $row = $(this);
+ if($originTable) $row = $originTable.find('tbody>tr[data-id="' + $row.data('id') + '"]');
+
+ var data = $row.data();
+ executionIDList.push(data.id);
+
+ if(data.status === 'wait') checkedWait++;
+ if(data.status === 'doing') checkedDoing++;
+ });
+
+ if(status != 'all') return (checkedTotal ? checkedExecutions : executionSummary).replace('%s', $rows.length);
+ return (checkedTotal ? checkedSummary : pageSummary).replace('%total%', $rows.length).replace('%wait%', checkedWait).replace('%doing%', checkedDoing);
+ }
+ })
+
+ $('input[name^="showEdit"]').click(function()
+ {
+ $.cookie('showExecutionBatchEdit', $(this).is(':checked') ? 1 : 0, {expires: config.cookieLife, path: config.webRoot});
+ setCheckbox();
+ });
+ setCheckbox();
+
+ $('#executionTableList tr').on('click', function(e)
+ {
+ if($.cookie('showExecutionBatchEdit') != 1) e.stopPropagation();
+ });
+});
+
+/**
+ * Location to product list.
+ *
+ * @param int productID
+ * @param int projectID
+ * @param string status
+ * @access public
+ * @return void
+ */
+function byProduct(productID, projectID, status)
+{
+ location.href = createLink('project', 'all', "status=" + status + "&project=" + projectID + "&orderBy=" + orderBy + '&productID=' + productID);
+}
+
+/**
+ * Set batch edit checkbox.
+ *
+ * @access public
+ * @return void
+ */
+function setCheckbox()
+{
+ $('#executionsForm .checkbox-primary').hide();
+ $('.check-all, .sortable tr').removeClass('checked');
+ $(":checkbox[name^='executionIDList']").prop('checked', false);
+ $('#executionsForm').removeClass('has-row-checked');
+ if($.cookie('showExecutionBatchEdit') == 1) $('#executionsForm .checkbox-primary').show();
+}
diff --git a/module/execution/model.php b/module/execution/model.php
index 2135e8d631..2f506ae56d 100755
--- a/module/execution/model.php
+++ b/module/execution/model.php
@@ -5217,6 +5217,129 @@ class executionModel extends model
}
}
+ /**
+ * Generate col for dtable.
+ *
+ * @access public
+ * @return void
+ */
+ public function generateCol()
+ {
+ $this->loadModel('datatable');
+
+ $setting = $this->datatable->getSetting('execution');
+
+ $fieldList = $this->config->execution->datatable->fieldList;
+
+ foreach($fieldList as $field => $items)
+ {
+ $title = zget($this->lang->execution, $items['title'], zget($this->lang, $items['title'], $items['title']));
+ $fieldList[$field]['title'] = $title;
+ }
+
+ if(empty($setting))
+ {
+ $setting = $this->config->execution->datatable->defaultField;
+ $order = 1;
+ foreach($setting as $key => $value)
+ {
+ $id = $value;
+ $set = new stdclass();;
+ $set->order = $order++;
+ $set->show = true;
+ $set->name = $value;
+ $set->title = $fieldList[$id]['title'];
+
+ if(isset($fieldList[$id]['checkbox'])) $set->checkbox = $fieldList[$id]['checkbox'];
+ if(isset($fieldList[$id]['nestedToggle'])) $set->nestedToggle = $fieldList[$id]['nestedToggle'];
+ if(isset($fieldList[$id]['fixed'])) $set->fixed = $fieldList[$id]['fixed'];
+ if(isset($fieldList[$id]['width'])) $set->width = $fieldList[$id]['width'];
+ if(isset($fieldList[$id]['type'])) $set->type = $fieldList[$id]['type'];
+ if(isset($fieldList[$id]['sortType'])) $set->sortType = $fieldList[$id]['sortType'];
+ if(isset($fieldList[$id]['flex'])) $set->flex = $fieldList[$id]['flex'];
+ if(isset($fieldList[$id]['minWidth'])) $set->minWidth = $fieldList[$id]['minWidth'];
+ if(isset($fieldList[$id]['maxWidth'])) $set->maxWidth = $fieldList[$id]['maxWidth'];
+ if(isset($fieldList[$id]['pri'])) $set->pri = $fieldList[$id]['pri'];
+
+ $setting[$key] = $set;
+ }
+ }
+ else
+ {
+ foreach($setting as $key => $set)
+ {
+ if(empty($set->show))
+ {
+ unset($setting[$key]);
+ continue;
+ }
+
+ $set->name = $set->id;
+ $set->title = $fieldList[$set->id]['title'];
+
+ if(isset($fieldList[$set->id]['checkbox'])) $set->checkbox = $fieldList[$set->id]['checkbox'];
+ if(isset($fieldList[$set->id]['nestedToggle'])) $set->nestedToggle = $fieldList[$set->id]['nestedToggle'];
+ if(isset($fieldList[$set->id]['fixed'])) $set->fixed = $fieldList[$set->id]['fixed'];
+ if(isset($fieldList[$set->id]['type'])) $set->type = $fieldList[$set->id]['type'];
+ if(isset($fieldList[$set->id]['sortType'])) $set->sortType = $fieldList[$set->id]['sortType'];
+ if(isset($fieldList[$set->id]['flex'])) $set->flex = $fieldList[$set->id]['flex'];
+ if(isset($fieldList[$set->id]['minWidth'])) $set->minWidth = $fieldList[$set->id]['minWidth'];
+ if(isset($fieldList[$set->id]['maxWidth'])) $set->maxWidth = $fieldList[$set->id]['maxWidth'];
+ if(isset($fieldList[$set->id]['pri'])) $set->pri = $fieldList[$set->id]['pri'];
+
+ $set->width = str_replace('px', '', $set->width);
+
+ unset($set->id);
+
+ }
+ }
+
+ usort($setting, array('datatableModel', 'sortCols'));
+
+ return $setting;
+ }
+
+ /**
+ * Generate row for dtable.
+ *
+ * @param array $executions
+ * @param array $users
+ * @param int $productID
+ * @access public
+ * @return void
+ */
+ public function generateRow($executions, $users, $productID)
+ {
+ $rows = array();
+ foreach($executions as $id => $execution)
+ {
+ $label = $execution->type == 'stage' ? 'label-warning' : 'label-info';
+ $link = $execution->type == 'kanban' ? helper::createLink('execution', 'kanban', "id=$execution->id") : helper::createLink('execution', 'task', "id=$execution->id");
+ $execution->name = "
{$this->lang->execution->typeList[$execution->type]} " . html::a($link, $execution->name);
+ $execution->project = $execution->projectName;
+ $execution->parent = ($execution->parent and $execution->grade > 1) ? $execution->parent : '';
+ $execution->asParent = !empty($execution->children);
+ $execution->status = zget($this->lang->execution->statusList, $execution->status);
+ $execution->PM = zget($users, $execution->PM);
+ $execution->progress = $execution->hours->progress;
+ $execution->estimate = $execution->hours->totalEstimate;
+ $execution->consumed = $execution->hours->totalConsumed;
+ $execution->left = $execution->hours->totalLeft;
+
+ $children = isset($execution->children) ? $execution->children : array();
+ unset($execution->children);
+
+ $rows[] = $execution;
+
+ if(!empty($children))
+ {
+ $rows = array_merge($rows, $this->generateRow($children, $users, $productID));
+ }
+ }
+
+ return $rows;
+ }
+
/*
* Build search form
*
diff --git a/module/execution/view/all.html.php b/module/execution/view/all.html.php
index 880d885b4e..251458e3a2 100644
--- a/module/execution/view/all.html.php
+++ b/module/execution/view/all.html.php
@@ -1,38 +1,25 @@
-
- * @package execution
- * @version $Id: index.html.php 5094 2013-07-10 08:46:15Z chencongzhi520@gmail.com $
- */
-?>
-
moduleName . ucfirst($this->methodName);
-$useDatatable = (isset($config->datatable->$datatableId->mode) and $config->datatable->$datatableId->mode == 'datatable');
-?>
-execution->generateCol();
+$executions = $this->execution->generateRow($executionStats, $users, $productID);
+
+$sortLink = $this->createLink('execution', 'all', "status=$status&orderBy={orderBy}&productID=$productID¶m=$param&recTotal=$pager->recTotal&recPerPage=$pager->recPerPage&pageID=$pager->pageID");
+
+js::set('sortLink', $sortLink);
+js::set('cols', json_encode($cols));
+js::set('data', json_encode($executions));
+
+js::set('orderBy', $orderBy);
+js::set('status', $status);
js::set('from', $from);
-/* Replace Iteration to Execution. */
-js::set('checkedSummary', str_replace($lang->executionCommon, $lang->execution->common, $lang->execution->checkedExecSummary));
-js::set('pageSummary', str_replace($lang->executionCommon, $lang->execution->common, $lang->execution->pageExecSummary));
-js::set('executionSummary', str_replace($lang->executionCommon, $lang->execution->common, $lang->execution->executionSummary));
-js::set('checkedExecutions', str_replace($lang->executionCommon, $lang->execution->common, $lang->execution->checkedExecutions));
-?>
-execution->treeLevel['all']);
-js::set('foldAll', $lang->execution->treeLevel['root']);
-js::set('isCNLang', !$this->loadModel('common')->checkNotCN())
+js::set('isCNLang', !$this->loadModel('common')->checkNotCN());
?>
+
@@ -68,6 +54,7 @@ js::set('isCNLang', !$this->loadModel('common')->checkNotCN())
createLink('execution', 'create'), " " . ($from == 'execution' ? $lang->execution->createExec : $lang->execution->create), '', "class='btn btn-primary create-execution-btn' data-app='execution' onclick='$(this).removeAttr(\"data-toggle\")'");?>
+
@@ -82,70 +69,81 @@ js::set('isCNLang', !$this->loadModel('common')->checkNotCN())
-
+
-
-
diff --git a/module/execution/view/all.html.php.bak b/module/execution/view/all.html.php.bak
new file mode 100644
index 0000000000..880d885b4e
--- /dev/null
+++ b/module/execution/view/all.html.php.bak
@@ -0,0 +1,151 @@
+
+ * @package execution
+ * @version $Id: index.html.php 5094 2013-07-10 08:46:15Z chencongzhi520@gmail.com $
+ */
+?>
+
+
+
+moduleName . ucfirst($this->methodName);
+$useDatatable = (isset($config->datatable->$datatableId->mode) and $config->datatable->$datatableId->mode == 'datatable');
+?>
+executionCommon, $lang->execution->common, $lang->execution->checkedExecSummary));
+js::set('pageSummary', str_replace($lang->executionCommon, $lang->execution->common, $lang->execution->pageExecSummary));
+js::set('executionSummary', str_replace($lang->executionCommon, $lang->execution->common, $lang->execution->executionSummary));
+js::set('checkedExecutions', str_replace($lang->executionCommon, $lang->execution->common, $lang->execution->checkedExecutions));
+?>
+execution->treeLevel['all']);
+js::set('foldAll', $lang->execution->treeLevel['root']);
+js::set('isCNLang', !$this->loadModel('common')->checkNotCN())
+?>
+
+
+
+
+ " . $lang->export, '', "class='btn btn-link export'")?>
+ createLink('execution', 'create'), " " . ($from == 'execution' ? $lang->execution->createExec : $lang->execution->create), '', "class='btn btn-primary create-execution-btn' data-app='execution' onclick='$(this).removeAttr(\"data-toggle\")'");?>
+
+
+
+
+
+
+ execution->noExecutions : $lang->execution->noExecution;?>
+
+
+ createLink('execution', 'create'), " " . ($from == 'execution' ? $lang->execution->createExec : $lang->execution->create), '', "class='btn btn-info' data-app='execution'");?>
+
+
+
+
+
+
+
+
+
+
+
diff --git a/module/execution/view/batchedit.html.php b/module/execution/view/batchedit.html.php
index 9f7c3d3b0b..ed66113b25 100755
--- a/module/execution/view/batchedit.html.php
+++ b/module/execution/view/batchedit.html.php
@@ -77,7 +77,7 @@