Merge branch 'sprint/182_tianshujie_47336' into kanban
This commit is contained in:
@@ -11,6 +11,9 @@ $config->execution->list->exportFields = 'id,name,projectName,code,PM,end,status
|
||||
|
||||
$config->execution->modelList['scrum'] = 'sprint';
|
||||
$config->execution->modelList['waterfall'] = 'stage';
|
||||
$config->execution->modelList['kanban'] = 'kanban';
|
||||
|
||||
$config->execution->statusActions = array('start', 'putoff', 'suspend', 'close', 'activate');
|
||||
|
||||
global $lang, $app;
|
||||
$app->loadLang('task');
|
||||
|
||||
@@ -1397,6 +1397,7 @@ class execution extends control
|
||||
$this->loadModel('kanban')->createRDKanban($execution);
|
||||
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
if($this->app->tab == 'project') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('project', 'index', "projectID=$projectID")));
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('kanban', "executionID=$executionID")));
|
||||
}
|
||||
|
||||
@@ -1476,6 +1477,7 @@ class execution extends control
|
||||
$this->app->loadLang('stage');
|
||||
$this->app->loadLang('programplan');
|
||||
$browseExecutionLink = $this->createLink('execution', 'browse', "executionID=$executionID");
|
||||
$execution = $this->execution->getById($executionID);
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
@@ -1527,6 +1529,7 @@ class execution extends control
|
||||
|
||||
$this->executeHooks($executionID);
|
||||
if($_POST['status'] == 'doing') $this->loadModel('common')->syncPPEStatus($executionID);
|
||||
if($execution->type == 'kanban') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "executionID=$executionID")));
|
||||
}
|
||||
|
||||
@@ -1534,7 +1537,6 @@ class execution extends control
|
||||
$this->execution->setMenu($executionID);
|
||||
|
||||
$executions = array('' => '') + $this->executions;
|
||||
$execution = $this->execution->getById($executionID);
|
||||
$managers = $this->execution->getDefaultManagers($executionID);
|
||||
|
||||
$project = $this->project->getByID($execution->project);
|
||||
@@ -1721,6 +1723,7 @@ class execution extends control
|
||||
{
|
||||
$execution = $this->commonAction($executionID);
|
||||
$executionID = $execution->id;
|
||||
if($execution->type == 'kanban') $this->lang->executionCommon = $this->lang->execution->kanban;
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
@@ -1793,6 +1796,7 @@ class execution extends control
|
||||
{
|
||||
$execution = $this->commonAction($executionID);
|
||||
$executionID = $execution->id;
|
||||
if($execution->type == 'kanban') $this->lang->executionCommon = $this->lang->execution->kanban;
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
@@ -1828,6 +1832,7 @@ class execution extends control
|
||||
{
|
||||
$execution = $this->commonAction($executionID);
|
||||
$executionID = $execution->id;
|
||||
if($execution->type == 'kanban') $this->lang->executionCommon = $this->lang->execution->kanban;
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
@@ -1870,6 +1875,7 @@ class execution extends control
|
||||
{
|
||||
$execution = $this->commonAction($executionID);
|
||||
$executionID = $execution->id;
|
||||
if($execution->type == 'kanban') $this->lang->executionCommon = $this->lang->execution->kanban;
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
@@ -1967,13 +1973,18 @@ class execution extends control
|
||||
*/
|
||||
public function kanban($executionID, $browseType = 'all', $orderBy = 'id_asc', $groupBy = 'all')
|
||||
{
|
||||
unset($this->lang->execution->menu);
|
||||
$this->lang->execution->menu = new stdclass();
|
||||
$execution = $this->commonAction($executionID);
|
||||
$kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $browseType, $orderBy, $groupBy);
|
||||
$executionActions = array();
|
||||
|
||||
$users = $this->loadModel('user')->getPairs('noletter|nodeleted');
|
||||
$kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $browseType, $orderBy, $groupBy);
|
||||
$execution = $this->execution->getById($executionID);
|
||||
foreach($this->config->execution->statusActions as $action)
|
||||
{
|
||||
if($this->execution->isClickable($execution, $action)) $executionActions[] = $action;
|
||||
}
|
||||
|
||||
$userList = array();
|
||||
$users = $this->loadModel('user')->getPairs('noletter|nodeleted');
|
||||
$avatarPairs = $this->dao->select('account, avatar')->from(TABLE_USER)->where('deleted')->eq(0)->fetchPairs();
|
||||
foreach($avatarPairs as $account => $avatar)
|
||||
{
|
||||
@@ -1993,16 +2004,17 @@ class execution extends control
|
||||
foreach($plans as $plan) $allPlans += $plan;
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->kanban->view;
|
||||
$this->view->users = $users;
|
||||
$this->view->regions = $kanbanData;
|
||||
$this->view->execution = $execution;
|
||||
$this->view->userList = $userList;
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->groupBy = $groupBy;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->allPlans = $allPlans;
|
||||
$this->view->title = $this->lang->kanban->view;
|
||||
$this->view->users = $users;
|
||||
$this->view->regions = $kanbanData;
|
||||
$this->view->execution = $execution;
|
||||
$this->view->userList = $userList;
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->groupBy = $groupBy;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->allPlans = $allPlans;
|
||||
$this->view->executionActions = $executionActions;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -2397,6 +2409,7 @@ class execution extends control
|
||||
else
|
||||
{
|
||||
/* Delete execution. */
|
||||
$execution = $this->execution->getByID($executionID);
|
||||
$this->dao->update(TABLE_EXECUTION)->set('deleted')->eq(1)->where('id')->eq($executionID)->exec();
|
||||
$this->loadModel('action')->create('execution', $executionID, 'deleted', '', ACTIONMODEL::CAN_UNDELETED);
|
||||
$this->execution->updateUserView($executionID);
|
||||
@@ -2405,7 +2418,8 @@ class execution extends control
|
||||
$this->executeHooks($executionID);
|
||||
|
||||
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess));
|
||||
die(js::reload('parent'));
|
||||
if($execution->type == 'kanban') return print(js::locate($this->createLink('execution', 'all'), 'parent'));
|
||||
return print(js::reload('parent'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2959,7 +2973,7 @@ class execution extends control
|
||||
$projects = $this->loadModel('program')->getProjectList(0, 'all', 0, 'order_asc', null, 0, 0, true);
|
||||
$executionGroups = $this->dao->select('*')->from(TABLE_EXECUTION)
|
||||
->where('deleted')->eq(0)
|
||||
->andWhere('type')->in('sprint,stage')
|
||||
->andWhere('type')->in('sprint,stage,kanban')
|
||||
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->sprints)->fi()
|
||||
->beginIF($this->config->systemMode == 'new')->andWhere('project')->in(array_keys($projects))->fi()
|
||||
->orderBy('id_desc')
|
||||
|
||||
@@ -108,3 +108,4 @@
|
||||
#kanbanScaleControl > .input-group-btn:first-child > .btn {border-radius: 16px 0 0 16px; border-right-color: transparent;}
|
||||
#kanbanScaleControl > .input-group-btn:last-child > .btn {border-radius: 0 16px 16px 0; border-left-color: transparent;}
|
||||
#kanbanScaleControl > .input-group-btn > .btn:hover {border-color: #b8bfce;}
|
||||
#kanbanActionMenu {top: 24px; right: 28px;}
|
||||
|
||||
@@ -65,7 +65,7 @@ class executionModel extends model
|
||||
{
|
||||
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'));
|
||||
|
||||
$executions = $this->loadModel('execution')->getPairs(0, 'all', 'nocode');
|
||||
$executions = $this->getPairs(0, 'all', 'nocode');
|
||||
if(!$executionID and $this->session->execution) $executionID = $this->session->execution;
|
||||
if(!$executionID or !in_array($executionID, array_keys($executions))) $executionID = key($executions);
|
||||
$this->session->set('execution', $executionID);
|
||||
@@ -1054,7 +1054,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)
|
||||
->beginIF($type == 'all')->andWhere('type')->in('stage,sprint')->fi()
|
||||
->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()
|
||||
->beginIF(strpos($mode, 'withdelete') === false)->andWhere('deleted')->eq(0)->fi()
|
||||
@@ -1319,7 +1319,7 @@ class executionModel extends model
|
||||
$module = 'execution';
|
||||
$method = 'task';
|
||||
}
|
||||
if($module == 'testcase' and ($method == 'view' || $method == 'edit' || $method == 'batchedit'))
|
||||
if($module == 'testcase' and ($method == 'view' or $method == 'edit' or $method == 'batchedit'))
|
||||
{
|
||||
$module = 'execution';
|
||||
$method = 'testcase';
|
||||
@@ -1329,7 +1329,7 @@ class executionModel extends model
|
||||
$module = 'execution';
|
||||
$method = 'testtask';
|
||||
}
|
||||
if($module == 'build' and ($method == 'edit' || $method= 'view'))
|
||||
if($module == 'build' and ($method == 'edit' or $method == 'view'))
|
||||
{
|
||||
$module = 'execution';
|
||||
$method = 'build';
|
||||
@@ -3038,7 +3038,9 @@ class executionModel extends model
|
||||
*/
|
||||
public static function isClickable($execution, $action)
|
||||
{
|
||||
$action = strtolower($action);
|
||||
$action = strtolower($action);
|
||||
$clickable = commonModel::hasPriv('execution', $action);
|
||||
if(!$clickable) return false;
|
||||
|
||||
if($action == 'start') return $execution->status == 'wait';
|
||||
if($action == 'close') return $execution->status != 'closed';
|
||||
|
||||
@@ -75,6 +75,11 @@ foreach($executions as $projectID => $projectExecutions)
|
||||
$selected = $execution->id == $executionID ? 'selected' : '';
|
||||
if($execution->status != 'done' and $execution->status != 'closed' and ($execution->PM == $this->app->user->account or isset($execution->teams[$this->app->user->account])))
|
||||
{
|
||||
$kanbanLink = $this->createLink('execution', 'kanban', "executionID=%s");
|
||||
$taskLink = $this->createLink('execution', 'task', "executionID=%s");
|
||||
if($execution->type != 'kanban' and $link == $kanbanLink) $link = $taskLink;
|
||||
if($execution->type == 'kanban' and $link != $kanbanLink) $link = $kanbanLink;
|
||||
|
||||
$myExecutionsHtml .= '<li>' . html::a(sprintf($link, $execution->id), $execution->name, '', "class='$selected executionName' title='{$execution->name}' data-key='" . zget($executionsPinYin, $execution->name, '') . "' data-app='{$this->app->tab}'") . '</li>';
|
||||
|
||||
if($selected == 'selected') $tabActive = 'myExecution';
|
||||
|
||||
@@ -91,6 +91,39 @@ js::set('hasTaskButton', $hasTaskButton);
|
||||
<button class='btn btn-icon' type='button' data-type='+'><i class='icon icon-plus-solid-circle text-muted'></i></button>
|
||||
</span>
|
||||
</div>
|
||||
<div class='btn-toolbar pull-right'>
|
||||
<?php
|
||||
echo html::a('javascript:fullScreen()', "<i class='icon-fullscreen muted'></i> " . $lang->kanban->fullScreen, '', "class='btn btn-link'");
|
||||
$actions = '';
|
||||
$printSettingBtn = (common::hasPriv('kanban', 'createRegion') or (common::hasPriv('kanban', 'setLaneHeight')) or common::hasPriv('execution', 'edit') or common::hasPriv('execution', 'close') or common::hasPriv('execution', 'delete') or !empty($executionActions));
|
||||
|
||||
if($printSettingBtn)
|
||||
{
|
||||
$actions .= html::a('javascript:;', "<i class='icon icon-cog-outline'></i>" . $lang->kanban->setting, '', "data-toggle='dropdown' class='btn btn-link'");
|
||||
$actions .= "<ul id='kanbanActionMenu' class='dropdown-menu pull-right'>";
|
||||
$width = $this->app->getClientLang() == 'en' ? '70%' : '60%';
|
||||
if(common::hasPriv('kanban', 'createRegion')) $actions .= '<li>' . html::a(helper::createLink('kanban', 'createRegion', "kanbanID=$execution->id", '', true), '<i class="icon icon-plus"></i>' . $lang->kanban->createRegion, '', "class='iframe btn btn-link'") . '</li>';
|
||||
if(common::hasPriv('kanban', 'setLaneHeight')) $actions .= '<li>' . html::a(helper::createLink('kanban', 'setLaneHeight', "kanbanID=$execution->id&from=execution", '', true), '<i class="icon icon-size-height"></i>' . $lang->kanban->laneHeight, '', "class='iframe btn btn-link' data-width=$width") . '</li>';
|
||||
$kanbanActions = '';
|
||||
if(common::hasPriv('execution', 'edit')) $kanbanActions .= '<li>' . html::a(helper::createLink('execution', 'edit', "executionID=$execution->id", '', true), '<i class="icon icon-edit"></i>' . $lang->kanban->edit, '', "class='iframe btn btn-link' data-width='75%'") . '</li>';
|
||||
if(in_array('start', $executionActions)) $kanbanActions .= '<li>' . html::a(helper::createLink('execution', 'start', "executionID=$execution->id", '', true), '<i class="icon icon-play"></i>' . $lang->execution->start, '', "class='iframe btn btn-link text-left' data-width='75%'") . '</li>';
|
||||
if(in_array('putoff', $executionActions)) $kanbanActions .= '<li>' . html::a(helper::createLink('execution', 'putoff', "executionID=$execution->id", '', true), '<i class="icon icon-calendar"></i>' . $lang->execution->putoff, '', "class='iframe btn btn-link text-left' data-width='75%'") . '</li>';
|
||||
if(in_array('suspend', $executionActions)) $kanbanActions .= '<li>' . html::a(helper::createLink('execution', 'suspend', "executionID=$execution->id", '', true), '<i class="icon icon-pause"></i>' . $lang->execution->suspend, '', "class='iframe btn btn-link text-left' data-width='75%'") . '</li>';
|
||||
if(in_array('close', $executionActions)) $kanbanActions .= '<li>' . html::a(helper::createLink('execution', 'close', "executionID=$execution->id", '', true), '<i class="icon icon-off"></i>' . $lang->execution->close, '', "class='iframe btn btn-link text-left' data-width='75%'") . '</li>';
|
||||
if(in_array('activate', $executionActions)) $kanbanActions .= '<li>' . html::a(helper::createLink('execution', 'activate', "executionID=$execution->id", '', true), '<i class="icon icon-magic"></i>' . $lang->execution->activate, '', "class='iframe btn btn-link text-left' data-width='75%'") . '</li>';
|
||||
if(common::hasPriv('execution', 'delete')) $kanbanActions .= '<li>' . html::a(helper::createLink('execution', 'delete', "executionID=$execution->id"), '<i class="icon icon-trash"></i>' . $lang->delete, 'hiddenwin', "class='btn btn-link text-left'") . '</li>';
|
||||
if($kanbanActions)
|
||||
{
|
||||
$actions .= ((common::hasPriv('kanban', 'createRegion') or common::hasPriv('kanban', 'setLaneHeight')) and (common::hasPriv('execution', 'edit') or common::hasPriv('execution', 'delete') or !empty($executionActions))) ? "<div class='divider'></div>" . $kanbanActions : $kanbanActions;
|
||||
}
|
||||
$actions .= "</ul>";
|
||||
}
|
||||
|
||||
$actions .= "</div>";
|
||||
|
||||
echo $actions;
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class='panel' id='kanbanContainer'>
|
||||
<div class='panel-body'>
|
||||
|
||||
@@ -479,7 +479,8 @@ class kanban extends control
|
||||
|
||||
$kanban = $from == 'execution' ? $this->loadModel('execution')->getByID($kanbanID) : $this->kanban->getByID($kanbanID);
|
||||
|
||||
$this->view->heightType = $kanban->displayCards > 2 ? 'custom' : 'auto';
|
||||
$this->view->heightType = $kanban->displayCards > 2 ? 'custom' : 'auto';
|
||||
$this->view->displayCards = $kanban->displayCards ? $kanban->displayCards : '';
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
</tr>
|
||||
<tr class="hidden" id='cardBox'>
|
||||
<th class='c-count'><?php echo $lang->kanban->cardCount;?></th>
|
||||
<td><?php echo html::input('displayCards', '', "class='form-control' required placeholder='{$lang->kanban->cardCountTip}' autocomplete='off'");?></td>
|
||||
<td><?php echo html::input('displayCards', $displayCards, "class='form-control' required placeholder='{$lang->kanban->cardCountTip}' autocomplete='off'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2' class='text-center form-actions'>
|
||||
|
||||
@@ -586,8 +586,7 @@ class project extends control
|
||||
}
|
||||
}
|
||||
|
||||
$canChangeModel = $this->project->checkCanChangeModel($projectID, $project->model);
|
||||
$disableModel = $canChangeModel == true ? '' : 'disabled';
|
||||
if($project->model != 'kanban') $canChangeModel = $this->project->checkCanChangeModel($projectID, $project->model);
|
||||
|
||||
$this->view->title = $this->lang->project->edit;
|
||||
$this->view->position[] = $this->lang->project->edit;
|
||||
@@ -614,7 +613,7 @@ class project extends control
|
||||
$this->view->availableBudget = $this->program->getBudgetLeft($parentProject) + (float)$project->budget;
|
||||
$this->view->budgetUnitList = $this->project->getBudgetUnitList();
|
||||
$this->view->model = $project->model;
|
||||
$this->view->disableModel = $disableModel;
|
||||
$this->view->disableModel = (isset($canChangeModel) and $canChangeModel == true) ? '' : 'disabled';
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -1836,7 +1836,7 @@ class projectModel extends model
|
||||
|
||||
$executions = $this->dao->select('t1.*,t2.name projectName, t2.model as projectModel')->from(TABLE_EXECUTION)->alias('t1')
|
||||
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
|
||||
->where('t1.type')->in('sprint,stage')
|
||||
->where('t1.type')->in('sprint,stage,kanban')
|
||||
->beginIF($projectID != 0)->andWhere('t1.project')->eq($projectID)->fi()
|
||||
->beginIF(!empty($myExecutionIDList))->andWhere('t1.id')->in(array_keys($myExecutionIDList))->fi()
|
||||
->beginIF($status == 'undone')->andWhere('t1.status')->notIN('done,closed')->fi()
|
||||
|
||||
@@ -34,10 +34,12 @@
|
||||
</div>
|
||||
<form class='form-indicator main-form form-ajax' method='post' target='hiddenwin' id='dataform'>
|
||||
<table class='table table-form'>
|
||||
<?php if($project->model != 'kanban'):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->project->model;?></th>
|
||||
<td><?php echo html::select('model', $lang->project->modelList, $model, "class='form-control chosen' required $disableModel");?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
<th class='w-120px'><?php echo $lang->program->parent;?></th>
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user