Merge branch 'zentaopms_284' of https://gitlab.zcorp.cc/easycorp/zentaopms into zentaopms_284

This commit is contained in:
tianshujie
2023-02-15 16:31:53 +08:00
22 changed files with 741 additions and 259 deletions
+5
View File
@@ -374,6 +374,11 @@ class action extends control
$hasCreatedTask = $this->loadModel('programplan')->isCreateTask($execution->parent);
if(!$hasCreatedTask) die(js::alert($this->lang->action->hasCreatedTask));
/* Check type of siblings. */
$siblings = $this->dao->select('DISTINCT type')->from(TABLE_EXECUTION)->where('deleted')->eq(0)->andWhere('parent')->eq($execution->parent)->fetchPairs('type');
if($execution->type == 'stage' and (isset($bsiblings['sprint']) or isset($siblings['kanban']))) die(js::alert($this->lang->action->hasOtherType[$execution->type]));
if(($execution->type == 'sprint' or $execution->type == 'kanban') and isset($siblings['stage'])) die(js::alert($this->lang->action->hasOtherType[$execution->type]));
/* If parent stage is not exists, you should recover its parent stages, refresh status. */
$stagePathList = explode(',', trim($execution->path, ','));
$deletedStageList = $this->dao->select('*')->from(TABLE_EXECUTION)->where('id')->in($stagePathList)->andWhere('deleted')->eq(1)->andWhere('type')->eq('stage')->orderBy('id_asc')->fetchAll('id');
+5
View File
@@ -63,6 +63,11 @@ $lang->action->hasDeletedParent = 'Restoring this phase requires restoring the
$lang->action->hasChangedAttr = "After recovery, the phase type will be adjusted to '%s' according to the parent phase type.";
$lang->action->whetherToRestore = 'Confirm to restore?';
$lang->action->hasOtherType = array();
$lang->action->hasOtherType['stage'] = "Only subtypes of {$lang->executionCommon} / Kanban types can be created at this parent stage, so the current stage cannot be restored.";
$lang->action->hasOtherType['sprint'] = "Only subtypes of Stage types can be created at this parent stage, so the current {$lang->executionCommon} cannot be restored.";
$lang->action->hasOtherType['kanban'] = "Only subtypes of Stage types can be created at this parent stage, so the current Kanban cannot be restored.";
$lang->action->repeatChange = '%s with the same name and code already exists in the system, After recovery, the name are \"%s\",the code are \"%s\".';
$lang->action->nameRepeatChange = '%s with the same name already exists in the system, After recovery, the name are \"%s\".';
$lang->action->codeRepeatChange = '%s with the same code already exists in the system, After recovery, the code are \"%s\".';
+5
View File
@@ -63,6 +63,11 @@ $lang->action->hasDeletedParent = 'Restoring this phase requires restoring the
$lang->action->hasChangedAttr = "After recovery, the phase type will be adjusted to '%s' according to the parent phase type.";
$lang->action->whetherToRestore = 'Confirm to restore?';
$lang->action->hasOtherType = array();
$lang->action->hasOtherType['stage'] = "Only subtypes of {$lang->executionCommon} / Kanban types can be created at this parent stage, so the current stage cannot be restored.";
$lang->action->hasOtherType['sprint'] = "Only subtypes of Stage types can be created at this parent stage, so the current {$lang->executionCommon} cannot be restored.";
$lang->action->hasOtherType['kanban'] = "Only subtypes of Stage types can be created at this parent stage, so the current Kanban cannot be restored.";
$lang->action->repeatChange = '%s with the same name and code already exists in the system, After recovery, the name are \"%s\",the code are \"%s\".';
$lang->action->nameRepeatChange = '%s with the same name already exists in the system, After recovery, the name are \"%s\".';
$lang->action->codeRepeatChange = '%s with the same code already exists in the system, After recovery, the code are \"%s\".';
+5
View File
@@ -63,6 +63,11 @@ $lang->action->hasDeletedParent = 'Restoring this phase requires restoring the
$lang->action->hasChangedAttr = "After recovery, the phase type will be adjusted to '%s' according to the parent phase type.";
$lang->action->whetherToRestore = 'Confirm to restore?';
$lang->action->hasOtherType = array();
$lang->action->hasOtherType['stage'] = "Only subtypes of {$lang->executionCommon} / Kanban types can be created at this parent stage, so the current stage cannot be restored.";
$lang->action->hasOtherType['sprint'] = "Only subtypes of Stage types can be created at this parent stage, so the current {$lang->executionCommon} cannot be restored.";
$lang->action->hasOtherType['kanban'] = "Only subtypes of Stage types can be created at this parent stage, so the current Kanban cannot be restored.";
$lang->action->repeatChange = '%s with the same name and code already exists in the system, After recovery, the name are \"%s\",the code are \"%s\".';
$lang->action->nameRepeatChange = '%s with the same name already exists in the system, After recovery, the name are \"%s\".';
$lang->action->codeRepeatChange = '%s with the same code already exists in the system, After recovery, the code are \"%s\".';
+5
View File
@@ -63,6 +63,11 @@ $lang->action->hasDeletedParent = '恢复该阶段需要同时恢复已删除
$lang->action->hasChangedAttr = '恢复后阶段类型将根据父阶段类型均调整为“%s”,';
$lang->action->whetherToRestore = '是否恢复?';
$lang->action->hasOtherType = array();
$lang->action->hasOtherType['stage'] = "当前阶段的父级现在只允许创建{$lang->executionCommon}/看板类型的子级,故无法恢复当前阶段。";
$lang->action->hasOtherType['sprint'] = "当前{$lang->executionCommon}的父级现在只允许创建阶段类型的子级,故无法恢复当前{$lang->executionCommon}";
$lang->action->hasOtherType['kanban'] = "当前看板的父级现在只允许创建阶段类型的子级,故无法恢复当前看板。";
$lang->action->repeatChange = '系统内已有同名、同代号的%s,恢复后名称为\"%s\"、代号为\"%s\"。';
$lang->action->nameRepeatChange = '系统内已有同名的%s,恢复后名称为\"%s\"。';
$lang->action->codeRepeatChange = '系统内已有同代号的%s,恢复后代号为\"%s\"。';
+3 -3
View File
@@ -1,6 +1,8 @@
<?php $currentModule = $this->app->rawModule;?>
<?php $currentMethod = $this->app->rawMethod;?>
<?php $datatableId = $this->moduleName . ucfirst($this->methodName);?>
<?php js::set('currentMethod', $this->app->rawMethod)?>
<?php js::set('currentModule', $this->app->rawModule)?>
<style>
#setShowModule {margin-left: 30px;}
@@ -29,7 +31,7 @@ $(function()
$dropmenu.append("<li><a href='<?php echo $this->createLink('datatable', 'ajaxCustom', 'id=' . $this->moduleName . '&method=' . $this->methodName)?>' data-toggle='modal' data-type='ajax'><?php echo $lang->datatable->custom?></a></li>");
}
$dropmenu.append("<li><a href='javascript:saveDatatableConfig(\"mode\", \"<?php echo $mode == 'table' ? 'datatable' : 'table';?>\", true);' id='switchToDatatable'><?php echo $mode == 'table' ? $lang->datatable->switchToDatatable : $lang->datatable->switchToTable;?></a></li>");
if(!(currentModule == 'execution' && currentMethod == 'all')) $dropmenu.append("<li><a href='javascript:saveDatatableConfig(\"mode\", \"<?php echo $mode == 'table' ? 'datatable' : 'table';?>\", true);' id='switchToDatatable'><?php echo $mode == 'table' ? $lang->datatable->switchToDatatable : $lang->datatable->switchToTable;?></a></li>");
$dropdown.append($dropmenu)
.appendTo($btnToolbar)
.on('shown.zui.dropdown', function(){$btnToolbar.closest('.table-header').css('z-index', 11);})
@@ -43,8 +45,6 @@ $(function()
{
if('<?php echo $this->app->user->account?>' == 'guest') return;
datatableId = '<?php echo $datatableId?>';
currentModule = '<?php echo $currentModule?>';
currentMethod = '<?php echo $currentMethod?>';
var value = $('#showModuleModal input[name="showModule"]:checked').val();
var allModule = $('#showModuleModal input[name="showAllModule"]:checked').val();
var showBranch = $('#showModuleModal input[name="showBranch"]:checked').val();
+131
View File
@@ -0,0 +1,131 @@
<?php if($extView = $this->getExtViewFile(__FILE__)){include $extView; return helper::cd();}?>
<?php js::import($jsRoot . 'dtable/min.js'); ?>
<?php css::import($jsRoot . 'dtable/min.css'); ?>
<?php if(!empty($lang->datatable)):?>
<style>
.datatable {margin-bottom: 0;}
.datatable .table>tbody>tr>td, .datatable .table>thead>tr>th {line-height: 29px; padding-top: 2px; padding-bottom: 2px; height: 36px; vertical-align: middle; white-space: nowrap;}
.datatable .table>tbody>tr.hover {box-shadow: none!important;}
.datatable .flexarea .table-children,
.datatable .fixed-left .table-children {border-right: none;}
.datatable .flexarea .table-children,
.datatable .fixed-right .table-children {border-left: none;}
.datatable tr.hover td.c-actions .more {display: block; background-color: #ebf2f9}
.datatable .fixed-left .table,
.datatable .flexarea .table,
.datatable .flexarea tbody > tr.checked,
.datatable .fixed-left tbody > tr.checked {border-top-right-radius: 0; border-bottom-right-radius: 0;}
.datatable .flexarea tbody > tr.checked,
.datatable .fixed-right .table,
.datatable .flexarea .table,
.datatable .fixed-right tbody > tr.checked {border-top-left-radius: 0; border-bottom-left-radius: 0;}
.datatable .flexarea tbody>tr.checked>td:first-child:before,
.datatable .fixed-right tbody>tr.checked>td:first-child:before {display: none}
.datatable>.scroll-wrapper {z-index: 10;}
.has-fixed-footer .scroll-wrapper {bottom: 49px; position: fixed;}
.has-fixed-footer .scroll-wrapper .scroll-slide.scroll-pos-out{height:8px;bottom: -8px;}
.has-fixed-footer .scroll-wrapper .scroll-slide.scroll-pos-out .bar{height:8px;}
.datatable .flexarea thead>tr>th:first-child,
.datatable .flexarea tbody>tr>td:first-child,
.datatable .fixed-right thead>tr>th:first-child,
.datatable .fixed-right tbody>tr>td {padding-left: 5px!important;}
.datatable .c-actions {white-space: nowrap;}
.datatable.head-fixed {padding-top: 41px;}
.datatable .table>thead>tr>th.col-hover {background: rgba(0,0,0,.07);}
</style>
<script>
<?php $datatableId = $this->moduleName . ucfirst($this->methodName);?>
var datatableOptions =
{
customizable : false,
sortable : false,
scrollPos : 'out',
tableClass : 'tablesorter',
storage : false,
fixCellHeight : false,
selectable : false,
fixedHeader: true,
ready: function()
{
this.$table.addClass('datatable-origin');
if (this.$table.hasClass('has-sort-head'))
{
this.$datatable.find('.table').addClass('has-sort-head');
}
this.$datatable.find('.sparkline').sparkline();
$('.progress-pie').progressPie();
}
};
/**
* Init datatable.
*
* @param int $datatable
* @access public
* @return void
*/
function initDatatable($datatable)
{
$datatable = $datatable || $('table.datatable').first();
if(!$datatable.length || $datatable.data('zui.datatable')) return null;
var $datatable = $('table.datatable').first();
var datatableId = $datatable.attr('id');
var dtSetting = $.cookie('datatable.<?php echo $datatableId?>' + '.cols') || {};
if(dtSetting === 'null') dtSetting = {};
if(typeof dtSetting === 'string') dtSetting = $.parseJSON(dtSetting);
$datatable.datatable(datatableOptions);
$datatable.find('thead>tr>th').each(function(idx)
{
var $th = $(this);
idx = $th.data('index') || idx;
var colSetting = dtSetting[idx];
$th.toggleClass('ignore', !!(colSetting && colSetting.ignore));
});
return $datatable;
};
$(document).ready(function()
{
var $datatable = initDatatable();
if($datatable && $datatable.length)
{
$('#main').on('beforeTableReload', '[data-ride="table"]', function()
{
initDatatable($datatable);
});
}
window.saveDatatableConfig = function(name, value, reload, global)
{
if('<?php echo $this->app->user->account?>' == 'guest') return;
var datatableId = '<?php echo $datatableId;?>';
if(typeof value === 'object') value = JSON.stringify(value);
if(typeof global === 'undefined') global = 0;
$.ajax(
{
type: "POST",
dataType: 'json',
data: {target: datatableId, name: name, value: value, global: global},
success:function(e){if(reload) window.location.reload();},
url: '<?php echo $this->createLink('datatable', 'ajaxSave')?>'
});
};
var $modal = $('#customDatatable');
var $checkList = $modal.find('.modal-body > .table > tbody');
$checkList.on('click', 'tr', function()
{
var $tr = $(this);
if($tr.hasClass('disabled')) return;
$tr.toggleClass('checked');
});
$(window).on('fixFooter', function(e, isFixed)
{
$('body').toggleClass('has-fixed-footer', isFixed);
});
});
</script>
<?php endif;?>
+2 -2
View File
@@ -62,8 +62,8 @@
<div class='cols-list template' id="originCols">
<?php foreach ($cols as $key => $col):?>
<?php
$required = $col['required'] == 'yes';
$fixed = $col['fixed'];
$required = $col['required'] == 'yes';
$fixed = $col['fixed'];
$autoWidth = $col['width'] == 'auto';
?>
<div class='clearfix col<?php echo ($required ? ' require' : '') . (' fixed-' . $fixed) ?>' data-key='<?php echo $key?>' data-fixed='<?php echo $fixed?>' data-width='<?php echo $col['width']?>'>
+40 -29
View File
@@ -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';
+9 -10
View File
@@ -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();
}
+4
View File
@@ -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}
+8 -123
View File
@@ -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();
}
+148
View File
@@ -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();
}
+125
View File
@@ -1025,6 +1025,8 @@ class executionModel extends model
->remove('comment,readjustTime,readjustTask')
->get();
if(empty($oldExecution->totalConsumed) and helper::isZeroDate($oldExecution->realBegan)) $execution->status = 'wait';
if(!$this->post->readjustTime)
{
unset($execution->begin);
@@ -5226,6 +5228,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 = "<span class='project-type-label label label-outline $label'>{$this->lang->execution->typeList[$execution->type]}</span> " . 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
*
+83 -85
View File
@@ -1,38 +1,25 @@
<?php
/**
* The html template file of all method of execution module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
* @author Yidong Wang <yidong@cnezsoft.com>
* @package execution
* @version $Id: index.html.php 5094 2013-07-10 08:46:15Z chencongzhi520@gmail.com $
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/sortable.html.php';?>
<?php include '../../common/view/datatable.fix.html.php';?>
<?php
$datatableId = $this->moduleName . ucfirst($this->methodName);
$useDatatable = (isset($config->datatable->$datatableId->mode) and $config->datatable->$datatableId->mode == 'datatable');
?>
<?php
js::set('unfoldExecutions', array());
js::set('useDatatable', $useDatatable);
js::import($jsRoot . 'dtable/min.js');
css::import($jsRoot . 'dtable/min.css');
$cols = $this->execution->generateCol();
$executions = $this->execution->generateRow($executionStats, $users, $productID);
$sortLink = $this->createLink('execution', 'all', "status=$status&orderBy={orderBy}&productID=$productID&param=$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));
?>
<?php
/* Set unfold parent executionID. */
js::set('unfoldAll', $lang->execution->treeLevel['all']);
js::set('foldAll', $lang->execution->treeLevel['root']);
js::set('isCNLang', !$this->loadModel('common')->checkNotCN())
js::set('isCNLang', !$this->loadModel('common')->checkNotCN());
?>
<?php $canBatchEdit = common::hasPriv('execution', 'batchEdit');?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolBar pull-left'>
@@ -60,7 +47,6 @@ js::set('isCNLang', !$this->loadModel('common')->checkNotCN())
<?php if($status == $key) $label .= " <span class='label label-light label-badge'>{$pager->recTotal}</span>";?>
<?php echo html::a($this->createLink($this->app->rawModule, $this->app->rawMethod, "status=$key&orderBy=$orderBy&productID=$productID"), $label, '', "class='btn btn-link' id='{$key}Tab' data-app='$from'");?>
<?php endforeach;?>
<?php if($canBatchEdit) echo html::checkbox('showEdit', array('1' => $lang->execution->editAction), $showBatchEdit);?>
<a class="btn btn-link querybox-toggle" id='bysearchTab'><i class="icon icon-search muted"></i> <?php echo $lang->execution->byQuery;?></a>
</div>
<div class='btn-toolbar pull-right'>
@@ -68,6 +54,7 @@ js::set('isCNLang', !$this->loadModel('common')->checkNotCN())
<?php if(common::hasPriv('execution', 'create')) echo html::a($this->createLink('execution', 'create'), "<i class='icon icon-sm icon-plus'></i> " . ($from == 'execution' ? $lang->execution->createExec : $lang->execution->create), '', "class='btn btn-primary create-execution-btn' data-app='execution' onclick='$(this).removeAttr(\"data-toggle\")'");?>
</div>
</div>
<div id='mainContent' class="main-row fade">
<div class="cell<?php if($status == 'bySearch') echo ' show';?>" id="queryBox" data-module='execution'></div>
<?php if(empty($executionStats)):?>
@@ -82,70 +69,81 @@ js::set('isCNLang', !$this->loadModel('common')->checkNotCN())
</p>
</div>
<?php else:?>
<form class='main-table' id='executionsForm' method='post' action='<?php echo inLink('batchEdit');?>'>
<form class='main-table' id='' method='post' action='<?php echo inLink('batchEdit');?>'>
<div class="table-header fixed-right">
<nav class="btn-toolbar pull-right setting"></nav>
</div>
<?php
$vars = "status=$status&orderBy=%s&productID=$productID&param=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";
if($useDatatable) include '../../common/view/datatable.html.php';
else include '../../common/view/tablesorter.html.php';
$setting = $this->datatable->getSetting('execution');
$widths = $this->datatable->setFixedFieldWidth($setting);
$columns = 0;
?>
<?php if(!$useDatatable) echo '<div class="table-responsive">';?>
<table class='table has-sort-head<?php if($useDatatable) echo ' datatable';?>' id='executionList' data-fixed-left-width='<?php echo $widths['leftWidth']?>' data-fixed-right-width='<?php echo $widths['rightWidth']?>'>
<thead>
<tr>
<?php
foreach($setting as $key => $value)
{
if($value->show)
{
$this->datatable->printHead($value, $orderBy, $vars, $canBatchEdit);
$columns ++;
}
}
?>
</tr>
</thead>
<tbody class='sortable' id='executionTableList'>
<?php foreach($executionStats as $execution):?>
<tr data-id='<?php echo $execution->id ?>' data-order='<?php echo $execution->order ?>' data-status='<?php echo $execution->status?>'>
<?php foreach($setting as $key => $value) $this->execution->printCell($value, $execution, $users, $useDatatable ? 'datatable' : 'table', $isStage, $productID);?>
</tr>
<?php if(!empty($execution->children)):?>
<?php $i = 0;?>
<?php foreach($execution->children as $key => $child):?>
<?php $class = $i == 0 ? ' table-child-top' : '';?>
<?php $class .= ($i + 1 == count($execution->children)) ? ' table-child-bottom' : '';?>
<tr class='table-children<?php echo $class;?> parent-<?php echo $execution->id;?>' data-id='<?php echo $child->id?>'>
<?php foreach($setting as $key => $value) $this->execution->printCell($value, $child, $users, $useDatatable ? 'datatable' : 'table', $isStage, $productID, true);?>
</tr>
<?php $i ++;?>
<?php endforeach;?>
<?php endif;?>
<?php endforeach;?>
</tbody>
</table>
<?php if(!$useDatatable) echo '</div>';?>
<?php if($executionStats):?>
<div id="myTable"></div>
<div class='table-footer'>
<?php if($canBatchEdit):?>
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
<div class="table-actions btn-toolbar">
<?php echo html::submitButton($lang->execution->batchEdit, '', 'btn');?>
<?php
if($canBatchEdit)
{
$actionLink = $this->createLink('project', 'batchEdit');
$misc = "id='batchEditBtn'";
echo html::commonButton($lang->edit, $misc);
}
?>
</div>
<?php endif;?>
<div class="table-statistic"></div>
<?php $pager->show('right', 'pagerjs');?>
</div>
<?php endif;?>
</form>
<script>
cols = JSON.parse(cols);
data = JSON.parse(data);
console.log(cols);
const options = {
height: 'auto',
striped: true,
plugins: ['nested', 'checkable'],
checkOnClickRow: true,
sortLink: createSortLink,
cols: cols,
data: data,
onCheckChange: toggleActions,
};
function createSortLink(col)
{
var sort = col.name + '_asc';
if(sort == orderBy) sort = col.name + '_desc';
return sortLink.replace('{orderBy}', sort);
}
function toggleActions(changes)
{
checkItems = this.getChecks();
$.cookie('checkedItem', checkItems.join(','), {expires: config.cookieLife, path: config.webRoot});
if(checkItems.length > 0)
{
$('.table-footer .table-actions').show();
}
else
{
$('.table-footer .table-actions').hide();
}
}
$('#myTable').dtable(options);
$('#batchEditBtn').click(function()
{
var batchEditLink = createLink('execution', 'batchEdit');
var tempform = document.createElement("form");
tempform.action = batchEditLink;
tempform.method = "post";
tempform.style.display = "none";
var opt = document.createElement("input");
opt.name = 'executionIDList';
opt.value = checkItems;
tempform.appendChild(opt);
document.body.appendChild(tempform);
tempform.submit();
})
</script>
<?php endif;?>
</div>
<?php js::set('orderBy', $orderBy)?>
<?php js::set('status', $status)?>
<?php include '../../common/view/footer.html.php';?>
+151
View File
@@ -0,0 +1,151 @@
<?php
/**
* The html template file of all method of execution module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
* @author Yidong Wang <yidong@cnezsoft.com>
* @package execution
* @version $Id: index.html.php 5094 2013-07-10 08:46:15Z chencongzhi520@gmail.com $
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/sortable.html.php';?>
<?php include '../../common/view/datatable.fix.html.php';?>
<?php
$datatableId = $this->moduleName . ucfirst($this->methodName);
$useDatatable = (isset($config->datatable->$datatableId->mode) and $config->datatable->$datatableId->mode == 'datatable');
?>
<?php
js::set('unfoldExecutions', array());
js::set('useDatatable', $useDatatable);
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));
?>
<?php
/* Set unfold parent executionID. */
js::set('unfoldAll', $lang->execution->treeLevel['all']);
js::set('foldAll', $lang->execution->treeLevel['root']);
js::set('isCNLang', !$this->loadModel('common')->checkNotCN())
?>
<?php $canBatchEdit = common::hasPriv('execution', 'batchEdit');?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolBar pull-left'>
<?php if($from == 'project'):?>
<div class='btn-group'>
<?php $viewName = $productID != 0 ? zget($productList,$productID) : $lang->product->allProduct;?>
<a href='javascript:;' class='btn btn-link btn-limit' data-toggle='dropdown'><span class='text' title='<?php echo $viewName;?>'><?php echo $viewName;?></span> <span class='caret'></span></a>
<ul class='dropdown-menu' style='max-height:240px; max-width: 300px; overflow-y:auto'>
<?php
$class = '';
if($productID == 0) $class = 'class="active"';
echo "<li $class>" . html::a($this->createLink('project', 'execution', "status=$status&orderby=$orderBy"), $lang->product->allProduct) . "</li>";
foreach($productList as $key => $product)
{
$class = $productID == $key ? 'class="active"' : '';
echo "<li $class>" . html::a($this->createLink('project', 'execution', "status=$status&orderby=$orderBy&productID=$key"), $product) . "</li>";
}
?>
</ul>
</div>
<?php endif;?>
<?php common::sortFeatureMenu();?>
<?php foreach($lang->execution->featureBar['all'] as $key => $label):?>
<?php $label = "<span class='text'>$label</span>";?>
<?php if($status == $key) $label .= " <span class='label label-light label-badge'>{$pager->recTotal}</span>";?>
<?php echo html::a($this->createLink($this->app->rawModule, $this->app->rawMethod, "status=$key&orderBy=$orderBy&productID=$productID"), $label, '', "class='btn btn-link' id='{$key}Tab' data-app='$from'");?>
<?php endforeach;?>
<?php if($canBatchEdit) echo html::checkbox('showEdit', array('1' => $lang->execution->editAction), $showBatchEdit);?>
<a class="btn btn-link querybox-toggle" id='bysearchTab'><i class="icon icon-search muted"></i> <?php echo $lang->execution->byQuery;?></a>
</div>
<div class='btn-toolbar pull-right'>
<?php common::printLink('execution', 'export', "status=$status&productID=$productID&orderBy=$orderBy&from=$from", "<i class='icon-export muted'> </i> " . $lang->export, '', "class='btn btn-link export'")?>
<?php if(common::hasPriv('execution', 'create')) echo html::a($this->createLink('execution', 'create'), "<i class='icon icon-sm icon-plus'></i> " . ($from == 'execution' ? $lang->execution->createExec : $lang->execution->create), '', "class='btn btn-primary create-execution-btn' data-app='execution' onclick='$(this).removeAttr(\"data-toggle\")'");?>
</div>
</div>
<div id='mainContent' class="main-row fade">
<div class="cell<?php if($status == 'bySearch') echo ' show';?>" id="queryBox" data-module='execution'></div>
<?php if(empty($executionStats)):?>
<div class="table-empty-tip">
<p>
<span class="text-muted"><?php echo $from == 'execution' ? $lang->execution->noExecutions : $lang->execution->noExecution;?></span>
<?php if(empty($allExecutionsNum)):?>
<?php if(common::hasPriv('execution', 'create')):?>
<?php echo html::a($this->createLink('execution', 'create'), "<i class='icon icon-plus'></i> " . ($from == 'execution' ? $lang->execution->createExec : $lang->execution->create), '', "class='btn btn-info' data-app='execution'");?>
<?php endif;?>
<?php endif;?>
</p>
</div>
<?php else:?>
<form class='main-table' id='executionsForm' method='post' action='<?php echo inLink('batchEdit');?>'>
<div class="table-header fixed-right">
<nav class="btn-toolbar pull-right setting"></nav>
</div>
<?php
$vars = "status=$status&orderBy=%s&productID=$productID&param=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";
if($useDatatable) include '../../common/view/datatable.html.php';
else include '../../common/view/tablesorter.html.php';
$setting = $this->datatable->getSetting('execution');
$widths = $this->datatable->setFixedFieldWidth($setting);
$columns = 0;
?>
<?php if(!$useDatatable) echo '<div class="table-responsive">';?>
<table class='table has-sort-head<?php if($useDatatable) echo ' datatable';?>' id='executionList' data-fixed-left-width='<?php echo $widths['leftWidth']?>' data-fixed-right-width='<?php echo $widths['rightWidth']?>'>
<thead>
<tr>
<?php
foreach($setting as $key => $value)
{
if($value->show)
{
$this->datatable->printHead($value, $orderBy, $vars, $canBatchEdit);
$columns ++;
}
}
?>
</tr>
</thead>
<tbody class='sortable' id='executionTableList'>
<?php foreach($executionStats as $execution):?>
<tr data-id='<?php echo $execution->id ?>' data-order='<?php echo $execution->order ?>' data-status='<?php echo $execution->status?>'>
<?php foreach($setting as $key => $value) $this->execution->printCell($value, $execution, $users, $useDatatable ? 'datatable' : 'table', $isStage, $productID);?>
</tr>
<?php if(!empty($execution->children)):?>
<?php $i = 0;?>
<?php foreach($execution->children as $key => $child):?>
<?php $class = $i == 0 ? ' table-child-top' : '';?>
<?php $class .= ($i + 1 == count($execution->children)) ? ' table-child-bottom' : '';?>
<tr class='table-children<?php echo $class;?> parent-<?php echo $execution->id;?>' data-id='<?php echo $child->id?>'>
<?php foreach($setting as $key => $value) $this->execution->printCell($value, $child, $users, $useDatatable ? 'datatable' : 'table', $isStage, $productID, true);?>
</tr>
<?php $i ++;?>
<?php endforeach;?>
<?php endif;?>
<?php endforeach;?>
</tbody>
</table>
<?php if(!$useDatatable) echo '</div>';?>
<?php if($executionStats):?>
<div class='table-footer'>
<?php if($canBatchEdit):?>
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
<div class="table-actions btn-toolbar">
<?php echo html::submitButton($lang->execution->batchEdit, '', 'btn');?>
</div>
<?php endif;?>
<div class="table-statistic"></div>
<?php $pager->show('right', 'pagerjs');?>
</div>
<?php endif;?>
</form>
<?php endif;?>
</div>
<?php js::set('orderBy', $orderBy)?>
<?php js::set('status', $status)?>
<?php include '../../common/view/footer.html.php';?>
+1 -1
View File
@@ -77,7 +77,7 @@
</tr>
</thead>
<tbody>
<?php foreach($executionIDList as $executionID):?>
<?php foreach($executions as $executionID => $execution):?>
<?php
if(!empty($this->config->moreLinks["PM"])) $this->config->moreLinks["PMs[$executionID]"] = $this->config->moreLinks["PM"];
if(!empty($this->config->moreLinks["PO"])) $this->config->moreLinks["POs[$executionID]"] = $this->config->moreLinks["PO"];
+2 -2
View File
@@ -58,10 +58,10 @@ $config->programplan->customCreateFields = 'PM,percent,attribute,acl,milestone,r
$config->programplan->custom = new stdclass();
$config->programplan->custom->createFields = 'PM,percent,attribute,acl,milestone';
$config->programplan->customAgilePlusCreateFields = 'PM,milestone,acl,desc';
$config->programplan->customAgilePlusCreateFields = 'PM,milestone,acl,desc,attribute';
$config->programplan->customAgilePlus = new stdclass();
$config->programplan->customAgilePlus->createFields = 'PM,milestone,acl,desc';
$config->programplan->customAgilePlus->createFields = 'PM,milestone,acl,desc,attribute';
$config->programplan->custom->customGanttFields = 'PM,deadline,status,realBegan,realEnd,progress,taskProgress,estimate,consumed,delay,delayDays';
$config->programplan->ganttCustom = new stdclass();
+3 -3
View File
@@ -168,13 +168,13 @@ class programplan extends control
$executions = !empty($planID) ? $this->loadModel('execution')->getChildExecutions($planID) : array();
$plans = $this->programplan->getStage($planID ? $planID : $projectID, $this->productID, 'parent');
if(!empty($planID) and !empty($plans))
if(!empty($planID) and !empty($plans) and $project->model == 'waterfallplus')
{
$executionType = 'stage';
unset($this->lang->programplan->typeList['agileplus']);
}
if(!empty($planID) and !empty($executions) and empty($plans))
if(!empty($planID) and !empty($executions) and empty($plans) and $project->model == 'waterfallplus')
{
$executionType = 'agileplus';
unset($this->lang->programplan->typeList['stage']);
@@ -208,7 +208,7 @@ class programplan extends control
$this->view->productID = $productID ? $productID : key($productList);
$this->view->stages = empty($planID) ? $this->loadModel('stage')->getStages('id_asc') : array();
$this->view->programPlan = $programPlan;
$this->view->plans = empty($executions) ? $this->programplan->getStage($planID ? $planID : $projectID, $this->productID, 'parent', 'order_asc') : $executions;
$this->view->plans = empty($executions) ? $plans : $executions;
$this->view->planID = $planID;
$this->view->type = 'lists';
$this->view->executionType = $executionType;
+1 -1
View File
@@ -43,7 +43,7 @@
</div>
<div id='mainContent' class='main-content'>
<div class='main-header'>
<?php if(!empty($planID)):?>
<?php if(!empty($planID) and $project->model == 'waterfallplus'):?>
<div class="pull-left">
<div class='btn-group'>
<a href='javascript:;' class='btn btn-link btn-limit' data-toggle='dropdown'><span class='text' title='<?php echo zget($lang->programplan->typeList, $executionType);?>'><?php echo zget($lang->programplan->typeList, $executionType);?></span> <span class='caret'></span></a>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long