Merge branch 'master' into 'sprint/master_fixbug'
# Conflicts: # module/project/model.php
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
[submodule "extension/qucheng"]
|
||||
path = extension/qucheng
|
||||
url = https://gitlab.zcorp.cc/easycorp/qucheng.git
|
||||
+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.
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
include $app->getExtensionRoot() . '/biz/attend/ext/view/stat.oa.html.hook.php';
|
||||
?>
|
||||
@@ -0,0 +1,3 @@
|
||||
<script>
|
||||
$('#headerActions').css("right", '210px');
|
||||
</script>
|
||||
@@ -45,7 +45,11 @@
|
||||
{
|
||||
foreach (explode('|', 'kanban|task|calendar|gantt|tree|grouptask') as $view)
|
||||
{
|
||||
if(common::hasPriv('execution', $view)) $kanbanview = $view; break;
|
||||
if(common::hasPriv('execution', $view))
|
||||
{
|
||||
$kanbanview = $view;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -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>';?>
|
||||
|
||||
Submodule
+1
Submodule extension/qucheng added at 14b5630326
@@ -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 */
|
||||
|
||||
@@ -2076,7 +2076,7 @@ class baseRouter
|
||||
if($type != 'fetch')
|
||||
{
|
||||
/* 分割URI。 Spit the URI. */
|
||||
$items = explode($this->config->requestFix, $this->URI);
|
||||
$items = explode($this->config->requestFix, (string)$this->URI);
|
||||
$itemCount = count($items);
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
.c-date {width: 150px;}
|
||||
.c-actions {width: 60px;}
|
||||
|
||||
tbody tr td {white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
|
||||
|
||||
@@ -29,7 +29,7 @@ html[lang="en"] .product-info .type-info {color: #A6AAB8; text-align: center; po
|
||||
.product-info .type-label {font-size: 12px; overflow: visible; text-overflow: ellipsis; white-space: nowrap;}
|
||||
.product-info .type-value {font-size: 14px;}
|
||||
.product-info .type-value > strong {font-size: 20px; color: #3C4353;}
|
||||
.product-info .actions {position: absolute; left: 10px; top: 14px;}
|
||||
.product-info .actions {position: absolute; right: 90px; top: 14px;}
|
||||
.block-statistic .panel-body {padding-top: 0;}
|
||||
.block-statistic .panel-body {padding-top: 0;}
|
||||
.block-statistic .tile {margin-bottom: 30px;}
|
||||
|
||||
@@ -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:?>
|
||||
|
||||
@@ -112,7 +112,7 @@ class deptModel extends model
|
||||
|
||||
krsort($deptMenu);
|
||||
$topMenu = array_pop($deptMenu);
|
||||
$topMenu = explode("\n", trim($topMenu));
|
||||
$topMenu = explode("\n", trim((string)$topMenu));
|
||||
$lastMenu[] = '/';
|
||||
foreach($topMenu as $menu)
|
||||
{
|
||||
|
||||
@@ -308,8 +308,6 @@ class design extends control
|
||||
$repos = $this->loadModel('repo')->getRepoPairs('project', $design->project);
|
||||
$repoID = $repoID ? $repoID : key($repos);
|
||||
|
||||
if(empty($repoID)) return print(js::locate(helper::createLink('repo', 'create', "objectID=$design->project")));
|
||||
|
||||
$repo = $this->loadModel('repo')->getRepoByID($repoID);
|
||||
$revisions = $this->repo->getCommits($repo, '', 'HEAD', '', '', $begin, $end);
|
||||
|
||||
@@ -399,12 +397,15 @@ class design extends control
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = pager::init(0, $recPerPage, $pageID);
|
||||
|
||||
$design = $this->design->getCommit($designID, $pager);
|
||||
|
||||
$this->view->title = $this->lang->design->common . $this->lang->colon . $this->lang->design->submission;
|
||||
$this->view->position[] = $this->lang->design->submission;
|
||||
|
||||
$this->view->design = $this->design->getCommit($designID, $pager);
|
||||
$this->view->design = $design;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->repos = $this->loadModel('repo')->getRepoPairs('project', $design->project);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
#mainContent .pull-right{margin-bottom: 10px}
|
||||
.table{border: 1px solid #ddd;}
|
||||
@@ -0,0 +1,20 @@
|
||||
$(function()
|
||||
{
|
||||
$('#linkCommit').click(function()
|
||||
{
|
||||
if(repos.length == 0)
|
||||
{
|
||||
var onlybody = config.onlybody;
|
||||
config.onlybody = 'no';
|
||||
|
||||
var link = createLink('repo', 'create', 'objectID=' + projectID);
|
||||
|
||||
config.onlybody = onlybody;
|
||||
window.parent.$.apps.open(link, 'devops');
|
||||
|
||||
parent.$('#triggerModal').modal('hide');
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -51,9 +51,9 @@
|
||||
<td class='c-actions text-center'>
|
||||
<?php
|
||||
$vars = "design={$design->id}";
|
||||
common::printIcon('design', 'edit', $vars, $design, 'list', 'alter', '', '', '', '', '', $design->project);
|
||||
common::printIcon('design', 'edit', $vars, $design, 'list', 'alter');
|
||||
common::printIcon('design', 'viewCommit', $vars, $design, 'list', 'list-alt', '', 'iframe showinonlybody', true);
|
||||
common::printIcon('design', 'delete', $vars, $design, 'list', 'trash', 'hiddenwin', '', '', '', '', $design->project);
|
||||
common::printIcon('design', 'delete', $vars, $design, 'list', 'trash', 'hiddenwin');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -11,10 +11,8 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<style>
|
||||
#mainContent .pull-right{margin-bottom: 10px}
|
||||
.table{border: 1px solid #ddd;}
|
||||
</style>
|
||||
<?php js::set('repos', $repos);?>
|
||||
<?php js::set('projectID', $design->project);?>
|
||||
<div id="mainContent">
|
||||
<div class='main-header'>
|
||||
<h2>
|
||||
@@ -24,7 +22,7 @@
|
||||
</h2>
|
||||
</div>
|
||||
<div class='btn-toolbar pull-right'>
|
||||
<?php common::printLink('design', 'linkCommit', "designID=$design->id", "<i class='icon icon-plus'></i>" . $lang->design->linkCommit, '_blank', "class='btn btn-primary'");?>
|
||||
<?php common::printLink('design', 'linkCommit', "designID=$design->id", "<i class='icon icon-plus'></i>" . $lang->design->linkCommit, '', "class='btn btn-primary' id='linkCommit'");?>
|
||||
</div>
|
||||
<?php if(empty($design->commit)):?>
|
||||
<div class="table-empty-tip">
|
||||
|
||||
@@ -99,3 +99,5 @@ ol, ul {margin-bottom: 0}
|
||||
|
||||
.tree li.active > .tree-group a {font-weight: 700; color: #0c64eb;}
|
||||
.tree li>.list-toggle {left: -4px; top: 0;}
|
||||
|
||||
.fullscreen-close {top: 8px !important;}
|
||||
|
||||
@@ -7,4 +7,4 @@ table {width: 90% !important;}
|
||||
#product_chosen {width: 50% !important;}
|
||||
#execution_chosen {width: 50% !important;}
|
||||
|
||||
#whiteListBox .input-group:last-child {margin-top: 10px;}
|
||||
#groups_chosen.chosen-container .chosen-results, #users_chosen.chosen-container .chosen-results {max-height: 160px;}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#whiteListBox .input-group:last-child {margin-top: 10px;}
|
||||
#mainContent .main-header h2 {width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
|
||||
.fullscreen-save, .markdown-fullscreen-save {position: fixed; top: 10px; right: 30px; z-index: 999999;}
|
||||
|
||||
.modal-header .fullscreen-save, .markdown-fullscreen-save {top: 5px; right: 60px;}
|
||||
|
||||
@@ -4,3 +4,4 @@ form {margin-right: 30px;}
|
||||
#whiteListBox .input-group:last-child {margin-top: 10px;}
|
||||
|
||||
.center-block {margin-top: 20px;}
|
||||
#groups_chosen.chosen-container .chosen-results, #users_chosen.chosen-container .chosen-results {max-height: 160px;}
|
||||
|
||||
@@ -82,6 +82,34 @@ $(function()
|
||||
}
|
||||
}, 200);
|
||||
}
|
||||
else
|
||||
{
|
||||
setTimeout(function()
|
||||
{
|
||||
if($('a[title="Fullscreen"]').hasClass('active'))
|
||||
{
|
||||
$('.main-header').hide();
|
||||
$('#submit').addClass('markdown-fullscreen-save');
|
||||
$('#submit').removeClass('btn-wide');
|
||||
$('#mainContent .fullscreen').css('padding-top', '8px');
|
||||
$('#mainContent .fullscreen').css('height', '40px');
|
||||
$('.CodeMirror-fullscreen').css('top', '40px');
|
||||
$('.editor-preview-side').css('top', '40px');
|
||||
$('#submit').data('placement', 'left');
|
||||
parent.$('.modal-header > .close').addClass('fullscreen-close');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('.main-header').show();
|
||||
$('#submit').removeClass('markdown-fullscreen-save');
|
||||
$('#mainContent .editor-toolbar').css('padding', '1px');
|
||||
$('#mainContent .editor-toolbar').css('height', '30px');
|
||||
$('.CodeMirror').css('top', '0px');
|
||||
$('.editor-preview-side').css('top', '0px');
|
||||
parent.$('.modal-header > .close').removeClass('fullscreen-close');
|
||||
}
|
||||
}, 200);
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
@@ -1971,7 +1971,7 @@ class execution extends control
|
||||
if($execution->type == 'kanban')
|
||||
{
|
||||
if(defined('RUN_MODE') && RUN_MODE == 'api') return print($this->fetch('execution', 'kanban', "executionID=$executionID"));
|
||||
return $this->locate(inlink('kanban', "executionID=$executionID"));
|
||||
return print(js::locate(inlink('kanban', "executionID=$executionID")));
|
||||
}
|
||||
|
||||
$this->app->loadLang('program');
|
||||
@@ -2041,7 +2041,7 @@ class execution extends control
|
||||
|
||||
$this->lang->execution->menu = new stdclass();
|
||||
$execution = $this->commonAction($executionID);
|
||||
if($execution->type != 'kanban') return $this->locate(inlink('view', "executionID=$executionID"));
|
||||
if($execution->type != 'kanban') return print(js::locate(inlink('view', "executionID=$executionID")));
|
||||
|
||||
$kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $browseType, $orderBy, 0, $groupBy);
|
||||
$executionActions = array();
|
||||
@@ -3279,7 +3279,8 @@ class execution extends control
|
||||
$this->view->project = $project;
|
||||
$this->project->setMenu($projectID);
|
||||
|
||||
if(!empty($project->model) and $project->model == 'kanban' and !(defined('RUN_MODE') and RUN_MODE == 'api')) return $this->locate($this->createLink('project', 'index', "projectID=$projectID"));
|
||||
if(!$projectID) return print(js::locate($this->createLink('project', 'browse')));
|
||||
if(!empty($project->model) and $project->model == 'kanban' and !(defined('RUN_MODE') and RUN_MODE == 'api')) return print(js::locate($this->createLink('project', 'index', "projectID=$projectID")));
|
||||
}
|
||||
|
||||
if($this->app->viewType == 'mhtml')
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
@@ -1680,9 +1680,9 @@ class executionModel extends model
|
||||
|
||||
$execution->days = $execution->days ? $execution->days : '';
|
||||
$execution->totalHours = $this->dao->select('sum(days * hours) AS totalHours')->from(TABLE_TEAM)->where('root')->eq($execution->id)->andWhere('type')->eq('execution')->fetch('totalHours');
|
||||
$execution->totalEstimate = round($total->totalEstimate, 1);
|
||||
$execution->totalConsumed = round($total->totalConsumed, 1);
|
||||
$execution->totalLeft = round($total->totalLeft - $closedTotalLeft, 1);
|
||||
$execution->totalEstimate = round((float)$total->totalEstimate, 1);
|
||||
$execution->totalConsumed = round((float)$total->totalConsumed, 1);
|
||||
$execution->totalLeft = round((float)($total->totalLeft - $closedTotalLeft), 1);
|
||||
|
||||
$execution = $this->loadModel('file')->replaceImgURL($execution, 'desc');
|
||||
if($setImgSize) $execution->desc = $this->file->setImgSize($execution->desc);
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
.fullscreen-close {top: 8px !important;}
|
||||
@@ -240,6 +240,14 @@ class programModel extends model
|
||||
foreach($products as $product)
|
||||
{
|
||||
$product->plans = zget($plans, $product->id, array());
|
||||
|
||||
/* Convert predefined HTML entities to characters. */
|
||||
!empty($product->plans) && array_map(function($planVal)
|
||||
{
|
||||
return $planVal->title = htmlspecialchars_decode($planVal->title, ENT_QUOTES);
|
||||
},
|
||||
$product->plans);
|
||||
|
||||
$product->releases = zget($releases, $product->id, array());
|
||||
$projects = zget($projectGroup, $product->id, array());
|
||||
foreach($projects as $project)
|
||||
|
||||
@@ -2189,6 +2189,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>
|
||||
|
||||
@@ -833,7 +833,7 @@ class task extends control
|
||||
}
|
||||
|
||||
$execution = $this->execution->getById($task->execution);
|
||||
if(!isonlybody() and $execution->type == 'kanban') return $this->locate($this->createLink('execution', 'kanban', "executionID=$execution->id"));
|
||||
if(!isonlybody() and $execution->type == 'kanban') return print(js::locate($this->createLink('execution', 'kanban', "executionID=$execution->id")));
|
||||
|
||||
$this->session->project = $task->project;
|
||||
|
||||
|
||||
+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>
|
||||
|
||||
@@ -176,7 +176,7 @@ class treeModel extends model
|
||||
|
||||
ksort($treeMenu);
|
||||
$topMenu = @array_shift($treeMenu);
|
||||
$topMenu = explode("\n", trim($topMenu));
|
||||
$topMenu = explode("\n", trim((string)$topMenu));
|
||||
$lastMenu[] = '/';
|
||||
foreach($topMenu as $menu)
|
||||
{
|
||||
|
||||
@@ -718,7 +718,7 @@ class upgrade extends control
|
||||
}
|
||||
|
||||
$extFiles = $this->upgrade->getExtFiles();
|
||||
if(!empty($extFiles) and $skipMoveFile == 'no') return $this->locate(inlink('moveExtFiles', "fromVersion=$fromVersion"));
|
||||
if(!empty($extFiles) and $skipMoveFile == 'no') return print(js::locate(inlink('moveExtFiles', "fromVersion=$fromVersion")));
|
||||
|
||||
$response = $this->upgrade->removeEncryptedDir();
|
||||
if($response['result'] == 'fail')
|
||||
|
||||
@@ -424,7 +424,7 @@ class userModel extends model
|
||||
$data[$i]->type = 'inside';
|
||||
$data[$i]->realname = $users->realname[$i];
|
||||
$data[$i]->role = $role;
|
||||
$data[$i]->group = in_array('ditto', $users->group[$i]) ? (isset($prev['group']) ? $prev['group'] : '') : $users->group[$i];
|
||||
$data[$i]->group = in_array('ditto', isset($users->group[$i]) ? $users->group[$i] : array()) ? (isset($prev['group']) ? $prev['group'] : '') : $users->group[$i];
|
||||
$data[$i]->email = $users->email[$i];
|
||||
$data[$i]->gender = $users->gender[$i];
|
||||
$data[$i]->password = md5(trim($users->password[$i]));
|
||||
|
||||
@@ -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>
|
||||
|
||||
+206
-61
@@ -138,13 +138,27 @@ class kanbanTest
|
||||
return $object;
|
||||
}
|
||||
|
||||
public function splitColumnTest($columnID)
|
||||
/**
|
||||
* Test split column.
|
||||
*
|
||||
* @param int $columnID
|
||||
* @param array $param
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
public function splitColumnTest($columnID, $param)
|
||||
{
|
||||
foreach($param as $key => $value) $_POST[$key] = $value;
|
||||
|
||||
$objects = $this->objectModel->splitColumn($columnID);
|
||||
|
||||
unset($_POST);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
global $tester;
|
||||
$childs = $tester->dao->select('*')->from(TABLE_KANBANCOLUMN)->where('`parent`')->eq($columnID)->fetchAll();
|
||||
return count($childs);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -755,13 +769,42 @@ class kanbanTest
|
||||
return $object;
|
||||
}
|
||||
|
||||
public function updateSpaceTest($spaceID, $type = '')
|
||||
/**
|
||||
* Test update a space.
|
||||
*
|
||||
* @param int $spaceID
|
||||
* @param string $type
|
||||
* @param array $param
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function updateSpaceTest($spaceID, $type = '', $param = array())
|
||||
{
|
||||
$objects = $this->objectModel->updateSpace($spaceID, $type = '');
|
||||
global $tester;
|
||||
$object = $tester->dao->select('`type`,`name`,`owner`,`team`,`desc`,`whitelist`')->from(TABLE_KANBANSPACE)->where('`id`')->eq($spaceID)->fetch();
|
||||
$object->team = explode(',', $object->team);
|
||||
$object->whitelist = explode(',', $object->whitelist);
|
||||
|
||||
foreach($object as $field => $value)
|
||||
{
|
||||
if(in_array($field, array_keys($param)))
|
||||
{
|
||||
$_POST[$field] = $param[$field];
|
||||
}
|
||||
else
|
||||
{
|
||||
$_POST[$field] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$change = $this->objectModel->updateSpace($spaceID, $type);
|
||||
if($change == array()) $change = '没有数据更新';
|
||||
|
||||
unset($_POST);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
return $change;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -774,6 +817,11 @@ class kanbanTest
|
||||
*/
|
||||
public function getLanePairsByRegionTest($regionID, $type = 'all')
|
||||
{
|
||||
global $tester;
|
||||
|
||||
|
||||
foreach($param as $key => $value) $_POST[$key] = $value;
|
||||
|
||||
$objects = $this->objectModel->getLanePairsByRegion($regionID, $type);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
@@ -846,13 +894,39 @@ class kanbanTest
|
||||
return $object;
|
||||
}
|
||||
|
||||
public function updateTest($kanbanID)
|
||||
/**
|
||||
* Test update a kanban.
|
||||
*
|
||||
* @param int $kanbanID
|
||||
* @param array $param
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function updateTest($kanbanID, $param)
|
||||
{
|
||||
$objects = $this->objectModel->update($kanbanID);
|
||||
global $tester;
|
||||
$object = $tester->dao->select('`space`,`name`,`owner`,`team`,`desc`')->from(TABLE_KANBAN)->where('`id`')->eq($kanbanID)->fetch();
|
||||
$object->team = explode(',', $object->team);
|
||||
|
||||
foreach($object as $field => $value)
|
||||
{
|
||||
if(in_array($field, array_keys($param)))
|
||||
{
|
||||
$_POST[$field] = $param[$field];
|
||||
}
|
||||
else
|
||||
{
|
||||
$_POST[$field] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$change = $this->objectModel->update($kanbanID);
|
||||
if($change == array()) $change = '没有数据更新';
|
||||
unset($_POST);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
return $change;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1031,22 +1105,51 @@ class kanbanTest
|
||||
return count($objects);
|
||||
}
|
||||
|
||||
public function updateRegionTest($regionID)
|
||||
/**
|
||||
* Test update a region.
|
||||
*
|
||||
* @param int $regionID
|
||||
* @param string $name
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function updateRegionTest($regionID, $name)
|
||||
{
|
||||
$objects = $this->objectModel->updateRegion($regionID);
|
||||
$_POST['name'] = $name;
|
||||
|
||||
$change = $this->objectModel->updateRegion($regionID);
|
||||
if($change == array()) $change = '没有数据更新';
|
||||
|
||||
unset($_POST);
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
return $change;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test update kanban lane.
|
||||
*
|
||||
* @param int $executionID
|
||||
* @param string $laneType
|
||||
* @param int $cardID
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function updateLaneTest($executionID, $laneType, $cardID = 0)
|
||||
{
|
||||
$objects = $this->objectModel->updateLane($executionID, $laneType, $cardID = 0);
|
||||
global $tester;
|
||||
$objects = $tester->dao->select('*')->from(TABLE_KANBANLANE)->where('type')->ne('common')->andWhere('execution')->eq($executionID)->fetch();
|
||||
if(empty($objects)) $this->objectModel->createExecutionLane($executionID);
|
||||
|
||||
$this->objectModel->updateLane($executionID, $laneType, $cardID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
$objects = $tester->dao->select('*')->from(TABLE_KANBANCELL)->where('kanban')->eq($executionID)->andWhere('type')->eq($laneType)->fetchAll();
|
||||
$cards = '';
|
||||
foreach($objects as $object) $cards .= $object->cards;
|
||||
$cards = preg_replace('#,+#', ',', $cards);
|
||||
return $cards;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1074,22 +1177,28 @@ class kanbanTest
|
||||
return $cards;
|
||||
}
|
||||
|
||||
public function updateLaneColumnTest($columnID, $column)
|
||||
/**
|
||||
* Test update a column.
|
||||
*
|
||||
* @param int $columnID
|
||||
* @param string $name
|
||||
* @param string $color
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function updateLaneColumnTest($columnID, $name, $color)
|
||||
{
|
||||
$objects = $this->objectModel->updateLaneColumn($columnID, $column);
|
||||
$_POST['name'] = $name;
|
||||
$_POST['color'] = $color;
|
||||
|
||||
$column = $this->objectModel->getColumnByID($columnID);
|
||||
$change = $this->objectModel->updateLaneColumn($columnID, $column);
|
||||
if($change == array()) $change = '没有数据更新';
|
||||
|
||||
unset($_POST);
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function updateLaneOrderTest($executionID, $currentType, $targetType)
|
||||
{
|
||||
$objects = $this->objectModel->updateLaneOrder($executionID, $currentType, $targetType);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
return $change;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1115,13 +1224,40 @@ class kanbanTest
|
||||
return $object;
|
||||
}
|
||||
|
||||
public function updateCardTest($cardID)
|
||||
/**
|
||||
* Test update a card.
|
||||
*
|
||||
* @param int $cardID
|
||||
* @param array $param
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function updateCardTest($cardID, $param)
|
||||
{
|
||||
$objects = $this->objectModel->updateCard($cardID);
|
||||
global $tester;
|
||||
$object = $tester->dao->select('`name`,`desc`,`assignedTo`,`begin`,`end`,`pri`,`estimate`, `progress`')->from(TABLE_KANBANCARD)->where('`id`')->eq($cardID)->fetch();
|
||||
$object->assignedTo = explode(',', $object->assignedTo);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
foreach($object as $field => $value)
|
||||
{
|
||||
if(in_array($field, array_keys($param)))
|
||||
{
|
||||
$_POST[$field] = $param[$field];
|
||||
}
|
||||
else
|
||||
{
|
||||
$_POST[$field] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
return $objects;
|
||||
$change = $this->objectModel->updateCard($cardID);
|
||||
if($change == array()) $change = '没有数据更新';
|
||||
unset($_POST);
|
||||
|
||||
|
||||
if(dao::isError()) return dao::getError()[0];
|
||||
|
||||
return $change;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1222,31 +1358,23 @@ class kanbanTest
|
||||
return $object;
|
||||
}
|
||||
|
||||
public function setHeaderActionsTest($kanban)
|
||||
{
|
||||
$objects = $this->objectModel->setHeaderActions($kanban);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function setSwitcherTest($kanban)
|
||||
{
|
||||
$objects = $this->objectModel->setSwitcher($kanban);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test sort kanban group;
|
||||
*
|
||||
* @param int $region
|
||||
* @param array $groups
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function sortGroupTest($region, $groups)
|
||||
{
|
||||
$objects = $this->objectModel->sortGroup($region, $groups);
|
||||
$this->objectModel->sortGroup($region, $groups);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
global $tester;
|
||||
$objects = $tester->dao->select('*')->from(TABLE_KANBANGROUP)->where('region')->eq($region)->orderBy('order_asc')->fetchAll('id');
|
||||
return implode(array_keys($objects), ',');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1272,22 +1400,22 @@ class kanbanTest
|
||||
return $object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test update a card's color.
|
||||
*
|
||||
* @param int $cardID
|
||||
* @param string $color
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function updateCardColorTest($cardID, $color)
|
||||
{
|
||||
$objects = $this->objectModel->updateCardColor($cardID, $color);
|
||||
$this->objectModel->updateCardColor($cardID, $color);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function resetLaneOrderTest($executionID, $type, $groupBy)
|
||||
{
|
||||
$objects = $this->objectModel->resetLaneOrder($executionID, $type, $groupBy);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
$object = $this->objectModel->getCardByID($cardID);
|
||||
return $object;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1366,7 +1494,7 @@ class kanbanTest
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
global $tester;
|
||||
$nodes = $tester->dao->select('id,id')->from(TABLE_KANBANCOLUMN)->where('`parent`')->eq($column->parent)->fetchPairs();
|
||||
$nodes = $tester->dao->select('*')->from(TABLE_KANBANCOLUMN)->where('`parent`')->eq($column->parent)->andWhere('`id`')->ne($columnID)->fetchAll('id');
|
||||
$objects = $tester->dao->select('*')->from(TABLE_KANBANCELL)->where('`column`')->in(array_keys($nodes))->fetchAll();
|
||||
|
||||
$cards = '';
|
||||
@@ -1503,6 +1631,15 @@ class kanbanTest
|
||||
return $object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get object group list.
|
||||
*
|
||||
* @param int $executionID
|
||||
* @param string $type
|
||||
* @param string $groupBy
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getObjectGroupTest($executionID, $type, $groupBy)
|
||||
{
|
||||
$objects = $this->objectModel->getObjectGroup($executionID, $type, $groupBy);
|
||||
@@ -1566,6 +1703,14 @@ class kanbanTest
|
||||
return count($objects);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get Kanban cards menus by execution id.
|
||||
*
|
||||
* @param int $executionID
|
||||
* @param string $objecType
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
public function getKanbanCardMenuTest($executionID, $objecType)
|
||||
{
|
||||
global $tester;
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
class myTest
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
global $tester;
|
||||
$this->objectModel = $tester->loadModel('my');
|
||||
}
|
||||
|
||||
/**
|
||||
* Function getProducts test by my
|
||||
*
|
||||
* @param string $type
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getProductsTest($type)
|
||||
{
|
||||
$objects = $this->objectModel->getProducts($type);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function getDoingProjects test by my
|
||||
*
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getDoingProjectsTest()
|
||||
{
|
||||
$objects = $this->objectModel->getDoingProjects();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function getOverview test by my
|
||||
*
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getOverviewTest()
|
||||
{
|
||||
$objects = $this->objectModel->getOverview();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function getContribute test by my
|
||||
*
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getContributeTest()
|
||||
{
|
||||
$objects = $this->objectModel->getContribute();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function getActions test by my
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getActionsTest()
|
||||
{
|
||||
$objects = $this->objectModel->getActions();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,6 @@ class programTest
|
||||
{
|
||||
global $tester;
|
||||
|
||||
su('admin');
|
||||
$this->program = $tester->loadModel('program');
|
||||
}
|
||||
|
||||
@@ -51,93 +50,6 @@ class programTest
|
||||
return $this->program->getStakeholdersByPrograms($programID);
|
||||
}
|
||||
|
||||
/**
|
||||
* getBudgetLeft
|
||||
*
|
||||
* @param int mixed $programID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getBudgetLeft($programID)
|
||||
{
|
||||
$program = $this->program->getById(1);
|
||||
|
||||
return $this->program->getBudgetLeft($program);
|
||||
}
|
||||
|
||||
/**
|
||||
* getBudgetUnitList
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getBudgetUnitList()
|
||||
{
|
||||
global $app;
|
||||
$app->loadConfig('project');
|
||||
$app->loadLang('project');
|
||||
|
||||
return $this->program->getBudgetUnitList();
|
||||
}
|
||||
|
||||
/**
|
||||
* getById
|
||||
*
|
||||
* @param iont mixed $programID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getById($programID)
|
||||
{
|
||||
if(empty($this->program->getById($programID)))
|
||||
{
|
||||
return array('code' => 'fail', 'message' => 'Not Found');
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->program->getById($programID);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getChildren
|
||||
*
|
||||
* @param int mixed $programID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getChildren($programID)
|
||||
{
|
||||
$programInfo = $this->program->getChildren($programID);
|
||||
if(empty($programInfo))
|
||||
{
|
||||
return array('code' => 'fail' , 'message' => 'Not Found');
|
||||
}
|
||||
else
|
||||
{
|
||||
return $programInfo;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get pairs by list.
|
||||
*
|
||||
* @param string|array $programIDList
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getPairsByList($programIDList = '')
|
||||
{
|
||||
if(empty($this->program->getPairsByList($programIDList)))
|
||||
{
|
||||
return array('code' => '404', 'message' => 'Not Found');
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->program->getPairsByList($programIDList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get list.
|
||||
*
|
||||
@@ -156,228 +68,6 @@ class programTest
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getParentPairs
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getParentPairs()
|
||||
{
|
||||
return $this->program->getParentPairs();
|
||||
}
|
||||
|
||||
/**
|
||||
* getParentPM
|
||||
*
|
||||
* @param array mixed $programIdList
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getParentPM($programIdList)
|
||||
{
|
||||
return $this->program->getParentPM($programIdList);
|
||||
}
|
||||
|
||||
/**
|
||||
* getProductPairsByID
|
||||
*
|
||||
* @param int $programID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getProductPairsByID($programID = 0)
|
||||
{
|
||||
$program = $this->program->getByID($programID);
|
||||
if(empty($program)) return array('message' => 'Not Found');
|
||||
return $this->program->getProductPairs($programID, 'assign', 'all');
|
||||
}
|
||||
|
||||
/**
|
||||
* getProductPairsByMod
|
||||
*
|
||||
* @param string $mode
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getProductPairsByMod($mode = 'assign')
|
||||
{
|
||||
return $this->program->getProductPairs(1, $mode, 'noclosed');
|
||||
}
|
||||
|
||||
/**
|
||||
* getProductPairsByStatus
|
||||
*
|
||||
* @param string $status
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getProductPairsByStatus($status = 'all')
|
||||
{
|
||||
return $this->program->getProductPairs(1, 'assign', $status);
|
||||
}
|
||||
|
||||
/**
|
||||
* getProgressList
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getProgressList()
|
||||
{
|
||||
return $this->program->getProgressList();
|
||||
}
|
||||
|
||||
/**
|
||||
* getStatsByProgramID
|
||||
*
|
||||
* @param int $programID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getStatsByProgramID($programID = 0)
|
||||
{
|
||||
return count($this->program->getProjectStats($programID));
|
||||
}
|
||||
|
||||
/**
|
||||
* getStatsByStatus
|
||||
*
|
||||
* @param string $browseType
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getStatsByStatus($browseType = 'all')
|
||||
{
|
||||
$projects = $this->program->getProjectStats('0', $browseType);
|
||||
|
||||
if(!$projects) return 0;
|
||||
foreach($projects as $project)
|
||||
{
|
||||
if($project->status != $browseType and $browseType != 'all' and $browseType != 'undone') return 0;
|
||||
if($browseType == 'undone' and ($project->status != ('wait' or 'doing'))) return 0;
|
||||
}
|
||||
|
||||
return count($projects);
|
||||
}
|
||||
|
||||
/**
|
||||
* getStatsByOrder
|
||||
*
|
||||
* @param string $orderBy
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getStatsByOrder($orderBy = 'id_desc')
|
||||
{
|
||||
$projects = $this->program->getProjectStats('0', 'all', '0', $orderBy);
|
||||
|
||||
return checkOrder($projects, $orderBy);
|
||||
}
|
||||
|
||||
/**
|
||||
* getStatsAddProgramTitle
|
||||
*
|
||||
* @param int $programTitle
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getStatsAddProgramTitle($programTitle = 0)
|
||||
{
|
||||
return $this->program->getProjectStats('0', 'all', '0', 'id_desc', '', $programTitle);
|
||||
}
|
||||
|
||||
/**
|
||||
* getStatsByInvolved
|
||||
*
|
||||
* @param int $involved
|
||||
* @param string $count
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getStatsByInvolved($involved = 0, $count = '')
|
||||
{
|
||||
$projects = $this->program->getProjectStats('0', 'all', '0', 'id_desc', '', '0', $involved);
|
||||
|
||||
if($count == 'count') return count($projects);
|
||||
return $projects;
|
||||
}
|
||||
|
||||
/**
|
||||
* getByPrograms
|
||||
*
|
||||
* @param int $programIdList
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getByPrograms($programIdList = 0)
|
||||
{
|
||||
$stakeHolders = $this->program->getStakeholdersByPrograms($programIdList);
|
||||
|
||||
return $stakeHolders;
|
||||
}
|
||||
|
||||
/**
|
||||
* getByOrder
|
||||
*
|
||||
* @param string $orderBy
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getByOrder($orderBy = 'id_desc')
|
||||
{
|
||||
$stakeholders = $this->program->getStakeholders(2, $orderBy);
|
||||
|
||||
return checkOrder($stakeholders, $orderBy);
|
||||
}
|
||||
|
||||
/**
|
||||
* getTopPairs
|
||||
*
|
||||
* @param string $count
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getTopPairs($count = '')
|
||||
{
|
||||
if($count == 'count') return count($this->program->getTopPairs());
|
||||
return $this->program->getTopPairs();
|
||||
}
|
||||
|
||||
/**
|
||||
* getUnfinished
|
||||
*
|
||||
* @param mixed $programID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getUnfinished($programID)
|
||||
{
|
||||
$program = $this->program->getById($programID);
|
||||
|
||||
return $this->program->hasUnfinished($program);
|
||||
}
|
||||
|
||||
/**
|
||||
* setTreePath
|
||||
*
|
||||
* @param mixed $programID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setTreePath($programID)
|
||||
{
|
||||
$programPath = $this->program->setTreePath($programID);
|
||||
if($programPath)
|
||||
{
|
||||
return $this->program->getById($programID);
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* update
|
||||
*
|
||||
@@ -388,75 +78,10 @@ class programTest
|
||||
*/
|
||||
public function update($programID, $data)
|
||||
{
|
||||
global $app;
|
||||
|
||||
$_POST = $data;
|
||||
$result = $this->program->update(10);
|
||||
$this->program->update($programID);
|
||||
if(dao::isError()) return array('message' => dao::getError());
|
||||
|
||||
$app->dbh->query("UPDATE " . TABLE_PROGRAM . " SET name = '" . $result[0]['old']. "' where id = '" . $programID . "'");
|
||||
return $result;
|
||||
return $this->program->getByID($programID);
|
||||
}
|
||||
|
||||
/**
|
||||
* updateProgram
|
||||
*
|
||||
* @param mixed $programID
|
||||
* @param int $status
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function updateProgram($programID, $status = 0)
|
||||
{
|
||||
$data = array(
|
||||
'parent' => '0',
|
||||
'name' => '测试更新项目集十',
|
||||
'begin' => '2020-10-10',
|
||||
'end' => '2020-10-11',
|
||||
'acl' => 'private',
|
||||
'budget' => '100',
|
||||
'budgetUnit' => 'CNY',
|
||||
'whitelist' => array('dev10', 'dev12')
|
||||
);
|
||||
|
||||
switch($status)
|
||||
{
|
||||
case '1': // 项目集名称已经存在时
|
||||
$data['name'] = '项目集1';
|
||||
break;
|
||||
case '2': // 当计划开始为空时更新项目集信息
|
||||
$data['begin'] = '';
|
||||
break;
|
||||
case '3': // 当计划完成为空时更新项目集信息
|
||||
$data['end'] = '';
|
||||
break;
|
||||
case '4': // 当计划完成小于计划开始时
|
||||
$data['end'] = '2020-01-01';
|
||||
break;
|
||||
case '5': // 项目集开始时间小于父项目集时
|
||||
$data['parent'] = '9';
|
||||
$data['begin'] = '2019-01-01';
|
||||
break;
|
||||
default: // 更新id为10的项目集信息
|
||||
}
|
||||
return $this->update($programID, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test process node method.
|
||||
*
|
||||
* @param int $programID
|
||||
* @param int $parentID
|
||||
* @param string $oldPath
|
||||
* @param int $oldGrade
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function processNode($programID, $parentID, $oldPath, $oldGrade)
|
||||
{
|
||||
$programs = $this->program->processNode($programID, $parentID, $oldPath, $oldGrade);
|
||||
return $programs;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -47,12 +47,12 @@ fields:
|
||||
format: ""
|
||||
- field: date
|
||||
note: "日期"
|
||||
from: common.date.v1.yaml
|
||||
use: dateA
|
||||
range: "(-1M)-(w):1D"
|
||||
type: timestamp
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
format: "YYYY-MM-DD hh:mm:ss"
|
||||
- field: comment
|
||||
note: "备注"
|
||||
range: 1-100000
|
||||
|
||||
@@ -17,6 +17,8 @@ fields:
|
||||
range: []
|
||||
- field: type
|
||||
range: sprint{30},stage{30},kanban{30}
|
||||
- field: budget
|
||||
range: 800000-1:100
|
||||
- field: status
|
||||
range: wait,doing
|
||||
- field: percent
|
||||
|
||||
@@ -17,6 +17,8 @@ fields:
|
||||
range: []
|
||||
- field: type
|
||||
range: stage
|
||||
- field: budget
|
||||
range: 700000-1:100
|
||||
- field: status
|
||||
range: wait,doing
|
||||
- field: percent
|
||||
|
||||
@@ -17,6 +17,8 @@ fields:
|
||||
range: 1-10000
|
||||
- field: type
|
||||
range: program
|
||||
- field: budget
|
||||
range: 1000000-1:100
|
||||
- field: status
|
||||
range: wait
|
||||
- field: parent
|
||||
@@ -42,6 +44,18 @@ fields:
|
||||
prefix: "项目集描述"
|
||||
- field: acl
|
||||
range: open{4},private{4}
|
||||
- field: PO
|
||||
range: 1-10
|
||||
prefix: "po"
|
||||
- field: PM
|
||||
range: 1-10
|
||||
prefix: "pm"
|
||||
- field: QD
|
||||
range: 1-10
|
||||
prefix: "test"
|
||||
- field: RD
|
||||
range: 1-10
|
||||
prefix: "dev"
|
||||
- field: openedVersion
|
||||
range: "16.5"
|
||||
- field: whitelist
|
||||
|
||||
@@ -22,7 +22,7 @@ fields:
|
||||
- field: lifetime
|
||||
range:
|
||||
- field: budget
|
||||
range: 0
|
||||
range: 900000-1:100
|
||||
- field: budgetUnit
|
||||
range: CNY,USD
|
||||
- field: attribute
|
||||
|
||||
@@ -50,6 +50,7 @@ class Processor
|
||||
$this->initBug();
|
||||
$this->initTest();
|
||||
$this->initTodo();
|
||||
$this->initBassicSql();
|
||||
|
||||
$this->dao->commit();
|
||||
}
|
||||
@@ -285,6 +286,20 @@ class Processor
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* init BassicSql.
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
*/
|
||||
private function initBassicSql()
|
||||
{
|
||||
global $app;
|
||||
$sqlRoot = $app->getAppRoot();
|
||||
$this->dao->exec(file_get_contents($sqlRoot . '/data/zt_lang.sql'));
|
||||
$this->dao->exec(file_get_contents($sqlRoot . '/data/zt_cron.sql'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Init Stakeholder.
|
||||
*
|
||||
@@ -417,5 +432,15 @@ class Processor
|
||||
$this->dao->query("update zt_kanbancell set `cards` = ',246,' where id = 428");
|
||||
$this->dao->query("update zt_kanbancell set `cards` = ',184,185,186,' where id = 439");
|
||||
$this->dao->query("update zt_kanbancell set `cards` = ',62,' where id = 448");
|
||||
$this->dao->query("update zt_kanbancell set `cards` = ',247,' where id = 458");
|
||||
$this->dao->query("update zt_kanbancell set `cards` = ',187,188,189,' where id = 469");
|
||||
$this->dao->query("update zt_kanbancell set `cards` = ',63,' where id = 477");
|
||||
$this->dao->query("update zt_kanbancell set `cards` = ',248,' where id = 485");
|
||||
$this->dao->query("update zt_kanbancell set `cards` = ',190,191,192,' where id = 496");
|
||||
$this->dao->query("update zt_kanbancell set `cards` = ',64,' where id = 504");
|
||||
$this->dao->query("update zt_kanbancolumn set `parent` = '-1' where id = 202");
|
||||
$this->dao->query("update zt_kanbancolumn set `parent` = '202' where id in ('203','204')");
|
||||
$this->dao->query("update zt_kanbancolumn set `parent` = '-1' where id = 206");
|
||||
$this->dao->query("update zt_kanbancolumn set `parent` = '206' where id in ('207','208')");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
truncate `zt_cron`;
|
||||
INSERT INTO `zt_cron` (`m`, `h`, `dom`, `mon`, `dow`, `command`, `remark`, `type`, `buildin`, `status`, `lastTime`) VALUES
|
||||
('*', '*', '*', '*', '*', '', '监控定时任务', 'zentao', 1, 'normal', '0000-00-00 00:00:00'),
|
||||
('30', '23', '*', '*', '*', 'moduleName=execution&methodName=computeburn', '更新燃尽图', 'zentao', 1, 'normal', '0000-00-00 00:00:00'),
|
||||
('0', '8', '*', '*', '*', 'moduleName=report&methodName=remind', '每日任务提醒', 'zentao', 1, 'normal', '0000-00-00 00:00:00'),
|
||||
('*/5', '*', '*', '*', '*', 'moduleName=svn&methodName=run', '同步SVN', 'zentao', 1, 'stop', '0000-00-00 00:00:00'),
|
||||
('*/5', '*', '*', '*', '*', 'moduleName=git&methodName=run', '同步GIT', 'zentao', 1, 'stop', '0000-00-00 00:00:00'),
|
||||
('30', '0', '*', '*', '*', 'moduleName=backup&methodName=backup', '备份数据和附件', 'zentao', 1, 'normal', '0000-00-00 00:00:00'),
|
||||
('*/5', '*', '*', '*', '*', 'moduleName=mail&methodName=asyncSend', '异步发信', 'zentao', 1, 'normal', '0000-00-00 00:00:00'),
|
||||
('*/5', '*', '*', '*', '*', 'moduleName=webhook&methodName=asyncSend', '异步发送Webhook', 'zentao', 1, 'normal', '0000-00-00 00:00:00'),
|
||||
('*/5', '*', '*', '*', '*', 'moduleName=admin&methodName=deleteLog', '删除过期日志', 'zentao', 1, 'normal', '0000-00-00 00:00:00'),
|
||||
('1', '1', '*', '*', '*', 'moduleName=todo&methodName=createCycle', '生成周期性待办', 'zentao', 1, 'normal', '0000-00-00 00:00:00'),
|
||||
('1', '0', '*', '*', '*', 'moduleName=ci&methodName=initQueue', '创建周期性任务', 'zentao', 1, 'normal', '0000-00-00 00:00:00'),
|
||||
('*/5', '*', '*', '*', '*', 'moduleName=ci&methodName=checkCompileStatus', '同步DevOps构建任务状态', 'zentao', 1, 'normal', '0000-00-00 00:00:00'),
|
||||
('*/5', '*', '*', '*', '*', 'moduleName=ci&methodName=exec', '执行DevOps构建任务', 'zentao', 1, 'normal', '0000-00-00 00:00:00'),
|
||||
('*/5', '*', '*', '*', '*', 'moduleName=mr&methodName=syncMR', '定时同步GitLab合并数据到禅道数据库', 'zentao', 1, 'normal', '0000-00-00 00:00:00');
|
||||
INSERT INTO `zt_cron` (`m`, `h`, `dom`, `mon`, `dow`, `command`, `remark`, `type`, `buildin`, `status`, `lastTime`) VALUES ('30', '23', '*', '*', '*', 'moduleName=execution&methodName=computeTaskEffort', '计算任务剩余工时', 'zentao', '1', 'normal', '0000-00-00 00:00:00');
|
||||
INSERT INTO `zt_cron` (`m`, `h`, `dom`, `mon`, `dow`, `command`, `remark`, `type`, `buildin`, `status`, `lastTime`) VALUES ('30', '7', '*', '*', '*', 'moduleName=effort&methodName=remindNotRecord', '提醒录入日志', 'zentao', '1', 'stop', '0000-00-00 00:00:00');
|
||||
REPLACE INTO `zt_cron` (`m`, `h`, `dom`, `mon`, `dow`, `command`, `remark`, `type`, `buildin`, `status`, `lastTime`) VALUES
|
||||
('1','0','*','*','*','moduleName=weekly&methodName=computeWeekly','更新项目周报','system',0,'normal','2020-08-27 10:07:53'),
|
||||
('1','0','*','*','*','moduleName=measurement&methodName=initCrontabQueue','初始化度量队列','zentao',0,'normal','2020-07-07 14:51:48'),
|
||||
('*/5','*','*','*','*','moduleName=measurement&methodName=execCrontabQueue','执行度量队列','zentao',0,'running','2020-07-10 13:10:58');
|
||||
@@ -0,0 +1,14 @@
|
||||
truncate `zt_lang`;
|
||||
REPLACE INTO `zt_lang` (`lang`, `module`, `section`, `key`, `value`, `system`) VALUES
|
||||
('zh-cn', 'custom', 'URSRList', '1', '{\"SRName\":\"\\u8f6f\\u4ef6\\u9700\\u6c42\",\"URName\":\"\\u7528\\u6237\\u9700\\u6c42\"}', '1'),('zh-cn', 'custom', 'URSRList', '2', '{\"SRName\":\"\\u7814\\u53d1\\u9700\\u6c42\",\"URName\":\"\\u7528\\u6237\\u9700\\u6c42\"}', '1'),
|
||||
('zh-cn', 'custom', 'URSRList', '3', '{\"SRName\":\"\\u8f6f\\u9700\",\"URName\":\"\\u7528\\u9700\"}', '1'),('zh-cn', 'custom', 'URSRList', '4', '{\"SRName\":\"\\u6545\\u4e8b\",\"URName\":\"\\u53f2\\u8bd7\"}', '1'),
|
||||
('zh-cn', 'custom', 'URSRList', '5', '{\"SRName\":\"\\u9700\\u6c42\",\"URName\":\"\\u7528\\u6237\\u9700\\u6c42\"}', '1'),
|
||||
('en', 'custom', 'URSRList', '1', '{\"SRName\":\"Story\",\"URName\":\"Epic\"}', '0'),
|
||||
('en', 'custom', 'URSRList', '2', '{\"SRName\":\"Software Requirement\",\"URName\":\"User Requirement\"}', '0'),
|
||||
('all','stage','typeList','request','需求', '1'),
|
||||
('all','stage','typeList','design','设计', '1'),
|
||||
('all','stage','typeList','dev','开发', '1'),
|
||||
('all','stage','typeList','qa','测试', '1'),
|
||||
('all','stage','typeList','release','发布', '1'),
|
||||
('all','stage','typeList','review','总结评审','1'),
|
||||
('all','stage','typeList','other','其他','1');
|
||||
@@ -24,6 +24,6 @@ r($kanban->getCardGroupByExecutionTest($executionIDList[1]))
|
||||
r($kanban->getCardGroupByExecutionTest($executionIDList[1], $browseTypeList[0])) && p() && e('1'); // 测试查询execution162的task卡片
|
||||
r($kanban->getCardGroupByExecutionTest($executionIDList[1], $browseTypeList[1])) && p() && e('3'); // 测试查询execution162的bug卡片
|
||||
r($kanban->getCardGroupByExecutionTest($executionIDList[1], $browseTypeList[2])) && p() && e('1'); // 测试查询execution162的story卡片
|
||||
r($kanban->getCardGroupByExecutionTest($executionIDList[2])) && p() && e('0'); // 测试查询execution163的卡片
|
||||
r($kanban->getCardGroupByExecutionTest($executionIDList[3])) && p() && e('0'); // 测试查询execution164的卡片
|
||||
r($kanban->getCardGroupByExecutionTest($executionIDList[2])) && p() && e('4'); // 测试查询execution163的卡片
|
||||
r($kanban->getCardGroupByExecutionTest($executionIDList[3])) && p() && e('4'); // 测试查询execution164的卡片
|
||||
r($kanban->getCardGroupByExecutionTest($executionIDList[4])) && p() && e('0'); // 测试查询execution165的卡片
|
||||
|
||||
@@ -23,9 +23,9 @@ r($kanban->getRDKanbanTest($executionIDList[0], $browseTypeList[0], $regionIDLis
|
||||
r($kanban->getRDKanbanTest($executionIDList[0], $browseTypeList[0], $regionIDList[2])) && p() && e('columns:0, lanes:0, cards:0'); // 获取执行161 all region 102的执行看板
|
||||
r($kanban->getRDKanbanTest($executionIDList[1])) && p() && e('columns:27, lanes:3, cards:5'); // 获取执行162的执行看板
|
||||
r($kanban->getRDKanbanTest($executionIDList[1], $browseTypeList[1], $regionIDList[2])) && p() && e('columns:11, lanes:1, cards:2'); // 获取执行162 story region 102的执行看板
|
||||
r($kanban->getRDKanbanTest($executionIDList[2])) && p() && e('columns:27, lanes:3, cards:0'); // 获取执行163的执行看板
|
||||
r($kanban->getRDKanbanTest($executionIDList[2])) && p() && e('columns:27, lanes:3, cards:4'); // 获取执行163的执行看板
|
||||
r($kanban->getRDKanbanTest($executionIDList[2], $browseTypeList[2], $regionIDList[3])) && p() && e('columns:7, lanes:1, cards:4'); // 获取执行163 task region 103的执行看板
|
||||
r($kanban->getRDKanbanTest($executionIDList[3])) && p() && e('columns:27, lanes:3, cards:0'); // 获取执行164的执行看板
|
||||
r($kanban->getRDKanbanTest($executionIDList[3])) && p() && e('columns:27, lanes:3, cards:4'); // 获取执行164的执行看板
|
||||
r($kanban->getRDKanbanTest($executionIDList[3], $browseTypeList[3], $regionIDList[4])) && p() && e('columns:9, lanes:1, cards:3'); // 获取执行164 bug region 104的执行看板
|
||||
r($kanban->getRDKanbanTest($executionIDList[4])) && p() && e('columns:27, lanes:3, cards:0'); // 获取执行165的执行看板
|
||||
r($kanban->getRDKanbanTest($executionIDList[4], $browseTypeList[1], $regionIDList[5])) && p() && e('columns:11, lanes:1, cards:2'); // 获取执行165 story region 105的执行看板
|
||||
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/kanban.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 kanbanModel->processCards();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$columnIDList = array('203', '204', '207', '208');
|
||||
|
||||
$kanban = new kanbanTest();
|
||||
|
||||
r($kanban->processCardsTest($columnIDList[0])) && p() && e('204:,407,408,807,405,406,805,'); // 计算删除列203后的卡片
|
||||
r($kanban->processCardsTest($columnIDList[1])) && p() && e('203:,405,406,805,407,408,807,405,406,805,'); // 计算删除列204后的卡片
|
||||
r($kanban->processCardsTest($columnIDList[2])) && p() && e('208:,415,416,815,413,414,813,'); // 计算删除列207后的卡片
|
||||
r($kanban->processCardsTest($columnIDList[3])) && p() && e('207:,413,414,813,415,416,815,413,414,813,'); // 计算删除列208后的卡片
|
||||
system("./ztest init");
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/kanban.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 kanbanModel->sortGroup();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$regionIDList = array('101', '102', '103', '104', '105');
|
||||
$groupIDList = array(array('103', '101', '102'), array('105', '106', '104'), array('107', '109', '108'), array('112', '111', '110'), array('114', '113', '115'));
|
||||
|
||||
$kanban = new kanbanTest();
|
||||
|
||||
r($kanban->sortGroupTest($regionIDList[0], $groupIDList[0])) && p() && e('103,101,102'); // 测试区域101 泳道组101 102 103排序
|
||||
r($kanban->sortGroupTest($regionIDList[1], $groupIDList[1])) && p() && e('105,106,104'); // 测试区域102 泳道组104 105 106排序
|
||||
r($kanban->sortGroupTest($regionIDList[2], $groupIDList[2])) && p() && e('107,109,108'); // 测试区域103 泳道组107 108 109排序
|
||||
r($kanban->sortGroupTest($regionIDList[3], $groupIDList[3])) && p() && e('112,111,110'); // 测试区域104 泳道组110 111 112排序
|
||||
r($kanban->sortGroupTest($regionIDList[4], $groupIDList[4])) && p() && e('114,113,115'); // 测试区域105 泳道组113 114 115排序
|
||||
Executable
+46
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/kanban.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 kanbanModel->splitColumn();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$columnIDList = array('1', '2', '3', '4');
|
||||
|
||||
$name = array('1' => '拆分的子列1', '2' => '拆分的子列2');
|
||||
$color = array('1' => '#333', '2' => '#333');
|
||||
$WIPCount = array('1' => '111');
|
||||
$noLimit = array('2' => '-1');
|
||||
$splits1 = array('name' => $name, 'color' => $color, 'WIPCount' => $WIPCount, 'noLimit' => $noLimit);
|
||||
|
||||
$name = array('1' => '拆分的子列3', '2' => '拆分的子列4');
|
||||
$WIPCount = array('1' => '111', '2' => '111');
|
||||
$splits2 = array('name' => $name, 'color' => $color, 'WIPCount' => $WIPCount);
|
||||
|
||||
$name = array('1' => '拆分的子列5', '2' => '拆分的子列6');
|
||||
$noLimit = array('1' => '-1', '2' => '-1');
|
||||
$splits3 = array('name' => $name, 'color' => $color, 'noLimit' => $noLimit);
|
||||
|
||||
$WIPCount = array('1' => 'a', '2' => '0');
|
||||
$splits4 = array('name' => $name, 'color' => $color, 'WIPCount' => $WIPCount);
|
||||
|
||||
$name = array('1' => '', '2' => '');
|
||||
$splits5 = array('name' => $name, 'color' => $color, 'noLimit' => $noLimit);
|
||||
|
||||
|
||||
|
||||
$kanban = new kanbanTest();
|
||||
|
||||
r($kanban->splitColumnTest($columnIDList[0], $splits1)) && p() && e('2'); // 测试拆分列1
|
||||
r($kanban->splitColumnTest($columnIDList[1], $splits2)) && p() && e('2'); // 测试拆分列2
|
||||
r($kanban->splitColumnTest($columnIDList[2], $splits3)) && p() && e('2'); // 测试拆分列3
|
||||
r($kanban->splitColumnTest($columnIDList[3], $splits4)) && p('limit') && e('在制品数量必须是正整数。'); // 测试拆分列4
|
||||
r($kanban->splitColumnTest($columnIDList[3], $splits5)) && p('name') && e('『看板列名称』不能为空。'); // 测试拆分列4
|
||||
system("./ztest init");
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/kanban.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 kanbanModel->update();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$kanbanIDList = array('1', '2', '3', '4', '5');
|
||||
|
||||
$names = array('修改名字', '', ' ');
|
||||
$space = array('2', '');
|
||||
$desc = '修改注释';
|
||||
$owner = 'user4';
|
||||
$team = array('user5', 'po17', 'user3');
|
||||
|
||||
$kanban = new kanbanTest();
|
||||
|
||||
r($kanban->updateTest($kanbanIDList[0], array('name' => $names[0]))) && p('0:field,old,new') && e('name,通用看板1,修改名字'); // 测试修改看板名称
|
||||
r($kanban->updateTest($kanbanIDList[1], array('space' => $space[0]))) && p('0:field,old,new') && e('space,1,2'); // 测试修改看板空间
|
||||
r($kanban->updateTest($kanbanIDList[2], array('desc' => $desc))) && p('0:field,old,new') && e('desc,看板详情,修改注释'); // 测试修改看板备注
|
||||
r($kanban->updateTest($kanbanIDList[3], array('owner' => $owner))) && p('0:field,old,new') && e('owner,po16,user4'); // 测试修改看板负责人
|
||||
r($kanban->updateTest($kanbanIDList[4], array('team' => $team))) && p('0:field,old,new') && e('team,,user5,po17,,user5,po17,user3'); // 测试修改看板团队成员
|
||||
r($kanban->updateTest($kanbanIDList[0], array('name' => $names[0]))) && p() && e('没有数据更新'); // 测试重复修改看板名称
|
||||
r($kanban->updateTest($kanbanIDList[0], array('name' => $names[1]))) && p('name:0') && e('『看板名称』不能为空。'); // 测试修改看板名称为空
|
||||
r($kanban->updateTest($kanbanIDList[0], array('name' => $names[2]))) && p('name:0') && e('『看板名称』不能为空。'); // 测试修改看板名称为空格
|
||||
r($kanban->updateTest($kanbanIDList[0], array('space' => $space[1]))) && p('space:0') && e('『所属空间』不能为空。'); // 测试修改看板空间为空
|
||||
system("./ztest init");
|
||||
Executable
+49
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/kanban.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 kanbanModel->updateCard();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$cardIDList = array('1', '2', '3', '4', '5');
|
||||
|
||||
$name = array('修改名字', '', ' ');
|
||||
$desc = '修改注释';
|
||||
$assignedTo = array('user5', 'po17', 'user3');
|
||||
$begin = '2022-03-30';
|
||||
$end = '2022-04-01';
|
||||
$pri = '1';
|
||||
$estimate = array('3' , '0', '', '-1');
|
||||
$progress = array('0', '50', '100', '-1', '101');
|
||||
|
||||
$param1 = array('name' => $name[0], 'desc' => $desc, 'estimate' => $estimate[0]);
|
||||
$param2 = array('begin' => $begin, 'end' => $end, 'progress' => $progress[0]);
|
||||
$param3 = array('assignedTo' => $assignedTo, 'estimate' => $estimate[1], 'progress' => $progress[1]);
|
||||
$param4 = array('estimate' => $estimate[2], 'progress' => $progress[2]);
|
||||
$param5 = array('pri' => $pri);
|
||||
|
||||
$end = '2022-01-01';
|
||||
$param6 = array('begin' => $begin, 'end' => $end);
|
||||
$param7 = array('estimate' => $estimate[3]);
|
||||
$param8 = array('progress' => $progress[3]);
|
||||
$param9 = array('progress' => $progress[4]);
|
||||
|
||||
$kanban = new kanbanTest();
|
||||
|
||||
r($kanban->updateCardTest($cardIDList[0], $param1)) && p('0:field,old,new;1:field,old,new;2:field,old,new') && e('name,卡片1,修改名字;desc,,修改注释;estimate,0,3'); // 测试修改卡片1
|
||||
r($kanban->updateCardTest($cardIDList[1], $param2)) && p('0:field,new;1:field,new;2:field,old,new') && e('begin,2022-03-30;end,2022-04-01;progress,50,0'); // 测试修改卡片2
|
||||
r($kanban->updateCardTest($cardIDList[2], $param3)) && p('0:field,old,new;1:field,old,new;2:field,old,new') && e('assignedTo,admin,user5,po17,user3;progress,100,50;status,done,doing'); // 测试修改卡片3
|
||||
r($kanban->updateCardTest($cardIDList[3], $param4)) && p('0:field,old,new;1:field,old,new') && e('progress,0,100;status,doing,done'); // 测试修改卡片4
|
||||
r($kanban->updateCardTest($cardIDList[4], $param5)) && p('0:field,old,new') && e('pri,3,1'); // 测试修改卡片5
|
||||
r($kanban->updateCardTest($cardIDList[0], $param6)) && p() && e('"截止日期"不能小于"预计开始"!'); // 测试修改卡片开始小于结束日期
|
||||
r($kanban->updateCardTest($cardIDList[0], $param7)) && p() && e('预计不能为负数!'); // 测试修改卡片预计小于0
|
||||
r($kanban->updateCardTest($cardIDList[0], $param8)) && p() && e('请输入正确的进度'); // 测试修改卡片进度小于0
|
||||
r($kanban->updateCardTest($cardIDList[0], $param9)) && p() && e('请输入正确的进度'); // 测试修改卡片进度大于100
|
||||
system("./ztest init");
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/kanban.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 kanbanModel->updateCardColor();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$cardIDList = array('1', '2', '3', '4', '5');
|
||||
$colorList = array('b10b0b', 'cfa227', '2a5f29');
|
||||
|
||||
$kanban = new kanbanTest();
|
||||
|
||||
r($kanban->updateCardColorTest($cardIDList[0], $colorList[0])) && p('id,name,color') && e('1,卡片1,#b10b0b'); // 更新卡片1的颜色
|
||||
r($kanban->updateCardColorTest($cardIDList[1], $colorList[1])) && p('id,name,color') && e('2,卡片2,#cfa227'); // 更新卡片2的颜色
|
||||
r($kanban->updateCardColorTest($cardIDList[2], $colorList[2])) && p('id,name,color') && e('3,卡片3,#2a5f29'); // 更新卡片3的颜色
|
||||
r($kanban->updateCardColorTest($cardIDList[3], $colorList[0])) && p('id,name,color') && e('4,卡片4,#b10b0b'); // 更新卡片4的颜色
|
||||
r($kanban->updateCardColorTest($cardIDList[4], $colorList[1])) && p('id,name,color') && e('5,卡片5,#cfa227'); // 更新卡片5的颜色
|
||||
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/kanban.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 kanbanModel->updateLane();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$executionID = array('101', '102', '103');
|
||||
$laneType = array('story', 'bug', 'task');
|
||||
|
||||
$kanban = new kanbanTest();
|
||||
|
||||
r($kanban->updateLaneTest($executionID[0], $laneType[0])) && p() && e('0'); // 测试更新执行101的story泳道
|
||||
r($kanban->updateLaneTest($executionID[0], $laneType[1])) && p() && e(',1,3,301,2,'); // 测试更新执行101的bug泳道
|
||||
r($kanban->updateLaneTest($executionID[0], $laneType[2])) && p() && e(',1,901,907,902,908,903,909,904,910,905,906,'); // 测试更新执行101的task泳道
|
||||
r($kanban->updateLaneTest($executionID[1], $laneType[0])) && p() && e(',6,8,'); // 测试更新执行102的story泳道
|
||||
r($kanban->updateLaneTest($executionID[1], $laneType[1])) && p() && e(',5,302,4,6,'); // 测试更新执行102的bug泳道
|
||||
r($kanban->updateLaneTest($executionID[1], $laneType[2])) && p() && e(',2,604,605,606,'); // 测试更新执行102的task泳道
|
||||
r($kanban->updateLaneTest($executionID[2], $laneType[0])) && p() && e(',10,12,'); // 测试更新执行103的story泳道
|
||||
r($kanban->updateLaneTest($executionID[2], $laneType[1])) && p() && e(',7,9,303,8,'); // 测试更新执行103的bug泳道
|
||||
r($kanban->updateLaneTest($executionID[2], $laneType[2])) && p() && e(',607,608,3,609,'); // 测试更新执行103的task泳道
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/kanban.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 kanbanModel->updateLaneColumn();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
$columnIDList = array('1', '2', '3', '4', '5');
|
||||
$nameList = array('测试修改列名1', '测试修改列名2', '测试修改列名3', '', ' ');
|
||||
$colorList = array('#2b519c', '#e48610', '#d2313d', '#2a9f23', '#777');
|
||||
|
||||
$kanban = new kanbanTest();
|
||||
|
||||
r($kanban->updateLaneColumnTest($columnIDList[0], $nameList[0], $colorList[0])) && p('0:field,new,old;1:field,new,old') && e('name,测试修改列名1,未开始;color,#2b519c,#333'); // 测试修改列1信息
|
||||
r($kanban->updateLaneColumnTest($columnIDList[1], $nameList[1], $colorList[1])) && p('0:field,new,old;1:field,new,old') && e('name,测试修改列名2,进行中;color,#e48610,#333'); // 测试修改列2信息
|
||||
r($kanban->updateLaneColumnTest($columnIDList[2], $nameList[2], $colorList[2])) && p('0:field,new,old;1:field,new,old') && e('name,测试修改列名3,已完成;color,#d2313d,#333'); // 测试修改列3信息
|
||||
r($kanban->updateLaneColumnTest($columnIDList[3], $nameList[3], $colorList[3])) && p('name:0') && e('『看板列名称』不能为空。'); // 测试修改列4信息
|
||||
r($kanban->updateLaneColumnTest($columnIDList[4], $nameList[4], $colorList[4])) && p('name:0') && e('『看板列名称』不能为空。'); // 测试修改列5信息
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/kanban.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 kanbanModel->updateRegion();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$regionIDList = array('1', '2', '3', '4', '5');
|
||||
$nameList = array('测试修改区域名称1', '测试修改区域名称2', '测试修改区域名称3', '', ' ');
|
||||
|
||||
$kanban = new kanbanTest();
|
||||
|
||||
r($kanban->updateRegionTest($regionIDList[0], $nameList[0])) && p('0:field,old,new') && e('name,默认区域,测试修改区域名称1'); // 测试修改区域1的信息
|
||||
r($kanban->updateRegionTest($regionIDList[1], $nameList[1])) && p('0:field,old,new') && e('name,默认区域,测试修改区域名称2'); // 测试修改区域2的信息
|
||||
r($kanban->updateRegionTest($regionIDList[2], $nameList[2])) && p('0:field,old,new') && e('name,默认区域,测试修改区域名称3'); // 测试修改区域3的信息
|
||||
r($kanban->updateRegionTest($regionIDList[3], $nameList[3])) && p('name:0') && e('『区域名称』不能为空。'); // 测试修改区域4的信息
|
||||
r($kanban->updateRegionTest($regionIDList[4], $nameList[4])) && p('name:0') && e('『区域名称』不能为空。'); // 测试修改区域5的信息
|
||||
Executable
+41
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/kanban.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 kanbanModel->updateSpace();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$spaceIDList = array('1', '2', '3', '4', '5');
|
||||
$typeList = array('cooperation', 'private', 'public');
|
||||
$nameList = array('测试修改名称1', '测试修改名称2', '测试修改名称3', '测试修改名称4', '', ' ');
|
||||
$ownerList = array('user3', '');
|
||||
$whitelist = array(',user4,po16,user3,');
|
||||
$team = array(',user5,po17,user3,');
|
||||
$desc = '修改备注';
|
||||
|
||||
$param1 = array('name' => $nameList[0], 'owner' => $ownerList[0]);
|
||||
$param2 = array('name' => $nameList[1], 'whitelist' => $whitelist);
|
||||
$param3 = array('name' => $nameList[2], 'team' => $team);
|
||||
$param4 = array('name' => $nameList[3], 'desc' => $desc);
|
||||
$param5 = array('name' => $nameList[4]);
|
||||
$param6 = array('name' => $nameList[5]);
|
||||
$param7 = array('owner' => $ownerList[1]);
|
||||
|
||||
$kanban = new kanbanTest();
|
||||
|
||||
r($kanban->updateSpaceTest($spaceIDList[0], $typeList[0], $param1)) && p('0:field,old,new;1:field,old,new') && e('name,协作空间1,测试修改名称1;owner,po15,user3'); // 测试修改空间1
|
||||
r($kanban->updateSpaceTest($spaceIDList[1], $typeList[1], $param2)) && p('0:field,old,new;1:field,old,new') && e('name,私有空间2,测试修改名称2;whitelist,,user4,po16,,,user4,po16,user3,'); // 测试修改空间2
|
||||
r($kanban->updateSpaceTest($spaceIDList[2], $typeList[2], $param3)) && p('0:field,old,new;1:field,old,new') && e('name,公共空间3,测试修改名称3;team,,user5,po17,,,user5,po17,user3,'); // 测试修改空间3
|
||||
r($kanban->updateSpaceTest($spaceIDList[3], $typeList[0], $param4)) && p('0:field,old,new;1:field,old,new') && e('name,协作空间4,测试修改名称4;desc,,修改备注'); // 测试修改空间4
|
||||
r($kanban->updateSpaceTest($spaceIDList[3], $typeList[0], $param4)) && p() && e('没有数据更新'); // 测试重复修改空间4
|
||||
r($kanban->updateSpaceTest($spaceIDList[4], $typeList[1], $param5)) && p('name:0') && e('『空间名称』不能为空。'); // 测试修改空间5 不填写名称
|
||||
r($kanban->updateSpaceTest($spaceIDList[4], $typeList[1], $param6)) && p('name:0') && e('『空间名称』不能为空。'); // 测试修改空间5 名称为空格
|
||||
r($kanban->updateSpaceTest($spaceIDList[4], $typeList[1], $param7)) && p('owner:0') && e('『负责人』不能为空。'); // 测试修改空间5 不填写负责人
|
||||
system("./ztest init");
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/my.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 myModel->getActions();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
正常查询action >> 32,,32,,这是一个系统日志测试备注32
|
||||
正常查询action统计 >> 5
|
||||
|
||||
*/
|
||||
|
||||
$my = new myTest();
|
||||
|
||||
r($my->getActionsTest()) && p('0:id,product,comment') && e('32,,32,,这是一个系统日志测试备注32');// 正常查询action
|
||||
r(count($my->getActionsTest())) && p() && e('5'); // 正常查询action统计
|
||||
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/my.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 myModel->getContribute();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
myTaskTotal数据获取 >> 0
|
||||
myStoryTotal数据获取 >> 0
|
||||
myBugTotal数据获取 >> 85
|
||||
docCreatedTotal数据获取 >> 900
|
||||
ownerProductTotal数据获取 >> 0
|
||||
involvedProjectTotal数据获取 >> 1
|
||||
|
||||
*/
|
||||
|
||||
$my = new myTest();
|
||||
|
||||
$myTaskTotal = $my->getContributeTest()->myTaskTotal;
|
||||
$myStoryTotal = $my->getContributeTest()->myStoryTotal;
|
||||
$myBugTotal = $my->getContributeTest()->myBugTotal;
|
||||
$docCreatedTotal = $my->getContributeTest()->docCreatedTotal;
|
||||
$ownerProductTotal = $my->getContributeTest()->ownerProductTotal;
|
||||
$involvedProjectTotal = $my->getContributeTest()->involvedProjectTotal;
|
||||
|
||||
r($myTaskTotal) && p() && e('0'); //myTaskTotal数据获取
|
||||
r($myStoryTotal) && p() && e('0'); //myStoryTotal数据获取
|
||||
r($myBugTotal) && p() && e('85'); //myBugTotal数据获取
|
||||
r($docCreatedTotal) && p() && e('900');//docCreatedTotal数据获取
|
||||
r($ownerProductTotal) && p() && e('0'); //ownerProductTotal数据获取
|
||||
r($involvedProjectTotal) && p() && e('1'); //involvedProjectTotal数据获取
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/my.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 myModel->getDoingProjects();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
获取doingcount数据 >> 5
|
||||
获取doing状态的项目 >> 项目86,doing
|
||||
获取doing状态的项目统计 >> 5
|
||||
|
||||
*/
|
||||
|
||||
$my = new myTest();
|
||||
|
||||
$doingCount = $my->getDoingProjectsTest()->doingCount;
|
||||
$projects = $my->getDoingProjectsTest()->projects;
|
||||
|
||||
r($doingCount) && p() && e('5'); //获取doingcount数据
|
||||
r($projects) && p('0:name,status') && e('项目86,doing');//获取doing状态的项目
|
||||
r(count($projects)) && p() && e('5'); //获取doing状态的项目统计
|
||||
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/my.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 myModel->getOverview();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
projectTotal数据获取 >> 110
|
||||
allConsumed数据获取 >> 6750
|
||||
thisYearConsumed数据获取 >> 0
|
||||
|
||||
*/
|
||||
|
||||
$my = new myTest();
|
||||
|
||||
$projectTotal = $my->getOverviewTest()->projectTotal;
|
||||
$allConsumed = $my->getOverviewTest()->allConsumed;
|
||||
$thisYearConsumed = $my->getOverviewTest()->thisYearConsumed;
|
||||
|
||||
r($projectTotal) && p() && e('110'); //projectTotal数据获取
|
||||
r($allConsumed) && p() && e('6750');//allConsumed数据获取
|
||||
r($thisYearConsumed) && p() && e('0'); //thisYearConsumed数据获取
|
||||
Executable
+42
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/my.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 myModel->getProducts();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
undone产品allCount查询 >> 80
|
||||
undone产品unclosedCount查询 >> 80
|
||||
undone产品查询统计 >> 5
|
||||
ownbyme产品allCount查询 >> 0
|
||||
ownbyme产品unclosedCount查询 >> 0
|
||||
ownbyme产品查询 >> 0
|
||||
ownbyme产品查询统计 >> 0
|
||||
随意输入type产品数量查询 >> 5
|
||||
不输入type产品数量查询 >> 5
|
||||
|
||||
*/
|
||||
|
||||
$typeList = array('undone', 'ownbyme', 'all');
|
||||
|
||||
$my = new myTest();
|
||||
|
||||
$undoneProducts = $my->getProductsTest($typeList[0]);
|
||||
$ownbymeProducts = $my->getProductsTest($typeList[1]);
|
||||
$allProducts = $my->getProductsTest($typeList[2]);
|
||||
$noType = $my->getProductsTest('');
|
||||
|
||||
r($undoneProducts->allCount) && p() && e('80'); //undone产品allCount查询
|
||||
r($undoneProducts->unclosedCount) && p() && e('80'); //undone产品unclosedCount查询
|
||||
r(count($undoneProducts->products)) && p() && e('5'); //undone产品查询统计
|
||||
r($ownbymeProducts->allCount) && p() && e('0'); //ownbyme产品allCount查询
|
||||
r($ownbymeProducts->unclosedCount) && p() && e('0'); //ownbyme产品unclosedCount查询
|
||||
r($ownbymeProducts->products) && p() && e('0'); //ownbyme产品查询
|
||||
r(count($ownbymeProducts->products)) && p() && e('0'); //ownbyme产品查询统计
|
||||
r(count($allProducts->products)) && p() && e('5'); //随意输入type产品数量查询
|
||||
r(count($noType->products)) && p() && e('5'); //不输入type产品数量查询
|
||||
@@ -2,6 +2,7 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/program.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
|
||||
@@ -12,9 +12,14 @@ pid=1
|
||||
创建id=1的项目集的干系人dev1,dev2并查看。 >> dev2;dev1
|
||||
|
||||
*/
|
||||
$Stakeholder = new Program('admin');
|
||||
|
||||
$t_Stakeholder = array('1');
|
||||
global $tester;
|
||||
$tester->loadModel('program');
|
||||
|
||||
r($Stakeholder->createStakeholder($t_Stakeholder[0])) && p('0:account;1:account') && e('dev2;dev1'); // 创建id=1的项目集的干系人dev1,dev2并查看。
|
||||
system("./ztest init");
|
||||
$_POST['accounts'] = array('dev1', 'dev2');
|
||||
$tester->program->createStakeholder(1);
|
||||
$result = $tester->program->getStakeholdersByPrograms(1);
|
||||
|
||||
r(count($result)) && p('') && e('2'); // 创建id=1的项目集的干系人并查看数量。
|
||||
r($result) && p('0:account;1:account') && e('dev2;dev1'); // 创建id=1的项目集的干系人dev1,dev2并查看Account。
|
||||
system("./ztest init");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/program.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,8 +13,11 @@ pid=1
|
||||
|
||||
*/
|
||||
|
||||
$parentProjectSet = new Program('admin');
|
||||
global $tester;
|
||||
$tester->loadModel('program');
|
||||
$program1 = $tester->program->getById(11);
|
||||
$program2 = $tester->program->getById(12);
|
||||
$result1 = $tester->program->getBudgetLeft($program1);
|
||||
$result2 = $tester->program->getBudgetLeft($program2);
|
||||
|
||||
$t_itemsid = array('1');
|
||||
|
||||
r($parentProjectSet->getBudgetLeft($t_itemsid[0])) && p() && e('0'); // 查看父项目集id=1的预算剩余
|
||||
r($result) && p() && e('0'); // 查看父项目集id=1的预算剩余
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/program.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,10 +15,9 @@ pid=1
|
||||
|
||||
*/
|
||||
|
||||
$SubprojectSet = new Program('admin');
|
||||
global $tester;
|
||||
$tester->loadModel('program');
|
||||
|
||||
$t_findnu = array('1', '22', '221');
|
||||
|
||||
r($SubprojectSet->getChildren($t_findnu[0])) && p() && e('9'); // 通过id查找id=1的子项目集个数
|
||||
r($SubprojectSet->getChildren($t_findnu[1])) && p() && e('7'); // 通过id查找id=22的子项目集个数
|
||||
r($SubprojectSet->getChildren($t_findnu[2])) && p('message') && e('Not Found'); // 通过id查找id=221的子项目集个数
|
||||
r($tester->program->getChildren(1)) && p() && e('9'); // 通过id查找id=1的子项目集个数
|
||||
r($tester->program->getChildren(22)) && p() && e('7'); // 通过id查找id=22的子项目集个数
|
||||
r($tester->program->getChildren(221)) && p() && e('0'); // 通过id查找id=221的子项目集个数
|
||||
|
||||
@@ -13,7 +13,11 @@ pid=1
|
||||
|
||||
*/
|
||||
|
||||
$ParentProjectSet = new Program('admin');
|
||||
global $tester;
|
||||
$tester->loadModel('program');
|
||||
$program1 = $tester->program->getParentPairs();
|
||||
$program2 = $tester->program->getParentPairs('waterfall');
|
||||
|
||||
r($ParentProjectSet->getCount1()) && p() && e('11'); //
|
||||
r($ParentProjectSet->getParentPairs()) && p('1') && e(''); // 获取父项目集的id/name关联数组
|
||||
r(count($program1)) && p() && e('7'); // 获取所有父项目集的数量
|
||||
r(count($program2)) && p() && e('1'); // 获取瀑布类型父项目集的数量
|
||||
r($program1) && p('1') && e('/项目集1'); // 获取ID为1的父项目集的名称
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/program.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,7 +13,12 @@ GetParentPM(). >> 0
|
||||
|
||||
*/
|
||||
|
||||
$getPM = new Program('admin');
|
||||
global $tester;
|
||||
$tester->loadModel('program');
|
||||
|
||||
$programIdList = array(1, 2, 3);
|
||||
$parentPM = $tester->program->getParentPM($programIdList);
|
||||
a($parentPM);die;
|
||||
|
||||
/* GetParentPM($programIdList). */
|
||||
r($getPM->getParentPM('1')) && p() && e('0'); //
|
||||
r($getPM->getParentPM('1')) && p() && e('0'); //
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/program.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,8 +15,10 @@ pid=1
|
||||
|
||||
*/
|
||||
|
||||
$getItemsets = new Program('admin');
|
||||
global $tester;
|
||||
$tester->loadModel('program');
|
||||
$progressList = $tester->program->getProgressList();
|
||||
|
||||
r($getItemsets->getCount3()) && p() && e('100'); // 获取项目和项目集的个数
|
||||
r($getItemsets->getProgressList()) && p('1') && e('0'); // 获取id=1的项目的进度
|
||||
r($getItemsets->getProgressList()) && p('11') && e('45'); // 获取id=11的项目集的进度
|
||||
r(count($progressList)) && p() && e('120'); // 获取项目和项目集的个数
|
||||
r($progressList) && p('1') && e('41'); // 获取id=1的项目的进度
|
||||
r($progressList) && p('11') && e('45'); // 获取id=11的项目集的进度
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/program.class.php';
|
||||
|
||||
su('dev1');
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,9 +15,10 @@ pid=1
|
||||
|
||||
*/
|
||||
|
||||
$t = new Program('admin');
|
||||
global $tester;
|
||||
$tester->loadModel('program');
|
||||
$top1 = $tester->program->getTopByID(1);
|
||||
$top1000 = $tester->program->getTopByID(1000);
|
||||
|
||||
$program_id = array(1, 1000);
|
||||
|
||||
r($t->getByID3($program_id[0])) && p() && e('1'); //获取项目集1最上级的项目集id
|
||||
r($t->getByID3($program_id[1])) && p() && e('Not Found'); //获取项目集1000最上级的项目集id
|
||||
r($top1) && p() && e('1'); //获取项目集1最上级的项目集id
|
||||
r($top1000) && p() && e('0'); //获取项目集1000最上级的项目集id
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/program.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,9 +14,9 @@ pid=1
|
||||
|
||||
*/
|
||||
|
||||
$program = new Program('admin');
|
||||
global $tester;
|
||||
$tester->loadModel('program');
|
||||
|
||||
$t_checkId = 'count';
|
||||
|
||||
r($program->getTopPairs()) && p('1') && e('项目集1'); // 查看id=1的父项目集
|
||||
r($program->getTopPairs($t_checkId)) && p() && e('6'); // 查看父项目集的个数
|
||||
r(count($tester->program->getTopPairs())) && p() && e('10'); // 获取系统中所有顶级项目集数量
|
||||
r(count($tester->program->getTopPairs('', 'noclosed'))) && p() && e('10'); // 获取系统中所有未关闭的顶级项目集数量
|
||||
r(count($tester->program->getTopPairs('', '', true))) && p() && e('10'); // 获取系统中所有顶级项目集数量
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 programModel::getTopPairs();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$tester->loadModel('program');
|
||||
$path1 = ',2,3,4,';
|
||||
$path2 = '100,101';
|
||||
|
||||
r($tester->program->getTopByPath($path1)) && p() && e('2'); // 传入一个path,返回最顶级path
|
||||
r($tester->program->getTopByPath($path2)) && p() && e('100'); // 传入一个path,返回最顶级path
|
||||
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
|
||||
/**
|
||||
|
||||
title=测试 programModel::getTreeMenu();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$tester->loadModel('program');
|
||||
$programs1 = $tester->program->getTreeMenu(1);
|
||||
|
||||
r(strlen($programs1)) && p() && e('789'); // 查看返回的字符个数
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/program.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,8 +13,10 @@ pid=1
|
||||
|
||||
*/
|
||||
|
||||
$program = new Program('admin');
|
||||
global $tester;
|
||||
$tester->loadModel('program');
|
||||
$program1 = $tester->program->getById(1);
|
||||
$program2 = $tester->program->getById(2);
|
||||
|
||||
$unFinish = 1;
|
||||
|
||||
r($program->getUnfinished($unFinish)) && p() && e('9'); // 获取项目集1下未完成的项目和项目集
|
||||
r($tester->program->hasUnfinished($program1)) && p() && e('9'); // 获取项目集1下未完成的项目和项目集数量
|
||||
r($tester->program->hasUnfinished($program2)) && p() && e('7'); // 获取项目集2下未完成的项目和项目集数量
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/program.class.php';
|
||||
|
||||
/**
|
||||
|
||||
title=测试 programModel::createStakeholder();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
创建id=1的项目集的干系人dev1,dev2并查看。 >> dev2;dev1
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$tester->loadModel('program');
|
||||
|
||||
$program1 = $tester->program->getById(1);
|
||||
$program2 = $tester->program->getById(2);
|
||||
|
||||
r($tester->program->isClickable($program1, 'close')) && p('') && e('1'); // 传入项目集1,动作为closed,判断是否可点击
|
||||
r($tester->program->isClickable($program1, 'activate')) && p('') && e('0'); // 传入项目集1,动作为activate,判断是否可点击
|
||||
r($tester->program->isClickable($program1, 'suspend')) && p('') && e('1'); // 传入项目集1,动作为suspend,判断是否可点击
|
||||
r($tester->program->isClickable($program2, 'close')) && p('') && e('1'); // 传入项目集2,动作为closed,判断是否可点击
|
||||
r($tester->program->isClickable($program2, 'activate')) && p('') && e('0'); // 传入项目集2,动作为activate,判断是否可点击
|
||||
r($tester->program->isClickable($program2, 'suspend')) && p('') && e('1'); // 传入项目集2,动作为activate,判断是否可点击
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/program.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,8 +13,13 @@ pid=1
|
||||
|
||||
*/
|
||||
|
||||
$program = new Program('admin');
|
||||
global $tester;
|
||||
$tester->loadModel('program');
|
||||
|
||||
$findId = array(12, 1000);
|
||||
$before = $tester->program->getById(12);
|
||||
$tester->program->setTreePath(12);
|
||||
$after = $tester->program->getById(12);
|
||||
|
||||
r($program->setTreePath($findId[0])) && p('path') && e(',2,12,'); // 查找id=12的项目集的path
|
||||
r($before) && p('path') && e(',2,12,'); // 设置之前的项目集的path
|
||||
r($after) && p('path') && e(',2,12,'); // 设置之后的项目集的path
|
||||
system('./ztest init');
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/program.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,12 +19,43 @@ pid=1
|
||||
|
||||
*/
|
||||
|
||||
$t = new Program('admin');
|
||||
$program = new programTest();
|
||||
|
||||
r($t->updateProgram(10)) && p('message:end') && e('测试更新项目集十'); // 更新id为10的项目集信息
|
||||
r($t->updateProgram(10, 2)) && p('message[begin]:0') && e('『计划开始』不能为空。'); //当计划开始为空时更新项目集信息
|
||||
r($t->updateProgram(10, 3)) && p('message[end]:0') && e('『计划完成』不能为空。'); //当计划完成为空时更新项目集信息
|
||||
r($t->updateProgram(10, 4)) && p('message[end]:0') && e('『计划完成』应当大于『2020-10-10』。'); //当计划完成小于计划开始时
|
||||
r($t->updateProgram(10, 1)) && p('message[name]:0') && e('『项目集名称』已经有『项目集1』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。'); //项目集名称已经存在时
|
||||
r($t->updateProgram(10, 5)) && p('message:begin;message:end') && e('父项目集的开始日期:2019-09-09,开始日期不能小于父项目集的开始日期;父项目集的完成日期:2019-09-09,完成日期不能大于父项目集的完成日期');// 项目集开始时间小于父项目集时
|
||||
system("./ztest init");
|
||||
$data = array(
|
||||
'parent' => '0',
|
||||
'name' => '测试更新项目集十',
|
||||
'begin' => '2020-10-10',
|
||||
'end' => '2022-06-01',
|
||||
'acl' => 'private',
|
||||
'budget' => '100',
|
||||
'budgetUnit' => 'CNY',
|
||||
'syncPRJUnit' => true,
|
||||
'exchangeRate' => '',
|
||||
'whitelist' => array('dev10', 'dev12')
|
||||
);
|
||||
|
||||
$normalProgram = $data;
|
||||
|
||||
$emptyTitleProgram = $data;
|
||||
$emptyTitleProgram['name'] = '项目集1';
|
||||
|
||||
$emptyBeginProgram = $data;
|
||||
$emptyBeginProgram['begin'] = '';
|
||||
|
||||
$emptyEndProgram = $data;
|
||||
$emptyEndProgram['end'] = '';
|
||||
|
||||
$beginGtEndProgram = $data;
|
||||
$beginGtEndProgram['begin'] = '2022-07-01';
|
||||
|
||||
$beginLtParentProgram = $data;
|
||||
$beginLtParentProgram['parent'] = '9';
|
||||
$beginLtParentProgram['begin'] = '2019-01-01';
|
||||
|
||||
r($program->update(10, $normalProgram)) && p('name') && e('测试更新项目集十'); // 正常更新项目集的情况
|
||||
r($program->update(10, $emptyTitleProgram)) && p('message[name]:0') && e('『项目集名称』已经有『项目集1』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。'); // 更新项目集名称重复时
|
||||
r($program->update(10, $emptyBeginProgram)) && p('message[begin]:0') && e('『计划开始』不能为空。'); // 当计划完成为空时更新项目集信息
|
||||
r($program->update(10, $emptyEndProgram)) && p('message:end') && e('子项目的最大完成日期:2022-05-27,父项目的完成日期不能小于子项目的最大完成日期'); //当计划完成小于计划开始时
|
||||
r($program->update(10, $beginGtEndProgram)) && p('message:begin') && e('子项目集的最小开始日期:2022-02-01,父项目集的开始日期不能大于子项目集的最小开始日期'); // 父项目集的开始日期大于子项目集的开始日期时
|
||||
r($program->update(10, $beginLtParentProgram)) && p('message:begin;message:end') && e('父项目集的开始日期:2022-02-09,开始日期不能小于父项目集的开始日期;父项目集的完成日期:2022-04-16,完成日期不能大于父项目集的完成日期'); // 项目集开始、结束日期和子项目不符的情况
|
||||
system("./ztest init");
|
||||
|
||||
@@ -58,6 +58,9 @@ switch($argv[1])
|
||||
case 'kanban':
|
||||
ztfRun('model/kanban');
|
||||
break;
|
||||
case 'my':
|
||||
ztfRun('model/my');
|
||||
break;
|
||||
case 'model':
|
||||
ztfRun('model');
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user