Merge branch 'sprint/tianshujie_fixbug'
This commit is contained in:
+1
-1
@@ -146,7 +146,7 @@ $config->file->allowed = 'txt,doc,docx,dot,wps,wri,pdf,ppt,pptx,xls,xlsx,ett
|
||||
$config->file->storageType = 'fs'; // fs or s3
|
||||
|
||||
/* Upload settings. */
|
||||
$config->allowedTags = '<p><span><h1><h2><h3><h4><h5><em><u><strong><br><ol><ul><li><img><a><b><font><hr><pre><div><table><td><th><tr><tbody><embed><style>';
|
||||
$config->allowedTags = '<p><span><h1><h2><h3><h4><h5><em><u><strong><br><ol><ul><li><img><a><b><font><hr><pre><div><table><td><th><tr><tbody><embed><style><s>';
|
||||
$config->accountRule = '|^[a-zA-Z0-9_]{1}[a-zA-Z0-9_\.]{1,}[a-zA-Z0-9_]{1}$|';
|
||||
$config->checkVersion = true; // Auto check for new version or not.
|
||||
|
||||
|
||||
@@ -337,7 +337,7 @@
|
||||
<?php js::set('executionID', $execution->id);?>
|
||||
<?php if(isonlybody()):?>
|
||||
<style>
|
||||
.body-modal .main-header {padding-right: 0px; z-index: 1100;}
|
||||
.body-modal .main-header {padding-right: 0px; z-index: 1000;}
|
||||
.btn-toolbar > .dropdown {margin: 0px;}
|
||||
</style>
|
||||
<?php $html = '<div class="divider"></div><button id="closeModal" type="button" class="btn btn-link" data-dismiss="modal"><i class="icon icon-close"></i></button>';?>
|
||||
|
||||
@@ -153,10 +153,10 @@ class helper extends baseHelper
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
static public function createLink($moduleName, $methodName = 'index', $vars = '', $viewType = '', $onlyBody = false)
|
||||
static public function createLink($moduleName, $methodName = 'index', $vars = '', $viewType = 'json', $onlyBody = false)
|
||||
{
|
||||
global $config;
|
||||
$link = parent::createLink($moduleName, $methodName, $vars, 'html');
|
||||
$link = parent::createLink($moduleName, $methodName, $vars, $viewType);
|
||||
$pos = strpos($link, '.php');
|
||||
|
||||
/* The requestTypes are: GET, PATH_INFO2, PATH_INFO */
|
||||
|
||||
@@ -22,7 +22,7 @@ if(!$selfCall) die(include('./todolist.html.php'));
|
||||
.block-todoes .todoes > li {position: relative; padding: 5px 10px 5px 35px; list-style: none; white-space:nowrap; overflow: auto; overflow-x:hidden;}
|
||||
.block-todoes .todoes > li:hover {background-color: #e9f2fb;}
|
||||
.block-todoes .todo-title {padding: 5px 15px 5px 5px;}
|
||||
.titleBox {width: 700px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;}
|
||||
.titleBox {max-width: 700px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;}
|
||||
.block-todoes .todo-pri {margin: 0 5px;}
|
||||
.block-todoes .todo-time {display: inline-block; padding: 0 5px; font-size: 12px; color: #8e939a; width: 95px;}
|
||||
.block-todoes .todo-check {position: absolute; top: 5px; left: 10px; display: block; width: 20px; height: 20px; font-size: 20px; color: transparent; cursor: pointer; background: #fff; border: 2px solid #eee; border-radius: 50%;}
|
||||
@@ -97,7 +97,7 @@ if(!$selfCall) die(include('./todolist.html.php'));
|
||||
?>
|
||||
<li data-id='<?php echo $todo->id?>' class='titleBox'>
|
||||
<span class="todo-check icon icon-check-circle"></span>
|
||||
<a href="<?php echo empty($sso) ? $viewLink : $sso . $sign . 'referer=' . base64_encode($viewLink);?>" class='iframe' data-toggle='modal' <?php echo $appid?>>
|
||||
<a href="<?php echo empty($sso) ? $viewLink : $sso . $sign . 'referer=' . base64_encode($viewLink);?>" class='iframe' data-width='1000px' data-toggle='modal' <?php echo $appid?>>
|
||||
<?php if ($todo->date == '2030-01-01') :?>
|
||||
<span class="todo-time"><?php echo $lang->todo->periods['future'] ?></span>
|
||||
<?php else:?>
|
||||
|
||||
@@ -363,6 +363,8 @@ function findDropColumns($element, $root)
|
||||
var laneType = $element.closest('.kanban-lane').data().lane.type;
|
||||
var kanbanRules = window.kanbanDropRules ? window.kanbanDropRules[laneType] : null;
|
||||
|
||||
hideKanbanAction();
|
||||
|
||||
if(!kanbanRules) return $root.find('.kanban-lane-col:not([data-type="' + col.type + '"])');
|
||||
|
||||
var colRules = kanbanRules[col.type];
|
||||
@@ -993,23 +995,27 @@ function changeCardColType(cardID, fromColID, toColID, fromLaneID, toLaneID, car
|
||||
*/
|
||||
function deleteCard(objectType, objectID, regionID)
|
||||
{
|
||||
var objectLang = objectType + 'Lang';
|
||||
var result = confirm(window[objectLang].confirmDelete) ? true : false;
|
||||
|
||||
if(!result) return false;
|
||||
if(!objectID) return false;
|
||||
|
||||
var url = createLink('kanban', 'deleteObjectCard', 'objectType=' + objectType + '&objectID=' + objectID + '®ionID=' + regionID);
|
||||
return $.ajax(
|
||||
$.zui.ContextMenu.hide();
|
||||
setTimeout(function()
|
||||
{
|
||||
method: 'post',
|
||||
dataType: 'json',
|
||||
url: url,
|
||||
success: function(data)
|
||||
var objectLang = objectType + 'Lang';
|
||||
var result = confirm(window[objectLang].confirmDelete) ? true : false;
|
||||
|
||||
if(!result) return false;
|
||||
if(!objectID) return false;
|
||||
|
||||
var url = createLink('kanban', 'deleteObjectCard', 'objectType=' + objectType + '&objectID=' + objectID + '®ionID=' + regionID);
|
||||
return $.ajax(
|
||||
{
|
||||
updateRegion(regionID, data[regionID]);
|
||||
}
|
||||
});
|
||||
method: 'post',
|
||||
dataType: 'json',
|
||||
url: url,
|
||||
success: function(data)
|
||||
{
|
||||
updateRegion(regionID, data[regionID]);
|
||||
}
|
||||
});
|
||||
}, 200)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -515,6 +515,8 @@ function findDropColumns($element, $root)
|
||||
var kanbanID = $root.data('id');
|
||||
var kanbanRules = window.kanbanDropRules ? window.kanbanDropRules[kanbanID] : null;
|
||||
|
||||
$.zui.ContextMenu.hide();
|
||||
|
||||
if(!kanbanRules) return $root.find('.kanban-lane-col:not([data-type="' + col.type + '"])');
|
||||
|
||||
var colRules = kanbanRules[col.type];
|
||||
@@ -1238,3 +1240,8 @@ function resetKanbanHeight()
|
||||
|
||||
$('.kanban-lane').css('height', height -2);
|
||||
}
|
||||
|
||||
$(document).on('click', '.dropdown-menu', function()
|
||||
{
|
||||
$.zui.ContextMenu.hide();
|
||||
});
|
||||
|
||||
@@ -3005,6 +3005,7 @@ class executionModel extends model
|
||||
}
|
||||
$parents = $this->dao->select('*')->from(TABLE_TASK)->where('id')->in($parents)->fetchAll('id');
|
||||
|
||||
if($this->config->vision == 'lite') $tasks = $this->loadModel('task')->appendLane($tasks);
|
||||
foreach($tasks as $task)
|
||||
{
|
||||
if($task->parent > 0)
|
||||
|
||||
@@ -58,9 +58,9 @@ $canDeleteRegion = commonModel::hasPriv('kanban', 'deleteRegion');
|
||||
$canCreateLane = commonModel::hasPriv('kanban', 'createLane');
|
||||
$canCreateTask = common::hasPriv('task', 'create');
|
||||
$canBatchCreateTask = common::hasPriv('task', 'batchCreate');
|
||||
$canCreateBug = common::hasPriv('bug', 'create');
|
||||
$canBatchCreateBug = common::hasPriv('bug', 'batchCreate');
|
||||
$canImportBug = common::hasPriv('execution', 'importBug');
|
||||
$canCreateBug = ($productID and common::hasPriv('bug', 'create'));
|
||||
$canBatchCreateBug = ($productID and common::hasPriv('bug', 'batchCreate'));
|
||||
$canImportBug = ($productID and common::hasPriv('execution', 'importBug'));
|
||||
$canCreateStory = ($productID and common::hasPriv('story', 'create'));
|
||||
$canBatchCreateStory = ($productID and common::hasPriv('story', 'batchCreate'));
|
||||
$canLinkStory = ($productID and common::hasPriv('execution', 'linkStory'));
|
||||
|
||||
@@ -78,9 +78,9 @@
|
||||
$checkObject->execution = $executionID;
|
||||
$canCreateTask = common::hasPriv('task', 'create', $checkObject);
|
||||
$canBatchCreateTask = common::hasPriv('task', 'batchCreate', $checkObject);
|
||||
$canCreateBug = common::hasPriv('bug', 'create');
|
||||
$canBatchCreateBug = common::hasPriv('bug', 'batchCreate');
|
||||
$canImportBug = common::hasPriv('execution', 'importBug');
|
||||
$canCreateBug = ($productID and common::hasPriv('bug', 'create'));
|
||||
$canBatchCreateBug = ($productID and common::hasPriv('bug', 'batchCreate'));
|
||||
$canImportBug = ($productID and common::hasPriv('execution', 'importBug'));
|
||||
$canCreateStory = ($productID and common::hasPriv('story', 'create'));
|
||||
$canBatchCreateStory = ($productID and common::hasPriv('story', 'batchCreate'));
|
||||
$canLinkStory = ($productID and common::hasPriv('execution', 'linkStory'));
|
||||
|
||||
@@ -181,7 +181,7 @@ class group extends control
|
||||
if($type == 'byModule') $result = $this->group->updatePrivByModule();
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse')));
|
||||
return print(js::alert($this->lang->saveSuccess) . js::execute('window.parent.location.reload()'));
|
||||
}
|
||||
|
||||
if($type == 'byGroup')
|
||||
|
||||
@@ -1404,7 +1404,8 @@ class kanban extends control
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
$kanbanID = $this->kanban->getKanbanIDByregion($regionID);
|
||||
$kanbanGroup = $this->kanban->getRDKanban($kanbanID);
|
||||
$$browseType = $this->config->vision == 'lite' ? 'task' : 'all';
|
||||
$kanbanGroup = $this->kanban->getRDKanban($kanbanID, $$browseType);
|
||||
|
||||
return print(json_encode($kanbanGroup));
|
||||
}
|
||||
|
||||
@@ -1592,7 +1592,7 @@ function resetRegionHeight(fold)
|
||||
}
|
||||
}
|
||||
|
||||
$('.dropdown-menu').click(function()
|
||||
$(document).on('click', '.dropdown-menu', function()
|
||||
{
|
||||
$.zui.ContextMenu.hide();
|
||||
})
|
||||
});
|
||||
|
||||
@@ -28,27 +28,18 @@ $lang->misc->zentao->icons['service'] = 'heart';
|
||||
|
||||
$lang->misc->zentao->about['bizversion'] = 'ZenTao Biz';
|
||||
$lang->misc->zentao->about['official'] = "Official Website";
|
||||
$lang->misc->zentao->about['changelog'] = "Change Log";
|
||||
$lang->misc->zentao->about['license'] = "License";
|
||||
|
||||
|
||||
|
||||
$lang->misc->zentao->support['vip'] = "VIP Support";
|
||||
$lang->misc->zentao->support['manual'] = "User Manual";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$lang->misc->zentao->cowin['reportbug'] = "Report Bug ";
|
||||
$lang->misc->zentao->cowin['feedback'] = "Feedback";
|
||||
$lang->misc->zentao->cowin['translate'] = "Translate";
|
||||
$lang->misc->zentao->cowin['recommend'] = "More";
|
||||
|
||||
|
||||
$lang->misc->zentao->service['idc'] = 'ZenTao Cloud';
|
||||
$lang->misc->zentao->service['custom'] = 'ZenTao Custom';
|
||||
$lang->misc->zentao->service['servicemore']= 'More';
|
||||
|
||||
global $config;
|
||||
$lang->misc->zentao->others['chanzhi'] = "<img src='{$config->webRoot}theme/default/images/main/chanzhi.ico' /> Zsite";
|
||||
|
||||
@@ -42,13 +42,11 @@ $lang->misc->zentao->support['qqgroup'] = "官方QQ群";
|
||||
|
||||
$lang->misc->zentao->cowin['reportbug'] = "汇报Bug";
|
||||
$lang->misc->zentao->cowin['feedback'] = "反馈需求";
|
||||
$lang->misc->zentao->cowin['translate'] = "参与翻译";
|
||||
$lang->misc->zentao->cowin['recommend'] = "推荐给朋友";
|
||||
|
||||
$lang->misc->zentao->service['zentaotrain']= '禅道使用培训';
|
||||
$lang->misc->zentao->service['idc'] = '禅道在线托管';
|
||||
$lang->misc->zentao->service['custom'] = '禅道定制开发';
|
||||
$lang->misc->zentao->service['servicemore']= '更多服务...';
|
||||
|
||||
global $config;
|
||||
$lang->misc->zentao->others['chanzhi'] = "<img src='{$config->webRoot}theme/default/images/main/chanzhi.ico' /> 蝉知门户";
|
||||
|
||||
@@ -922,8 +922,7 @@ EOF;
|
||||
$sort = common::appendOrder($orderBy);
|
||||
|
||||
/* Get users by dept. */
|
||||
$user = $this->loadModel('user')->getById($this->app->user->account, 'account');
|
||||
$deptID = $user->dept;
|
||||
$deptID = $this->app->user->admin ? 0 : $this->app->user->dept;
|
||||
$users = $this->loadModel('company')->getUsers('inside', 'bydept', 0, $deptID, $sort, $pager);
|
||||
foreach($users as $user) unset($user->password); // Remove passwd.
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ class projectModel extends model
|
||||
if(defined('TUTORIAL')) return $projectID;
|
||||
|
||||
if($projectID == 0 and $this->cookie->lastProject) $projectID = $this->cookie->lastProject;
|
||||
if($projectID == 0 and $this->session->project == '') $projectID = key($projects);
|
||||
if(($projectID == 0 and $this->session->project == '') or !isset($projects[$projectID])) $projectID = key($projects);
|
||||
$this->session->set('project', (int)$projectID, $this->app->tab);
|
||||
|
||||
if(!isset($projects[$this->session->project]))
|
||||
@@ -2187,6 +2187,20 @@ class projectModel extends model
|
||||
if($task->status != 'cancel' and $task->status != 'closed') $hour->totalLeft += $task->left;
|
||||
}
|
||||
$hours[$executionID] = $hour;
|
||||
|
||||
if($executions[$executionID]->type == 'stage' and $executions[$executionID]->grade == 2)
|
||||
{
|
||||
$stageParent = $executions[$executionID]->parent;
|
||||
if(!isset($hours[$stageParent]))
|
||||
{
|
||||
$hours[$stageParent] = clone $hour;
|
||||
continue;
|
||||
}
|
||||
|
||||
$hours[$stageParent]->totalEstimate += $hour->totalEstimate;
|
||||
$hours[$stageParent]->totalConsumed += $hour->totalConsumed;
|
||||
$hours[$stageParent]->totalLeft += $hour->totalLeft;
|
||||
}
|
||||
}
|
||||
|
||||
/* Compute totalReal and progress. */
|
||||
|
||||
+15
-10
@@ -2345,23 +2345,26 @@ class story extends control
|
||||
}
|
||||
}
|
||||
|
||||
/* Get users, products and executions. */
|
||||
$users = $this->loadModel('user')->getPairs('noletter');
|
||||
$products = $this->product->getPairs('nocode');
|
||||
/* Get users, products and relations. */
|
||||
$users = $this->loadModel('user')->getPairs('noletter');
|
||||
$products = $this->product->getPairs('nocode');
|
||||
$relations = $this->story->getStoryRelationByIds($storyIdList, $type);
|
||||
|
||||
/* Get related objects id lists. */
|
||||
$relatedProductIdList = array();
|
||||
$relatedStoryIdList = array();
|
||||
$relatedPlanIdList = array();
|
||||
$relatedBranchIdList = array();
|
||||
$relatedStoryIDs = array();
|
||||
$relatedStoryIds = array();
|
||||
|
||||
foreach($stories as $story)
|
||||
{
|
||||
$relatedProductIdList[$story->product] = $story->product;
|
||||
$relatedPlanIdList[$story->plan] = $story->plan;
|
||||
$relatedBranchIdList[$story->branch] = $story->branch;
|
||||
$relatedStoryIDs[$story->id] = $story->id;
|
||||
$relatedStoryIds[$story->id] = $story->id;
|
||||
|
||||
if(isset($relations[$story->id])) $story->linkStories = $story->linkStories . ',' . $relations[$story->id];
|
||||
|
||||
/* Process related stories. */
|
||||
$relatedStories = $story->childStories . ',' . $story->linkStories . ',' . $story->duplicateStory;
|
||||
@@ -2372,14 +2375,14 @@ class story extends control
|
||||
}
|
||||
}
|
||||
|
||||
$storyTasks = $this->loadModel('task')->getStoryTaskCounts($relatedStoryIDs);
|
||||
$storyBugs = $this->loadModel('bug')->getStoryBugCounts($relatedStoryIDs);
|
||||
$storyCases = $this->loadModel('testcase')->getStoryCaseCounts($relatedStoryIDs);
|
||||
$storyTasks = $this->loadModel('task')->getStoryTaskCounts($relatedStoryIds);
|
||||
$storyBugs = $this->loadModel('bug')->getStoryBugCounts($relatedStoryIds);
|
||||
$storyCases = $this->loadModel('testcase')->getStoryCaseCounts($relatedStoryIds);
|
||||
|
||||
/* Get related objects title or names. */
|
||||
$productsType = $this->dao->select('id, type')->from(TABLE_PRODUCT)->where('id')->in($relatedProductIdList)->fetchPairs();
|
||||
$relatedPlans = $this->dao->select('id, title')->from(TABLE_PRODUCTPLAN)->where('id')->in(join(',', $relatedPlanIdList))->fetchPairs();
|
||||
$relatedStories = $this->dao->select('id,title')->from(TABLE_STORY) ->where('id')->in($relatedStoryIdList)->fetchPairs();
|
||||
$relatedStories = $this->dao->select('id,title')->from(TABLE_STORY)->where('id')->in($relatedStoryIdList)->fetchPairs();
|
||||
$relatedFiles = $this->dao->select('id, objectID, pathname, title')->from(TABLE_FILE)->where('objectType')->eq('story')->andWhere('objectID')->in($storyIdList)->andWhere('extra')->ne('editor')->fetchGroup('objectID');
|
||||
$relatedSpecs = $this->dao->select('*')->from(TABLE_STORYSPEC)->where('`story`')->in($storyIdList)->orderBy('version desc')->fetchGroup('story');
|
||||
$relatedBranch = array('0' => $this->lang->branch->main) + $this->dao->select('id, name')->from(TABLE_BRANCH)->where('id')->in($relatedBranchIdList)->fetchPairs();
|
||||
@@ -2448,10 +2451,12 @@ class story extends control
|
||||
|
||||
if($story->linkStories)
|
||||
{
|
||||
$tmpLinkStories = array();
|
||||
$tmpLinkStories = array();
|
||||
$linkStoriesIdList = explode(',', $story->linkStories);
|
||||
foreach($linkStoriesIdList as $linkStoryID)
|
||||
{
|
||||
if(empty($linkStoryID)) continue;
|
||||
|
||||
$linkStoryID = trim($linkStoryID);
|
||||
$tmpLinkStories[] = isset($relatedStories[$linkStoryID]) ? $relatedStories[$linkStoryID] : $linkStoryID;
|
||||
}
|
||||
|
||||
@@ -4393,6 +4393,30 @@ class storyModel extends model
|
||||
return $story;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get story relation by Ids.
|
||||
*
|
||||
* @param array $storyIdList
|
||||
* @param string $storyType
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getStoryRelationByIds($storyIdList, $storyType)
|
||||
{
|
||||
$conditionField = $storyType == 'story' ? 'BID' : 'AID';
|
||||
$storyType = $storyType == 'story' ? 'BID, GROUP_CONCAT(`AID` SEPARATOR ",")' : 'AID, GROUP_CONCAT(`BID` SEPARATOR ",")';
|
||||
|
||||
$relations = $this->dao->select($storyType)->from(TABLE_RELATION)
|
||||
->where('AType')->eq('requirement')
|
||||
->andWhere('BType')->eq('story')
|
||||
->andWhere('relation')->eq('subdivideinto')
|
||||
->andWhere($conditionField)->in($storyIdList)
|
||||
->groupBy($conditionField)
|
||||
->fetchPairs();
|
||||
|
||||
return $relations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Link a story.
|
||||
*
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th class='thWidth'><?php echo $lang->story->reviewedDate;?></th>
|
||||
<td class='w-p25-f'><?php echo html::input('reviewedDate', helper::today(), "class='form-control form-date'");?></td><td></td>
|
||||
<td class='w-p25-f'><?php echo html::input('reviewedDate', helper::now(), "class='form-control form-datetime' data-picker-position='bottom-right'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->reviewResult;?></th>
|
||||
|
||||
@@ -413,7 +413,7 @@
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->reviewedDate;?></th>
|
||||
<td><?php if($story->reviewedBy) echo date('Y-m-d', strtotime($story->reviewedDate))?></td>
|
||||
<td><?php if($story->reviewedBy) echo $story->reviewedDate;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->closedBy;?></th>
|
||||
|
||||
+43
-35
@@ -2198,41 +2198,7 @@ class taskModel extends model
|
||||
}
|
||||
$parents = $this->dao->select('*')->from(TABLE_TASK)->where('id')->in($parents)->fetchAll('id');
|
||||
|
||||
if ($this->config->vision == 'lite') {
|
||||
$lanes = array();
|
||||
$cardsWhere = '';
|
||||
foreach($tasks as $task)
|
||||
{
|
||||
if(empty($cardsWhere))
|
||||
{
|
||||
$cardsWhere = "cards like '%,{$task->id},%'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$cardsWhere .= " or cards like '%,{$task->id},%'";
|
||||
}
|
||||
}
|
||||
$lanes = $this->dao->select('t1.lane,t2.name,t1.cards')
|
||||
->from(TABLE_KANBANCELL)->alias('t1')
|
||||
->leftJoin(TABLE_KANBANLANE)->alias('t2')->on('t1.lane = t2.id')
|
||||
->where('t1.kanban')->eq($executionID)
|
||||
->andWhere('t2.deleted')->eq(0)
|
||||
->andWhere("($cardsWhere)")
|
||||
->fetchAll();
|
||||
|
||||
foreach($tasks as $task)
|
||||
{
|
||||
$task->lane = '';
|
||||
if(!empty($lanes))
|
||||
{
|
||||
foreach($lanes as $lane)
|
||||
{
|
||||
if(strpos($lane->cards, ",{$task->id},") !== false) $task->lane = $lane->name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($this->config->vision == 'lite') $tasks = $this->appendLane($tasks);
|
||||
foreach($tasks as $task)
|
||||
{
|
||||
if($task->parent > 0)
|
||||
@@ -2681,6 +2647,48 @@ class taskModel extends model
|
||||
if(!dao::isError()) return common::createChanges($oldTask, $newTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* Append lane field to tasks;
|
||||
*
|
||||
* @param array $tasks
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function appendLane($tasks)
|
||||
{
|
||||
$executionIdList = array();
|
||||
foreach($tasks as $task)
|
||||
{
|
||||
$task->lane = '';
|
||||
if(!isset($executionIdList[$task->execution])) $executionIdList[$task->execution] = $task->execution;
|
||||
}
|
||||
|
||||
$lanes = $this->dao->select('t1.kanban,t1.lane,t2.name,t1.cards')->from(TABLE_KANBANCELL)->alias('t1')
|
||||
->leftJoin(TABLE_KANBANLANE)->alias('t2')->on('t1.lane = t2.id')
|
||||
->where('t1.kanban')->in($executionIdList)
|
||||
->andWhere('t2.deleted')->eq(0)
|
||||
->andWhere('t1.type')->eq('task')
|
||||
->andWhere("t1.cards")->ne('')
|
||||
->fetchAll();
|
||||
|
||||
if(empty($lanes)) return $tasks;
|
||||
|
||||
foreach($tasks as $task)
|
||||
{
|
||||
foreach($lanes as $lane)
|
||||
{
|
||||
if($lane->kanban != $task->execution) continue;
|
||||
if(strpos(",{$lane->cards},", ",{$task->id},") !== false)
|
||||
{
|
||||
$task->lane = $lane->name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $tasks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch process tasks.
|
||||
*
|
||||
|
||||
@@ -376,6 +376,12 @@ class todo extends control
|
||||
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'message' => '404 Not found'));
|
||||
return print(js::error($this->lang->notFound) . js::locate('back'));
|
||||
}
|
||||
|
||||
if($todo->private and $todo->account != $this->app->user->account)
|
||||
{
|
||||
return print(js::error($this->lang->todo->thisIsPrivate) . js::locate('back'));
|
||||
}
|
||||
|
||||
/* Save the session. */
|
||||
if(!isonlybody())
|
||||
{
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<?php js::set('systemMode', $config->systemMode);?>
|
||||
<?php if(!$todo->private or ($todo->private and $todo->account == $app->user->account)):?>
|
||||
<style>.chosen-container .chosen-results{max-height: 170px; overflow-y: initial;}</style>
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div class="btn-toolbar pull-left">
|
||||
@@ -302,9 +301,6 @@
|
||||
</div>
|
||||
<?php js::set('todoID', $todo->id);?>
|
||||
<?php js::set('selectExecution', $lang->execution->selectExecution);?>
|
||||
<?php else:?>
|
||||
<?php echo $lang->todo->thisIsPrivate;?>
|
||||
<?php endif;?>
|
||||
<script>
|
||||
$(function() {parent.$('body.hide-modal-close').removeClass('hide-modal-close'); })
|
||||
</script>
|
||||
|
||||
@@ -52,7 +52,9 @@
|
||||
<td><?php echo $todo->date == '2030-01-01' ? $lang->todo->periods['future'] : $todo->date;?></td>
|
||||
<td><?php echo $lang->todo->typeList[$todo->type];?></td>
|
||||
<td><span class='<?php echo 'pri' . zget($lang->todo->priList, $todo->pri, $todo->pri);?>'><?php echo zget($lang->todo->priList, $todo->pri, $todo->pri);?></span></td>
|
||||
<td class='text-left'><?php echo html::a($this->createLink('todo', 'view', "id=$todo->id&from=company", '', true), $todo->name, '', "class='iframe'");?></td>
|
||||
<td class='text-left'>
|
||||
<?php echo ($todo->private and $this->app->user->account != $todo->account) ? $todo->name : html::a($this->createLink('todo', 'view', "id=$todo->id&from=company", '', true), $todo->name, '', "class='iframe'");?>
|
||||
</td>
|
||||
<td><?php echo $todo->begin;?></td>
|
||||
<td><?php echo $todo->end;?></td>
|
||||
<td class='<?php echo $todo->status;?>'><?php echo $lang->todo->statusList[$todo->status];?></td>
|
||||
|
||||
Reference in New Issue
Block a user