diff --git a/config/zentaopms.php b/config/zentaopms.php
index 2d3fe90dfa..40ec64cfce 100644
--- a/config/zentaopms.php
+++ b/config/zentaopms.php
@@ -417,7 +417,7 @@ $config->pipelineTypeList = array('gitlab', 'gogs', 'gitea', 'jenkins', 'sonarqu
$config->programPriv = new stdclass();
$config->programPriv->noSprint = array('task', 'story', 'tree', 'project', 'execution', 'build', 'bug', 'testcase', 'testreport', 'doc', 'repo', 'stakeholder', 'projectrelease', 'requirement');
$config->programPriv->scrum = array('story', 'requirement', 'productplan', 'tree', 'projectplan', 'projectstory', 'projectrelease', 'project', 'execution', 'build', 'bug', 'testcase', 'testreport', 'doc', 'repo', 'meeting', 'stakeholder', 'testtask');
-$config->programPriv->waterfall = array_merge($config->programPriv->scrum, array('task', 'workestimation', 'durationestimation', 'budget', 'programplan', 'review', 'reviewissue', 'weekly', 'cm', 'milestone', 'design', 'issue', 'risk', 'opportunity', 'measrecord', 'auditplan', 'trainplan', 'gapanalysis', 'pssp', 'researchplan', 'researchreport'));
+$config->programPriv->waterfall = array_merge($config->programPriv->scrum, array('workestimation', 'durationestimation', 'budget', 'programplan', 'review', 'reviewissue', 'weekly', 'cm', 'milestone', 'design', 'issue', 'risk', 'opportunity', 'measrecord', 'auditplan', 'trainplan', 'gapanalysis', 'pssp', 'researchplan', 'researchreport'));
$config->waterfallModules = array('workestimation', 'durationestimation', 'budget', 'programplan', 'review', 'reviewissue', 'weekly', 'cm', 'milestone', 'design', 'opportunity', 'auditplan', 'trainplan', 'gapanalysis', 'pssp', 'researchplan', 'researchreport');
diff --git a/module/bug/control.php b/module/bug/control.php
index eb6b86c45f..b0651b9bb2 100755
--- a/module/bug/control.php
+++ b/module/bug/control.php
@@ -1822,11 +1822,6 @@ class bug extends control
if(!isset($users[$assignedTo])) $assignedTo = $this->bug->getModuleOwner($bug->module, $productID);
unset($this->lang->bug->resolutionList['tostory']);
- $product = $this->loadModel('product')->getById($productID);
- $branch = $product->type == 'branch' ? ($bug->branch > 0 ? $bug->branch . ',0' : '0') : '';
- $productBugs = $this->bug->getProductBugPairs($productID, $branch);
- unset($productBugs[$bugID]);
-
$this->bug->checkBugExecutionPriv($bug);
$this->qa->setMenu($this->products, $productID, $bug->branch);
@@ -1834,7 +1829,6 @@ class bug extends control
$this->view->bug = $bug;
$this->view->users = $users;
$this->view->assignedTo = $assignedTo;
- $this->view->productBugs = $productBugs;
$this->view->executions = $this->loadModel('product')->getExecutionPairsByProduct($productID, $bug->branch ? "0,{$bug->branch}" : 0, 'id_desc', $projectID, 'stagefilter');
$this->view->builds = $this->loadModel('build')->getBuildPairs($productID, $bug->branch, 'withbranch,noreleased');
$this->view->actions = $this->action->getList('bug', $bugID);
@@ -2476,6 +2470,24 @@ class bug extends control
return print(html::select('assignedTo', $productMembers, $selectedUser, 'class="form-control"'));
}
+ /**
+ * Ajax get product bugs.
+ *
+ * @param int $productID
+ * @param int $bugID
+ * @access public
+ * @return string
+ */
+ public function ajaxGetProductBugs($productID, $bugID)
+ {
+ $product = $this->loadModel('product')->getById($productID);
+ $branch = $product->type == 'branch' ? ($bug->branch > 0 ? $bug->branch . ',0' : '0') : '';
+ $productBugs = $this->bug->getProductBugPairs($productID, $branch);
+ unset($productBugs[$bugID]);
+
+ return print(html::select('duplicateBug', $productBugs, '', "class='form-control' placeholder='{$this->lang->bug->duplicateTip}'"));
+ }
+
/**
* Ajax get project team members.
*
diff --git a/module/bug/js/common.js b/module/bug/js/common.js
index 81920153b2..59fee7d102 100644
--- a/module/bug/js/common.js
+++ b/module/bug/js/common.js
@@ -298,7 +298,7 @@ function loadProductModules(productID)
if(typeof(branch) == 'undefined') branch = 0;
if(typeof(moduleID) == 'undefined') moduleID = 0;
if(config.currentMethod == 'edit') moduleID = $('#module').val();
- link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=bug&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=&needManage=true&extra=¤tModuleID=' + moduleID);
+ link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=bug&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=&needManage=true&extra=nodeleted¤tModuleID=' + moduleID);
$('#moduleIdBox').load(link, function()
{
$(this).find('select').chosen()
diff --git a/module/bug/js/resolve.js b/module/bug/js/resolve.js
index 8afea5743c..2dc1d67371 100644
--- a/module/bug/js/resolve.js
+++ b/module/bug/js/resolve.js
@@ -2,6 +2,18 @@ function setDuplicate(resolution)
{
if(resolution == 'duplicate')
{
+ $.ajaxSettings.async = false;
+ $.get(createLink('bug', 'ajaxGetProductBugs', 'projectID=' + productID + '&bugID=' + bugID),function(data)
+ {
+ $('#duplicateBug').replaceWith(data);
+ $('#pk_duplicateBug-search').parent().parent().remove();
+ $('#duplicateBug').picker(
+ {
+ disableEmptySearch : true,
+ dropWidth : 'auto'
+ });
+ });
+ $.ajaxSettings.async = true;
$('#duplicateBugBox').show();
}
else
diff --git a/module/bug/model.php b/module/bug/model.php
index b1bc91512f..e66901ea90 100644
--- a/module/bug/model.php
+++ b/module/bug/model.php
@@ -1023,6 +1023,7 @@ class bugModel extends model
->setDefault('lastEditedBy', $this->app->user->account)
->setDefault('lastEditedDate', $now)
->setDefault('assignedDate', $now)
+ ->setDefault('mailto', '')
->stripTags($this->config->bug->editor->assignto['id'], $this->config->allowedTags)
->remove('comment,showModule')
->join('mailto', ',')
@@ -1060,6 +1061,7 @@ class bugModel extends model
->setDefault('lastEditedBy', $this->app->user->account)
->setDefault('lastEditedDate', $now)
->setDefault('assignedDate', $now)
+ ->setDefault('mailto', '')
->stripTags($this->config->bug->editor->confirmbug['id'], $this->config->allowedTags)
->remove('comment')
->join('mailto', ',')
diff --git a/module/bug/view/resolve.html.php b/module/bug/view/resolve.html.php
index 78ed516c22..b7b04261b1 100644
--- a/module/bug/view/resolve.html.php
+++ b/module/bug/view/resolve.html.php
@@ -16,6 +16,7 @@
product);
+js::set('bugID', $bug->id);
js::set('released', $lang->build->released);
?>
@@ -39,7 +40,7 @@ js::set('released', $lang->build->released);
| bug->duplicateBug;?> |
- bug->duplicateTip}'");?> |
+ bug->duplicateTip}'");?> |
| bug->resolvedBuild;?> |
diff --git a/module/common/view/successmodal.html.php b/module/common/view/successmodal.html.php
deleted file mode 100644
index 4933fc4dfa..0000000000
--- a/module/common/view/successmodal.html.php
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
diff --git a/module/execution/control.php b/module/execution/control.php
index f08c6ed378..92a51ab52a 100644
--- a/module/execution/control.php
+++ b/module/execution/control.php
@@ -282,7 +282,7 @@ class execution extends control
/* Get tasks and group them. */
if(empty($groupBy))$groupBy = 'story';
- if(($groupBy == 'story') and ($execution->type == 'ops'))$groupBy = 'status';
+ if(($groupBy == 'story') and ($execution->lifetime == 'ops')) $groupBy = 'status';
$sort = common::appendOrder($groupBy);
$tasks = $this->loadModel('task')->getExecutionTasks($executionID, $productID = 0, $status = 'all', $modules = 0, $sort);
$groupBy = str_replace('`', '', $groupBy);
@@ -2657,6 +2657,7 @@ class execution extends control
unset($this->lang->kanban->type['story']);
unset($this->lang->kanban->type['bug']);
unset($this->lang->kanban->type['all']);
+ unset($this->lang->kanban->group->task['story']);
}
if($groupBy == 'story' and $browseType == 'task' and !isset($this->lang->kanban->orderList[$orderBy])) $orderBy = 'id_asc';
diff --git a/module/execution/js/task.js b/module/execution/js/task.js
index ec899288f9..8a8d1f948f 100644
--- a/module/execution/js/task.js
+++ b/module/execution/js/task.js
@@ -41,3 +41,29 @@ function adjustTableFooter()
$('.table-footer').css({'left': 0, 'bottom': 0, 'width': 'unset'});
}
}
+
+/**
+ * Ajax refresh.
+ *
+ * @access public
+ * @return void
+ */
+function ajaxRefresh()
+{
+ var $table = $('#executionTaskForm').closest('[data-ride="table"]');
+ if($table.length)
+ {
+ var table = $table.data('zui.table');
+ if(table)
+ {
+ table.options.replaceId = 'executionTaskForm';
+ table.reload();
+ }
+ }
+ $.get(location.href, function(data)
+ {
+ var $data = $(data);
+ $('#mainMenu > div.btn-toolbar.pull-left').html($data.find('#mainMenu > div.btn-toolbar.pull-left').html());
+ if($data.find('#mainContent .main-col .table-empty-tip').length) $('#mainContent .main-col').html($data.find('#mainContent .main-col'));
+ });
+}
diff --git a/module/execution/view/grouptask.html.php b/module/execution/view/grouptask.html.php
index 87dc3aa96f..6a976a3da3 100644
--- a/module/execution/view/grouptask.html.php
+++ b/module/execution/view/grouptask.html.php
@@ -103,7 +103,7 @@
execution->groups as $key => $value):?>
type == 'ops' && $key == 'story') continue;
+ if($execution->lifetime == 'ops' && $key == 'story') continue;
$active = $key == $groupBy ? "class='active'" : '';
echo ""; common::printLink('execution', 'groupTask', "execution=$executionID&groupBy=$key", $value); echo '';
?>
diff --git a/module/execution/view/task.html.php b/module/execution/view/task.html.php
index bf70233621..36056b17a2 100644
--- a/module/execution/view/task.html.php
+++ b/module/execution/view/task.html.php
@@ -62,7 +62,7 @@ body {margin-bottom: 25px;}
common::sortFeatureMenu();
foreach(customModel::getFeatureMenu('execution', 'task') as $menuItem)
{
- if($execution->type == 'ops' && $menuItem->name == 'needconfirm') continue;
+ if($execution->lifetime == 'ops' && $menuItem->name == 'needconfirm') continue;
if(isset($menuItem->hidden)) continue;
$menuType = $menuItem->name;
if($menuType == 'QUERY')
@@ -215,7 +215,7 @@ body {margin-bottom: 25px;}
if($useDatatable) include '../../common/view/datatable.html.php';
$customFields = $this->datatable->getSetting('execution');
- if($execution->type == 'ops')
+ if($execution->lifetime == 'ops')
{
foreach($customFields as $id => $customField)
{
diff --git a/module/execution/view/taskheader.html.php b/module/execution/view/taskheader.html.php
index e7c2eea834..78dc5503ef 100644
--- a/module/execution/view/taskheader.html.php
+++ b/module/execution/view/taskheader.html.php
@@ -28,7 +28,7 @@
foreach(customModel::getFeatureMenu('execution', 'task') as $menuItem)
{
- if($execution->type == 'ops' && $menuItem->name == 'needconfirm') continue;
+ if($execution->lifetime == 'ops' && $menuItem->name == 'needconfirm') continue;
if(isset($menuItem->hidden)) continue;
$menuType = $menuItem->name;
if(strpos($menuType, 'QUERY') === 0)
@@ -74,7 +74,7 @@
foreach ($lang->execution->groups as $key => $value)
{
if($key == '') continue;
- if($execution->type == 'ops' && $key == 'story') continue;
+ if($execution->lifetime == 'ops' && $key == 'story') continue;
echo '';
common::printLink('execution', 'groupTask', "execution=$executionID&groupBy=$key", $value);
}
diff --git a/module/execution/view/treetask.html.php b/module/execution/view/treetask.html.php
index 287204f2ee..0d8a9b57c4 100644
--- a/module/execution/view/treetask.html.php
+++ b/module/execution/view/treetask.html.php
@@ -45,7 +45,7 @@
desc) ? $task->desc : "" . $lang->noData . '
';?>
-type != 'ops'):?>
+lifetime != 'ops'):?>
fromBug != 0):?>
bug->steps;?>
diff --git a/module/kanban/control.php b/module/kanban/control.php
index 1070aef18e..ad818eafd1 100644
--- a/module/kanban/control.php
+++ b/module/kanban/control.php
@@ -1197,6 +1197,7 @@ class kanban extends control
$pager = new pager($recTotal, $recPerPage, $pageID);
$productPairs = $this->product->getPairs('', 0, '', 'all');
+ $productPairs = array($this->lang->kanban->allProducts) + $productPairs;
$selectedProductID = empty($selectedProductID) ? key($productPairs) : $selectedProductID;
/* Waterfall project has no plan. */
diff --git a/module/message/model.php b/module/message/model.php
index f0191d4173..d9a2a8c564 100755
--- a/module/message/model.php
+++ b/module/message/model.php
@@ -144,7 +144,7 @@ class messageModel extends model
$table = $this->config->objectTables[$objectType];
$field = $this->config->action->objectNameFields[$objectType];
$object = $this->dao->select('*')->from($table)->where('id')->eq($objectID)->fetch();
- $toList = $this->getToList($object, $objectType);
+ $toList = $this->getToList($object, $objectType, $actionID);
if(empty($toList)) return false;
if($toList == $actor) return false;
@@ -181,10 +181,11 @@ class messageModel extends model
*
* @param object $object
* @param string $objectType
+ * @param int $actionID
* @access public
* @return string
*/
- public function getToList($object, $objectType)
+ public function getToList($object, $objectType, $actionID = 0)
{
$toList = '';
if(!empty($object->assignedTo)) $toList = $object->assignedTo;
@@ -211,6 +212,13 @@ class messageModel extends model
if($toList == 'closed') $toList = '';
if($objectType == 'feedback' and $object->status == 'replied') $toList = ',' . $object->openedBy . ',';
+ if($objectType == 'story' and $actionID)
+ {
+ $action = $this->loadModel('action')->getById($actionID);
+ list($toList, $ccList) = $this->loadModel($objectType)->getToAndCcList($object, $action->action);
+ $toList = $toList . $ccList;
+ }
+
return $toList;
}
diff --git a/module/misc/control.php b/module/misc/control.php
index b7fb0fe17b..a8ceb47dd6 100644
--- a/module/misc/control.php
+++ b/module/misc/control.php
@@ -230,6 +230,7 @@ class misc extends control
*/
public function captcha($sessionVar = 'captcha', $uuid = '')
{
+ if($sessionVar == 'user') die('The string user is not allowed to be defined as a session field.');
$obLevel = ob_get_level();
for($i = 0; $i < $obLevel; $i++) ob_end_clean();
diff --git a/module/my/control.php b/module/my/control.php
index 75e03d3233..09fbf922f7 100755
--- a/module/my/control.php
+++ b/module/my/control.php
@@ -1154,18 +1154,20 @@ EOF;
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'workFeedback');
- $storyIdList = $bugIdList = $todoIdList = $taskIdList = array();
+ $storyIdList = $bugIdList = $todoIdList = $taskIdList = $ticketIdList = array();
foreach($feedbacks as $feedback)
{
- if($feedback->solution == 'tobug') $bugIdList[] = $feedback->result;
- if($feedback->solution == 'tostory') $storyIdList[] = $feedback->result;
- if($feedback->solution == 'totodo') $todoIdList[] = $feedback->result;
- if($feedback->solution == 'totask') $taskIdList[] = $feedback->result;
+ if($feedback->solution == 'tobug') $bugIdList[] = $feedback->result;
+ if($feedback->solution == 'tostory') $storyIdList[] = $feedback->result;
+ if($feedback->solution == 'totodo') $todoIdList[] = $feedback->result;
+ if($feedback->solution == 'totask') $taskIdList[] = $feedback->result;
+ if($feedback->solution == 'ticket') $ticketIdList[] = $feedback->result;
}
- $bugs = $bugIdList ? $this->loadModel('bug')->getByList($bugIdList) : array();
- $stories = $storyIdList ? $this->loadModel('story')->getByList($storyIdList) : array();
- $todos = $todoIdList ? $this->loadModel('todo')->getByList($todoIdList) : array();
- $tasks = $taskIdList ? $this->loadModel('task')->getByList($taskIdList) : array();
+ $bugs = $bugIdList ? $this->loadModel('bug')->getByList($bugIdList) : array();
+ $stories = $storyIdList ? $this->loadModel('story')->getByList($storyIdList) : array();
+ $todos = $todoIdList ? $this->loadModel('todo')->getByList($todoIdList) : array();
+ $tasks = $taskIdList ? $this->loadModel('task')->getByList($taskIdList) : array();
+ $tickets = $ticketIdList ? $this->loadModel('ticket')->getByList($ticketIdList) : array();
$products = $this->loadModel('product')->getPairs();
@@ -1199,9 +1201,10 @@ EOF;
$this->view->todos = $todos;
$this->view->stories = $stories;
$this->view->tasks = $tasks;
+ $this->view->tickets = $tickets;
$this->view->depts = $this->loadModel('dept')->getOptionMenu();
$this->view->users = $this->loadModel('user')->getPairs('noletter|nodeleted|noclosed');
- $this->view->projects = $this->loadModel('project')->getPairsByProgram(0, 'noclosed');
+ $this->view->projects = $this->loadModel('project')->getPairsByProgram('', 'noclosed');
$this->view->allProducts = $this->dao->select('*')->from(TABLE_PRODUCT)->where('deleted')->eq('0')->fetchPairs('id', 'name');
$this->view->modulePairs = $this->tree->getModulePairs(0, 'feedback');
$this->view->modules = $this->tree->getOptionMenu(0, $viewType = 'feedback', 0);
diff --git a/module/programplan/model.php b/module/programplan/model.php
index 04fd203d96..cc18f4a942 100755
--- a/module/programplan/model.php
+++ b/module/programplan/model.php
@@ -54,14 +54,14 @@ class programplanModel extends model
{
if(empty($executionID)) return array();
- $plans = $this->dao->select('t2.*')->from(TABLE_PROJECTPRODUCT)->alias('t1')
- ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
- ->where('t2.type')->eq('stage')
- ->beginIF($productID)->andWhere('t1.product')->eq($productID)->fi()
- ->beginIF($browseType == 'all')->andWhere('t2.project')->eq($executionID)->fi()
- ->beginIF($browseType == 'parent')->andWhere('t2.parent')->eq($executionID)->fi()
- ->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->sprints)->fi()
- ->andWhere('t2.deleted')->eq('0')
+ $plans = $this->dao->select('t1.*')->from(TABLE_EXECUTION)->alias('t1')
+ ->leftJoin(TABLE_PROJECTPRODUCT)->alias('t2')->on('t1.id = t2.project')
+ ->where('t1.type')->eq('stage')
+ ->beginIF($productID)->andWhere('t2.product')->eq($productID)->fi()
+ ->beginIF($browseType == 'all')->andWhere('t1.project')->eq($executionID)->fi()
+ ->beginIF($browseType == 'parent')->andWhere('t1.parent')->eq($executionID)->fi()
+ ->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->sprints)->fi()
+ ->andWhere('t1.deleted')->eq('0')
->orderBy($orderBy)
->fetchAll('id');
diff --git a/module/project/model.php b/module/project/model.php
index ff9799ec50..2d5fedce17 100644
--- a/module/project/model.php
+++ b/module/project/model.php
@@ -827,7 +827,8 @@ class projectModel extends model
->where('type')->eq('project')
->andWhere('deleted')->eq(0)
->andWhere('vision')->eq($this->config->vision)
- ->beginIF($programID !== '')->andWhere('path')->like("%,$programID,%")->fi()
+ ->beginIF(!empty($programID))->andWhere('path')->like("%,$programID,%")->fi()
+ ->beginIF($programID === 0)->andWhere('parent')->eq(0)->fi()
->beginIF($status != 'all' and $status != 'noclosed')->andWhere('status')->eq($status)->fi()
->beginIF($excludedModel)->andWhere('model')->ne($excludedModel)->fi()
->beginIF($model)->andWhere('model')->eq($model)->fi()
diff --git a/module/repo/control.php b/module/repo/control.php
index 327adc59aa..7b2ee1892e 100644
--- a/module/repo/control.php
+++ b/module/repo/control.php
@@ -1381,9 +1381,29 @@ class repo extends control
{
$content = file($logFile);
$lastLine = $content[count($content) - 1];
+
if(!strpos($lastLine, 'done'))
{
- return print(1);
+ if(strpos($lastLine, 'empty repository') !== false)
+ {
+ @unlink($logFile);
+ }
+ elseif(strpos($lastLine, 'Total') !== false)
+ {
+ $logContent = file_get_contents($logFile);
+ if(strpos($logContent, 'Counting objects: 100%') !== false and strpos($logContent, 'Compressing objects: 100%') !== false)
+ {
+ @unlink($logFile);
+ }
+ else
+ {
+ return print(1);
+ }
+ }
+ else
+ {
+ return print(1);
+ }
}
elseif(strpos($lastLine, 'fatal') !== false)
{
diff --git a/module/repo/model.php b/module/repo/model.php
index 5ed4e397ef..29e3b8e167 100644
--- a/module/repo/model.php
+++ b/module/repo/model.php
@@ -332,9 +332,13 @@ class repoModel extends model
if($type == 'bug') $links = $this->post->bugs;
if($type == 'task') $links = $this->post->tasks;
- $revisionID = $this->dao->select('id')->from(TABLE_REPOHISTORY)->where('repo')->eq($repoID)->andWhere('revision')->eq($revision)->fetch('id');
+ $revisionInfo = $this->dao->select('*')->from(TABLE_REPOHISTORY)->where('repo')->eq($repoID)->andWhere('revision')->eq($revision)->fetch();
+ $committer = $this->dao->select('account')->from(TABLE_USER)->where('commiter')->eq($revisionInfo->committer)->fetch('account');
+ if(empty($committer)) $committer = $revisionInfo->committer;
foreach($links as $linkID)
{
+ $revisionID = $revisionInfo->id;
+
$relation = new stdclass;
$relation->AType = 'revision';
$relation->AID = $revisionID;
@@ -344,9 +348,9 @@ class repoModel extends model
$this->dao->replace(TABLE_RELATION)->data($relation)->exec();
- if($type == 'story') $this->action->create('story', $linkID, 'linked2revision', '', $revisionID);
- if($type == 'bug') $this->action->create('bug', $linkID, 'linked2revision', '', $revisionID);
- if($type == 'task') $this->action->create('task', $linkID, 'linked2revision', '', $revisionID);
+ if($type == 'story') $this->action->create('story', $linkID, 'linked2revision', '', $revisionID, $committer);
+ if($type == 'bug') $this->action->create('bug', $linkID, 'linked2revision', '', $revisionID, $committer);
+ if($type == 'task') $this->action->create('task', $linkID, 'linked2revision', '', $revisionID, $committer);
}
}
diff --git a/module/repo/view/ajaxgeteditorcontent.html.php b/module/repo/view/ajaxgeteditorcontent.html.php
index b99f92b8ec..feb143dfbe 100644
--- a/module/repo/view/ajaxgeteditorcontent.html.php
+++ b/module/repo/view/ajaxgeteditorcontent.html.php
@@ -47,7 +47,7 @@ js::import($jsRoot . 'monaco-editor/min/vs/loader.js');
-
+
@@ -135,12 +134,10 @@ function getRelation(commit)
}
$('.table-empty-tip').hide();
- $('#unlink').show();
$('#related button').show();
}
else
{
- $('#unlink').hide();
if(!canLinkStory && !canLinkBug && !canLinkTask) $('#related button').hide();
}
@@ -157,6 +154,16 @@ function getRelation(commit)
$('#related').show();
}
+
+$('#relationTabs').on('onLoad', function(event, tab) {
+ var objectInfo = tab.id.split('-');
+ objectID = objectInfo[0];
+ objectType = objectInfo[1];
+ unlink = createLink('repo', 'unlink', 'repoID=' + repoID + '&commit=' + globalCommit + '&objectID=' + objectID + '&objectType=' + objectType);
+ $('#relationTabs ul li[data-id=' + tab.id + '] span.title').after('
');
+});
+
+
/**
* Set tab data.
*
@@ -331,7 +338,7 @@ $(function()
parent.loadLinkPage(link);
});
- $('#unlink a').on('click', function()
+ $('#relationTabs').on('click', '.unlinks',function()
{
var link = $(this).attr('data-link');
$.post(link, function(data)
@@ -352,11 +359,6 @@ $(function()
{
$('#tab-nav-item-' + tab.id).attr('title', tab.title);
- var objectInfo = tab.id.split('-');
- objectID = objectInfo[0];
- objectType = objectInfo[1];
- $('#unlink a').attr('data-link', createLink('repo', 'unlink', 'repoID=' + repoID + '&commit=' + globalCommit + '&objectID=' + objectID + '&objectType=' + objectType));
-
var relatedHeight = codeHeight / 5 * 2 - $('#log').height() - 45;
$('#relationTabs iframe').css('height', relatedHeight);
});
diff --git a/module/repo/view/linkbug.html.php b/module/repo/view/linkbug.html.php
index d2c7650410..f3fbefc7a9 100644
--- a/module/repo/view/linkbug.html.php
+++ b/module/repo/view/linkbug.html.php
@@ -15,6 +15,7 @@
diff --git a/module/repo/view/linkstory.html.php b/module/repo/view/linkstory.html.php
index 9cd9d0cc0a..4fd4a6b133 100644
--- a/module/repo/view/linkstory.html.php
+++ b/module/repo/view/linkstory.html.php
@@ -15,6 +15,7 @@
diff --git a/module/repo/view/linktask.html.php b/module/repo/view/linktask.html.php
index 0256b43a5b..7d21568668 100644
--- a/module/repo/view/linktask.html.php
+++ b/module/repo/view/linktask.html.php
@@ -15,6 +15,7 @@
diff --git a/module/story/control.php b/module/story/control.php
index 443d827e39..014eb38c1f 100755
--- a/module/story/control.php
+++ b/module/story/control.php
@@ -389,7 +389,7 @@ class story extends control
foreach($this->config->story->fromObjects[$fromObjectIDKey]['fields'] as $storyField => $fromObjectField)
{
- $$storyField = $fromObject->{$fromObjectField};
+ $storyField = $fromObject->{$fromObjectField};
}
}
@@ -1052,6 +1052,7 @@ class story extends control
unset($stories[$id]);
}
if(!empty($twins)) echo js::alert(sprintf($this->lang->story->batchEditTip, $twins));
+ if(empty($stories)) return print(js::locate($this->session->storyList));
$this->loadModel('branch');
if($productID and !$executionID)
@@ -2457,6 +2458,7 @@ class story extends control
$this->view->type = $type;
$this->view->stories2Link = $stories2Link;
$this->view->users = $this->loadModel('user')->getPairs('noletter');
+ $this->view->storyType = $storyType;
$this->display();
}
diff --git a/module/story/js/batchedit.js b/module/story/js/batchedit.js
index 5a92791404..7a16ff6e67 100644
--- a/module/story/js/batchedit.js
+++ b/module/story/js/batchedit.js
@@ -31,7 +31,7 @@ function loadBranches(product, branch, storyID)
if(!branch) branch = 0;
var currentModuleID = $('#modules' + storyID).val();
- moduleLink = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + product + '&viewtype=story&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=' + storyID + '&needManage=false&extra=¤tModuleID=' + currentModuleID);
+ moduleLink = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + product + '&viewtype=story&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=' + storyID + '&needManage=false&extra=nodeleted¤tModuleID=' + currentModuleID);
$('#modules' + storyID).parent('td').load(moduleLink, function(){$('#modules' + storyID).chosen();});
planID = $('#plans' + storyID).val();
diff --git a/module/story/js/create.js b/module/story/js/create.js
index f1b15d12d4..939934970a 100644
--- a/module/story/js/create.js
+++ b/module/story/js/create.js
@@ -59,6 +59,12 @@ $(function()
return false;
});
+ $('#product').on('change', function(){
+ var productID = $('#product').val();
+ var viewLink = createLink('story', 'create', 'productID=' + productID + '&branch=all');
+ self.location.href = viewLink;
+ });
+
$('#module').on('change', function(){
loadURS();
});
@@ -287,7 +293,7 @@ function loadModuleForTwins(productID, branch, branchIndex)
{
/* Load module */
var currentModule = 0;
- var moduleLink = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=' + branchIndex + '&needManage=false&extra=¤tModuleID=' + currentModule);
+ var moduleLink = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=' + branchIndex + '&needManage=false&extra=nodeleted¤tModuleID=' + currentModule);
if(branchIndex > 0)
{
var $moduleIDBox = $('.addBranchesBox'+ branchIndex +' #moduleIdBox');
diff --git a/module/story/model.php b/module/story/model.php
index cf705af348..e676929965 100644
--- a/module/story/model.php
+++ b/module/story/model.php
@@ -352,7 +352,7 @@ class storyModel extends model
if($executionID != 0)
{
$this->linkStory($executionID, $this->post->product, $storyID);
- if($this->config->systemMode == 'new' and $executionID != $this->session->project) $this->linkStory($this->session->project, $this->post->product, $storyID);
+ if($this->config->systemMode == 'ALM' and $executionID != $this->session->project) $this->linkStory($this->session->project, $this->post->product, $storyID);
$this->loadModel('kanban');
@@ -603,6 +603,11 @@ class storyModel extends model
if(is_array($story->{$extendField->field})) $story->{$extendField->field} = join(',', $story->{$extendField->field});
$story->{$extendField->field} = htmlSpecialString($story->{$extendField->field});
+ if(empty($story->{$extendField->field}))
+ {
+ dao::$errors[] = sprintf($this->lang->error->notempty, $extendField->name);
+ return false;
+ }
}
foreach(explode(',', $this->config->story->create->requiredFields) as $field)
@@ -6039,7 +6044,7 @@ class storyModel extends model
if($result == 'reject')
{
$now = helper::now();
- $reason = (empty($reason) and isset($story->closedReason)) ? $story->closedReason : $reason;
+ $reason = (!empty($story->closedReason)) ? $story->closedReason : $reason;
$story->status = 'closed';
$story->closedBy = $this->app->user->account;
diff --git a/module/story/view/header.html.php b/module/story/view/header.html.php
index 6b6835039c..d014cb0b45 100644
--- a/module/story/view/header.html.php
+++ b/module/story/view/header.html.php
@@ -191,7 +191,7 @@ function loadProductModules(productID, branch)
currentModule = $('#module').val();
}
- var moduleLink = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=&needManage=true&extra=¤tModuleID=' + currentModule);
+ var moduleLink = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=&needManage=true&extra=nodeleted¤tModuleID=' + currentModule);
var $moduleIDBox = $('#moduleIdBox');
$moduleIDBox.load(moduleLink, function()
{
diff --git a/module/story/view/linkstory.html.php b/module/story/view/linkstory.html.php
index 3c5fb388fe..9142415c91 100644
--- a/module/story/view/linkstory.html.php
+++ b/module/story/view/linkstory.html.php
@@ -24,6 +24,13 @@
+
+
+
+ story->noRequirement : $lang->story->noStory;?>
+
+
+