Merge branch 'sprint/206_liumengyi_58288' of https://gitlab.zcorp.cc/easycorp/zentaopms into liu
This commit is contained in:
@@ -1498,6 +1498,7 @@ class execution extends control
|
||||
}
|
||||
}
|
||||
|
||||
$this->app->loadLang('kanban');
|
||||
$this->loadModel('user');
|
||||
$poUsers = $this->user->getPairs('noclosed|nodeleted|pofirst', '', $this->config->maxCount);
|
||||
if(!empty($this->config->user->moreLink)) $this->config->moreLinks["PM"] = $this->config->user->moreLink;
|
||||
@@ -1700,6 +1701,7 @@ class execution extends control
|
||||
}
|
||||
|
||||
$this->loadModel('user');
|
||||
$this->loadModel('kanban');
|
||||
$poUsers = $this->user->getPairs('noclosed|nodeleted|pofirst', $execution->PO, $this->config->maxCount);
|
||||
if(!empty($this->config->user->moreLink)) $this->config->moreLinks["PM"] = $this->config->user->moreLink;
|
||||
|
||||
@@ -1737,6 +1739,11 @@ class execution extends control
|
||||
$this->view->branchGroups = $this->execution->getBranchByProduct(array_keys($linkedProducts), $this->config->systemMode == 'new' ? $execution->project : 0, 'noclosed', $linkedBranchList);
|
||||
$this->view->teamMembers = $this->execution->getTeamMembers($executionID);
|
||||
if($this->config->systemMode == 'new') $this->view->allProjects = $this->project->getPairsByModel($project->model, 0, 'noclosed', $project->id);
|
||||
|
||||
$this->view->laneCount = $this->kanban->getLaneCount($executionID, $execution->model);
|
||||
$this->view->heightType = $execution->displayCards > 2 ? 'custom' : 'auto';
|
||||
$this->view->displayCards = $execution->displayCards ? $execution->displayCards : '';
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -274,3 +274,15 @@ $(function()
|
||||
adjustProductBoxMargin();
|
||||
adjustPlanBoxMargin();
|
||||
});
|
||||
|
||||
/**
|
||||
* Set card count.
|
||||
*
|
||||
* @param string $heightType
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setCardCount(heightType)
|
||||
{
|
||||
heightType != 'custom' ? $('#cardBox').addClass('hidden') : $('#cardBox').removeClass('hidden');
|
||||
}
|
||||
|
||||
@@ -5,6 +5,9 @@ function setCopyProject(executionID)
|
||||
|
||||
$(function()
|
||||
{
|
||||
var heightType = $("[name='heightType']:checked").val();
|
||||
setCardCount(heightType);
|
||||
|
||||
$('#copyProjects a').click(function(){setCopyProject($(this).data('id')); $('#copyProjectModal').modal('hide')});
|
||||
$('#begin').on('change', function()
|
||||
{
|
||||
|
||||
@@ -37,6 +37,9 @@ $().ready(function()
|
||||
|
||||
$(function()
|
||||
{
|
||||
var heightType = $("[name='heightType']:checked").val();
|
||||
setCardCount(heightType);
|
||||
|
||||
/* If the story of the product which linked the execution under the project, you don't allow to remove the product. */
|
||||
$("#productsBox select[name^='products']").each(function()
|
||||
{
|
||||
|
||||
@@ -333,15 +333,27 @@ class executionModel extends model
|
||||
->setDefault('lastEditedBy', $this->app->user->account)
|
||||
->setDefault('lastEditedDate', helper::now())
|
||||
->setDefault('team', substr($this->post->name, 0, 30))
|
||||
->setDefault('displayCards', 0)
|
||||
->setIF($this->post->heightType == 'auto', 'displayCards', 0)
|
||||
->setIF(!isset($_POST['whitelist']), 'whitelist', '')
|
||||
->setIF($this->config->systemMode == 'new', 'parent', $this->post->project)
|
||||
->setIF($this->post->acl == 'open', 'whitelist', '')
|
||||
->join('whitelist', ',')
|
||||
->setDefault('type', $type)
|
||||
->stripTags($this->config->execution->editor->create['id'], $this->config->allowedTags)
|
||||
->remove('products, workDays, delta, branch, uid, plans, teams, teamMembers, contactListMenu')
|
||||
->remove('products, workDays, delta, branch, uid, plans, teams, teamMembers, contactListMenu, heightType')
|
||||
->get();
|
||||
|
||||
if(isset($_POST['heightType']) and $this->post->heightType == 'custom')
|
||||
{
|
||||
if(!preg_match("/^-?\d+$/", $sprint->displayCards) or $sprint->displayCards < 3)
|
||||
{
|
||||
$this->app->loadLang('kanban');
|
||||
dao::$errors['displayCards'] = $this->lang->kanbanlane->error->mustBeInt;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check the workload format and total. */
|
||||
if(!empty($sprint->percent)) $this->checkWorkload('create', $sprint->percent);
|
||||
|
||||
@@ -475,6 +487,8 @@ class executionModel extends model
|
||||
->add('id', $executionID)
|
||||
->setDefault('lastEditedBy', $this->app->user->account)
|
||||
->setDefault('lastEditedDate', helper::now())
|
||||
->setDefault('displayCards', 0)
|
||||
->setIF($this->post->heightType == 'auto', 'displayCards', 0)
|
||||
->setIF(helper::isZeroDate($this->post->begin), 'begin', '')
|
||||
->setIF(helper::isZeroDate($this->post->end), 'end', '')
|
||||
->setIF(!isset($_POST['whitelist']), 'whitelist', '')
|
||||
@@ -483,9 +497,19 @@ class executionModel extends model
|
||||
->setDefault('team', $this->post->name)
|
||||
->join('whitelist', ',')
|
||||
->stripTags($this->config->execution->editor->edit['id'], $this->config->allowedTags)
|
||||
->remove('products, branch, uid, plans, syncStories, contactListMenu, teamMembers')
|
||||
->remove('products, branch, uid, plans, syncStories, contactListMenu, teamMembers, heightType')
|
||||
->get();
|
||||
|
||||
if(isset($_POST['heightType']) and $this->post->heightType == 'custom')
|
||||
{
|
||||
if(!preg_match("/^-?\d+$/", $sprint->displayCards) or $sprint->displayCards < 3)
|
||||
{
|
||||
$this->app->loadLang('kanban');
|
||||
dao::$errors['displayCards'] = $this->lang->kanbanlane->error->mustBeInt;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(in_array($execution->status, array('closed', 'suspended'))) $this->computeBurn($executionID);
|
||||
|
||||
if($this->config->systemMode == 'new' and (empty($execution->project) or $execution->project == $oldExecution->project)) $this->checkBeginAndEndDate($oldExecution->project, $execution->begin, $execution->end);
|
||||
|
||||
@@ -219,6 +219,18 @@
|
||||
<th><?php echo $lang->execution->team;?></th>
|
||||
<td colspan='3'><?php echo html::select('teamMembers[]', $users, '', "class='form-control chosen' multiple"); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->kanban->columnWidth;?></th>
|
||||
<td colspan='2'><?php echo nl2br(html::radio('fluidBoard', $lang->kanbancolumn->fluidBoardList, 0));?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th id='c-name'><?php echo $lang->kanban->laneHeight;?></th>
|
||||
<td class='laneHeightBox' colspan='2'><?php echo nl2br(html::radio('heightType', $lang->kanbanlane->heightTypeList, 'auto', "onclick='setCardCount(this.value);'"));?></td>
|
||||
</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>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $showExecutionExec ? $lang->execution->execDesc : $lang->execution->desc;?></th>
|
||||
<td colspan='3'>
|
||||
|
||||
@@ -193,6 +193,20 @@
|
||||
<th><?php echo $lang->execution->team;?></th>
|
||||
<td colspan='2'><?php echo html::select('teamMembers[]', $users, array_keys($teamMembers), "class='form-control chosen' multiple"); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->kanban->columnWidth;?></th>
|
||||
<td><?php echo nl2br(html::radio('fluidBoard', $lang->kanbancolumn->fluidBoardList, $execution->fluidBoard));?></td>
|
||||
</tr>
|
||||
<?php if($laneCount > 1):?>
|
||||
<tr>
|
||||
<th id='c-name'><?php echo $lang->kanban->laneHeight;?></th>
|
||||
<td class='laneHeightBox'><?php echo nl2br(html::radio('heightType', $lang->kanbanlane->heightTypeList, $heightType, "onclick='setCardCount(this.value);'"));?></td>
|
||||
</tr>
|
||||
<tr class="hidden" id='cardBox'>
|
||||
<th class='c-count'><?php echo $lang->kanban->cardCount;?></th>
|
||||
<td><?php echo html::input('displayCards', $displayCards, "class='form-control' required placeholder='{$lang->kanban->cardCountTip}' autocomplete='off'");?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
<th><?php echo $lang->execution->desc;?></th>
|
||||
<td colspan='2'><?php echo html::textarea('desc', htmlSpecialString($execution->desc), "rows='6' class='form-control kindeditor' hidefocus='true'");?></td>
|
||||
|
||||
+19
-8
@@ -2127,6 +2127,7 @@ class kanbanModel extends model
|
||||
->setDefault('lastEditedDate', helper::now())
|
||||
->setDefault('displayCards', 0)
|
||||
->setIF($this->post->import == 'off', 'object', '')
|
||||
->setIF($this->post->heightType == 'auto', 'displayCards', 0)
|
||||
->join('whitelist', ',')
|
||||
->join('team', ',')
|
||||
->trim('name')
|
||||
@@ -3863,13 +3864,23 @@ class kanbanModel extends model
|
||||
*/
|
||||
public function getLaneCount($kanbanID, $type = 'common')
|
||||
{
|
||||
return $this->dao->select('COUNT(t2.id) as count')->from(TABLE_KANBANREGION)->alias('t1')
|
||||
->leftJoin(TABLE_KANBANLANE)->alias('t2')->on('t1.id=t2.region')
|
||||
->where('t1.kanban')->eq($kanbanID)
|
||||
->andWhere('t1.deleted')->eq(0)
|
||||
->andWhere('t2.deleted')->eq(0)
|
||||
->beginIF($type == 'common')->andWhere('t2.type')->eq('common')->fi()
|
||||
->beginIF($type != 'common')->andWhere('t2.type')->ne('common')->fi()
|
||||
->fetch('count');
|
||||
if($type == 'common ' or $type == 'kanban')
|
||||
{
|
||||
return $this->dao->select('COUNT(t2.id) as count')->from(TABLE_KANBANREGION)->alias('t1')
|
||||
->leftJoin(TABLE_KANBANLANE)->alias('t2')->on('t1.id=t2.region')
|
||||
->where('t1.kanban')->eq($kanbanID)
|
||||
->andWhere('t1.deleted')->eq(0)
|
||||
->andWhere('t2.deleted')->eq(0)
|
||||
->beginIF($type == 'common')->andWhere('t2.type')->eq('common')->fi()
|
||||
->beginIF($type != 'common')->andWhere('t2.type')->ne('common')->fi()
|
||||
->fetch('count');
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->dao->select('COUNT(id) as count')->from(TABLE_KANBANLANE)
|
||||
->where('execution')->eq($kanbanID)
|
||||
->andWhere('deleted')->eq(0)
|
||||
->fetch('count');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user