Merge branch 'master' of github.com:easysoft/zentaopms

This commit is contained in:
wangyidong
2019-08-08 18:48:56 +08:00
6 changed files with 140 additions and 58 deletions
+13 -1
View File
@@ -47,7 +47,19 @@ class fixer extends baseFixer
foreach($this->data as $field => $value)
{
/* Implode array when form has array. */
if(isset($flowFields[$field]) and is_array($value)) $this->data->$field = implode(',', $value);
if(isset($flowFields[$field]) and is_array($value))
{
$canImplode = true;
foreach($value as $k => $v)
{
if(is_object($v) or is_array($v))
{
$canImplode = false;
break;
}
}
if($canImplode) $this->data->$field = implode(',', $value);
}
$this->specialChars($field);
}
+22 -22
View File
@@ -1490,22 +1490,24 @@ class project extends control
$stories = $this->loadModel('story')->getProjectStories($projectID, $orderBy);
$kanbanGroup = $this->project->getKanbanGroupData($stories, $tasks, $bugs, $type);
$kanbanSetting = $this->project->getKanbanSetting($projectID);
$kanbanSetting = $this->project->getKanbanSetting();
$this->view->title = $this->lang->project->kanban;
$this->view->position[] = html::a($this->createLink('project', 'browse', "projectID=$projectID"), $project->name);
$this->view->position[] = $this->lang->project->kanban;
$this->view->stories = $stories;
$this->view->realnames = $this->loadModel('user')->getPairs('noletter');
$this->view->storyOrder = $orderBy;
$this->view->orderBy = 'id_asc';
$this->view->projectID = $projectID;
$this->view->browseType = '';
$this->view->project = $project;
$this->view->type = $type;
$this->view->kanbanGroup = $kanbanGroup;
$this->view->allCols = $kanbanSetting->allCols;
$this->view->colorList = $kanbanSetting->colorList;
$this->view->title = $this->lang->project->kanban;
$this->view->position[] = html::a($this->createLink('project', 'browse', "projectID=$projectID"), $project->name);
$this->view->position[] = $this->lang->project->kanban;
$this->view->stories = $stories;
$this->view->realnames = $this->loadModel('user')->getPairs('noletter');
$this->view->storyOrder = $orderBy;
$this->view->orderBy = 'id_asc';
$this->view->projectID = $projectID;
$this->view->browseType = '';
$this->view->project = $project;
$this->view->type = $type;
$this->view->kanbanGroup = $kanbanGroup;
$this->view->kanbanColumns = $this->project->getKanbanColumns($kanbanSetting);
$this->view->statusMap = $this->project->getKanbanStatusMap($kanbanSetting);
$this->view->statusList = $this->project->getKanbanStatusList($kanbanSetting);
$this->view->colorList = $this->project->getKanbanColorList($kanbanSetting);
$this->display();
}
@@ -2339,11 +2341,9 @@ class project extends control
}
$this->app->loadLang('task');
$kanbanSetting = $this->project->getKanbanSetting($projectID);
$this->view->allCols = $kanbanSetting->allCols;
$this->view->colorList = $kanbanSetting->colorList;
$this->view->projectID = $projectID;
$this->view->setting = $this->project->getKanbanSetting();
$this->view->projectID = $projectID;
$this->display();
}
@@ -2357,7 +2357,7 @@ class project extends control
*/
public function ajaxResetKanban($projectID, $confirm = 'no')
{
if($confirm != 'yes')die(js::confirm($this->lang->kanbanSetting->noticeReset, inlink('ajaxResetKanban', "projectID=$projectID&confirm=yes")));
if($confirm != 'yes') die(js::confirm($this->lang->kanbanSetting->noticeReset, inlink('ajaxResetKanban', "projectID=$projectID&confirm=yes")));
$this->loadModel('setting');
@@ -2387,8 +2387,8 @@ class project extends control
*/
public function importPlanStories($projectID, $planID)
{
$planStories = $planProducts = array();
$planStory = $this->loadModel('story')->getPlanStories($planID);
$planStories = $planProducts = array();
$planStory = $this->loadModel('story')->getPlanStories($planID);
$count = 0;
if(!empty($planStory))
{
+1 -20
View File
@@ -38,26 +38,7 @@ $(function()
$.cookie('selfClose', 0, {expires:config.cookieLife, path:config.webRoot});
var $kanban = $('#kanban');
var statusMap =
{
task:
{
wait : {doing: 'start', done: 'finish', cancel: 'cancel'},
doing : {done: 'finish', pause: 'pause'},
pause : {doing: 'activate', done: 'finish', cancel: 'cancel'},
done : {doing: 'activate', closed: 'close'},
cancel : {doing: 'activate', closed: 'close'},
closed : {doing: 'activate'}
},
bug:
{
wait : {done: 'resolve', cancel: 'resolve'},
doing : {},
done : {wait: 'activate', closed: 'close'},
cancel : {wait: 'activate', closed: 'close'},
closed : {wait: 'activate'}
}
};
console.log(statusMap);
// Get scrollbar width
var getScrollbarWidth = function ()
+95 -2
View File
@@ -2489,11 +2489,10 @@ class projectModel extends model
/**
* Get kanban setting.
*
* @param int $projectID
* @access public
* @return object
*/
public function getKanbanSetting($projectID)
public function getKanbanSetting()
{
$allCols = '1';
$showOption = '0';
@@ -2510,6 +2509,100 @@ class projectModel extends model
return $kanbanSetting;
}
/**
* Get kanban columns.
*
* @param object $kanbanSetting
* @access public
* @return array
*/
public function getKanbanColumns($kanbanSetting)
{
if($kanbanSetting->allCols) return array('wait', 'doing', 'pause', 'done', 'cancel', 'closed');
return array('wait', 'doing', 'pause', 'done');
}
/**
* 获取状态和方法的映射关系,此关系决定了看板内容能否从一个泳道拖动到另一个泳道,以及拖动后执行什么方法。
* Get the mapping between state and method. This relationship determines whether kanban content can be dragged from one lane
* to another, and what method is executed after dragging.
*
* 映射关系的基本格式为 map[$mode][$fromStatus][$toStatus] = $methodName。
* The basic format of the mapping relationship is map[$mode][$fromStatus][$toStatus] = $methodName.
*
* @param string $mode 看板内容类型,可选值 task|bug The content mode of kanban, should be task or bug.
* @param string $fromStatus 拖动内容的来源泳道 The origin lane the content draged from.
* @param string $toStatus 拖动内容的目标泳道 The destination lane the content draged to.
* @param string $methodName 拖动到目标泳道后执行的方法名 The method to execute after draged the content.
*
* 例如 map['task']['doing']['done'] = 'close' 表示:任务(task)看板从进行中(doing)泳道拖动到已完成(done)泳道时,执行关闭(close)方法。
* For example, map['task']['doing']['done'] = 'close' means: when the task kanban is dragged from the doing lane to the done lane,
* execute the close method.
*
* @param object $kanbanSetting This param is used in the biz version, don't remove it.
* @access public
* @return string
*/
public function getKanbanStatusMap($kanbanSetting)
{
$statusMap = array();
$statusMap['task']['wait']['doing'] = 'start';
$statusMap['task']['wait']['done'] = 'finish';
$statusMap['task']['wait']['cancel'] = 'cancel';
$statusMap['task']['doing']['done'] = 'finish';
$statusMap['task']['doing']['pause'] = 'pause';
$statusMap['task']['pause']['doing'] = 'activate';
$statusMap['task']['pause']['done'] = 'finish';
$statusMap['task']['pause']['cancel'] = 'cancel';
$statusMap['task']['done']['doing'] = 'activate';
$statusMap['task']['done']['closed'] = 'close';
$statusMap['task']['cancel']['doing'] = 'activate';
$statusMap['task']['cancel']['closed'] = 'close';
$statusMap['task']['closed']['doing'] = 'activate';
$statusMap['bug']['wait']['done'] = 'resolve';
$statusMap['bug']['wait']['cancel'] = 'resolve';
$statusMap['bug']['done']['wait'] = 'activate';
$statusMap['bug']['done']['closed'] = 'close';
$statusMap['bug']['cancel']['wait'] = 'activate';
$statusMap['bug']['cancel']['closed'] = 'close';
$statusMap['bug']['closed']['wait'] = 'activate';
return $statusMap;
}
/**
* Get status list of kanban.
*
* @param object $kanbanSetting This param is used in the biz version, don't remove it.
* @access public
* @return string
*/
public function getKanbanStatusList($kanbanSetting)
{
return $this->lang->task->statusList;
}
/**
* Get color list of kanban.
*
* @param object $kanbanSetting
* @access public
* @return array
*/
public function getKanbanColorList($kanbanSetting)
{
return $kanbanSetting->colorList;
}
/**
* Build burn data.
*
@@ -26,17 +26,17 @@ form {padding: 30px 0 40px;}
<form target='hiddenwin' method='post'>
<table class='table table-form'>
<?php if(common::hasPriv('project', 'kanbanHideCols')):?>
<tr>
<tr class='statusTR'>
<th class='text-right w-200px'><?php echo $lang->project->kanbanHideCols?></th>
<td><?php echo html::radio('allCols', $lang->kanbanSetting->optionList, $allCols)?></td>
<td><?php echo html::radio('allCols', $lang->kanbanSetting->optionList, $setting->allCols)?></td>
</tr>
<?php endif;?>
<?php if(common::hasPriv('project', 'kanbanColsColor')):?>
<tr>
<tr class='statusTR'>
<th class='text-right'><?php echo $lang->project->kanbanColsColor?></th>
<td>
<div class='row'>
<?php foreach($colorList as $status => $color):?>
<?php foreach($setting->colorList as $status => $color):?>
<div class='col-sm-2'>
<div class='input-group'>
<input type='hidden' id='color<?php echo $status?>' name="colorList[<?php echo $status?>]" data-provide='colorpicker' data-wrapper='input-group-btn' value='<?php echo $color;?>' data-colors='#333,#2B529C,#E48600,#D2323D,#229F24,#777,#D2691E,#008B8B,#2E8B57,#4169E1,#4B0082,#FA8072,#BA55D3,#2E8B57,#6B8E23'>
+5 -9
View File
@@ -9,6 +9,7 @@
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php js::set('statusMap', $statusMap);?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-right'>
<?php echo html::a($this->createLink('project', 'ajaxKanbanSetting', "projectID=$projectID"), "<i class='icon-cog muted'></i> " . $lang->project->kanbanSetting, '', "class='iframe btn btn-link'");?>
@@ -48,11 +49,6 @@
<?php echo "#kanban .c-board.s-$status{border-color: " . ($color ? $color : '#000') . ";}\n"?>
<?php endforeach?>
</style>
<?php
$taskCols = array('wait', 'doing', 'pause', 'done');
if($allCols) $taskCols = array('wait', 'doing', 'pause', 'done', 'cancel', 'closed');
$account = $this->app->user->account;
?>
<div id="kanban" class="main-table fade auto-fade-in" data-ride="table" data-checkable="false" data-group="true">
<?php
$hasTask = false;
@@ -96,8 +92,8 @@ $account = $this->app->user->account;
</div>
</th>
<?php endif;?>
<?php foreach($taskCols as $col):?>
<th class='c-board s-<?php echo $col?>'><?php echo $lang->task->statusList[$col];?></th>
<?php foreach($kanbanColumns as $col):?>
<th class='c-board s-<?php echo $col?>'><?php echo zget($statusList, $col);?></th>
<?php endforeach;?>
</tr>
</thead>
@@ -143,10 +139,10 @@ $account = $this->app->user->account;
<?php endif;?>
</td>
<?php endif;?>
<td class="c-boards no-padding text-left" colspan="<?php echo count($taskCols);?>">
<td class="c-boards no-padding text-left" colspan="<?php echo count($kanbanColumns);?>">
<div class="boards-wrapper">
<div class="boards">
<?php foreach($taskCols as $col):?>
<?php foreach($kanbanColumns as $col):?>
<div class="board" data-type="<?php echo $col;?>">
<?php if(!empty($group->tasks[$col])):?>
<?php foreach($group->tasks[$col] as $task):?>