";
echo "id class='table-nest-icon icon table-nest-toggle'>";
if($this->config->systemMode == 'new')
{
@@ -4441,6 +4441,18 @@ class executionModel extends model
return $productpairs;
}
+ /**
+ * Get lifetime by id list.
+ *
+ * @param string $idList
+ * @access public
+ * @return array
+ */
+ public function getLifetimeByIdList($idList = '')
+ {
+ return $this->dao->select('id,lifetime')->from(TABLE_EXECUTION)->where('id')->in($idList)->fetchPairs();
+ }
+
/**
** Set stage tree path.
**
diff --git a/module/kanban/model.php b/module/kanban/model.php
index a857dc05bd..ac59a711bc 100644
--- a/module/kanban/model.php
+++ b/module/kanban/model.php
@@ -1680,9 +1680,10 @@ class kanbanModel extends model
if($browseType == 'task')
{
if($searchValue != '' and strpos($object->name, $searchValue) === false) continue;
- $cardData['name'] = $object->name;
- $cardData['status'] = $object->status;
- $cardData['left'] = $object->left;
+ $cardData['name'] = $object->name;
+ $cardData['status'] = $object->status;
+ $cardData['left'] = $object->left;
+ $cardData['estStarted'] = $object->estStarted;
}
else
{
@@ -3808,7 +3809,7 @@ class kanbanModel extends model
{
$menu = array();
- if(common::hasPriv('task', 'edit') and $this->task->isClickable($task, 'edit')) $menu[] = array('label' => $this->lang->task->edit, 'icon' => 'edit', 'url' => helper::createLink('task', 'edit', "taskID=$task->id", '', true), 'size' => '95%');
+ if(common::hasPriv('task', 'edit') and $this->task->isClickable($task, 'edit')) $menu[] = array('label' => $this->lang->task->edit, 'icon' => 'edit', 'url' => helper::createLink('task', 'edit', "taskID=$task->id&comment=false&kanbanGroup=default&from=taskkanban", '', true), 'size' => '95%');
if(common::hasPriv('task', 'pause') and $this->task->isClickable($task, 'pause')) $menu[] = array('label' => $this->lang->task->pause, 'icon' => 'pause', 'url' => helper::createLink('task', 'pause', "taskID=$task->id&extra=from=taskkanban", '', true));
if(common::hasPriv('task', 'restart') and $this->task->isClickable($task, 'restart')) $menu[] = array('label' => $this->lang->task->restart, 'icon' => 'play', 'url' => helper::createLink('task', 'restart', "taskID=$task->id&from=taskkanban", '', true));
if(common::hasPriv('task', 'recordEstimate') and $this->task->isClickable($task, 'recordEstimate')) $menu[] = array('label' => $this->lang->task->recordEstimate, 'icon' => 'time', 'url' => helper::createLink('task', 'recordEstimate', "taskID=$task->id&from=taskkanban", '', true));
diff --git a/module/productplan/model.php b/module/productplan/model.php
index e97ac85e01..663e969371 100644
--- a/module/productplan/model.php
+++ b/module/productplan/model.php
@@ -639,7 +639,7 @@ class productplanModel extends model
$childStatus = $this->dao->select('status')->from(TABLE_PRODUCTPLAN)->where('parent')->eq($parentID)->andWhere('deleted')->eq(0)->fetchPairs();
/* If the subplan is empty, update the plan. */
- if(empty($childStatus)) $this->dao->update(TABLE_PRODUCTPLAN)->set('parent')->eq(0)->exec();
+ if(empty($childStatus)) $this->dao->update(TABLE_PRODUCTPLAN)->set('parent')->eq(0)->where('id')->eq($parentID)->exec();
if(count($childStatus) == 1 and isset($childStatus['wait']))
{
diff --git a/module/project/js/execution.js b/module/project/js/execution.js
index 7e49d3e892..1209f65a01 100644
--- a/module/project/js/execution.js
+++ b/module/project/js/execution.js
@@ -31,6 +31,7 @@ function loadData($showmore)
var executionID = $showmore.attr('data-parent');
var maxTaskID = $showmore.attr('data-id');
+ var maxTaskID = maxTaskID.replace('t', '');
var link = createLink('task', 'ajaxGetTasks', 'executionID=' + executionID + '&maxTaskID=' + maxTaskID);
$.get(link, function(data)
{
diff --git a/module/project/view/createguide.html.php b/module/project/view/createguide.html.php
index 6231872da1..0abab2b72c 100644
--- a/module/project/view/createguide.html.php
+++ b/module/project/view/createguide.html.php
@@ -21,22 +21,23 @@
project->chooseProgramType; ?>
+ tab;?>
- createLink("project", "create", "model=scrum&programID=$programID©ProjectID=0&extra=productID=$productID,branchID=$branchID"), "  ", '', "data-app='{$this->app->tab}' class='createButton'")?>
+ createLink("project", "create", "model=scrum&programID=$programID©ProjectID=0&extra=productID=$productID,branchID=$branchID"), "  ", '', "data-app='{$tab}' class='createButton'")?>
project->scrum; ?>
project->scrumTitle; ?>
- createLink("project", "create", "model=waterfall&programID=$programID©ProjectID=0&extra=productID=$productID,branchID=$branchID"), "  ", '', "data-app='{$this->app->tab}' class='createButton'")?>
+ createLink("project", "create", "model=waterfall&programID=$programID©ProjectID=0&extra=productID=$productID,branchID=$branchID"), "  ", '', "data-app='{$tab}' class='createButton'")?>
project->waterfall; ?>
project->waterfallTitle; ?>
- createLink("project", "create", "model=kanban&programID=$programID©ProjectID=0&extra=productID=$productID,branchID=$branchID"), "  ", '', "data-app='{$this->app->tab}' class='createButton'")?>
+ createLink("project", "create", "model=kanban&programID=$programID©ProjectID=0&extra=productID=$productID,branchID=$branchID"), "  ", '', "data-app='{$tab}' class='createButton'")?>
project->kanban;?>
project->kanbanTitle;?>
diff --git a/module/story/view/batchcreate.html.php b/module/story/view/batchcreate.html.php
index 87dda33306..07f38f0967 100755
--- a/module/story/view/batchcreate.html.php
+++ b/module/story/view/batchcreate.html.php
@@ -273,7 +273,6 @@ $(function()
$(function()
{
parent.$('#triggerModal .modal-content .modal-header .close').hide();
- $('#closeModal').on('click', function(){window.parent.$.closeModal();})
})
diff --git a/module/task/control.php b/module/task/control.php
index 27419d0dbd..0aaa687020 100755
--- a/module/task/control.php
+++ b/module/task/control.php
@@ -290,7 +290,8 @@ class task extends control
/* Set Custom*/
foreach(explode(',', $this->config->task->customCreateFields) as $field) $customFields[$field] = $this->lang->task->$field;
- if($execution->type == 'ops') unset($customFields['story']);
+
+ $executions = $this->config->systemMode == 'classic' ? $executions : $this->execution->getByProject($projectID, !common::canModify('execution', $execution) ? 'noclosed' : 'all', 0, true);
$this->view->customFields = $customFields;
$this->view->showFields = $this->config->task->custom->createFields;
@@ -300,7 +301,8 @@ class task extends control
$this->view->position = $position;
$this->view->gobackLink = (isset($output['from']) and $output['from'] == 'global') ? $this->createLink('execution', 'task', "executionID=$executionID") : '';
$this->view->execution = $execution;
- $this->view->executions = $this->config->systemMode == 'classic' ? $executions : $this->execution->getByProject($projectID, !common::canModify('execution', $execution) ? 'noclosed' : 'all', 0, true);
+ $this->view->executions = $executions;
+ $this->view->lifetimeList = $this->execution->getLifetimeByIdList(array_keys($executions));
$this->view->task = $task;
$this->view->users = $users;
$this->view->storyID = $storyID;
@@ -435,6 +437,9 @@ class task extends control
if($execution->type == 'stage' and strpos('estStarted,deadline', $field) !== false) continue;
$customFields[$field] = $this->lang->task->$field;
}
+
+ if($execution->lifetime == 'ops') unset($customFields['story']);
+
$this->view->customFields = $customFields;
$this->view->showFields = $this->config->task->custom->batchCreateFields;
@@ -502,10 +507,11 @@ class task extends control
* @param int $taskID
* @param bool $comment
* @param string $kanbanGroup
+ * @param string $from
* @access public
* @return void
*/
- public function edit($taskID, $comment = false, $kanbanGroup = 'default')
+ public function edit($taskID, $comment = false, $kanbanGroup = 'default', $from = '')
{
$this->commonAction($taskID);
$task = $this->task->getById($taskID);
@@ -553,7 +559,7 @@ class task extends control
$execution = $this->execution->getByID($task->execution);
$execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all';
$execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default';
- if($execution->type == 'kanban')
+ if(($this->app->tab == 'execution' or ($this->config->vision == 'lite' and $this->app->tab == 'project')) and $execution->type == 'kanban')
{
$rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : '';
$kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', 0, $execGroupBy, $rdSearchValue);
@@ -561,7 +567,7 @@ class task extends control
return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)"));
}
- else
+ if($from == 'taskkanban')
{
$taskSearchValue = $this->session->taskSearchValue ? $this->session->taskSearchValue : '';
$kanbanData = $this->loadModel('kanban')->getExecutionKanban($task->execution, $execLaneType, $execGroupBy, $taskSearchValue);
@@ -792,7 +798,7 @@ class task extends control
$execution = $this->execution->getByID($task->execution);
$execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all';
$execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default';
- if($execution->type == 'kanban')
+ if(($this->app->tab == 'execution' or ($this->config->vision == 'lite' and $this->app->tab == 'project')) and $execution->type == 'kanban')
{
$rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : '';
$kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', 0, $execGroup, $rdSearchValue);
@@ -1051,7 +1057,7 @@ class task extends control
$execution = $this->execution->getByID($task->execution);
$execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all';
$execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default';
- if($execution->type == 'kanban')
+ if(($this->app->tab == 'execution' or ($this->config->vision == 'lite' and $this->app->tab == 'project')) and $execution->type == 'kanban')
{
$rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : '';
$regionID = !empty($output['regionID']) ? $output['regionID'] : 0;
@@ -1124,7 +1130,7 @@ class task extends control
$execution = $this->execution->getByID($task->execution);
$execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all';
$execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default';
- if($execution->type == 'kanban')
+ if(($this->app->tab == 'execution' or ($this->config->vision == 'lite' and $this->app->tab == 'project')) and $execution->type == 'kanban')
{
$rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : '';
$kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', 0, $execGroupBy, $rdSearchValue);
@@ -1285,7 +1291,7 @@ class task extends control
$execution = $this->execution->getByID($task->execution);
$execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all';
$execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default';
- if($execution->type == "kanban")
+ if(($this->app->tab == 'execution' or ($this->config->vision == 'lite' and $this->app->tab == 'project')) and $execution->type == "kanban")
{
$rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : '';
$regionID = !empty($output['regionID']) ? $output['regionID'] : 0;
@@ -1383,7 +1389,7 @@ class task extends control
$execution = $this->execution->getByID($task->execution);
$execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all';
$execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default';
- if($execution->type == 'kanban')
+ if(($this->app->tab == 'execution' or ($this->config->vision == 'lite' and $this->app->tab == 'project')) and $execution->type == 'kanban')
{
$rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : '';
$regionID = !empty($output['regionID']) ? $output['regionID'] : 0;
@@ -1450,7 +1456,7 @@ class task extends control
$execution = $this->execution->getByID($task->execution);
$execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all';
$execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default';
- if($execution->type == 'kanban')
+ if(($this->app->tab == 'execution' or ($this->config->vision == 'lite' and $this->app->tab == 'project')) and $execution->type == 'kanban')
{
$rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : '';
$kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', 0, $execGroupBy, $rdSearchValue);
@@ -1531,7 +1537,7 @@ class task extends control
$execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all';
$execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default';
- if($execution->type == 'kanban')
+ if(($this->app->tab == 'execution' or ($this->config->vision == 'lite' and $this->app->tab == 'project')) and $execution->type == 'kanban')
{
$rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : '';
$regionID = !empty($output['regionID']) ? $output['regionID'] : 0;
@@ -1704,7 +1710,7 @@ class task extends control
$execution = $this->execution->getByID($task->execution);
$execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all';
$execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default';
- if($execution->type == 'kanban')
+ if(($this->app->tab == 'execution' or ($this->config->vision == 'lite' and $this->app->tab == 'project')) and $execution->type == 'kanban')
{
$rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : '';
$regionID = !empty($output['regionID']) ? $output['regionID'] : 0;
@@ -1770,7 +1776,7 @@ class task extends control
$execution = $this->execution->getByID($task->execution);
$execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all';
$execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default';
- if($execution->type == "kanban")
+ if(($this->app->tab == 'execution' or ($this->config->vision == 'lite' and $this->app->tab == 'project')) and $execution->type == "kanban")
{
$rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : '';
$regionID = !empty($output['regionID']) ? $output['regionID'] : 0;
@@ -2333,7 +2339,7 @@ class task extends control
{
$task = $this->task->getById($taskID);
$execution = $this->execution->getByID($task->execution);
- if($execution->type == 'kanban' and $this->app->tab == 'execution')
+ if(($this->app->tab == 'execution' or $this->config->vision == 'lite') and $this->app->tab == 'execution')
{
$rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : '';
$kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', 0, $kanbanGroup, $rdSearchValue);
diff --git a/module/task/js/create.js b/module/task/js/create.js
index fa6378c063..ab94beed36 100644
--- a/module/task/js/create.js
+++ b/module/task/js/create.js
@@ -3,6 +3,17 @@ $(function()
$('#customField').click(function()
{
hiddenRequireFields();
+
+ var fieldList = showFields + ',';
+ var requiredList = ',' + requiredFields + ',';
+ if(lifetime == 'ops')
+ {
+ $('#fieldsstory').parent('div').addClass('hidden');
+ }
+ else if(fieldList.indexOf('story') >= 0 && requiredList.indexOf('story') < 0)
+ {
+ $('#fieldsstory').parent('div').removeClass('hidden');
+ }
});
/* Implement a custom form without feeling refresh. */
@@ -22,6 +33,17 @@ $(function()
*/
function loadAll(executionID)
{
+ lifetime = lifetimeList[executionID];
+ var fieldList = showFields + ',';
+ if(lifetime == 'ops')
+ {
+ $('.storyBox').addClass('hidden');
+ }
+ else if(fieldList.indexOf('story') >= 0)
+ {
+ $('.storyBox').removeClass('hidden');
+ }
+
loadModuleMenu(executionID);
loadExecutionStories(executionID);
loadExecutionMembers(executionID);
@@ -408,8 +430,11 @@ $(document).ready(function()
});
$('#type').change(function()
{
- $('#selectTestStoryBox').toggleClass('hidden', $(this).val() != 'test');
- toggleSelectTestStory();
+ if(lifetime != 'ops')
+ {
+ $('#selectTestStoryBox').toggleClass('hidden', $(this).val() != 'test');
+ toggleSelectTestStory();
+ }
});
setStoryRelated();
diff --git a/module/task/model.php b/module/task/model.php
index b2284e7174..05c7217e63 100644
--- a/module/task/model.php
+++ b/module/task/model.php
@@ -116,8 +116,8 @@ class taskModel extends model
$task = $this->loadModel('file')->processImgURL($task, $this->config->task->editor->create['id'], $this->post->uid);
/* Fix Bug #1525 */
- $executionType = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($executionID)->fetch('type');
- if($executionType == 'ops')
+ $executionLifetime = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($executionID)->fetch('lifetime');
+ if($executionLifetime == 'ops')
{
$requiredFields = str_replace(",story,", ',', "$requiredFields");
$task->story = 0;
@@ -381,9 +381,9 @@ class taskModel extends model
}
/* Fix bug #1525*/
- $executionType = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($executionID)->fetch('type');
+ $executionLifetime = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($executionID)->fetch('lifetime');
$requiredFields = ',' . $this->config->task->create->requiredFields . ',';
- if($executionType == 'ops') $requiredFields = str_replace(',story,', ',', $requiredFields);
+ if($executionLifetime == 'ops') $requiredFields = str_replace(',story,', ',', $requiredFields);
$requiredFields = trim($requiredFields, ',');
/* check data. */
@@ -1036,9 +1036,9 @@ class taskModel extends model
$task->mode = '';
}
- $executionType = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($task->execution)->fetch('type');
+ $executionLifetime = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($task->execution)->fetch('lifetime');
$requiredFields = "," . $this->config->task->edit->requiredFields . ",";
- if($executionType == 'ops')
+ if($executionLifetime == 'ops')
{
$requiredFields = str_replace(",story,", ',', "$requiredFields");
$task->story = 0;
@@ -3760,19 +3760,19 @@ class taskModel extends model
public function buildNestedList($execution, $task, $isChild = false, $showmore = false, $users)
{
$showmore = $showmore ? 'showmore' : '';
- $trAttrs = "data-id=$task->id";
+ $trAttrs = "data-id='t$task->id'";
if(!$isChild)
{
- $path = $execution->grade == 2 ? "$execution->parent,$execution->id,$task->id," : ",$execution->id,$task->id,";
- $trAttrs .= " data-parent=$execution->id data-nest-parent=$execution->id data-nest-path=$path";
+ $path = $execution->grade == 2 ? "$execution->parent,$execution->id,t$task->id," : ",$execution->id,t$task->id,";
+ $trAttrs .= " data-parent='$execution->id' data-nest-parent='$execution->id' data-nest-path='$path'";
if(empty($task->children)) $trAttrs .= " data-nested='false'";
$trClass = empty($task->children) ? '' : " has-nest-child";
}
else
{
- $path = $execution->grade == 2 ? "$execution->parent,$execution->id,$task->parent,$task->id," : ",$execution->id,$task->parent,$task->id,";
+ $path = $execution->grade == 2 ? "$execution->parent,$execution->id,$task->parent,t$task->id," : ",$execution->id,$task->parent,t$task->id,";
$trClass = 'is-nest-child no-nest';
- $trAttrs .= " data-nested='false' data-parent=$task->parent data-nest-parent=$task->parent data-nest-path=$path";
+ $trAttrs .= " data-nested='false' data-parent='t$task->parent' data-nest-parent='t$task->parent' data-nest-path='$path'";
}
$list = " ";
diff --git a/module/task/view/batchcreate.html.php b/module/task/view/batchcreate.html.php
index b2329a7667..abb792f986 100755
--- a/module/task/view/batchcreate.html.php
+++ b/module/task/view/batchcreate.html.php
@@ -45,7 +45,7 @@ $colspan = count($visibleFields) + 3;
task->batchCreate;?>
- type != 'ops'):?>
+ lifetime != 'ops'):?>
@@ -67,7 +67,7 @@ $colspan = count($visibleFields) + 3;
| idAB;?> |
moduleBox'>task->module?> |
- type != 'ops'):?>
+ lifetime != 'ops'):?>
storyBox'>task->story;?> |
task->name;?> |
@@ -99,7 +99,7 @@ $colspan = count($visibleFields) + 3;
$lang->task->typeList['ditto'] = $lang->task->ditto;
$members['ditto'] = $lang->task->ditto;
$modules['ditto'] = $lang->task->ditto;
- if($execution->type == 'ops') $colspan = $colspan - 1;
+ if($execution->lifetime == 'ops') $colspan = $colspan - 1;
?>
task->batchCreate; $i++):?>
id)'")?>
- type != 'ops'):?>
+ lifetime != 'ops'):?>
@@ -266,7 +266,7 @@ $colspan = count($visibleFields) + 3;
|
- type != 'ops'):?>
+ lifetime != 'ops'):?>
@@ -340,7 +340,6 @@ $colspan = count($visibleFields) + 3;
$(function()
{
parent.$('#triggerModal .modal-content .modal-header .close').hide();
- $('#closeModal').on('click', function(){window.parent.$.closeModal();});
});
diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php
index ff4ce54b29..139676690b 100644
--- a/module/task/view/create.html.php
+++ b/module/task/view/create.html.php
@@ -19,6 +19,8 @@
vision);?>
task->create->requiredFields);?>
error->notempty, $lang->task->estimate))?>
+lifetime);?>
+
diff --git a/module/testcase/view/review.html.php b/module/testcase/view/review.html.php
index 501bf72314..28e540f524 100644
--- a/module/testcase/view/review.html.php
+++ b/module/testcase/view/review.html.php
@@ -30,7 +30,7 @@
|
| testcase->reviewResultAB;?> |
- testcase->reviewResultList, '', 'class=form-control');?> | |
+ testcase->reviewResultList, '', 'class=form-control required');?> | |
| testcase->status;?> |
diff --git a/www/js/my.full.js b/www/js/my.full.js
index 0c0db4fc4b..0482f92a3c 100644
--- a/www/js/my.full.js
+++ b/www/js/my.full.js
@@ -1237,6 +1237,8 @@ function showCheckedFields(fields)
if(!$('.borderBox').hasClass('hidden')) $('.borderBox').addClass('hidden');
if(!$('.datePlanBox').hasClass('hidden')) $('.datePlanBox').addClass('hidden');
}
+
+ if(typeof lifetime != 'undefined' && lifetime == 'ops') $('.storyBox').addClass('hidden');
}
}
|