Merge branch 'zentaopms_9.8' of https://github.com/easysoft/zentaopms into zentaopms_9.8
This commit is contained in:
@@ -115,14 +115,34 @@ class custom extends control
|
||||
{
|
||||
foreach($_POST['keys'] as $index => $key)
|
||||
{
|
||||
/* Fix bug #942. */
|
||||
if(!empty($key)) $key = trim($key);
|
||||
if($field == 'priList' and !is_numeric($key) or $key > 255) die(js::alert($this->lang->custom->notice->priListKey));
|
||||
if($module == 'bug' and $field == 'severityList' and !is_numeric($key)) die(js::alert($this->lang->custom->notice->severityListKey));
|
||||
if(!empty($key) and $key != 'n/a' and !validater::checkREG($key, '/^[a-z_0-9]+$/')) die(js::alert($this->lang->custom->notice->keyList));
|
||||
/* Invalid key. It should be numbers. (It includes severityList in bug module and priList in stroy, task, bug, testcasea, testtask and todo module.) */
|
||||
if($field == 'priList' or $field == 'severityList')
|
||||
{
|
||||
if(!is_numeric($key) or $key > 255) die(js::alert($this->lang->custom->notice->invalidNumberKey));
|
||||
}
|
||||
if(!empty($key) and $key != 'n/a' and !validater::checkREG($key, '/^[a-z_0-9]+$/')) die(js::alert($this->lang->custom->notice->invalidStringKey));
|
||||
|
||||
/* the length of role is 20, check it when save. */
|
||||
if($module == 'user' and $field == 'roleList' and strlen($key) > 10) die(js::alert($this->lang->custom->notice->userRole));
|
||||
/* The length of role is 10, check it when saved. */
|
||||
if($field == 'roleList' or $module == 'todo' and $field == 'typeList')
|
||||
{
|
||||
if(strlen($key) > 10) die(js::alert($this->lang->custom->notice->invalidStrlen['ten']));
|
||||
}
|
||||
|
||||
/* The length of these string is litter than 20, check it when saved. */
|
||||
if($field == 'sourceList' or $module == 'task' and $field == 'typeList')
|
||||
{
|
||||
if(strlen($key) > 20) die(js::alert($this->lang->custom->notice->invalidStrlen['twenty']));
|
||||
}
|
||||
|
||||
/* The length of stageList is 255, check it when saved. */
|
||||
if($module == 'testcase' and $field == 'stageList' and strlen($key) > 255) die(js::alert($this->lang->custom->notice->invalidStrlen['twoHundred']));
|
||||
|
||||
/* The length of these string is litter than 30, check it when saved. */
|
||||
if($module == 'bug' or $field == 'reasonList' or $module == 'testcase')
|
||||
{
|
||||
if(strlen($key) > 30) die(js::alert($this->lang->custom->notice->invalidStrlen['thirty']));
|
||||
}
|
||||
}
|
||||
|
||||
$lang = $_POST['lang'];
|
||||
|
||||
@@ -83,18 +83,22 @@ $lang->custom->allLang = 'All Language';
|
||||
$lang->custom->confirmRestore = 'Do you want to reset to Default?';
|
||||
|
||||
$lang->custom->notice = new stdclass();
|
||||
$lang->custom->notice->userRole = 'Key must be no more than 10 characters!';
|
||||
$lang->custom->notice->canNotAdd = 'These items are parameters of calculation, so customized creation is not enabled.';
|
||||
$lang->custom->notice->forceReview = '%s Review is required for certain submitters.';
|
||||
$lang->custom->notice->forceNotReview = "%s Review is NOT required for certain submitters.";
|
||||
$lang->custom->notice->longlife = 'Define shelved bugs.';
|
||||
$lang->custom->notice->priListKey = 'Priority list key should be a natural and not greater than 255.';
|
||||
$lang->custom->notice->keyList = 'The key should be a combination of lowercase English letters, numbers or underscores';
|
||||
$lang->custom->notice->severityListKey = 'Bug severity list key should be numbers.';
|
||||
$lang->custom->notice->invalidNumberKey = 'Priority list key should be a natural and not greater than 255.';
|
||||
$lang->custom->notice->invalidStringKey = 'The key should be a combination of lowercase English letters, numbers or underscores';
|
||||
|
||||
$lang->custom->notice->indexPage['product'] = "ZenTao 8.2+ has Product Homepage. Do you want to go to Product Homepage?";
|
||||
$lang->custom->notice->indexPage['project'] = "ZenTao 8.2+ has Project Homepage. Do you want to go to Project Homepage?";
|
||||
$lang->custom->notice->indexPage['qa'] = "ZenTao 8.2+ has QA Homepage. Do you want to go to QA Homepage?";
|
||||
|
||||
$lang->custom->notice->invalidStrlen['ten'] = 'The length of the key must be less than 10 characters.';
|
||||
$lang->custom->notice->invalidStrlen['twenty'] = 'The length of the key must be less than 20 characters.';
|
||||
$lang->custom->notice->invalidStrlen['thirty'] = 'The length of the key must be less than 30 characters.';
|
||||
$lang->custom->notice->invalidStrlen['twoHundred'] = 'The length of the key must be less than 225 characters.';
|
||||
|
||||
$lang->custom->storyReview = 'Review';
|
||||
$lang->custom->forceReview = 'Selective Review';
|
||||
$lang->custom->forceNotReview = 'No review';
|
||||
|
||||
@@ -83,17 +83,21 @@ $lang->custom->allLang = '适用所有语言';
|
||||
$lang->custom->confirmRestore = '是否要恢复默认配置?';
|
||||
|
||||
$lang->custom->notice = new stdclass();
|
||||
$lang->custom->notice->userRole = '键的长度必须小于10个字符!';
|
||||
$lang->custom->notice->canNotAdd = '该项参与运算,不提供自定义添加功能';
|
||||
$lang->custom->notice->forceReview = "指定人提交的%s必须评审。";
|
||||
$lang->custom->notice->forceNotReview = "指定人提交的%s不需要评审。";
|
||||
$lang->custom->notice->longlife = 'Bug列表页面的久未处理标签中,列出设置天数之前未处理的Bug。';
|
||||
$lang->custom->notice->priListKey = '优先级的键应当为不大于255的自然数';
|
||||
$lang->custom->notice->keyList = '键值应当为小写英文字母、数字或下划线的组合';
|
||||
$lang->custom->notice->severityListKey = 'Bug严重程度的键应当为数字!';
|
||||
$lang->custom->notice->indexPage['product'] = "从8.2版本起增加了产品主页视图,是否默认进入产品主页?";
|
||||
$lang->custom->notice->indexPage['project'] = "从8.2版本起增加了项目主页视图,是否默认进入项目主页?";
|
||||
$lang->custom->notice->indexPage['qa'] = "从8.2版本起增加了测试主页视图,是否默认进入测试主页?";
|
||||
$lang->custom->notice->canNotAdd = '该项参与运算,不提供自定义添加功能';
|
||||
$lang->custom->notice->forceReview = "指定人提交的%s必须评审。";
|
||||
$lang->custom->notice->forceNotReview = "指定人提交的%s不需要评审。";
|
||||
$lang->custom->notice->longlife = 'Bug列表页面的久未处理标签中,列出设置天数之前未处理的Bug。';
|
||||
$lang->custom->notice->invalidNumberKey = '键值应为不大于255的数字';
|
||||
$lang->custom->notice->invalidStringKey = '键值应当为小写英文字母、数字或下划线的组合';
|
||||
|
||||
$lang->custom->notice->indexPage['product'] = "从8.2版本起增加了产品主页视图,是否默认进入产品主页?";
|
||||
$lang->custom->notice->indexPage['project'] = "从8.2版本起增加了项目主页视图,是否默认进入项目主页?";
|
||||
$lang->custom->notice->indexPage['qa'] = "从8.2版本起增加了测试主页视图,是否默认进入测试主页?";
|
||||
|
||||
$lang->custom->notice->invalidStrlen['ten'] = '键的长度必须小于10个字符!';
|
||||
$lang->custom->notice->invalidStrlen['twenty'] = '键的长度必须小于20个字符!';
|
||||
$lang->custom->notice->invalidStrlen['thirty'] = '键的长度必须小于30个字符!';
|
||||
$lang->custom->notice->invalidStrlen['twoHundred'] = '键的长度必须小于225个字符!';
|
||||
|
||||
$lang->custom->storyReview = '评审流程';
|
||||
$lang->custom->forceReview = '强制评审';
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
$config->product = new stdclass();
|
||||
$config->product->orderBy = 'isClosed,order_desc';
|
||||
|
||||
$config->product->customBatchEditFields = 'PO,QD,RD,status,type,desc';
|
||||
$config->product->customBatchEditFields = 'line,PO,QD,RD,status,type,desc';
|
||||
|
||||
$config->product->custom = new stdclass();
|
||||
$config->product->custom->batchEditFields = 'PO,QD,RD,status';
|
||||
$config->product->custom->batchEditFields = 'line,PO,QD,RD,status';
|
||||
|
||||
$config->product->list = new stdclass();
|
||||
$config->product->list->exportFields = 'id,name,line,activeStories,changedStories,draftStories,closedStories,plans,releases,bugs,unResolvedBugs,assignToNullBugs';
|
||||
|
||||
@@ -273,7 +273,7 @@ class product extends control
|
||||
|
||||
$this->product->setMenu($this->products, $productID);
|
||||
|
||||
$product = $this->product->getStatByID($productID);
|
||||
$product = $this->product->getById($productID);
|
||||
$this->view->title = $this->lang->product->edit . $this->lang->colon . $product->name;
|
||||
$this->view->position[] = html::a($this->createLink($this->moduleName, 'browse'), $product->name);
|
||||
$this->view->position[] = $this->lang->product->edit;
|
||||
@@ -390,7 +390,7 @@ class product extends control
|
||||
{
|
||||
$this->product->setMenu($this->products, $productID);
|
||||
|
||||
$product = $this->product->getStatByID($productID);
|
||||
$product = $this->product->getStatByID($productID);
|
||||
$product->desc = $this->loadModel('file')->setImgSize($product->desc);
|
||||
if(!$product) die(js::error($this->lang->notFound) . js::locate('back'));
|
||||
|
||||
|
||||
@@ -383,7 +383,7 @@ class productModel extends model
|
||||
$products[$productID]->QD = $data->QDs[$productID];
|
||||
$products[$productID]->RD = $data->RDs[$productID];
|
||||
$products[$productID]->type = $data->types[$productID];
|
||||
$products[$productID]->line = $data->line[$productID];
|
||||
$products[$productID]->line = $data->lines[$productID];
|
||||
$products[$productID]->status = $data->statuses[$productID];
|
||||
$products[$productID]->desc = strip_tags($this->post->descs[$productID], $this->config->allowedTags);
|
||||
$products[$productID]->order = $data->orders[$productID];
|
||||
|
||||
@@ -42,7 +42,7 @@ foreach(explode(',', $this->config->product->edit->requiredFields) as $field)
|
||||
<th class='w-id'> <?php echo $lang->idAB;?></th>
|
||||
<th><?php echo $lang->product->name;?> <span class='required'></span></th>
|
||||
<th class='w-150px'><?php echo $lang->product->code;?> <span class='required'></span></th>
|
||||
<th class='w-150px'>
|
||||
<th class='w-150px<?php if(!isset($visibleFields['line'])) echo ' hidden';?>'>
|
||||
<?php echo $lang->product->line;?>
|
||||
<?php if(isset($requiredFields['line'])) echo " <span class='required'></span>";?>
|
||||
</th>
|
||||
@@ -78,7 +78,7 @@ foreach(explode(',', $this->config->product->edit->requiredFields) as $field)
|
||||
<td><?php echo sprintf('%03d', $productID) . html::hidden("productIDList[$productID]", $productID);?></td>
|
||||
<td title='<?php echo $products[$productID]->name?>'><?php echo html::input("names[$productID]", $products[$productID]->name, "class='form-control' autocomplete='off'");?></td>
|
||||
<td><?php echo html::input("codes[$productID]", $products[$productID]->code, "class='form-control' autocomplete='off'");?></td>
|
||||
<td class='text-left<?php echo zget($lines, $products[$productID]->line, '')?>' style='overflow:visible'><?php echo html::select("line[$productID]", $lines, $products[$productID]->line, "class='form-control chosen'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'line', ' hidden')?>' style='overflow:visible'><?php echo html::select("lines[$productID]", $lines, $products[$productID]->line, "class='form-control chosen'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'PO', ' hidden')?>' style='overflow:visible'><?php echo html::select("POs[$productID]", $poUsers, $products[$productID]->PO, "class='form-control chosen'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'QD', ' hidden')?>' style='overflow:visible'><?php echo html::select("QDs[$productID]", $qdUsers, $products[$productID]->QD, "class='form-control chosen'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'RD', ' hidden')?>' style='overflow:visible'><?php echo html::select("RDs[$productID]", $rdUsers, $products[$productID]->RD, "class='form-control chosen'");?></td>
|
||||
@@ -88,7 +88,7 @@ foreach(explode(',', $this->config->product->edit->requiredFields) as $field)
|
||||
<td><?php echo html::input("orders[$productID]", $products[$productID]->order, "class='form-control' autocomplete='off'");?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
<tr><td colspan='<?php echo count($visibleFields) + 5?>' class='text-center'><?php echo html::submitButton();?></td></tr>
|
||||
<tr><td colspan='<?php echo count($visibleFields) + 4?>' class='text-center'><?php echo html::submitButton();?></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php $customLink = $this->createLink('custom', 'ajaxSaveCustomFields', 'module=product§ion=custom&key=batchEditFields')?>
|
||||
|
||||
@@ -225,21 +225,23 @@ class task extends control
|
||||
$position[] = $this->lang->task->common;
|
||||
$position[] = $this->lang->task->batchCreate;
|
||||
|
||||
if($isChildren) $this->view->parentTitle = $this->dao->select('name')->from(TABLE_TASK)->where('id')->eq($taskID)->fetch('name');
|
||||
|
||||
$this->view->title = $title;
|
||||
$this->view->position = $position;
|
||||
$this->view->project = $project;
|
||||
$this->view->stories = $stories;
|
||||
$this->view->modules = $modules;
|
||||
$this->view->parent = $taskID;
|
||||
$this->view->storyID = $storyID;
|
||||
$this->view->isChildren = $isChildren;
|
||||
$this->view->storyID = $storyID;
|
||||
$this->view->story = $this->story->getByID($storyID);
|
||||
$this->view->storyTasks = $this->task->getStoryTaskCounts(array_keys($stories), $projectID);
|
||||
$this->view->members = $members;
|
||||
$this->view->moduleID = $moduleID;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Common actions of task module.
|
||||
*
|
||||
@@ -1086,8 +1088,7 @@ class task extends control
|
||||
{
|
||||
$story = $this->dao->select('story')->from(TABLE_TASK)->where('id')->eq($taskID)->fetch('story');
|
||||
$this->task->delete(TABLE_TASK, $taskID);
|
||||
$this->task->updateParentStatus($task->parent, 'done');
|
||||
$this->task->computeWorkingHours($task->parent);
|
||||
if($task->parent) $this->task->updateParentStatus($task->id);
|
||||
if($task->fromBug != 0) $this->dao->update(TABLE_BUG)->set('toTask')->eq(0)->where('id')->eq($task->fromBug)->exec();
|
||||
if($story) $this->loadModel('story')->setStage($story);
|
||||
die(js::locate($this->session->taskList, 'parent'));
|
||||
|
||||
@@ -14,4 +14,6 @@
|
||||
#taskPlanCol, #mailCol {width: 50%}
|
||||
#planAndMailCell.has-mail-col #taskPlanCol {padding-right: 5px;}
|
||||
#planAndMailCell.has-mail-col #taskPlanCol + #mailCol {padding-left: 5px;}
|
||||
.input-group-addon input[type='checkBox']{}
|
||||
.input-group-addon input[type='checkBox']{}
|
||||
|
||||
#modalTeam .modal-content{padding:8px 25px;}
|
||||
|
||||
@@ -3,3 +3,6 @@
|
||||
#finishedDate.form-control.form-date {width: 218px!important}
|
||||
#canceledDate.form-control.form-date {width: 218px!important}
|
||||
#closedDate.form-control.form-date {width: 218px!important}
|
||||
|
||||
#modalTeam .modal-content{padding:8px 25px;}
|
||||
#modalTeam .modal-content .table{border:none;}
|
||||
|
||||
+88
-55
@@ -280,7 +280,7 @@ class taskModel extends model
|
||||
{
|
||||
$estimate += $task->estimate;
|
||||
$consumed += $task->consumed;
|
||||
$left += $task->left;
|
||||
if($task->status != 'closed') $left += $task->left;
|
||||
}
|
||||
|
||||
$newTask = new stdClass();
|
||||
@@ -293,40 +293,66 @@ class taskModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* Check that all children's status.
|
||||
* Update parent status by taskID.
|
||||
*
|
||||
* @param $parentID
|
||||
* @param $status
|
||||
* @param $taskID
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function updateParentStatus($parentID, $status = 'done')
|
||||
public function updateParentStatus($taskID)
|
||||
{
|
||||
if(!$parentID) return true;
|
||||
$children = $this->dao->select('id,status')->from(TABLE_TASK)->where('parent')->eq($parentID)->andWhere('deleted')->eq(0)->fetchPairs('id', 'status');
|
||||
$childTask = $this->dao->select('*')->from(TABLE_TASK)->where('id')->eq($taskID)->fetch();
|
||||
$parentID = $childTask->parent;
|
||||
if(empty($parentID)) return true;
|
||||
|
||||
$changeStatus = true;
|
||||
foreach($children as $taskStatus)
|
||||
$childrenStatus = $this->dao->select('id,status')->from(TABLE_TASK)->where('parent')->eq($parentID)->andWhere('deleted')->eq(0)->fetchPairs('status', 'status');
|
||||
$status = '';
|
||||
if(isset($childrenStatus['doing']))
|
||||
{
|
||||
if($status == 'done' and $taskStatus != $status and $taskStatus != 'closed' and $taskStatus != 'cancel') $changeStatus = false;
|
||||
if($status != 'done' and $taskStatus != $status) $changeStatus = false;
|
||||
|
||||
$status = 'doing';
|
||||
}
|
||||
if($changeStatus)
|
||||
elseif(isset($childrenStatus['pause']) and !isset($childrenStatus['wait']))
|
||||
{
|
||||
$status = 'pause';
|
||||
}
|
||||
elseif(isset($childrenStatus['done']) and !isset($childrenStatus['wait']))
|
||||
{
|
||||
$status = 'done';
|
||||
}
|
||||
elseif(isset($childrenStatus['closed']) and !isset($childrenStatus['wait']))
|
||||
{
|
||||
$status = 'closed';
|
||||
}
|
||||
elseif(isset($childrenStatus['cancel']) and !isset($childrenStatus['wait']))
|
||||
{
|
||||
$status = 'cancel';
|
||||
}
|
||||
|
||||
$parentTask = $this->dao->select('*')->from(TABLE_TASK)->where('id')->eq($parentID)->fetchAll();
|
||||
if($status and $parentTask->status != $status)
|
||||
{
|
||||
$parentTask = $this->dao->select('*')->from(TABLE_TASK)->where('id')->eq($parentID)->fetchAll();
|
||||
$now = helper::now();
|
||||
$task = new stdclass();
|
||||
$task->status = $status;
|
||||
if($status == 'done')
|
||||
{
|
||||
$task->assignedTo = $parent->openedBy;
|
||||
$task->assignedTo = $parentTask->openedBy;
|
||||
$task->assignedDate = $now;
|
||||
$task->finishedBy = $this->app->user->account;
|
||||
$task->finishedDate = $now;
|
||||
}
|
||||
|
||||
if($status == 'cancel')
|
||||
{
|
||||
$task->assignedTo = $parentTask->openedBy;
|
||||
$task->assignedDate = $now;
|
||||
$task->finishedBy = '';
|
||||
$task->finishedDate = '';
|
||||
$task->canceledBy = $this->app->user->account;
|
||||
$task->canceledDate = $now;
|
||||
}
|
||||
|
||||
if($status == 'closed')
|
||||
{
|
||||
$task->assignedTo = 'closed';
|
||||
@@ -334,7 +360,34 @@ class taskModel extends model
|
||||
$task->closedBy = $this->app->user->account;
|
||||
$task->closedDate = $now;
|
||||
}
|
||||
|
||||
if($status == 'doing')
|
||||
{
|
||||
$task->assignedTo = '';
|
||||
$task->assignedDate = '';
|
||||
$task->finishedBy = '';
|
||||
$task->finishedDate = '';
|
||||
$task->closedBy = '';
|
||||
$task->closedDate = '';
|
||||
}
|
||||
|
||||
$task->lastEditedBy = $this->app->user->account;
|
||||
$task->lastEditedDate = $now;
|
||||
$this->dao->update(TABLE_TASK)->data($task)->where('id')->eq($parentID)->exec();
|
||||
if(!dao::isError())
|
||||
{
|
||||
$this->computeWorkingHours($parentID);
|
||||
$changes = common::createChanges($parentTask, $task);
|
||||
$action = 'Canceled';
|
||||
if($status == 'done') $action = 'Finished';
|
||||
if($status == 'closed') $action = 'Closed';
|
||||
if($status == 'pause') $action = 'Paused';
|
||||
if($status == 'doing' and $parentTask->status == 'wait') $action = 'Started';
|
||||
if($status == 'doing' and $parentTask->status == 'pause') $action = 'Restarted';
|
||||
if($status == 'doing' and $parentTask->status != 'wait' and $parentTask->status != 'pause') $action = 'Activated';
|
||||
$actionID = $this->loadModel('action')->create('task', $parentID, $action);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -443,7 +496,7 @@ class taskModel extends model
|
||||
->batchCheckIF($task->closedReason == 'cancel', 'finishedBy, finishedDate', 'empty')
|
||||
->where('id')->eq((int)$taskID)->exec();
|
||||
|
||||
$this->computeWorkingHours($oldTask->parent);
|
||||
if($oldTask->parent) $this->updateParentStatus($taskID);
|
||||
|
||||
/* Save team. */
|
||||
$this->dao->delete()->from(TABLE_TEAM)->where('root')->eq($taskID)->andWhere('type')->eq('task')->exec();
|
||||
@@ -617,7 +670,7 @@ class taskModel extends model
|
||||
if($oldTask->story != false) $this->loadModel('story')->setStage($oldTask->story);
|
||||
if(!dao::isError())
|
||||
{
|
||||
$this->computeWorkingHours($oldTask->parent);
|
||||
if($oldTask->parent) $this->updateParentStatus($oldTask->id);
|
||||
if($task->status == 'done') $this->loadModel('score')->create('task', 'finish', $taskID);
|
||||
if($task->status == 'closed') $this->loadModel('score')->create('task', 'close', $taskID);
|
||||
$allChanges[$taskID] = common::createChanges($oldTask, $task);
|
||||
@@ -761,20 +814,7 @@ class taskModel extends model
|
||||
->check('consumed,left', 'float')
|
||||
->where('id')->eq((int)$taskID)->exec();
|
||||
|
||||
if($oldTask->parent)
|
||||
{
|
||||
if($task->status == 'doing')
|
||||
{
|
||||
$this->dao->update(TABLE_TASK)->set('status')->eq('doing')->where('id')->eq((int)$oldTask->parent)->exec();
|
||||
}
|
||||
elseif($task->status == 'done')
|
||||
{
|
||||
$this->updateParentStatus($oldTask->parent, 'done');
|
||||
}
|
||||
}
|
||||
|
||||
$this->computeWorkingHours($oldTask->parent);
|
||||
|
||||
if($oldTask->parent) $this->updateParentStatus($taskID);
|
||||
if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story);
|
||||
if(!dao::isError()) return common::createChanges($oldTask, $task);
|
||||
}
|
||||
@@ -935,14 +975,9 @@ class taskModel extends model
|
||||
$changes = common::createChanges($oldTask, $newTask);
|
||||
if(!empty($actionID)) $this->action->logHistory($actionID, $changes);
|
||||
|
||||
if($task->parent)$this->updateParentStatus($task->id);
|
||||
if($task->story) $this->loadModel('story')->setStage($task->story);
|
||||
|
||||
if($task->status == 'done')
|
||||
{
|
||||
$this->updateParentStatus($task->parent, 'done');
|
||||
if(!dao::isError()) $this->loadModel('score')->create('task', 'finish', $taskID);
|
||||
}
|
||||
$this->computeWorkingHours($task->parent);
|
||||
if($task->status == 'done' and !dao::isError()) $this->loadModel('score')->create('task', 'finish', $taskID);
|
||||
|
||||
return $changes;
|
||||
}
|
||||
@@ -1037,9 +1072,7 @@ class taskModel extends model
|
||||
->where('id')->eq((int)$taskID)
|
||||
->exec();
|
||||
|
||||
if($task->status == 'done') $this->updateParentStatus($oldTask->parent, 'done');
|
||||
$this->computeWorkingHours($oldTask->parent);
|
||||
|
||||
if($oldTask->parent) $this->updateParentStatus($taskID);
|
||||
if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story);
|
||||
if($task->status == 'done' && !dao::isError()) $this->loadModel('score')->create('task', 'finish', $taskID);
|
||||
if(!dao::isError()) return common::createChanges($oldTask, $task);
|
||||
@@ -1065,6 +1098,7 @@ class taskModel extends model
|
||||
|
||||
$this->dao->update(TABLE_TASK)->data($task)->autoCheck()->where('id')->eq((int)$taskID)->exec();
|
||||
|
||||
if($oldTask->parent) $this->updateParentStatus($taskID);
|
||||
if(!dao::isError()) return common::createChanges($oldTask, $task);
|
||||
}
|
||||
|
||||
@@ -1093,15 +1127,11 @@ class taskModel extends model
|
||||
->get();
|
||||
|
||||
$this->dao->update(TABLE_TASK)->data($task)->autoCheck()->where('id')->eq((int)$taskID)->exec();
|
||||
$this->updateParentStatus($oldTask->parent, 'closed');
|
||||
$this->computeWorkingHours($oldTask->parent);
|
||||
|
||||
$this->dao->update(TABLE_TASK)->data($task)->autoCheck()->where('parent')->eq($taskID)->exec();
|
||||
|
||||
if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story);
|
||||
|
||||
if(!dao::isError())
|
||||
{
|
||||
if($oldTask->parent) $this->updateParentStatus($taskID);
|
||||
if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story);
|
||||
$this->loadModel('score')->create('task', 'close', $taskID);
|
||||
return common::createChanges($oldTask, $task);
|
||||
}
|
||||
@@ -1132,9 +1162,8 @@ class taskModel extends model
|
||||
->get();
|
||||
|
||||
$this->dao->update(TABLE_TASK)->data($task)->autoCheck()->where('id')->eq((int)$taskID)->exec();
|
||||
$this->updateParentStatus($oldTask->parent);
|
||||
$this->computeWorkingHours($oldTask->parent);
|
||||
if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story);
|
||||
if($oldTask->parent) $this->updateParentStatus($taskID);
|
||||
if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story);
|
||||
if(!dao::isError()) return common::createChanges($oldTask, $task);
|
||||
}
|
||||
|
||||
@@ -1171,11 +1200,8 @@ class taskModel extends model
|
||||
->where('id')->eq((int)$taskID)
|
||||
->exec();
|
||||
|
||||
$this->dao->update(TABLE_TASK)->data($task)->where('parent')->eq($taskID)->exec();
|
||||
if($oldTask->parent) $this->dao->update(TABLE_TASK)->data($task)->where('id')->eq((int)$oldTask->parent)->exec();
|
||||
$this->computeWorkingHours($oldTask->parent);
|
||||
|
||||
if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story);
|
||||
if($oldTask->parent) $this->updateParentStatus($taskID);
|
||||
if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story);
|
||||
if(!dao::isError()) return common::createChanges($oldTask, $task);
|
||||
}
|
||||
|
||||
@@ -1575,6 +1601,8 @@ class taskModel extends model
|
||||
}
|
||||
|
||||
$this->dao->update(TABLE_TASK)->data($data)->where('id')->eq($task->id)->exec();
|
||||
if($task->parent) $this->updateParentStatus($task->id);
|
||||
if($task->story) $this->loadModel('story')->setStage($oldTask->story);
|
||||
|
||||
$oldTask = new stdClass();
|
||||
$oldTask->consumed = $task->consumed;
|
||||
@@ -1612,6 +1640,8 @@ class taskModel extends model
|
||||
->set('status')->eq($task->status)
|
||||
->where('id')->eq($estimate->task)
|
||||
->exec();
|
||||
if($task->parent) $this->updateParentStatus($task->id);
|
||||
if($task->story) $this->loadModel('story')->setStage($oldTask->story);
|
||||
|
||||
$oldTask = new stdClass();
|
||||
$oldTask->consumed = $task->consumed;
|
||||
@@ -2047,6 +2077,9 @@ class taskModel extends model
|
||||
if($action == 'finish' and !empty($task->children)) return false;
|
||||
if($action == 'cancel' and !empty($task->children)) return false;
|
||||
if($action == 'pause' and !empty($task->children)) return false;
|
||||
if($action == 'activate' and !empty($task->children)) return false;
|
||||
if($action == 'assignto' and !empty($task->children)) return false;
|
||||
if($action == 'close' and !empty($task->children)) return false;
|
||||
if($action == 'batchcreate' and !empty($task->team)) return false;
|
||||
if($action == 'batchcreate' and $task->parent) return false;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<div id='titlebar'>
|
||||
<div class='heading'>
|
||||
<span class='prefix'><?php echo html::icon($lang->icons['task']);?></span>
|
||||
<strong><small class='text-muted'><?php echo html::icon($lang->icons['batchCreate']);?></small> <?php echo $isChildren ? $lang->task->batchCreateChildren : $lang->task->batchCreate;?></strong>
|
||||
<strong><small class='text-muted'><?php echo html::icon($lang->icons['batchCreate']);?></small> <?php echo $isChildren ? $parentTitle . ' ' . $lang->task->batchCreateChildren : $lang->task->batchCreate;?></strong>
|
||||
<?php if($project->type != 'ops'):?><span><small><a href='javascript:toggleZeroTaskStory();' id='zeroTaskStory'><?php echo $lang->story->zeroTask;?><i class='icon icon-remove'></i></a></small></span><?php endif;?>
|
||||
<div class='actions'>
|
||||
<?php echo html::commonButton($lang->pasteText, "data-toggle='myModal'", 'btn btn-primary')?>
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
<th class='w-90px'> <?php echo $lang->task->status;?></th>
|
||||
<th class='w-50px visible-lg'><?php echo $lang->task->consumedAB . $lang->task->lblHour;?></th>
|
||||
<th class='w-50px visible-lg'><?php echo $lang->task->leftAB . $lang->task->lblHour;?></th>
|
||||
<th class='w-150px'><?php echo $lang->actions;?></th>
|
||||
<th class='w-160px'><?php echo $lang->actions;?></th>
|
||||
</tr>
|
||||
<?php foreach($task->children as $child):?>
|
||||
<tr class='text-center'>
|
||||
@@ -137,14 +137,15 @@
|
||||
<td class='visible-lg'><?php echo $child->consumed;?></td>
|
||||
<td class='visible-lg'><?php echo $child->left;?></td>
|
||||
<td>
|
||||
<?php
|
||||
common::printIcon('task', 'assignTo', "projectID=$child->project&taskID=$child->id", $child, 'list', '', '', 'iframe', true);
|
||||
common::printIcon('task', 'start', "taskID=$child->id", $child, 'list', '', '', 'iframe', true);
|
||||
common::printIcon('task', 'recordEstimate', "taskID=$child->id", $child, 'list', 'time', '', 'iframe', true);
|
||||
common::printIcon('task', 'finish', "taskID=$child->id", $child, 'list', '', '', 'iframe', true);
|
||||
common::printIcon('task', 'close', "taskID=$child->id", $child, 'list', '', '', 'iframe', true);
|
||||
common::printIcon('task', 'edit',"taskID=$child->id", $child, 'list');
|
||||
?>
|
||||
<?php
|
||||
common::printIcon('task', 'assignTo', "projectID=$child->project&taskID=$child->id", $child, 'list', '', '', 'iframe', true);
|
||||
common::printIcon('task', 'start', "taskID=$child->id", $child, 'list', '', '', 'iframe', true);
|
||||
common::printIcon('task', 'activate', "taskID=$child->id", $child, 'list', '', '', 'iframe', true);
|
||||
common::printIcon('task', 'recordEstimate', "taskID=$child->id", $child, 'list', 'time', '', 'iframe', true);
|
||||
common::printIcon('task', 'finish', "taskID=$child->id", $child, 'list', '', '', 'iframe', true);
|
||||
common::printIcon('task', 'close', "taskID=$child->id", $child, 'list', '', '', 'iframe', true);
|
||||
common::printIcon('task', 'edit',"taskID=$child->id", $child, 'list');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
|
||||
@@ -764,7 +764,7 @@ class upgradeModel extends model
|
||||
public function execSQL($sqlFile)
|
||||
{
|
||||
$mysqlVersion = $this->loadModel('install')->getMysqlVersion();
|
||||
$ignoreCode = '|1050|1060|1062|1091|1169|1061|';
|
||||
$ignoreCode = '|1050|1060|1091|1061|';
|
||||
|
||||
/* Read the sql file to lines, remove the comment lines, then join theme by ';'. */
|
||||
$sqls = explode("\n", file_get_contents($sqlFile));
|
||||
|
||||
Reference in New Issue
Block a user