Merge branch 'sprint/185' into 'sprint/185_zhengrunyu_49283'

# Conflicts:
#   db/update16.4.sql
#   module/user/view/story.html.php
This commit is contained in:
李玉春
2022-02-23 01:33:37 +00:00
319 changed files with 11572 additions and 1545 deletions
+2
View File
@@ -78,6 +78,7 @@ $config->execution->search['fields']['finishedDate'] = $lang->task->finishedDa
$config->execution->search['fields']['closedDate'] = $lang->task->closedDate;
$config->execution->search['fields']['canceledDate'] = $lang->task->canceledDate;
$config->execution->search['fields']['lastEditedDate'] = $lang->task->lastEditedDate;
$config->execution->search['fields']['activatedDate'] = $lang->task->activatedDate;
$config->execution->search['params']['name'] = array('operator' => 'include', 'control' => 'input', 'values' => '');
$config->execution->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->task->statusList);
@@ -112,6 +113,7 @@ $config->execution->search['params']['finishedDate'] = array('operator' => '='
$config->execution->search['params']['closedDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
$config->execution->search['params']['canceledDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
$config->execution->search['params']['lastEditedDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
$config->execution->search['params']['activatedDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
$config->printKanban = new stdClass();
$config->printKanban->col['story'] = 1;
+49 -49
View File
@@ -126,7 +126,7 @@ class execution extends control
$execution = $this->commonAction($executionID, $status);
$executionID = $execution->id;
if($execution->type == 'kanban') $this->locate($this->createLink('execution', 'kanban', "executionID=$executionID"));
if($execution->type == 'kanban' and $this->config->vision != 'lite') $this->locate($this->createLink('execution', 'kanban', "executionID=$executionID"));
/* Get products by execution. */
$products = $this->product->getProductPairsByProject($executionID);
@@ -458,7 +458,7 @@ class execution extends control
if(!empty($_POST))
{
$this->execution->importTask($toExecution);
die(js::locate(inlink('importTask', "toExecution=$toExecution&fromExecution=$fromExecution"), 'parent'));
return print(js::locate(inlink('importTask', "toExecution=$toExecution&fromExecution=$fromExecution"), 'parent'));
}
$execution = $this->commonAction($toExecution);
@@ -513,9 +513,9 @@ class execution extends control
if(!empty($_POST))
{
$mails = $this->execution->importBug($executionID);
if(dao::isError()) die(js::error(dao::getError()));
if(dao::isError()) return print(js::error(dao::getError()));
die(js::locate($this->createLink('execution', 'importBug', "executionID=$executionID"), 'parent'));
return print(js::locate($this->createLink('execution', 'importBug', "executionID=$executionID"), 'parent'));
}
/* Set browseType, productID, moduleID and queryID. */
@@ -1179,7 +1179,7 @@ class execution extends control
public function computeBurn($reload = 'no')
{
$this->view->burns = $this->execution->computeBurn();
if($reload == 'yes') die(js::reload('parent'));
if($reload == 'yes') return print(js::reload('parent'));
$this->display();
}
@@ -1195,7 +1195,7 @@ class execution extends control
if($_POST)
{
$this->execution->fixFirst($executionID);
die(js::reload('parent.parent'));
return print(js::reload('parent.parent'));
}
$execution = $this->execution->getById($executionID);
@@ -1292,7 +1292,7 @@ class execution extends control
}
else
{
die(js::confirm($this->lang->execution->importPlanStory, inlink('create', "projectID=$projectID&executionID=$executionID&copyExecutionID=&planID=$planID&confirm=yes"), inlink('create', "projectID=$projectID&executionID=$executionID")));
return print(js::confirm($this->lang->execution->importPlanStory, inlink('create', "projectID=$projectID&executionID=$executionID&copyExecutionID=&planID=$planID&confirm=yes"), inlink('create', "projectID=$projectID&executionID=$executionID")));
}
}
@@ -1304,8 +1304,7 @@ class execution extends control
$this->view->executionID = $executionID;
$this->view->projectID = $projectID;
$this->view->project = $project;
$this->display();
exit;
return $this->display();
}
$name = '';
@@ -1397,6 +1396,11 @@ class execution extends control
$this->loadModel('kanban')->createRDKanban($execution);
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
$link= $this->config->vision != 'lite' ? $this->createLink('project', 'index', "projectID=$projectID") : $this->createLink('project', 'execution', "status=all&projectID=$projectID");
if($this->app->tab == 'project') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $link));
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('kanban', "executionID=$executionID")));
}
if(!empty($planID))
@@ -1657,7 +1661,7 @@ class execution extends control
$this->loadModel('common')->syncPPEStatus($syncExecution);
}
}
die(js::locate($this->session->executionList, 'parent'));
return print(js::locate($this->session->executionList, 'parent'));
}
if($this->app->tab == 'project')
@@ -1666,7 +1670,8 @@ class execution extends control
$this->view->project = $this->project->getById($this->session->project);
}
$executionIDList = $this->post->executionIDList ? $this->post->executionIDList : die(js::locate($this->session->executionList, 'parent'));
if(!$this->post->executionIDList) return print(js::locate($this->session->executionList, 'parent'));
$executionIDList = $this->post->executionIDList;
$executions = $this->dao->select('*')->from(TABLE_EXECUTION)->where('id')->in($executionIDList)->fetchAll('id');
$appendPoUsers = $appendPmUsers = $appendQdUsers = $appendRdUsers = array();
@@ -1727,7 +1732,7 @@ class execution extends control
{
$this->loadModel('action');
$changes = $this->execution->start($executionID);
if(dao::isError()) die(js::error(dao::getError()));
if(dao::isError()) return print(js::error(dao::getError()));
if($this->post->comment != '' or !empty($changes))
{
@@ -1772,7 +1777,7 @@ class execution extends control
{
$this->loadModel('action');
$changes = $this->execution->putoff($executionID);
if(dao::isError()) die(js::error(dao::getError()));
if(dao::isError()) return print(js::error(dao::getError()));
if($this->post->comment != '' or !empty($changes))
{
@@ -1816,7 +1821,7 @@ class execution extends control
{
$this->loadModel('action');
$changes = $this->execution->suspend($executionID);
if(dao::isError()) die(js::error(dao::getError()));
if(dao::isError()) return print(js::error(dao::getError()));
if($this->post->comment != '' or !empty($changes))
{
@@ -1860,7 +1865,7 @@ class execution extends control
{
$this->loadModel('action');
$changes = $this->execution->activate($executionID);
if(dao::isError()) die(js::error(dao::getError()));
if(dao::isError()) return print(js::error(dao::getError()));
if($this->post->comment != '' or !empty($changes))
{
@@ -1911,7 +1916,7 @@ class execution extends control
{
$this->loadModel('action');
$changes = $this->execution->close($executionID);
if(dao::isError()) die(js::error(dao::getError()));
if(dao::isError()) return print(js::error(dao::getError()));
if($this->post->comment != '' or !empty($changes))
{
@@ -1948,7 +1953,7 @@ class execution extends control
{
$executionID = $this->execution->saveState((int)$executionID, $this->executions);
$execution = $this->execution->getById($executionID, true);
if(empty($execution) || strpos('stage,sprint', $execution->type) === false) die(js::error($this->lang->notFound) . js::locate('back'));
if(empty($execution) || strpos('stage,sprint', $execution->type) === false) return print(js::error($this->lang->notFound) . js::locate('back'));
$this->app->loadLang('program');
@@ -2024,7 +2029,7 @@ class execution extends control
{
if($this->execution->isClickable($execution, $action)) $executionActions[] = $action;
}
$userList = array();
$users = $this->loadModel('user')->getPairs('noletter|nodeleted');
$avatarPairs = $this->user->getAvatarPairs();
@@ -2063,6 +2068,7 @@ class execution extends control
$this->view->groupBy = $groupBy;
$this->view->productID = $productID;
$this->view->branchID = $branchID;
$this->view->projectID = $this->loadModel('task')->getProjectID($execution->id);
$this->view->allPlans = $allPlans;
$this->view->kanbanData = $kanbanData;
$this->view->executionActions = $executionActions;
@@ -2252,7 +2258,7 @@ class execution extends control
$this->app->session->set('caseList', $uri, 'qa');
$this->app->session->set('bugList', $uri, 'qa');
if($type === 'json') die(helper::jsonEncode4Parse($tree, JSON_HEX_QUOT | JSON_HEX_APOS));
if($type === 'json') return print(helper::jsonEncode4Parse($tree, JSON_HEX_QUOT | JSON_HEX_APOS));
$this->view->title = $this->lang->execution->tree;
$this->view->position[] = html::a($this->createLink('execution', 'browse', "executionID=$executionID"), $execution->name);
@@ -2349,7 +2355,7 @@ class execution extends control
{
if(!empty($data)) $hasData = true;
}
if(!$hasData) die(js::alert($this->lang->execution->noPrintData) . js::close());
if(!$hasData) return print(js::alert($this->lang->execution->noPrintData) . js::close());
$this->execution->saveKanbanData($executionID, $originalDatas);
@@ -2369,8 +2375,7 @@ class execution extends control
$this->view->realnames = $this->loadModel('user')->getRealNameAndEmails($users);
$this->view->executionID = $executionID;
die($this->display());
return $this->display();
}
$this->execution->setMenu($executionID);
@@ -2459,8 +2464,7 @@ class execution extends control
include $this->app->getModulePath('', 'execution') . 'lang/' . $this->app->getClientLang() . '.php';
}
echo js::confirm($tips . sprintf($this->lang->execution->confirmDelete, $this->executions[$executionID]), $this->createLink('execution', 'delete', "executionID=$executionID&confirm=yes"));
exit;
return print(js::confirm($tips . sprintf($this->lang->execution->confirmDelete, $this->executions[$executionID]), $this->createLink('execution', 'delete', "executionID=$executionID&confirm=yes")));
}
else
{
@@ -2502,9 +2506,9 @@ class execution extends control
$executionType = $this->dao->findById($executionID)->from(TABLE_EXECUTION)->fetch('type');
if($executionType == 'stage')
{
if(!isset($_POST['products'])) die(js::alert($this->lang->execution->noLinkProduct) . js::locate($this->createLink('execution', 'manageProducts', "executionID=$executionID&from=$from")));
if(!isset($_POST['products'])) return print(js::alert($this->lang->execution->noLinkProduct) . js::locate($this->createLink('execution', 'manageProducts', "executionID=$executionID&from=$from")));
if(count($_POST['products']) > 1) die(js::alert($this->lang->execution->oneProduct) . js::locate($this->createLink('execution', 'manageProducts', "executionID=$executionID&from=$from")));
if(count($_POST['products']) > 1) return print(js::alert($this->lang->execution->oneProduct) . js::locate($this->createLink('execution', 'manageProducts', "executionID=$executionID&from=$from")));
}
$oldProducts = $this->product->getProducts($executionID);
@@ -2512,7 +2516,7 @@ class execution extends control
if($from == 'buildCreate' && $this->session->buildCreate) $browseExecutionLink = $this->session->buildCreate;
$this->execution->updateProducts($executionID);
if(dao::isError()) die(js::error(dao::getError()));
if(dao::isError()) return print(js::error(dao::getError()));
$oldProducts = array_keys($oldProducts);
$newProducts = $this->product->getProducts($executionID);
@@ -2523,7 +2527,7 @@ class execution extends control
if(isonlybody())
{
unset($_GET['onlybody']);
die(js::locate($this->createLink('build', 'create', "executionID=$executionID&productID=0&projectID=$execution->project"), 'parent'));
return print(js::locate($this->createLink('build', 'create', "executionID=$executionID&productID=0&projectID=$execution->project"), 'parent'));
}
}
@@ -2589,7 +2593,7 @@ class execution extends control
{
$this->execution->manageMembers($executionID);
$this->loadModel('action')->create('team', $executionID, 'managedTeam');
die(js::locate($this->createLink('execution', 'team', "executionID=$executionID"), 'parent'));
return print(js::locate($this->createLink('execution', 'team', "executionID=$executionID"), 'parent'));
}
/* Load model. */
@@ -2649,7 +2653,7 @@ class execution extends control
*/
public function unlinkMember($executionID, $userID, $confirm = 'no')
{
if($confirm == 'no') die(js::confirm($this->lang->execution->confirmUnlinkMember, $this->inlink('unlinkMember', "executionID=$executionID&userID=$userID&confirm=yes")));
if($confirm == 'no') return print(js::confirm($this->lang->execution->confirmUnlinkMember, $this->inlink('unlinkMember', "executionID=$executionID&userID=$userID&confirm=yes")));
$user = $this->loadModel('user')->getById($userID, 'id');
$account = $user->account;
@@ -2672,7 +2676,7 @@ class execution extends control
}
return $this->send($response);
}
die(js::locate($this->inlink('team', "executionID=$executionID"), 'parent'));
return print(js::locate($this->inlink('team', "executionID=$executionID"), 'parent'));
}
/**
@@ -2824,7 +2828,7 @@ class execution extends control
if($confirm == 'no')
{
$tip = $this->app->rawModule == 'projectstory' ? $this->lang->execution->confirmUnlinkExecutionStory : $this->lang->execution->confirmUnlinkStory;
die(js::confirm($tip, $this->createLink('execution', 'unlinkstory', "executionID=$executionID&storyID=$storyID&confirm=yes")));
return print(js::confirm($tip, $this->createLink('execution', 'unlinkstory', "executionID=$executionID&storyID=$storyID&confirm=yes")));
}
else
{
@@ -2833,7 +2837,7 @@ class execution extends control
/* if kanban then reload and if ajax request then send result. */
if(isonlybody())
{
die(js::reload('parent'));
return print(js::reload('parent'));
}
elseif(helper::isAjaxRequest())
{
@@ -2849,7 +2853,7 @@ class execution extends control
}
return $this->send($response);
}
die(js::locate($this->app->session->storyList, 'parent'));
return print(js::locate($this->app->session->storyList, 'parent'));
}
}
@@ -2878,7 +2882,7 @@ class execution extends control
}
}
if(!dao::isError()) $this->loadModel('score')->create('ajax', 'batchOther');
die(js::locate($this->createLink('execution', 'story', "executionID=$executionID")));
return print(js::locate($this->createLink('execution', 'story', "executionID=$executionID")));
}
/**
@@ -2965,7 +2969,7 @@ class execution extends control
public function ajaxGetProducts($executionID)
{
$products = $this->loadModel('product')->getProducts($executionID, 'all', '', false);
die(html::select('product', $products, '', 'class="form-control"'));
return print(html::select('product', $products, '', 'class="form-control"'));
}
/**
@@ -2981,12 +2985,12 @@ class execution extends control
$users = $this->loadModel('user')->getTeamMemberPairs($executionID, 'execution');
if($this->app->getViewType() === 'json')
{
die(json_encode($users));
return print(json_encode($users));
}
else
{
$assignedTo = isset($users[$assignedTo]) ? $assignedTo : '';
die(html::select('assignedTo', $users, $assignedTo, "class='form-control'"));
return print(html::select('assignedTo', $users, $assignedTo, "class='form-control'"));
}
}
@@ -3009,7 +3013,7 @@ class execution extends control
$users = $this->loadModel('user')->getPairs('nodeleted|noclosed');
$members = $this->user->getTeamMemberPairs($objectID, $type);
die(html::select('teamMembers[]', $users, array_keys($members), "class='form-control chosen' multiple"));
return print(html::select('teamMembers[]', $users, array_keys($members), "class='form-control chosen' multiple"));
}
/**
@@ -3409,7 +3413,7 @@ class execution extends control
}
if(common::hasPriv('execution', 'kanbanColsColor')) $this->setting->setItem("system.execution.kanbanSetting.colorList", json_encode($data->colorList));
die(js::reload('parent.parent'));
return print(js::reload('parent.parent'));
}
$this->app->loadLang('task');
@@ -3429,7 +3433,7 @@ class execution extends control
*/
public function ajaxResetKanban($executionID, $confirm = 'no')
{
if($confirm != 'yes') die(js::confirm($this->lang->kanbanSetting->noticeReset, inlink('ajaxResetKanban', "executionID=$executionID&confirm=yes")));
if($confirm != 'yes') return print(js::confirm($this->lang->kanbanSetting->noticeReset, inlink('ajaxResetKanban', "executionID=$executionID&confirm=yes")));
$this->loadModel('setting');
@@ -3445,7 +3449,7 @@ class execution extends control
if(common::hasPriv('execution', 'kanbanColsColor')) $this->setting->deleteItems("owner=system&module=execution&section=kanbanSetting&key=colorList");
die(js::reload('parent.parent'));
return print(js::reload('parent.parent'));
}
/**
@@ -3601,7 +3605,7 @@ class execution extends control
$this->app->loadLang('kanban');
$groups = array();
$groups = $this->lang->kanban->group->$type;
die(html::select("group", $groups, $group, 'class="form-control chosen" data-max_drop_width="215"'));
return print(html::select("group", $groups, $group, 'class="form-control chosen" data-max_drop_width="215"'));
}
/**
@@ -3613,7 +3617,7 @@ class execution extends control
* @param string $groupBy
* @param string $from execution|RD
* @access public
* @return array
* @return array
*/
public function ajaxUpdateKanban($executionID = 0, $enterTime = '', $browseType = '', $groupBy = '', $from = 'execution')
{
@@ -3623,11 +3627,7 @@ class execution extends control
if($lastEditedTime > $enterTime or $groupBy != 'default')
{
$kanbanGroup = $from == 'execution' ? $this->loadModel('kanban')->getExecutionKanban($executionID, $browseType, $groupBy) : $this->loadModel('kanban')->getRDKanban($executionID, $browseType, 'id_asc', 0, $groupBy);
die(json_encode($kanbanGroup));
}
else
{
die('');
return print(json_encode($kanbanGroup));
}
}
+38 -3
View File
@@ -533,7 +533,7 @@ function renderBugItem(item, $item, col)
if(scaleSize <= 1)
{
var $actions = $item.find('.actions');
if(!$actions.length && item.menus && item.menus.length)
if(!$actions.length && (priv.canEditBug || priv.canResolveBug || priv.canConfirmBug || priv.canCopyBug || priv.canToStoryBug))
{
$actions = $([
'<div class="actions">',
@@ -597,7 +597,7 @@ function renderTaskItem(item, $item, col)
if(scaleSize <= 1)
{
var $actions = $item.find('.actions');
if(!$actions.length && item.menus && item.menus.length)
if(!$actions.length && (priv.canEditTask || priv.canRecordEstimateTask || priv.canCreateTask || priv.canCancelTask))
{
$actions = $([
'<div class="actions">',
@@ -1037,12 +1037,47 @@ function processMinusBtn()
}
}
/**
* Create task menu
* @returns {Object[]}
*/
function createTaskMenu(options)
{
var $card = options.$trigger.closest('.kanban-item');
var task = $card.data('item');
var items = [];
if(priv.canEditTask) items.push({label: taskLang.edit, icon: 'edit', url: createLink('task', 'edit', 'taskID=' + task.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
if(priv.canRecordEstimateTask) items.push({label: executionLang.effort, icon: 'time', url: createLink('task', 'recordEstimate', 'taskID=' + task.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
if(priv.canCreateTask) items.push({label: taskLang.copy, icon: 'copy', url: createLink('task', 'create', 'projectID=' + projectID + '&storyID=' + '0' + '&moduleID=' + '0' + '&taskID=' + task.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
if(priv.canCancelTask) items.push({label: taskLang.cancel, icon: 'cancel', url: createLink('task', 'cancel', 'taskID=' + task.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
return items;
}
/**
* Create bug menu
* @returns {Object[]}
*/
function createBugMenu(options)
{
var $card = options.$trigger.closest('.kanban-item');
var bug = $card.data('item');
var items = [];
if(priv.canEditBug) items.push({label: bugLang.edit, icon: 'edit', url: createLink('bug', 'edit', 'bugID=' + bug.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
if(priv.canResolveBug) items.push({label: bugLang.resolve, icon: 'checked', url: createLink('bug', 'resolve', 'bugID=' + bug.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
if(priv.canConfirmBug) items.push({label: bugLang.confirmBug, icon: 'ok', url: createLink('bug', 'confirmbug', 'bugID=' + bug.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
if(priv.canCopyBug) items.push({label: bugLang.copy, icon: 'copy', url: createLink('bug', 'create', 'productID=' + productID + '&branch=' + '' + '&extras=bugID=' + bug.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
if(priv.canToStoryBug) items.push({label: bugLang.toStory, icon: 'lightbulb', url: createLink('story', 'create', 'product=' + productID + '&branch=' + '0' + '&module=' + '0' + '&story=' + '0' + '&execution=' + '0' + '&bugID=' + bug.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
return items;
}
/* Define menu creators */
window.menuCreators =
{
lane: createLaneMenu,
column: createColumnMenu,
columnCreate: createColumnCreateMenu
columnCreate: createColumnCreateMenu,
task: createTaskMenu,
bug: createBugMenu,
};
/**
+15
View File
@@ -271,6 +271,21 @@ function renderColumnCount($count, count, col)
{
var text = count + '/' + (col.limit < 0 ? '<i class="icon icon-infinite"></i>' : col.limit);
$count.html(text + '<i class="icon icon-arrow-up"></i>');
if(col.limit != -1 && col.limit < count)
{
$count.parents('.title').parent('.kanban-header-col').css('background-color', '#F6A1A1');
$count.parents('.title').find('.text').css('max-width', $count.parents('.title').width() - 200);
$count.css('color', '#E33030');
if(!$count.parent().find('.error').length) $count.parent().find('.include-last').after("<span class='error text-grey'><icon class='icon icon-help' title='" + kanbanLang.limitExceeded + "'></icon></span>");
}
else
{
$count.parents('.title').parent('.kanban-header-col').css('background-color', 'transparent');
$count.parents('.title').find('.text').css('max-width', $count.parents('.title').width() - 120);
$count.css('color', '#8B91A2');
$count.parent().find('.error').remove();
}
}
/**
+31 -17
View File
@@ -44,12 +44,12 @@ class executionModel extends model
echo(js::alert($this->lang->execution->accessDenied));
if(!$this->server->http_referer) die(js::locate(helper::createLink('execution', 'index')));
if(!$this->server->http_referer) return print(js::locate(helper::createLink('execution', 'index')));
$loginLink = $this->config->requestType == 'GET' ? "?{$this->config->moduleVar}=user&{$this->config->methodVar}=login" : "user{$this->config->requestFix}login";
if(strpos($this->server->http_referer, $loginLink) !== false) die(js::locate(helper::createLink('execution', 'index')));
if(strpos($this->server->http_referer, $loginLink) !== false) return print(js::locate(helper::createLink('execution', 'index')));
die(js::locate(helper::createLink('execution', 'all')));
return print(js::locate(helper::createLink('execution', 'all')));
}
/**
@@ -70,7 +70,7 @@ class executionModel extends model
$this->lang->execution->accessDenied = str_replace($this->lang->executionCommon, $this->lang->execution->kanban, $this->lang->execution->accessDenied);
}
if(!$this->app->user->admin and strpos(",{$this->app->user->view->sprints},", ",$executionID,") === false and !defined('TUTORIAL') and $executionID != 0) die(js::error($this->lang->execution->accessDenied) . js::locate('back'));
if(!$this->app->user->admin and strpos(",{$this->app->user->view->sprints},", ",$executionID,") === false and !defined('TUTORIAL') and $executionID != 0) return print(js::error($this->lang->execution->accessDenied) . js::locate('back'));
$executions = $this->getPairs(0, 'all', 'nocode');
if(!$executionID and $this->session->execution) $executionID = $this->session->execution;
@@ -324,7 +324,7 @@ class executionModel extends model
->setIF($this->config->systemMode == 'new', 'parent', $this->post->project)
->setIF($this->post->acl == 'open', 'whitelist', '')
->join('whitelist', ',')
->add('type', $type)
->setDefault('type', $type)
->stripTags($this->config->execution->editor->create['id'], $this->config->allowedTags)
->remove('products, workDays, delta, branch, uid, plans, teams, teamMembers, contactListMenu')
->get();
@@ -649,10 +649,10 @@ class executionModel extends model
$executions[$executionID]->{$extendField->field} = htmlSpecialString($executions[$executionID]->{$extendField->field});
$message = $this->checkFlowRule($extendField, $executions[$executionID]->{$extendField->field});
if($message) die(js::alert($message));
if($message) return print(js::alert($message));
}
}
if(dao::isError()) die(js::error(dao::getError()));
if(dao::isError()) return print(js::error(dao::getError()));
foreach($executions as $executionID => $execution)
{
@@ -671,7 +671,7 @@ class executionModel extends model
->where('id')->eq($executionID)
->limit(1)
->exec();
if(dao::isError()) die(js::error('execution#' . $executionID . dao::getError(true)));
if(dao::isError()) return print(js::error('execution#' . $executionID . dao::getError(true)));
if(!empty($execution->project) and $oldExecution->project != $execution->project)
{
@@ -1050,6 +1050,7 @@ class executionModel extends model
/* Order by status's content whether or not done */
$executions = $this->dao->select('*, IF(INSTR("done,closed", status) < 2, 0, 1) AS isDone, INSTR("doing,wait,suspended,closed", status) AS sortStatus')->from(TABLE_EXECUTION)
->where('deleted')->eq(0)
->andWhere('vision')->eq($this->config->vision)
->beginIF($type == 'all')->andWhere('type')->in('stage,sprint,kanban')->fi()
->beginIF($projectID and $this->config->systemMode == 'new')->andWhere('project')->eq($projectID)->fi()
->beginIF($type != 'all' and $this->config->systemMode == 'new')->andWhere('type')->eq($type)->fi()
@@ -2106,7 +2107,7 @@ class executionModel extends model
if(dao::isError())
{
echo js::error(dao::getError());
die(js::reload('parent'));
return print(js::reload('parent'));
}
$taskID = $this->dao->lastInsertID();
@@ -2151,7 +2152,7 @@ class executionModel extends model
$newBug->assignedTo = $task->assignedTo;
$newBug->assignedDate = $now;
$this->dao->update(TABLE_BUG)->data($newBug)->where('id')->eq($key)->exec();
if(dao::isError()) die(js::error(dao::getError()));
if(dao::isError()) return print(js::error(dao::getError()));
$changes = common::createChanges($bug, $newBug);
$actionID = $this->action->create('bug', $key, 'Assigned', '', $newBug->assignedTo);
@@ -2411,7 +2412,7 @@ class executionModel extends model
{
$executions = $this->dao->select('*')->from(TABLE_EXECUTION)->where('parent')->eq($executionID)->fetchAll('id');
$executionStories = $this->dao->select('project,story')->from(TABLE_PROJECTSTORY)->where('story')->eq($storyID)->andWhere('project')->in(array_keys($executions))->fetchAll();
if(!empty($executionStories)) die(js::alert($this->lang->execution->notAllowedUnlinkStory));
if(!empty($executionStories)) return print(js::alert($this->lang->execution->notAllowedUnlinkStory));
}
$this->dao->delete()->from(TABLE_PROJECTSTORY)->where('project')->eq($executionID)->andWhere('story')->eq($storyID)->limit(1)->exec();
@@ -3542,12 +3543,25 @@ class executionModel extends model
static $storyGroups, $taskGroups;
if(empty($storyGroups))
{
$stories = $this->dao->select('t2.*, t1.version as taskVersion')->from(TABLE_PROJECTSTORY)->alias('t1')
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id')
->where('t1.project')->eq((int)$executionID)
->andWhere('t2.deleted')->eq(0)
->orderBy('t1.`order`_desc')
->fetchAll();
if($this->config->vision == 'lite')
{
$execution = $this->getById($executionID);
$stories = $this->dao->select('t2.*, t1.version as taskVersion')->from(TABLE_PROJECTSTORY)->alias('t1')
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id')
->where('t1.project')->eq((int)$execution->project)
->andWhere('t2.deleted')->eq(0)
->orderBy('t1.`order`_desc')
->fetchAll();
}
else
{
$stories = $this->dao->select('t2.*, t1.version as taskVersion')->from(TABLE_PROJECTSTORY)->alias('t1')
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id')
->where('t1.project')->eq((int)$executionID)
->andWhere('t2.deleted')->eq(0)
->orderBy('t1.`order`_desc')
->fetchAll();
}
$storyGroups = array();
foreach($stories as $story) $storyGroups[$story->product][$story->module][$story->id] = $story;
}
+1 -1
View File
@@ -25,7 +25,7 @@
</div>
</body>
</html>
<?php exit;?>
<?php helper::end();?>
<?php endif;?>
<?php include '../../common/view/header.html.php';?>
+26 -19
View File
@@ -46,6 +46,7 @@ js::set('displayCards', $execution->displayCards);
js::set('fluidBoard', $execution->fluidBoard);
js::set('colorListLang', $lang->kanbancard->colorList);
js::set('colorList', $this->config->kanban->cardColorList);
js::set('projectID', $projectID);
$canSortRegion = commonModel::hasPriv('kanban', 'sortRegion') && count($regions) > 1;
$canEditRegion = commonModel::hasPriv('kanban', 'editRegion');
@@ -65,25 +66,31 @@ $hasBugButton = ($canCreateBug or $canBatchCreateBug);
js::set('priv',
array(
'canCreateTask' => $canCreateTask,
'canBatchCreateTask' => $canBatchCreateTask,
'canCreateBug' => $canCreateBug,
'canBatchCreateBug' => $canBatchCreateBug,
'canCreateStory' => $canCreateStory,
'canBatchCreateStory' => $canBatchCreateStory,
'canLinkStory' => $canLinkStory,
'canLinkStoryByPlan' => $canLinkStoryByPlan,
'canAssignTask' => common::hasPriv('task', 'assignto'),
'canAssignStory' => common::hasPriv('story', 'assignto'),
'canFinishTask' => common::hasPriv('task', 'finish'),
'canPauseTask' => common::hasPriv('task', 'pause'),
'canCancelTask' => common::hasPriv('task', 'cancel'),
'canCloseTask' => common::hasPriv('task', 'close'),
'canActivateTask' => common::hasPriv('task', 'activate'),
'canStartTask' => common::hasPriv('task', 'start'),
'canAssignBug' => common::hasPriv('bug', 'assignto'),
'canConfirmBug' => common::hasPriv('bug', 'confirmBug'),
'canActivateBug' => common::hasPriv('bug', 'activate')
'canCreateTask' => $canCreateTask,
'canBatchCreateTask' => $canBatchCreateTask,
'canCreateBug' => $canCreateBug,
'canBatchCreateBug' => $canBatchCreateBug,
'canCreateStory' => $canCreateStory,
'canBatchCreateStory' => $canBatchCreateStory,
'canLinkStory' => $canLinkStory,
'canLinkStoryByPlan' => $canLinkStoryByPlan,
'canAssignBug' => common::hasPriv('bug', 'assignto'),
'canConfirmBug' => common::hasPriv('bug', 'confirmBug'),
'canResolveBug' => common::hasPriv('bug', 'resolve'),
'canCopyBug' => common::hasPriv('bug', 'create'),
'canEditBug' => common::hasPriv('bug', 'edit'),
'canActivateBug' => common::hasPriv('bug', 'activate'),
'canAssignTask' => common::hasPriv('task', 'assignto'),
'canFinishTask' => common::hasPriv('task', 'finish'),
'canPauseTask' => common::hasPriv('task', 'pause'),
'canCancelTask' => common::hasPriv('task', 'cancel'),
'canCloseTask' => common::hasPriv('task', 'close'),
'canActivateTask' => common::hasPriv('task', 'activate'),
'canStartTask' => common::hasPriv('task', 'start'),
'canEditTask' => common::hasPriv('task', 'edit'),
'canRecordEstimateTask' => common::hasPriv('task', 'recordEstimate'),
'canToStoryBug' => common::hasPriv('story', 'create'),
'canAssignStory' => common::hasPriv('story', 'assignto'),
)
);
js::set('hasStoryButton', $hasStoryButton);