Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms into sprint/master_lanzongjun_fixbug
This commit is contained in:
@@ -55,7 +55,7 @@ class productEntry extends Entry
|
||||
$product->execution = $this->loadModel('product')->getExecutionPairsByProduct($productID);
|
||||
break;
|
||||
case 'moduleoptionmenu':
|
||||
$product->moduleOptionMenu = $this->loadModel('tree')->getOptionMenu($productID, 'bug', 0, 'all');
|
||||
$product->moduleOptionMenu = $this->loadModel('tree')->getOptionMenu($productID, 'story', 0, 'all');
|
||||
break;
|
||||
case 'builds':
|
||||
$product->builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,noterminate,nodone,withbranch', $this->param('object', 0), $this->param('objectType', 'execution'));
|
||||
|
||||
@@ -102,7 +102,7 @@ class taskEntry extends Entry
|
||||
$oldTask = $this->loadModel('task')->getByID($taskID);
|
||||
|
||||
/* Set $_POST variables. */
|
||||
$fields = 'name,type,desc,assignedTo,pri,estimate,left,consumed,story,parent,execution,module,closedReason,status,estStarted,deadline,team,teamEstimate,multiple,mailto,uid';
|
||||
$fields = 'name,type,desc,assignedTo,pri,estimate,left,consumed,story,parent,execution,module,closedReason,status,estStarted,deadline,team,teamEstimate,teamConsumed,teamLeft,multiple,mailto,uid';
|
||||
$this->batchSetPost($fields, $oldTask);
|
||||
|
||||
$control = $this->loadController('task', 'edit');
|
||||
|
||||
+1
-1
@@ -8816,7 +8816,7 @@ ALTER TABLE `zt_story` ADD `fromStory` mediumint(8) unsigned NOT NULL default 0
|
||||
ALTER TABLE `zt_story` ADD `fromVersion` smallint(6) NOT NULL default 1 after `fromStory`;
|
||||
ALTER TABLE `zt_story` ADD `approvedDate` date NOT NULL after `assignedDate`;
|
||||
|
||||
ALTER TABLE `zt_todo` CHANGE `type` `type` char(15) NOT NULL AFTER `feedback`;
|
||||
ALTER TABLE `zt_todo` CHANGE `type` char(15) NOT NULL AFTER `feedback`;
|
||||
|
||||
-- DROP TABLE IF EXISTS `zt_durationestimation`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_durationestimation` (
|
||||
|
||||
@@ -202,6 +202,8 @@ $lang->admin->menu->system['subMenu']->safe = array('link' => "$lang->sec
|
||||
$lang->admin->menu->system['subMenu']->cron = array('link' => "{$lang->admin->cron}|cron|index", 'subModule' => 'cron');
|
||||
$lang->admin->menu->system['subMenu']->timezone = array('link' => "$lang->timezone|custom|timezone");
|
||||
$lang->admin->menu->system['subMenu']->buildIndex = array('link' => "{$lang->admin->buildIndex}|search|buildindex|");
|
||||
|
||||
if($config->visions == ',lite,' and $config->edition != 'open') $lang->admin->menu->system['subMenu']->license = array('link' => "License|admin|license'", 'alias' => 'license');
|
||||
if($config->visions != ',lite,') unset($lang->admin->menu->system['subMenu']->buildIndex);
|
||||
|
||||
if($config->edition != 'open')
|
||||
|
||||
@@ -202,6 +202,8 @@ $lang->admin->menu->system['subMenu']->safe = array('link' => "$lang->sec
|
||||
$lang->admin->menu->system['subMenu']->cron = array('link' => "{$lang->admin->cron}|cron|index", 'subModule' => 'cron');
|
||||
$lang->admin->menu->system['subMenu']->timezone = array('link' => "$lang->timezone|custom|timezone");
|
||||
$lang->admin->menu->system['subMenu']->buildIndex = array('link' => "{$lang->admin->buildIndex}|search|buildindex|");
|
||||
|
||||
if($config->visions == ',lite,' and $config->edition != 'open') $lang->admin->menu->system['subMenu']->license = array('link' => "授权信息|admin|license'", 'alias' => 'license');
|
||||
if($config->visions != ',lite,') unset($lang->admin->menu->system['subMenu']->buildIndex);
|
||||
|
||||
if($config->edition != 'open')
|
||||
|
||||
@@ -188,6 +188,7 @@ class dingapi
|
||||
if(isset($response->errcode) and $response->errcode == 0) return $response;
|
||||
|
||||
if(empty($response)) $this->errors = $errors;
|
||||
if(isset($response->result) and $response->result == 'fail') $this->errors['curl'] = $response->message;
|
||||
if(isset($response->errcode)) $this->errors[$response->errcode] = "Errcode:{$response->errcode}, Errmsg:{$response->errmsg}";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -9,12 +9,12 @@ class feishuapi
|
||||
private $errors = array();
|
||||
|
||||
/**
|
||||
* Construct
|
||||
*
|
||||
* @param string $appKey
|
||||
* @param string $appSecret
|
||||
* @param string $agentId
|
||||
* @param string $apiUrl
|
||||
* Construct
|
||||
*
|
||||
* @param string $appKey
|
||||
* @param string $appSecret
|
||||
* @param string $agentId
|
||||
* @param string $apiUrl
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -29,7 +29,7 @@ class feishuapi
|
||||
|
||||
/**
|
||||
* Get token.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
@@ -47,7 +47,7 @@ class feishuapi
|
||||
|
||||
/**
|
||||
* Get users.
|
||||
*
|
||||
*
|
||||
* @param string $selectedDepts
|
||||
* @access public
|
||||
* @return array
|
||||
@@ -103,7 +103,7 @@ class feishuapi
|
||||
|
||||
/**
|
||||
* Get depts.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
@@ -146,7 +146,7 @@ class feishuapi
|
||||
|
||||
/**
|
||||
* Get department tree structure.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
@@ -186,10 +186,10 @@ class feishuapi
|
||||
}
|
||||
|
||||
/**
|
||||
* Send message
|
||||
*
|
||||
* @param string $userList
|
||||
* @param string $message
|
||||
* Send message
|
||||
*
|
||||
* @param string $userList
|
||||
* @param string $message
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
@@ -207,8 +207,8 @@ class feishuapi
|
||||
|
||||
/**
|
||||
* Query API.
|
||||
*
|
||||
* @param string $url
|
||||
*
|
||||
* @param string $url
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
@@ -225,6 +225,7 @@ class feishuapi
|
||||
if(isset($response->code) and $response->code == 0) return $response;
|
||||
|
||||
if(empty($response)) $this->errors = $errors;
|
||||
if(isset($response->result) and $response->result == 'fail') $this->errors['curl'] = $response->message;
|
||||
if(isset($response->code)) $this->errors[$response->code] = "Errcode:{$response->code}, Errmsg:{$response->msg}";
|
||||
if(!empty($this->errors))
|
||||
{
|
||||
@@ -236,7 +237,7 @@ class feishuapi
|
||||
|
||||
/**
|
||||
* Check for errors.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -247,7 +248,7 @@ class feishuapi
|
||||
|
||||
/**
|
||||
* Get errors.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
|
||||
@@ -259,7 +259,7 @@ class html extends baseHTML
|
||||
}
|
||||
elseif(is_object($user))
|
||||
{
|
||||
$userObj->avatar = $user->avatar;
|
||||
$userObj->avatar = isset($user->avatar) ? $user->avatar : '';
|
||||
$userObj->account = $user->account;
|
||||
$userObj->name = isset($user->name) ? $user->name : (isset($user->realname) ? $user->realname : $user->account);
|
||||
$user = $userObj;
|
||||
|
||||
@@ -230,7 +230,7 @@ class scm
|
||||
*/
|
||||
public static function checkRevision($revision)
|
||||
{
|
||||
if(preg_match('/[^a-z0-9\-_\.\^]/i', $revision)) return false;
|
||||
if(preg_match('/[^a-z0-9\-_\.\^\w][\x{4e00}-\x{9fa5}]/ui', $revision)) return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,6 +131,19 @@ class action extends control
|
||||
*/
|
||||
public function comment($objectType, $objectID)
|
||||
{
|
||||
if(strtolower($objectType) == 'task')
|
||||
{
|
||||
$task = $this->loadModel('task')->getById($objectID);
|
||||
$executions = explode(',', $this->app->user->view->sprints);
|
||||
if(!in_array($task->execution, $executions)) return print(js::error($this->lang->error->accessDenied));
|
||||
}
|
||||
elseif(strtolower($objectType) == 'story')
|
||||
{
|
||||
$story = $this->loadModel('story')->getById($objectID);
|
||||
$executions = explode(',', $this->app->user->view->sprints);
|
||||
if(!array_intersect(array_keys($story->executions), $executions)) return print(js::error($this->lang->error->accessDenied));
|
||||
}
|
||||
|
||||
$actionID = $this->action->create($objectType, $objectID, 'Commented', $this->post->comment);
|
||||
if(defined('RUN_MODE') && RUN_MODE == 'api')
|
||||
{
|
||||
|
||||
@@ -490,7 +490,7 @@ class actionModel extends model
|
||||
$name = $this->dao->select('name')->from(TABLE_TESTSUITE)->where('id')->eq($action->extra)->fetch('name');
|
||||
if($name) $action->extra = common::hasPriv('caselib', 'browse') ? html::a(helper::createLink('caselib', 'browse', "libID=$action->extra"), $name) : $name;
|
||||
}
|
||||
elseif(strpos('importfromstorylib,importfromrisklib,importfromissuelib,importfromopportunitylib', $actionName) !== false)
|
||||
elseif(strpos(',importfromstorylib,importfromrisklib,importfromissuelib,importfromopportunitylib,', ",{$actionName},") !== false and $this->config->edition == 'max')
|
||||
{
|
||||
$name = $this->dao->select('name')->from(TABLE_ASSETLIB)->where('id')->eq($action->extra)->fetch('name');
|
||||
if($name) $action->extra = common::hasPriv('assetlib', $action->objectType) ? html::a(helper::createLink('assetlib', $action->objectType, "libID=$action->extra"), $name) : $name;
|
||||
|
||||
@@ -1399,7 +1399,8 @@ class block extends control
|
||||
->where('deleted')->eq(0)
|
||||
->beginIF($this->config->vision == 'lite')->andWhere('type')->eq('kanban')->fi()
|
||||
->beginIF($this->config->vision == 'rnd')->andWhere('type')->eq('sprint')->fi()
|
||||
->andWhere('parent')->eq($this->session->project)
|
||||
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->sprints)->fi()
|
||||
->andWhere('project')->eq($this->session->project)
|
||||
->groupBy('status')
|
||||
->fetchPairs();
|
||||
|
||||
|
||||
@@ -388,6 +388,7 @@ $lang->error->noData = 'No data.';
|
||||
$lang->error->editedByOther = 'This record might have been changed. Please refresh and try to edit again!';
|
||||
$lang->error->tutorialData = 'No data can be imported in tutorial mode. Please quit tutorial first!';
|
||||
$lang->error->noCurlExt = 'No Curl module installed';
|
||||
$lang->error->loginTimeout = 'Login has timed out, please login again!';
|
||||
|
||||
/* Page info. */
|
||||
$lang->pager = new stdclass();
|
||||
|
||||
@@ -389,6 +389,7 @@ $lang->error->noData = '没有数据';
|
||||
$lang->error->editedByOther = '该记录可能已经被改动。请刷新页面重新编辑!';
|
||||
$lang->error->tutorialData = '新手模式下不会插入数据,请退出新手模式操作';
|
||||
$lang->error->noCurlExt = '服务器未安装Curl模块。';
|
||||
$lang->error->loginTimeout = '登录已超时,请重新登入!';
|
||||
|
||||
/* 分页信息。*/
|
||||
$lang->pager = new stdclass();
|
||||
|
||||
+18
-2
@@ -123,9 +123,15 @@ class commonModel extends model
|
||||
$projectID = $execution->project;
|
||||
$project = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetch();
|
||||
|
||||
$today = helper::today();
|
||||
if($project->status == 'wait')
|
||||
{
|
||||
$this->dao->update(TABLE_PROJECT)->set('status')->eq('doing')->where('id')->eq($projectID)->exec();
|
||||
$this->dao->update(TABLE_PROJECT)
|
||||
->set('status')->eq('doing')
|
||||
->beginIf(helper::isZeroDate($project->realBegan))->set('realBegan')->eq($today)->fi()
|
||||
->where('id')->eq($projectID)
|
||||
->exec();
|
||||
|
||||
$this->loadModel('action')->create('project', $projectID, 'syncproject');
|
||||
}
|
||||
return $project;
|
||||
@@ -2245,7 +2251,17 @@ EOD;
|
||||
}
|
||||
else
|
||||
{
|
||||
$referer = helper::safe64Encode($this->app->getURI(true));
|
||||
$uri = $this->app->getURI(true);
|
||||
if($module == 'message' and $method == 'ajaxgetmessage')
|
||||
{
|
||||
$uri = helper::createLink('my');
|
||||
}
|
||||
elseif(helper::isAjaxRequest())
|
||||
{
|
||||
die(json_encode(array('result' => false, 'message' => $this->lang->error->loginTimeout))); // Fix bug #14478.
|
||||
}
|
||||
|
||||
$referer = helper::safe64Encode($uri);
|
||||
print(js::locate(helper::createLink('user', 'login', "referer=$referer")));
|
||||
helper::end();
|
||||
}
|
||||
|
||||
@@ -18,3 +18,6 @@ js::import($jsRoot . 'dhtmlxgantt/ext/dhtmlxgantt_marker.js');
|
||||
$currentLang = $app->getClientLang();
|
||||
if($currentLang != 'en') js::import($jsRoot . 'dhtmlxgantt/lang/' . $currentLang . '.js');
|
||||
?>
|
||||
<style>
|
||||
.gantt_message_area{display:none;}
|
||||
</style>
|
||||
|
||||
@@ -172,14 +172,14 @@ class custom extends control
|
||||
}
|
||||
if(!empty($key) and !isset($oldCustoms[$key]) and $key != 'n/a' and !validater::checkREG($key, '/^[a-z_A-Z_0-9]+$/')) return $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->invalidStringKey));
|
||||
|
||||
/* The length of roleList in user module and typeList in todo module is less than 10. check it when saved. */
|
||||
if($field == 'roleList' or $module == 'todo' and $field == 'typeList')
|
||||
{
|
||||
if(strlen($key) > 10) return $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->invalidStrlen['ten']));
|
||||
}
|
||||
/* The length of roleList in user module is less than 10. check it when saved. */
|
||||
if($module == 'user' and $field == 'roleList' and strlen($key) > 10) return $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->invalidStrlen['ten']));
|
||||
|
||||
/* The length of typeList in todo module is less than 15. check it when saved. */
|
||||
if($module == 'todo' and $field == 'typeList' and strlen($key) > 15) return $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->invalidStrlen['fifteen']));
|
||||
|
||||
/* The length of sourceList in story module and typeList in task module is less than 20, check it when saved. */
|
||||
if($field == 'sourceList' or $module == 'task' and $field == 'typeList')
|
||||
if(($module == 'story' and $field == 'sourceList') or ($module == 'task' and $field == 'typeList'))
|
||||
{
|
||||
if(strlen($key) > 20) return $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->invalidStrlen['twenty']));
|
||||
}
|
||||
@@ -188,7 +188,7 @@ class custom extends control
|
||||
if($module == 'testcase' and $field == 'stageList' and strlen($key) > 255) return $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->invalidStrlen['twoHundred']));
|
||||
|
||||
/* The length of field that in bug and testcase module and reasonList in story and task module is less than 30, check it when saved. */
|
||||
if($module == 'bug' or $field == 'reasonList' or $module == 'testcase')
|
||||
if(in_array($module, array('bug', 'testcase')) or (in_array($module, array('story', 'task')) and $field == 'reasonList'))
|
||||
{
|
||||
if(strlen($key) > 30) return $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->invalidStrlen['thirty']));
|
||||
}
|
||||
|
||||
@@ -183,6 +183,7 @@ $lang->custom->notice->indexPage['project'] = "ZenTao 8.2+ has Project Home. Do
|
||||
$lang->custom->notice->indexPage['qa'] = "ZenTao 8.2+ has Test Homepage. Do you want to go to Test Homepage?";
|
||||
|
||||
$lang->custom->notice->invalidStrlen['ten'] = 'The key should be <= 10 characters.';
|
||||
$lang->custom->notice->invalidStrlen['fifteen'] = 'The key should be <= 15 characters.';
|
||||
$lang->custom->notice->invalidStrlen['twenty'] = 'The key should be <= 20 characters.';
|
||||
$lang->custom->notice->invalidStrlen['thirty'] = 'The key should be <= 30 characters.';
|
||||
$lang->custom->notice->invalidStrlen['twoHundred'] = 'The key should be <= 225 characters.';
|
||||
|
||||
@@ -183,6 +183,7 @@ $lang->custom->notice->indexPage['project'] = "从8.2版本起增加了项目主
|
||||
$lang->custom->notice->indexPage['qa'] = "从8.2版本起增加了测试主页视图,是否默认进入测试主页?";
|
||||
|
||||
$lang->custom->notice->invalidStrlen['ten'] = '键的长度必须小于10个字符!';
|
||||
$lang->custom->notice->invalidStrlen['fifteen'] = '键的长度必须小于15个字符!';
|
||||
$lang->custom->notice->invalidStrlen['twenty'] = '键的长度必须小于20个字符!';
|
||||
$lang->custom->notice->invalidStrlen['thirty'] = '键的长度必须小于30个字符!';
|
||||
$lang->custom->notice->invalidStrlen['twoHundred'] = '键的长度必须小于225个字符!';
|
||||
|
||||
@@ -434,7 +434,7 @@ class customModel extends model
|
||||
global $lang, $app, $dbh;
|
||||
if(!isset($lang->$module->featureBar[$method])) return;
|
||||
$queryModule = $module == 'execution' ? 'task' : ($module == 'product' ? 'story' : $module);
|
||||
$shortcuts = $dbh->query('select id, title from ' . TABLE_USERQUERY . " where `account` = '{$app->user->account}' AND `module` = '{$queryModule}' AND `shortcut` = '1' order by id")->fetchAll();
|
||||
$shortcuts = $dbh->query('select id, title from ' . TABLE_USERQUERY . " where (`account` = '{$app->user->account}' or `common` = '1') AND `module` = '{$queryModule}' AND `shortcut` = '1' order by id")->fetchAll();
|
||||
|
||||
if($shortcuts)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class='btn-toolbar pull-left'><?php // common::printAdminSubMenu('dev');?></div>
|
||||
</div>
|
||||
|
||||
@@ -87,6 +87,8 @@ function fullScreen()
|
||||
whenFailEnterFullscreen(error);
|
||||
}
|
||||
}
|
||||
|
||||
$('.main-col iframe').css('min-height', $(window).height() + 'px');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -102,6 +104,7 @@ function exitFullScreen()
|
||||
$('#content .actions').removeClass('hidden');
|
||||
$('#content .file-image .right-icon').removeClass('hidden');
|
||||
$('#content .detail').eq(1).removeClass('hidden');
|
||||
$('.main-col iframe').css('min-height', '380px');
|
||||
$.cookie('isFullScreen', 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -3310,10 +3310,22 @@ class execution extends control
|
||||
$this->view->title = $this->lang->execution->allExecutions;
|
||||
$this->view->position[] = $this->lang->execution->allExecutions;
|
||||
|
||||
$this->view->executionStats = $this->project->getStats($projectID, $status, $productID, 0, 30, $orderBy, $pager);
|
||||
$executionStats = $this->project->getStats($projectID, $status, $productID, 0, 30, $orderBy, $pager);
|
||||
|
||||
$parentIdList = array();
|
||||
foreach($executionStats as $execution)
|
||||
{
|
||||
if($execution->type != 'stage') continue;
|
||||
if($execution->grade == 2 and $execution->project != $execution->parent) $parentIdList[$execution->parent] = $execution->parent;
|
||||
}
|
||||
$parents = array();
|
||||
if($parentIdList) $parents = $this->execution->getByIdList($parentIdList);
|
||||
|
||||
$this->view->executionStats = $executionStats;
|
||||
$this->view->productList = $this->loadModel('product')->getProductPairsByProject($projectID);
|
||||
$this->view->productID = $productID;
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->parents = $parents;
|
||||
$this->view->projects = array('') + $this->project->getPairsByProgram();
|
||||
$this->view->pager = $pager;
|
||||
$this->view->orderBy = $orderBy;
|
||||
|
||||
@@ -24,3 +24,5 @@ td.flex span.project-type-label {margin-left: 5px; min-width: 36px;}
|
||||
.c-action {text-align: center;}
|
||||
.c-name > span {margin-right: 2px;}
|
||||
td.flex span.project-type-label {min-width: 40px;}
|
||||
|
||||
.label-children {min-width:22px !important;}
|
||||
|
||||
@@ -124,12 +124,18 @@
|
||||
<?php endif;?>
|
||||
<?php printf('%03d', $execution->id);?>
|
||||
</td>
|
||||
<td class='text-left c-name <?php if(!empty($execution->children)) echo 'has-child';?> flex' title='<?php echo $execution->name?>'>
|
||||
<?php
|
||||
$executionName = $execution->name;
|
||||
$onlyChildStage = ($execution->grade == 2 and $execution->project != $execution->parent);
|
||||
if($onlyChildStage and isset($parents[$execution->parent])) $executionName = $parents[$execution->parent]->name . '/' . $executionName;
|
||||
?>
|
||||
<td class='text-left c-name <?php if(!empty($execution->children)) echo 'has-child';?> flex' title='<?php echo $executionName?>'>
|
||||
<?php if($config->systemMode == 'new'):?>
|
||||
<span class='project-type-label label label-outline <?php echo $execution->type == 'stage' ? 'label-warning' : 'label-info';?>'><?php echo $lang->execution->typeList[$execution->type]?></span>
|
||||
<?php endif;?>
|
||||
<?php
|
||||
$executionLink = $execution->projectModel == 'kanban' ? html::a($this->createLink('execution', 'kanban', 'executionID=' . $execution->id), $execution->name, '', "class='text-ellipsis'") : html::a($this->createLink('execution', 'task', 'execution=' . $execution->id), $execution->name, '', "class='text-ellipsis'");
|
||||
$executionLink = $execution->projectModel == 'kanban' ? html::a($this->createLink('execution', 'kanban', 'executionID=' . $execution->id), $executionName, '', "class='text-ellipsis'") : html::a($this->createLink('execution', 'task', 'execution=' . $execution->id), $executionName, '', "class='text-ellipsis'");
|
||||
if($onlyChildStage) echo "<span class='label label-badge label-light label-children'>{$lang->programplan->childrenAB}</span> ";
|
||||
echo !empty($execution->children) ? $execution->name : $executionLink;
|
||||
if(isset($execution->delay)) echo "<span class='label label-danger label-badge'>{$lang->execution->delayed}</span> ";
|
||||
?>
|
||||
@@ -214,9 +220,9 @@
|
||||
</td>
|
||||
<td class='text-left' title='<?php echo $child->name?>'>
|
||||
<?php
|
||||
if(isset($child->delay)) echo "<span class='label label-danger label-badge'>{$lang->execution->delayed}</span> ";
|
||||
echo "<span class='label label-badge label-light' title='{$lang->programplan->children}'>{$lang->programplan->childrenAB}</span>";
|
||||
echo html::a($this->createLink('execution', 'task', 'execution=' . $child->id), $child->name);
|
||||
if(isset($child->delay)) echo "<span class='label label-danger label-badge'>{$lang->execution->delayed}</span> ";
|
||||
?>
|
||||
</td>
|
||||
<td><?php echo zget($users, $child->PM);?></td>
|
||||
|
||||
@@ -456,7 +456,7 @@ class extensionModel extends model
|
||||
if(!is_writable($parentDir) or !@mkdir($path, 0777, true))
|
||||
{
|
||||
$return->errors .= sprintf($this->lang->extension->errorTargetPathNotExists, $path) . '<br />';
|
||||
$return->mkdirCommands .= "mkdir -p $path<br />";
|
||||
$return->mkdirCommands .= "sudo mkdir -p $path<br />";
|
||||
$return->chmodCommands .= "sudo chmod -R 777 $path<br />";
|
||||
}
|
||||
$return->dirs2Created[] = $path;
|
||||
|
||||
@@ -457,12 +457,12 @@ class jobModel extends model
|
||||
|
||||
if($job->triggerType == 'tag')
|
||||
{
|
||||
$lastTag = $this->getLastTagByRepo($repo, $job);
|
||||
if($lastTag)
|
||||
$job->lastTag = $this->getLastTagByRepo($repo, $job);
|
||||
|
||||
if($job->lastTag)
|
||||
{
|
||||
$build->tag = $lastTag;
|
||||
$job->lastTag = $lastTag;
|
||||
$this->dao->update(TABLE_JOB)->set('lastTag')->eq($lastTag)->where('id')->eq($job->id)->exec();
|
||||
$build->tag = $job->lastTag;
|
||||
$this->dao->update(TABLE_JOB)->set('lastTag')->eq($job->lastTag)->where('id')->eq($job->id)->exec();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -422,11 +422,13 @@ class mr extends control
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->repo = $this->loadModel('repo')->getRepoByID($MR->repoID);
|
||||
$this->view->repoID = $MR->repoID;
|
||||
$this->view->diffs = $diffs;
|
||||
$this->view->encoding = $encoding;
|
||||
$this->view->arrange = $arrange;
|
||||
$this->view->repo = $this->loadModel('repo')->getRepoByID($MR->repoID);
|
||||
$this->view->repoID = $MR->repoID;
|
||||
$this->view->diffs = $diffs;
|
||||
$this->view->encoding = $encoding;
|
||||
$this->view->arrange = $arrange;
|
||||
$this->view->sourceBranch = $MR->sourceBranch;
|
||||
$this->view->targetBranch = $MR->targetBranch;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -1177,7 +1177,6 @@ class mrModel extends model
|
||||
$bugInfo['content'] = $data->steps;
|
||||
$bugInfo['title'] = $data->title;
|
||||
$bugInfo['objectType'] = 'bug';
|
||||
$bugInfo['entry'] = $data->entry;
|
||||
return $bugInfo;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,8 @@ if($repoExecution)
|
||||
}
|
||||
|
||||
$reviews = $this->mr->getReview($repoID, $MR->id);
|
||||
$v1 = isset($oldRevision) ? $oldRevision : 0;
|
||||
$v1 = str_replace('-', '*', $sourceBranch);
|
||||
$v2 = str_replace('-', '*', $targetBranch);
|
||||
|
||||
$this->loadModel('repo');
|
||||
|
||||
@@ -46,7 +47,7 @@ $taskModuleSelect = html::select('taskModule', $taskModules, $taskRepoModule,
|
||||
$taskUserSelect = html::select('taskAssignedTo', $taskMembers, '', 'class="form-control chosen"');
|
||||
$taskExecutionSelect = html::select('taskExecution', $taskExecutions, $repoExecution, 'class="form-control chosen" onchange="changeExecution(this)"');
|
||||
|
||||
$reviewUrl = $this->createLink('mr', 'addReview', "repoID=$repoID&mr={$MR->id}&v1=$v1&v2=");
|
||||
$reviewUrl = $this->createLink('mr', 'addReview', "repoID=$repoID&mr={$MR->id}&v1=$v1&v2=$v2");
|
||||
$productSelect = html::select('product', $products, $repoProduct, 'class="product form-control chosen" onchange="changeProduct(this)"');
|
||||
$branches = $this->loadModel('branch')->getPairs($repoProduct);
|
||||
$moduleSelect = html::select('module', $modules, $bugRepoModule, 'class="form-control chosen"');
|
||||
@@ -153,7 +154,6 @@ js::set('revision', '');
|
||||
<td colspan="3" class='form-actions'>
|
||||
<?php echo html::submitButton($lang->repo->submit, '', 'btn btn-wide btn-primary reviewSubmit');?>
|
||||
<?php echo html::commonButton($lang->cancel, "onclick='hiddenForm()'", 'btn btn-wide');?>
|
||||
<input type="hidden" id='entry' name="entry" value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -418,8 +418,9 @@ EOF;
|
||||
if($this->config->systemMode == 'new')
|
||||
{
|
||||
$projects = $this->dao->select('t1.id,t1.name,t2.id as execution')->from(TABLE_PROJECT)->alias('t1')
|
||||
->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.id=t2.parent')
|
||||
->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.id=t2.project')
|
||||
->where('t2.id')->in($executionIDList)
|
||||
->andWhere('t1.type')->eq('project')
|
||||
->fetchAll('execution');
|
||||
}
|
||||
|
||||
@@ -856,7 +857,7 @@ EOF;
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->ncs = $ncList;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter');
|
||||
$this->view->projects = $this->loadModel('project')->getPairsByProgram(0);
|
||||
$this->view->projects = $this->loadModel('project')->getPairsByProgram();
|
||||
$this->view->pager = $pager;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->mode = 'nc';
|
||||
|
||||
@@ -1285,6 +1285,7 @@ class productModel extends model
|
||||
->beginIF($branch)->andWhere('t1.branch')->in($branch)->fi()
|
||||
->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->sprints)->fi()
|
||||
->andWhere('t2.deleted')->eq('0')
|
||||
->orderBy('id_desc')
|
||||
->fetchAll('id');
|
||||
|
||||
$projectIdList = array();
|
||||
|
||||
@@ -200,8 +200,8 @@ class programplanModel extends model
|
||||
if($data->start_date) $data->start_date = date('d-m-Y', strtotime($data->start_date));
|
||||
if($data->start_date == '' or $data->endDate == '') $data->duration = 0;
|
||||
|
||||
$datas['data'][] = $data;
|
||||
$stageIndex[] = array('planID' => $plan->id, 'progress' => array('totalConsumed' => 0, 'totalReal' => 0));
|
||||
$datas['data'][] = $data;
|
||||
$stageIndex[$plan->id] = array('planID' => $plan->id, 'parent' => $plan->parent, 'progress' => array('totalConsumed' => 0, 'totalReal' => 0));
|
||||
}
|
||||
|
||||
$taskSign = "<span>[ T ] </span>";
|
||||
@@ -273,9 +273,15 @@ class programplanModel extends model
|
||||
{
|
||||
$stageIndex[$index]['progress']['totalConsumed'] += $task->consumed;
|
||||
$stageIndex[$index]['progress']['totalReal'] += ($task->left + $task->consumed);
|
||||
|
||||
$stageIndex[$stage['parent']]['progress']['totalConsumed'] += $task->consumed;
|
||||
$stageIndex[$stage['parent']]['progress']['totalReal'] += ($task->left + $task->consumed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Ceturns all the values from the stageIndex and indexes the array numerically. */
|
||||
$stageIndex = array_values($stageIndex);
|
||||
|
||||
/* Calculate the progress of the phase. */
|
||||
foreach($stageIndex as $index => $stage)
|
||||
|
||||
@@ -22,6 +22,11 @@
|
||||
.gantt_task_content{display: none;}
|
||||
.checkbox-primary {margin-top: 0px; margin-left: 10px;}
|
||||
form {display: block; margin-top: 0em; margin-block-end: 1em;}
|
||||
<?php if($selectCustom == 'task'):?>
|
||||
.gantt_grid .gantt_grid_scale{width:100% !important;}
|
||||
.gantt_grid .gantt_grid_data{width:100% !important;}
|
||||
.gantt_grid .gantt_grid_data .gantt_row{width:100% !important;}
|
||||
<?php endif;?>
|
||||
</style>
|
||||
<?php js::set('customUrl', $this->createLink('programplan', 'ajaxCustom'));?>
|
||||
<?php js::set('dateDetails', $dateDetails);?>
|
||||
@@ -71,7 +76,15 @@ function drawGanttToCanvas(exportType, successCallback, errorCallback)
|
||||
var $ganttDataArea = $ganttView.find('.gantt_data_area');
|
||||
var $ganttDridData = $ganttView.find('.gantt_grid_data');
|
||||
var ganttHeight = $ganttView.find('.gantt_task_bg').outerHeight() + $ganttView.find('.gantt_grid_scale').outerHeight() + 1;
|
||||
var ganttWidth = $ganttDataArea.outerWidth() + $ganttDridData.outerWidth();
|
||||
|
||||
<?php if($selectCustom == 'task'):?>
|
||||
var ganttWidth = $ganttDridData.width() - 100;
|
||||
var ganttHeight = $ganttView.find('.gantt_grid_scale').outerHeight();
|
||||
$ganttDridData.find('.gantt_row').each(function() {ganttHeight += $(this).outerHeight();});
|
||||
<?php else:?>
|
||||
var ganttWidth = $ganttDataArea.outerWidth() + $ganttDridData.outerWidth();
|
||||
var ganttHeight = $ganttView.find('.gantt_task_bg').outerHeight() + $ganttView.find('.gantt_grid_scale').outerHeight() + 1;
|
||||
<?php endif;?>
|
||||
|
||||
$ganttContainer.css(
|
||||
{
|
||||
@@ -202,13 +215,13 @@ function zoomTasks(node)
|
||||
break;
|
||||
case "week":
|
||||
gantt.config.min_column_width = 70;
|
||||
gantt.config.scales = [{unit: 'week', step: 1, format: "<?php echo $lang->project->gantt->zooming['week'];?> #%W"}, {unit:"day", step:1, date:"%D"}]
|
||||
gantt.config.scales = [{unit: 'week', step: 1, format: "<?php echo $lang->execution->gantt->zooming['week'];?> #%W"}, {unit:"day", step:1, date:"%D"}]
|
||||
gantt.config.scale_height = 60;
|
||||
break;
|
||||
case "month":
|
||||
gantt.config.min_column_width = 70;
|
||||
gantt.config.scale_height = 60;
|
||||
gantt.config.scales = [{unit: 'month', step: 1, format: '%M'}, {unit:"week", step:1, date:"<?php echo $lang->project->gantt->zooming['week'];?> #%W"}];
|
||||
gantt.config.scales = [{unit: 'month', step: 1, format: '%M'}, {unit:"week", step:1, date:"<?php echo $lang->execution->gantt->zooming['week'];?> #%W"}];
|
||||
break;
|
||||
}
|
||||
gantt.render();
|
||||
|
||||
@@ -272,9 +272,10 @@ class repo extends control
|
||||
|
||||
$this->commonAction($repoID, $objectID);
|
||||
|
||||
$file = $entry;
|
||||
$repo = $this->repo->getRepoByID($repoID);
|
||||
$entry = $this->repo->decodePath($entry);
|
||||
$file = $entry;
|
||||
$repo = $this->repo->getRepoByID($repoID);
|
||||
$entry = $this->repo->decodePath($entry);
|
||||
$revision = str_replace('*', '-', $revision);
|
||||
|
||||
$this->scm->setEngine($repo);
|
||||
$info = $this->scm->info($entry, $revision);
|
||||
|
||||
+15
-1
@@ -334,7 +334,7 @@ class searchModel extends model
|
||||
*
|
||||
* @param int $queryID
|
||||
* @access public
|
||||
* @return string
|
||||
* @return object
|
||||
*/
|
||||
public function getQuery($queryID)
|
||||
{
|
||||
@@ -357,6 +357,20 @@ class searchModel extends model
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a query.
|
||||
*
|
||||
* @param int $queryID
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getByID($queryID)
|
||||
{
|
||||
$query = $this->dao->findByID($queryID)->from(TABLE_USERQUERY)->fetch();
|
||||
if(!$query) return false;
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save current query to db.
|
||||
*
|
||||
|
||||
@@ -228,7 +228,7 @@ foreach($fieldParams as $fieldName => $param)
|
||||
<ul>
|
||||
<?php foreach($queries as $queryID => $queryName):?>
|
||||
<?php if(empty($queryID)) continue;?>
|
||||
<?php $query = $this->search->getQuery($queryID);?>
|
||||
<?php $query = $this->search->getByID($queryID);?>
|
||||
<li><?php echo html::a("javascript:executeQuery($queryID)", $queryName . ((common::hasPriv('search', 'deleteQuery') and $this->app->user->account == $query->account) ? '<i class="icon icon-close"></i>' : ''), '', "class='label user-query' data-query-id='$queryID' title='{$queryName}'");?></li>
|
||||
<?php endforeach;?>
|
||||
</ul>
|
||||
@@ -363,7 +363,6 @@ $(function()
|
||||
var setDateField = function(query, fieldNO)
|
||||
{
|
||||
var $period = $('#selectPeriod');
|
||||
if($period.length) $period.remove();
|
||||
|
||||
<?php
|
||||
$selectPeriod = "<ul id='selectPeriod' class='dropdown-menu'>";
|
||||
|
||||
@@ -1132,8 +1132,6 @@ class story extends control
|
||||
|
||||
$reviewers = $this->story->getReviewerPairs($storyID, $story->version);
|
||||
$reviewedBy = trim($story->reviewedBy, ',');
|
||||
$superReviewers = trim(zget($this->config->story, 'superReviewers', ''), ',');
|
||||
$checkSuperReviewed = empty($reviewedBy) ? false : strpos(",$superReviewers,", ",$reviewedBy,");
|
||||
|
||||
$this->executeHooks($storyID);
|
||||
|
||||
@@ -1165,7 +1163,6 @@ class story extends control
|
||||
$this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('story', $storyID);
|
||||
$this->view->from = $from;
|
||||
$this->view->param = $param;
|
||||
$this->view->checkSuperReviewed = $checkSuperReviewed !== false ? true : false;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
@@ -1341,6 +1338,7 @@ class story extends control
|
||||
{
|
||||
$changes = $this->story->close($storyID);
|
||||
if(dao::isError()) return print(js::error(dao::getError()));
|
||||
$this->story->closeParentRequirement($storyID);
|
||||
|
||||
if($changes)
|
||||
{
|
||||
|
||||
@@ -2989,6 +2989,25 @@ class storyModel extends model
|
||||
return array(0 => '') + $stories ;
|
||||
}
|
||||
|
||||
/**
|
||||
* Close requirement if all son story for segmentation has been closed.
|
||||
*
|
||||
* @param int $storyID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function closeParentRequirement($storyID)
|
||||
{
|
||||
$parentID = $this->dao->select('BID')->from(TABLE_RELATION)->where('AID')->eq($storyID)->fetch();
|
||||
$stories = $this->dao->select('t2.id, t2.status')->from(TABLE_RELATION)->alias('t1')
|
||||
->leftJoin(TABLE_STORY)->alias('t2')->on('t2.id=t1.AID')
|
||||
->where('t1.BType')->eq('requirement')
|
||||
->andWhere('t2.status')->ne('closed')
|
||||
->andWhere('t2.type')->eq('story')
|
||||
->fetchPairs();
|
||||
if(empty($stories)) $this->close($parentID->BID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get stories of a user.
|
||||
*
|
||||
|
||||
@@ -395,7 +395,6 @@
|
||||
<th><?php echo $lang->story->assignedTo;?></th>
|
||||
<td><?php if($story->assignedTo) echo zget($users, $story->assignedTo) . $lang->at . $story->assignedDate;?></td>
|
||||
</tr>
|
||||
<?php if(!$checkSuperReviewed):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->reviewers;?></th>
|
||||
<td>
|
||||
@@ -410,7 +409,6 @@
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->reviewedDate;?></th>
|
||||
<td><?php if($story->reviewedBy) echo $story->reviewedDate;?></td>
|
||||
|
||||
@@ -48,7 +48,7 @@ function loadList(type, id, defaultType, idvalue)
|
||||
if(data.length != 0)
|
||||
{
|
||||
$(divClass).html(data).find('select').chosen();
|
||||
if(config.currentMethod == 'edit') $(divClass).html(data).find('select').val(idvalue).trigger('chosen:updated');
|
||||
if(config.currentMethod == 'edit' || type == 'feedback') $(divClass).html(data).find('select').val(idvalue).trigger('chosen:updated');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ $(function()
|
||||
});
|
||||
|
||||
$('#pri').on('change', function()
|
||||
{
|
||||
{
|
||||
var $select = $(this);
|
||||
var $selector = $select.closest('.pri-selector');
|
||||
var value = $select.val();
|
||||
|
||||
@@ -553,7 +553,7 @@ class todoModel extends model
|
||||
if($todo->type == 'risk' && $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_RISK)->fetch('name');
|
||||
if($todo->type == 'opportunity' && $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_OPPORTUNITY)->fetch('name');
|
||||
if($todo->type == 'review' && $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_REVIEW)->fetch('title');
|
||||
if($todo->type == 'feedback' && $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_FEEDBACK)->fetch('title');
|
||||
if($todo->type == 'feedback' and $this->config->edition != 'open') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_FEEDBACK)->fetch('title');
|
||||
$todo->begin = date::formatTime($todo->begin);
|
||||
$todo->end = date::formatTime($todo->end);
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@
|
||||
<tr>
|
||||
<td colspan='3' class='text-center form-actions'>
|
||||
<?php echo html::submitButton();?>
|
||||
<?php if(!isonlybody()) echo html::a($this->createLink('my', 'todo', 'type=all'), $lang->goback, '', "class='btn btn-back btn-wide'");?>
|
||||
<?php if(!isonlybody()) echo html::a($this->session->todoList, $lang->goback, '', "class='btn btn-back btn-wide'");?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -18,7 +18,7 @@ $lang->tree->browseTask = 'Manage Task Module';
|
||||
$lang->tree->manage = 'Manage Module';
|
||||
$lang->tree->fix = 'Fix Module';
|
||||
$lang->tree->manageProduct = "Manage {$lang->productCommon} Modules";
|
||||
$lang->tree->manageExecution = "Manage {$lang->executionCommon} Modules";
|
||||
$lang->tree->manageExecution = "Manage {$lang->execution->common} Modules";
|
||||
$lang->tree->manageLine = "Manage {$lang->productCommon} Line";
|
||||
$lang->tree->manageBug = 'Manage Bug';
|
||||
$lang->tree->manageCase = 'Manage Case';
|
||||
@@ -32,7 +32,7 @@ $lang->tree->manageLineChild = "Manage {$lang->productCommon} Line";
|
||||
$lang->tree->manageBugChild = 'Manage Child Modules of Bugs';
|
||||
$lang->tree->manageCaseChild = 'Manage Child Cases';
|
||||
$lang->tree->manageCaselibChild = 'Manage Child Libraries';
|
||||
$lang->tree->manageTaskChild = "Manage Child {$lang->executionCommon} Modules";
|
||||
$lang->tree->manageTaskChild = "Manage Child {$lang->execution->common} Modules";
|
||||
$lang->tree->syncFromProduct = "Copy from Other {$lang->productCommon}s";
|
||||
$lang->tree->dragAndSort = "Drag to order";
|
||||
$lang->tree->sort = "Order";
|
||||
|
||||
@@ -18,7 +18,7 @@ $lang->tree->browseTask = '任务模块维护';
|
||||
$lang->tree->manage = '维护模块';
|
||||
$lang->tree->fix = '修正数据';
|
||||
$lang->tree->manageProduct = "维护{$lang->productCommon}视图模块";
|
||||
$lang->tree->manageExecution = "维护{$lang->executionCommon}视图模块";
|
||||
$lang->tree->manageExecution = "维护{$lang->execution->common}视图模块";
|
||||
$lang->tree->manageLine = "维护{$lang->productCommon}线";
|
||||
$lang->tree->manageBug = '维护测试视图模块';
|
||||
$lang->tree->manageCase = '维护用例视图模块';
|
||||
@@ -32,7 +32,7 @@ $lang->tree->manageLineChild = "维护{$lang->productCommon}线";
|
||||
$lang->tree->manageBugChild = '维护Bug子模块';
|
||||
$lang->tree->manageCaseChild = '维护用例子模块';
|
||||
$lang->tree->manageCaselibChild = '维护用例库子模块';
|
||||
$lang->tree->manageTaskChild = "维护{$lang->executionCommon}子模块";
|
||||
$lang->tree->manageTaskChild = "维护{$lang->execution->common}子模块";
|
||||
$lang->tree->syncFromProduct = '复制模块';
|
||||
$lang->tree->dragAndSort = "拖放排序";
|
||||
$lang->tree->sort = "排序";
|
||||
|
||||
@@ -495,7 +495,8 @@ class upgradeModel extends model
|
||||
|
||||
$this->updateGroup4Lite();
|
||||
break;
|
||||
case '16.5':
|
||||
case '16_5':
|
||||
$this->updateProjectStatus();
|
||||
$this->updateStoryReviewer();
|
||||
break;
|
||||
}
|
||||
@@ -6181,4 +6182,35 @@ class upgradeModel extends model
|
||||
$this->dao->insert(TABLE_STORYREVIEW)->data($data)->exec();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the project status.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function updateProjectStatus()
|
||||
{
|
||||
$projects = $this->dao->select('*')->from(TABLE_PROJECT)
|
||||
->where('deleted')->eq('0')
|
||||
->andWhere('status')->eq('doing')
|
||||
->andWhere('type')->eq('project')
|
||||
->andWhere('realBegan')->eq('0000-00-00')
|
||||
->fetchAll('id');
|
||||
|
||||
if(empty($projects)) return;
|
||||
|
||||
$projectIDList = array_keys($projects);
|
||||
|
||||
$executions = $this->dao->select('id,project,min(realBegan) as minBegan')->from(TABLE_EXECUTION)
|
||||
->where('status')->eq('doing')
|
||||
->andWhere('deleted')->eq('0')
|
||||
->andWhere('project')->in($projectIDList)
|
||||
->groupBy('project')
|
||||
->fetchAll();
|
||||
|
||||
if(empty($executions)) return;
|
||||
|
||||
foreach ($executions as $execution) $this->dao->update(TABLE_PROJECT)->set('realBegan')->eq($execution->minBegan)->where('id')->eq($execution->project)->exec();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ class userModel extends model
|
||||
{
|
||||
$users = $this->dao->select('account, realname, avatar, dept, role')->from(TABLE_USER)
|
||||
->where('deleted')->eq(0)
|
||||
->beginIF($accounts)->andWhere('type')->eq($type)->fi()
|
||||
->beginIF($type)->andWhere('type')->eq($type)->fi()
|
||||
->beginIF($accounts)->andWhere('account')->in($accounts)->fi()
|
||||
->fetchAll('account');
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ include '../../common/view/header.lite.html.php';
|
||||
<?php
|
||||
$isOnlybody = helper::inOnlyBodyMode();
|
||||
unset($_GET['onlybody']);
|
||||
echo html::a('javascript:void(0)', $lang->my->common, ($isOnlybody ? '_parent' : ''), 'class="btn show-in-app" onclick="changeLeftNavigation()"');
|
||||
echo html::a($this->createLink('my'), $lang->my->common, ($isOnlybody ? '_parent' : ''), "class='btn show-in-app' data-app='my'");
|
||||
if($refererBeforeDeny) echo html::a(helper::safe64Decode($refererBeforeDeny), $lang->user->goback, ($isOnlybody ? '_parent' : ''), "class='btn'");
|
||||
echo html::a($this->createLink('user', 'logout', "referer=" . helper::safe64Encode($denyPage)), $lang->user->relogin, ($isOnlybody ? '_parent' : ''), "class='btn btn-primary'");
|
||||
?>
|
||||
@@ -60,20 +60,4 @@ include '../../common/view/header.lite.html.php';
|
||||
<?php js::set('isOnlybody', $isOnlybody);?>
|
||||
<?php js::set('indexLink', helper::createLink('my', 'index'));?>
|
||||
</body>
|
||||
<script>
|
||||
/* Click my site to modify the left navigation. */
|
||||
function changeLeftNavigation()
|
||||
{
|
||||
if(window.parent && window.parent.$.apps && isOnlybody)
|
||||
{
|
||||
$.closeModal();
|
||||
window.parent.$.apps.open('my');
|
||||
}
|
||||
else
|
||||
{
|
||||
$.apps.close();
|
||||
$.apps.open('my');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,198 @@
|
||||
<?php
|
||||
class adminTest
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
global $tester;
|
||||
global $config;
|
||||
global $app;
|
||||
$this->objectModel = $tester->loadModel('admin');
|
||||
$this->user = $tester->loadModel('user');
|
||||
$this->communityConfig = $app->loadConfig('community');
|
||||
$this->adminConfig = $config->admin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Post data form API.
|
||||
*
|
||||
* @param string $url
|
||||
* @param string $formvars
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function postAPITest()
|
||||
{
|
||||
$apiConfig = $this->objectModel->getApiConfig();
|
||||
$apiURL = $this->adminConfig->apiRoot . "/user-apiRegister.json?HTTP_X_REQUESTED_WITH=XMLHttpRequest&{$apiConfig->sessionVar}={$apiConfig->sessionID}";
|
||||
|
||||
$objects = $this->objectModel->postAPI($apiURL);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get status of zentaopms.
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
|
||||
public function getStatOfPMSTest()
|
||||
{
|
||||
$objects = $this->objectModel->getStatOfPMS();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function getStatOfCompanyTest($companyID)
|
||||
{
|
||||
$objects = $this->objectModel->getStatOfCompany($companyID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function getStatOfSysTest()
|
||||
{
|
||||
$objects = $this->objectModel->getStatOfSys();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function registerByAPITest()
|
||||
{
|
||||
$objects = $this->objectModel->registerByAPI();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
/**
|
||||
* Login zentao by API.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function bindByAPITest($param)
|
||||
{
|
||||
$_POST = $param;
|
||||
$objects = $this->objectModel->bindByAPI();
|
||||
$objects = json_decode($objects);
|
||||
unset($_POST);
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function getSecretKeyTest()
|
||||
{
|
||||
$objects = $this->objectModel->getSecretKey();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function sendCodeByAPITest($type)
|
||||
{
|
||||
$objects = $this->objectModel->sendCodeByAPI($type);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function certifyByAPITest($type)
|
||||
{
|
||||
$objects = $this->objectModel->certifyByAPI($type);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function setCompanyByAPITest()
|
||||
{
|
||||
$objects = $this->objectModel->setCompanyByAPI();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get signature.
|
||||
*
|
||||
* @param array $params
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
|
||||
public function getSignatureTest()
|
||||
{
|
||||
$params['u'] = $this->communityConfig;
|
||||
$params['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequet';
|
||||
|
||||
$apiConfig = $this->objectModel->getApiConfig();
|
||||
$params[$apiConfig->sessionVar] = $apiConfig->sessionID;
|
||||
|
||||
$objects = $this->objectModel->getSignature($params);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
if($objects){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function getApiConfigTest()
|
||||
{
|
||||
$objects = $this->objectModel->getApiConfig();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get register information.
|
||||
*
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getRegisterInfoTest()
|
||||
{
|
||||
$objects = $this->objectModel->getRegisterInfo();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
/**
|
||||
* Check weak.
|
||||
*
|
||||
* @param object $user
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
|
||||
public function checkWeakTest($account)
|
||||
{
|
||||
$user = $this->user->getById($account);
|
||||
$objects = $this->objectModel->checkWeak($user);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
}
|
||||
@@ -276,7 +276,7 @@ class personnelTest
|
||||
*
|
||||
* @param string $objectType
|
||||
* @param int $objectID
|
||||
* @param string mixed $user
|
||||
* @param array mixed $user
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -292,8 +292,20 @@ class personnelTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete product whitelist Test
|
||||
*
|
||||
* @param int mixed $productID
|
||||
* @param string $account
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function deleteProductWhitelistTest($productID, $account = '')
|
||||
{
|
||||
global $tester;
|
||||
$this->addWhitelistTest('product', $productID, array('admin'));
|
||||
$tester->dao->update(TABLE_ACL)->set('source')->eq('sync')->where('objectID')->eq($productID)->andWhere('objectType')->eq('product')->exec();
|
||||
|
||||
$objects = $this->objectModel->deleteProductWhitelist($productID, $account);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
@@ -301,8 +313,19 @@ class personnelTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function deleteProgramWhitelistTest($programID = 0, $account = '')
|
||||
/**
|
||||
* Delete program whitelist Test
|
||||
*
|
||||
* @param int $programID
|
||||
* @param string $account
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function deleteProgramWhitelistTest($programID, $account)
|
||||
{
|
||||
global $tester;
|
||||
$this->addWhitelistTest('program', $programID, array($account));
|
||||
$tester->dao->update(TABLE_ACL)->set('source')->eq('sync')->where('objectID')->eq($programID)->andWhere('objectType')->eq('program')->exec();
|
||||
$objects = $this->objectModel->deleteProgramWhitelist($programID, $account);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
@@ -310,8 +333,19 @@ class personnelTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function deleteProjectWhitelistTest($objectID = 0, $account = '')
|
||||
/**
|
||||
* Delete project whitelist Test
|
||||
*
|
||||
* @param int mixed $objectID
|
||||
* @param string mixed $account
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function deleteProjectWhitelistTest($objectID, $account)
|
||||
{
|
||||
global $tester;
|
||||
$this->addWhitelistTest('project', $objectID, array($account));
|
||||
$tester->dao->update(TABLE_ACL)->set('source')->eq('sync')->where('objectID')->eq($objectID)->andWhere('objectType')->eq('project')->exec();
|
||||
$objects = $this->objectModel->deleteProjectWhitelist($objectID, $account);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
@@ -319,8 +353,19 @@ class personnelTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete execution whitelist Test
|
||||
*
|
||||
* @param int mixed $executionID
|
||||
* @param string $account
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function deleteExecutionWhitelistTest($executionID, $account = '')
|
||||
{
|
||||
global $tester;
|
||||
$this->addWhitelistTest('sprint', $executionID, array($account));
|
||||
$tester->dao->update(TABLE_ACL)->set('source')->eq('sync')->where('objectID')->eq($executionID)->andWhere('objectType')->eq('sprint')->exec();
|
||||
$objects = $this->objectModel->deleteExecutionWhitelist($executionID, $account);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
@@ -328,8 +373,21 @@ class personnelTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete whitelist Test
|
||||
*
|
||||
* @param array $users
|
||||
* @param string $objectType
|
||||
* @param int $objectID
|
||||
* @param int $groupID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function deleteWhitelistTest($users = array(), $objectType = 'program', $objectID = 0, $groupID = 0)
|
||||
{
|
||||
global $tester;
|
||||
$this->addWhitelistTest($objectType, $objectID, $users);
|
||||
$tester->dao->update(TABLE_ACL)->set('source')->eq('sync')->where('objectID')->eq($objectID)->andWhere('objectType')->eq($objectType)->exec();
|
||||
$objects = $this->objectModel->deleteWhitelist($users, $objectType, $objectID, $groupID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
+218
-41
@@ -5,6 +5,7 @@ class reportTest
|
||||
{
|
||||
global $tester;
|
||||
$this->objectModel = $tester->loadModel('report');
|
||||
$tester->dao->delete()->from(TABLE_ACTION)->where('id')->gt(100)->exec();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -75,10 +76,16 @@ class reportTest
|
||||
*/
|
||||
public function getExecutionsTest($begin = 0, $end = 0)
|
||||
{
|
||||
global $tester;
|
||||
$tester->dao->update(TABLE_EXECUTION)->set('`status`')->eq('closed')->where('`id`')->in('101,102,103,107,111,121,151,183')->exec();
|
||||
|
||||
$begin = $begin != 0 ? date('Y-m-d', strtotime(date('Y-m-d') . $begin)) : 0;
|
||||
$end = $end != 0 ? date('Y-m-d', strtotime(date('Y-m-d') . $end)) : 0;
|
||||
$objects = $this->objectModel->getExecutions($begin, $end);
|
||||
|
||||
$tester->dao->update(TABLE_EXECUTION)->set('`status`')->eq('wait')->where('`id`')->in('101,103,107,111,121,151,183')->exec();
|
||||
$tester->dao->update(TABLE_EXECUTION)->set('`status`')->eq('doing')->where('`id`')->in('102')->exec();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
$executions = '';
|
||||
@@ -135,13 +142,31 @@ class reportTest
|
||||
return $count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get workload.
|
||||
*
|
||||
* @param int $dept
|
||||
* @param string $assign
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getWorkloadTest($dept = 0, $assign = 'assign')
|
||||
{
|
||||
$objects = $this->objectModel->getWorkload($dept = 0, $assign = 'assign');
|
||||
$objects = $this->objectModel->getWorkload($dept, $assign);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
$workload = '';
|
||||
foreach($objects as $user => $work)
|
||||
{
|
||||
if(strlen($workload) > 40) break;
|
||||
|
||||
$workload .= "$user:";
|
||||
foreach($work['total'] as $key => $value) $workload .= "$key:$value,";
|
||||
$workload = trim($workload, ',');
|
||||
$workload .= ';';
|
||||
}
|
||||
return $workload;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -161,53 +186,88 @@ class reportTest
|
||||
return $count;
|
||||
}
|
||||
|
||||
public function getSysURLTest()
|
||||
{
|
||||
$objects = $this->objectModel->getSysURL();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get user bugs.
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getUserBugsTest()
|
||||
{
|
||||
$objects = $this->objectModel->getUserBugs();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
$counts = '';
|
||||
foreach($objects as $user => $bugs) $counts .= "$user:" . count($bugs) . ';';
|
||||
return $counts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get user tasks.
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getUserTasksTest()
|
||||
{
|
||||
$objects = $this->objectModel->getUserTasks();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
$counts = '';
|
||||
foreach($objects as $user => $tasks) $counts .= "$user:" . count($tasks) . ';';
|
||||
return $counts;
|
||||
}
|
||||
|
||||
public function getUserTodosTest()
|
||||
/**
|
||||
* Test get user todos.
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getUserTodosTest($userType)
|
||||
{
|
||||
$objects = $this->objectModel->getUserTodos();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
$counts = '';
|
||||
foreach($objects as $user => $todos)
|
||||
{
|
||||
if(strpos($user, $userType) !== false and str_replace($userType, '', $user) < 11) $counts .= "$user:" . count($todos) . ';';
|
||||
}
|
||||
return $counts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get user test tasks.
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getUserTestTasksTest()
|
||||
{
|
||||
$objects = $this->objectModel->getUserTestTasks();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
$counts = '';
|
||||
foreach($objects as $user => $testtasks) $counts .= "$user:" . count($testtasks) . ';';
|
||||
return $counts;
|
||||
}
|
||||
|
||||
public function getUserYearLoginsTest($accounts, $year)
|
||||
/**
|
||||
* Test get user login count in this year.
|
||||
*
|
||||
* @param string $accounts
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
public function getUserYearLoginsTest($accounts)
|
||||
{
|
||||
$year = date('Y');
|
||||
|
||||
$objects = $this->objectModel->getUserYearLogins($accounts, $year);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
@@ -215,8 +275,17 @@ class reportTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function getUserYearActionsTest($accounts, $year)
|
||||
/**
|
||||
* Test get user action count in this year.
|
||||
*
|
||||
* @param array $accounts
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getUserYearActionsTest($accounts)
|
||||
{
|
||||
$year = date('Y');
|
||||
|
||||
$objects = $this->objectModel->getUserYearActions($accounts, $year);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
@@ -224,49 +293,102 @@ class reportTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function getUserYearContributionsTest($accounts, $year)
|
||||
/**
|
||||
* Test get user contributions in this year.
|
||||
*
|
||||
* @param array $accounts
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getUserYearContributionsTest($accounts)
|
||||
{
|
||||
$year = date('Y');
|
||||
|
||||
$objects = $this->objectModel->getUserYearContributions($accounts, $year);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
$contributions = '';
|
||||
foreach($objects as $type => $contributionTypes)
|
||||
{
|
||||
$contributions .= "$type:";
|
||||
foreach($contributionTypes as $contributionType => $count) $contributions .= "$contributionType:$count,";
|
||||
$contributions = trim($contributions, ',') . ';';
|
||||
}
|
||||
return $contributions;
|
||||
}
|
||||
|
||||
public function getUserYearTodosTest($accounts, $year)
|
||||
/**
|
||||
* Test get user todo stat in this year.
|
||||
*
|
||||
* @param array $accounts
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getUserYearTodosTest($accounts)
|
||||
{
|
||||
$year = date('Y');
|
||||
$objects = $this->objectModel->getUserYearTodos($accounts, $year);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
$count = '';
|
||||
foreach($objects as $type => $value) $count .= "$type:$value;";
|
||||
return $count;
|
||||
}
|
||||
|
||||
public function getUserYearEffortsTest($accounts, $year)
|
||||
/**
|
||||
* Test get user effort stat in this error.
|
||||
*
|
||||
* @param string $accounts
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getUserYearEffortsTest($accounts)
|
||||
{
|
||||
$objects = $this->objectModel->getUserYearEfforts($accounts, $year);
|
||||
$year = date('Y');
|
||||
|
||||
$object = $this->objectModel->getUserYearEfforts($accounts, $year);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
return $object;
|
||||
}
|
||||
|
||||
public function getUserYearProductsTest($accounts, $year)
|
||||
/**
|
||||
* Test get count of created story,plan and closed story by accounts every product in this year.
|
||||
*
|
||||
* @param mixed $accounts
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getUserYearProductsTest($accounts)
|
||||
{
|
||||
$year = date('Y');
|
||||
|
||||
$objects = $this->objectModel->getUserYearProducts($accounts, $year);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
return implode(',', array_keys($objects));
|
||||
}
|
||||
|
||||
public function getUserYearExecutionsTest($accounts, $year)
|
||||
/**
|
||||
* Test get count of finished task, story and resolved bug by accounts every executions in this years.
|
||||
*
|
||||
* @param string $accounts
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getUserYearExecutionsTest($accounts)
|
||||
{
|
||||
$year = date('Y');
|
||||
|
||||
$objects = $this->objectModel->getUserYearExecutions($accounts, $year);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
return implode(',', array_keys($objects));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -290,49 +412,96 @@ class reportTest
|
||||
return $types;
|
||||
}
|
||||
|
||||
public function getYearObjectStatTest($accounts, $year, $objectType)
|
||||
/**
|
||||
* Test get year object stat, include status and action stat.
|
||||
*
|
||||
* @param string $accounts
|
||||
* @param string $objectType
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getYearObjectStatTest($accounts, $objectType)
|
||||
{
|
||||
$year = date('Y');
|
||||
|
||||
$objects = $this->objectModel->getYearObjectStat($accounts, $year, $objectType);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
$stats = '';
|
||||
foreach($objects['statusStat'] as $stat => $count) $stats .= "$stat:$count;";
|
||||
return $stats;
|
||||
}
|
||||
|
||||
public function getYearCaseStatTest($accounts, $year)
|
||||
/**
|
||||
* Test get year case stat, include result and action stat.
|
||||
*
|
||||
* @param string $accounts
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getYearCaseStatTest($accounts)
|
||||
{
|
||||
$year = date('Y');
|
||||
|
||||
$objects = $this->objectModel->getYearCaseStat($accounts, $year);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
$result = '';
|
||||
foreach($objects['resultStat'] as $type => $value) $result .= "$type:$value;";
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get year months.
|
||||
*
|
||||
* @param string $year
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getYearMonthsTest($year)
|
||||
{
|
||||
$objects = $this->objectModel->getYearMonths($year);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
return implode(',', $objects);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get status overview.
|
||||
*
|
||||
* @param string $objectType
|
||||
* @param array $statusStat
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getStatusOverviewTest($objectType, $statusStat)
|
||||
{
|
||||
$objects = $this->objectModel->getStatusOverview($objectType, $statusStat);
|
||||
$object = $this->objectModel->getStatusOverview($objectType, $statusStat);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
return $object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get project status overview.
|
||||
*
|
||||
* @param array $accounts
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getProjectStatusOverviewTest($accounts = array())
|
||||
{
|
||||
$objects = $this->objectModel->getProjectStatusOverview($accounts = array());
|
||||
$objects = $this->objectModel->getProjectStatusOverview($accounts);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
$counts = '';
|
||||
foreach($objects as $type => $count) $counts .= "$type:$count;";
|
||||
return $counts;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -343,8 +512,9 @@ class reportTest
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getOutput4APITest($accounts, $year)
|
||||
public function getOutput4APITest($accounts)
|
||||
{
|
||||
$year = date('Y');
|
||||
$objects = $this->objectModel->getOutput4API($accounts, $year);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
@@ -354,12 +524,19 @@ class reportTest
|
||||
return $output;
|
||||
}
|
||||
|
||||
public function getProjectExecutionsTest()
|
||||
/**
|
||||
* Test get project and execution name.
|
||||
*
|
||||
* @param bool $count
|
||||
* @access public
|
||||
* @return int|array
|
||||
*/
|
||||
public function getProjectExecutionsTest($count = false)
|
||||
{
|
||||
$objects = $this->objectModel->getProjectExecutions();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
return $count ? count($objects) : $objects;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,8 +185,7 @@ fields:
|
||||
format: ""
|
||||
- field: assignedTo
|
||||
note: "指派给"
|
||||
from: common.user.v1.yaml
|
||||
use: user
|
||||
range: ""
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
|
||||
+1
-2
@@ -185,8 +185,7 @@ fields:
|
||||
format: ""
|
||||
- field: assignedTo
|
||||
note: "指派给"
|
||||
from: common.user.v1.yaml
|
||||
use: user
|
||||
range: ""
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
|
||||
@@ -12,12 +12,12 @@ fields:
|
||||
format: ""
|
||||
- field: date
|
||||
note: "更新日期"
|
||||
from: common.date.v1.yaml
|
||||
use: dateB
|
||||
range: "(-1M)-(+1w):60s"
|
||||
type: timestamp
|
||||
format: "YYYY-MM-DD hh:mm:ss"
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: left
|
||||
note: "总计消耗"
|
||||
range: 0
|
||||
|
||||
@@ -185,8 +185,7 @@ fields:
|
||||
format: ""
|
||||
- field: assignedTo
|
||||
note: "指派给"
|
||||
from: common.user.v1.yaml
|
||||
use: user
|
||||
range: po82,user92
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
|
||||
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/admin.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 adminModel->bindByAPI();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
正常测试 >> success;wxm11,j8a5qCRTleJh9Gv4
|
||||
错误密码测试 >> fail;登录失败,请检查您的用户名或密码是否填写正确。
|
||||
post数据为空测试 >> fail;登录失败,请检查您的用户名或密码是否填写正确。
|
||||
|
||||
*/
|
||||
|
||||
$admin = new adminTest();
|
||||
|
||||
$paramInfo = array('account' => 'wxm11', 'password' => '123qweasd', 'sn' => 'c8aa3269e181f2b9258ce96625de1497', 'site' => 'http://zentaopmsdemo.com');
|
||||
$errorPwd = array('account' => 'wxm11', 'password' => '123', 'sn' => 'c8aa3269e181f2b9258ce96625de1497', 'site' => 'http://zentaopmsdemo.com');
|
||||
$emptyPost = array();
|
||||
|
||||
r($admin->bindByAPITest($errorPwd)) && p('result;message') && e('fail;登录失败,请检查您的用户名或密码是否填写正确。'); //错误密码测试
|
||||
r($admin->bindByAPITest($emptyPost)) && p('result;message') && e('fail;登录失败,请检查您的用户名或密码是否填写正确。'); //post数据为空测试
|
||||
r($admin->bindByAPITest($paramInfo)) && p('result;data:account,private') && e('success;wxm11,j8a5qCRTleJh9Gv4'); //正常测试
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/admin.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 adminModel->certifyByAPI();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
$admin = new adminTest();
|
||||
|
||||
r($admin->certifyByAPITest()) && p() && e();
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/admin.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 adminModel->checkWeak();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
正常测试 >> 0
|
||||
|
||||
*/
|
||||
$account = 'admin';
|
||||
|
||||
$admin = new adminTest();
|
||||
|
||||
r($admin->checkWeakTest($account)) && p() && e('0'); //正常测试
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/admin.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 adminModel->getApiConfig();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
$admin = new adminTest();
|
||||
|
||||
r($admin->getApiConfigTest()) && p() && e();
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/admin.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 adminModel->getRegisterInfo();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
正常测试 >> 易软天创网络科技有限公司
|
||||
|
||||
*/
|
||||
|
||||
$admin = new adminTest();
|
||||
|
||||
r($admin->getRegisterInfoTest()) && p('company') && e('易软天创网络科技有限公司'); //正常测试
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/admin.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 adminModel->getSecretKey();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
$admin = new adminTest();
|
||||
|
||||
r($admin->getSecretKeyTest()) && p() && e();
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/admin.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 adminModel->getSignature();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
正常测试 >> 1
|
||||
|
||||
*/
|
||||
$admin = new adminTest();
|
||||
|
||||
r($admin->getSignatureTest()) && p() && e('1'); //正常测试
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/admin.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 adminModel->getStatOfCompany();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
$admin = new adminTest();
|
||||
|
||||
r($admin->getStatOfCompanyTest()) && p() && e();
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/admin.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 adminModel->getStatOfPMS();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
正常测试 >> 0
|
||||
|
||||
*/
|
||||
|
||||
$admin = new adminTest();
|
||||
|
||||
r($admin->getStatOfPMSTest()) && p() && e('0'); //正常测试
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/admin.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 adminModel->getStatOfSys();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
$admin = new adminTest();
|
||||
|
||||
r($admin->getStatOfSysTest()) && p() && e();
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/admin.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 adminModel->postAPI();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
$admin = new adminTest();
|
||||
|
||||
a($admin->postAPITest());die;
|
||||
r($admin->postAPITest()) && p() && e();
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/admin.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 adminModel->registerByAPI();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
$admin = new adminTest();
|
||||
|
||||
r($admin->registerByAPITest()) && p() && e();
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/admin.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 adminModel->sendCodeByAPI();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
$admin = new adminTest();
|
||||
|
||||
r($admin->sendCodeByAPITest()) && p() && e();
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/admin.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 adminModel->setCompanyByAPI();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
$admin = new adminTest();
|
||||
|
||||
r($admin->setCompanyByAPITest()) && p() && e();
|
||||
@@ -30,6 +30,6 @@ $bug = new bugTest();
|
||||
r($bug->confirmTest($bugIDlist[0],$bug1)) && p('0:field,old,new;1:field,old,new') && e('assignedTo,admin,user92;confirmed,0,1'); // 确认指派人变化的bug
|
||||
r($bug->confirmTest($bugIDlist[1],$bug3)) && p('0:field,old,new;1:field,old,new') && e('type,install,codeerror;confirmed,0,1'); // 确认类型变化的bug
|
||||
r($bug->confirmTest($bugIDlist[2],$bug4)) && p('0:field,old,new') && e('assignedTo,admin,user95'); // 确认已确认的bug
|
||||
r($bug->confirmTest($bugIDlist[3],$bug5)) && p('0:field,old,new;1:field,old,new') && e('status,resolved,active;;pri,3,2'); // 确认优先级变化的bug
|
||||
r($bug->confirmTest($bugIDlist[3],$bug5)) && p('0:field,old,new;1:field,old,new') && e('status,resolved,active;pri,3,2'); // 确认优先级变化的bug
|
||||
r($bug->confirmTest($bugIDlist[4],$bug8)) && p('0:field,old,new') && e('status,closed,active'); // 确认bug
|
||||
system("./ztest init");
|
||||
|
||||
@@ -44,7 +44,7 @@ $bug5->execution = $executionID;
|
||||
|
||||
$bug=new bugTest();
|
||||
r($bug->createBugFromGitlabIssueTest($bug1, $executionID)) && p('title') && e('问题1'); // 测试正常的创建来源于gitlab issue的bug的title
|
||||
r($bug->createBugFromGitlabIssueTest($bug2, $executionID)) && p('execution') && e("$executionID"); // 测试正常的创建来源于gitlab issue的bug的execution
|
||||
r($bug->createBugFromGitlabIssueTest($bug2, $executionID)) && p('execution') && e('101'); // 测试正常的创建来源于gitlab issue的bug的execution
|
||||
r($bug->createBugFromGitlabIssueTest($bug3, $executionID)) && p('pri') && e('3'); // 测试正常的创建来源于gitlab issue的bug的pri
|
||||
r($bug->createBugFromGitlabIssueTest($bug4, $executionID)) && p('severity') && e('3'); // 测试正常的创建来源于gitlab issue的bug的severity
|
||||
r($bug->createBugFromGitlabIssueTest($bug5, $executionID)) && p('title:0') && e('『Bug标题』不能为空。'); // 测试创建没有标题 来源于gitlab issue的异常bug
|
||||
|
||||
@@ -18,7 +18,7 @@ pid=1
|
||||
|
||||
|
||||
$bug=new bugTest();
|
||||
r($bug->getDataOfBugsPerAssignedToTest()) && p('admin:name,value') && e('admin,80'); // 获取用户admin数据
|
||||
r($bug->getDataOfBugsPerAssignedToTest()) && p('admin:name,value') && e('admin,85'); // 获取用户admin数据
|
||||
r($bug->getDataOfBugsPerAssignedToTest()) && p('dev1:name,value') && e('开发1,85'); // 获取用户dev1数据
|
||||
r($bug->getDataOfBugsPerAssignedToTest()) && p('test1:name,value') && e('测试1,85'); // 获取用户test1数据
|
||||
r($bug->getDataOfBugsPerAssignedToTest()) && p('closed:name,value') && e('Closed,20'); // 获取用户closed数据
|
||||
|
||||
@@ -9,10 +9,10 @@ title=bugModel->getDataOfOpenedBugsPerDay();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
获取创建的数据 >> 315
|
||||
获取创建的数据 >> 23
|
||||
|
||||
*/
|
||||
|
||||
|
||||
$bug=new bugTest();
|
||||
r($bug->getDataOfOpenedBugsPerDayTest()) && p('0:value') && e('315'); // 获取创建的数据
|
||||
r($bug->getDataOfOpenedBugsPerDayTest()) && p('0:value') && e('23'); // 获取创建的数据
|
||||
|
||||
@@ -22,7 +22,7 @@ $accountIDList = array('admin', 'test1', 'test2', 'dev1', 'po1');
|
||||
|
||||
$bug=new bugTest();
|
||||
r($bug->getUserBugsTest($accountIDList[0])) && p() && e('85'); // 测试获取用户admin的bug
|
||||
r($bug->getUserBugsTest($accountIDList[1])) && p() && e('55'); // 测试获取用户test1的bug
|
||||
r($bug->getUserBugsTest($accountIDList[1])) && p() && e('85'); // 测试获取用户test1的bug
|
||||
r($bug->getUserBugsTest($accountIDList[2])) && p() && e('0'); // 测试获取用户test2的bug
|
||||
r($bug->getUserBugsTest($accountIDList[3])) && p() && e('55'); // 测试获取用户dev1的bug
|
||||
r($bug->getUserBugsTest($accountIDList[4])) && p() && e('0'); // 测试获取用户po1的bug
|
||||
|
||||
@@ -28,7 +28,7 @@ $t_untitle = array('title' => 'jack');
|
||||
$t_untype = array('type' => 'install');
|
||||
|
||||
$bug=new bugTest();
|
||||
r($bug->updateObject($projectIdList[0], $t_uptitle)) && p('0:field,old,new') && e('title,正常bug2,john'); // 测试更新bug名称
|
||||
r($bug->updateObject($projectIdList[0], $t_uptitle)) && p('0:field,old,new') && e('title,BUG1,john'); // 测试更新bug名称
|
||||
r($bug->updateObject($projectIdList[0], $t_uptype)) && p('0:field,old,new') && e('type,codeerror,config'); // 测试更新bug类型
|
||||
r($bug->updateObject($projectIdList[0], $t_typetitle)) && p('0:field,old,new;1:field,old,new') && e('title,john,jack;type,config,install'); // 测试更新bug名称和类型
|
||||
r($bug->updateObject($projectIdList[0], $t_untitle)) && p() && e('没有数据更新'); // 测试不更改bug名称
|
||||
|
||||
Regular → Executable
+23
-3
@@ -2,7 +2,6 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/personnel.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,8 +9,29 @@ title=测试 personnelModel->addWhitelist();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试正常添加白名单 >> 0
|
||||
测试不传用户名的情况,这里不传用户名会导致删除符合条件的数据 >> 0
|
||||
|
||||
*/
|
||||
|
||||
$personnel = new personnelTest();
|
||||
$personnel = new personnelTest('admin');
|
||||
|
||||
r($personnel->addWhitelistTest()) && p() && e();
|
||||
$user = array();
|
||||
$user[0] = array('admin');
|
||||
$user[1] = array();
|
||||
|
||||
$objectID = array();
|
||||
$objectID[0] = 11;
|
||||
$objectID[1] = 21;
|
||||
|
||||
$objectType = array();
|
||||
$objectType[0] = 'project';
|
||||
$objectType[1] = 'program';
|
||||
$objectType[2] = 'product';
|
||||
$objectType[3] = 'sprint';
|
||||
|
||||
$result1 = $personnel->addWhitelistTest($objectType[0], $objectID[0], $user[0]);
|
||||
$result2 = $personnel->addWhitelistTest($objectType[0], $objectID[0], $user[1]);
|
||||
|
||||
r($result1) && p() && e('0'); //测试正常添加白名单
|
||||
r($result2) && p() && e('0'); //测试不传用户名的情况,这里不传用户名会导致删除符合条件的数据
|
||||
Regular → Executable
+4
-3
@@ -2,7 +2,6 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/personnel.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,8 +9,10 @@ title=测试 personnelModel->buildSearchForm();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
$personnel = new personnelTest();
|
||||
$personnel = new personnelTest('admin');
|
||||
|
||||
r($personnel->buildSearchFormTest()) && p() && e();
|
||||
//r($personnel->buildSearchFormTest()) && p() && e();
|
||||
@@ -10,6 +10,9 @@ title=测试 personnelModel->canViewProgram();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
看是否具有访问权限有的情况 >> 1
|
||||
看是否具有访问权限no的情况 >> 1
|
||||
|
||||
*/
|
||||
|
||||
$personnel = new personnelTest('admin');
|
||||
@@ -21,4 +24,4 @@ $account = array();
|
||||
$account[0] = 'test2';
|
||||
|
||||
r($personnel->canViewProgramTest(1, 'test2')) && p() && e('1'); //看是否具有访问权限有的情况
|
||||
r($personnel->canViewProgramTest(10000, 'test2')) && p() && e('1'); //看是否具有访问权限no的情况
|
||||
r($personnel->canViewProgramTest(10000, 'test2')) && p() && e('1'); //看是否具有访问权限no的情况
|
||||
Regular → Executable
+4
-3
@@ -2,7 +2,6 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/personnel.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,8 +9,10 @@ title=测试 personnelModel->createMemberLink();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
$personnel = new personnelTest();
|
||||
$personnel = new personnelTest('admin');
|
||||
|
||||
r($personnel->createMemberLinkTest()) && p() && e();
|
||||
//r($personnel->createMemberLinkTest()) && p() && e();
|
||||
Regular → Executable
+17
-3
@@ -2,7 +2,6 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/personnel.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,8 +9,23 @@ title=测试 personnelModel->deleteExecutionWhitelist();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
调用add方法创建spring类型的白名单,并修改source为sync,然后再通过条件删除 >> 0
|
||||
不传参数的情况,删除id为0的匹配数据,为空则跳过 >> 0
|
||||
|
||||
*/
|
||||
|
||||
$personnel = new personnelTest();
|
||||
$personnel = new personnelTest('admin');
|
||||
|
||||
r($personnel->deleteExecutionWhitelistTest()) && p() && e();
|
||||
$executionID = array();
|
||||
$executionID[0] = 16;
|
||||
$executionID[1] = '';
|
||||
|
||||
$account = array();
|
||||
$account[0] = 'admin';
|
||||
$account[1] = '';
|
||||
|
||||
$result1 = $personnel->deleteExecutionWhitelistTest($executionID[0], $account[0]);
|
||||
$result2 = $personnel->deleteExecutionWhitelistTest($executionID[1], $account[1]);
|
||||
|
||||
r($result1) && p() && e('0'); //调用add方法创建spring类型的白名单,并修改source为sync,然后再通过条件删除
|
||||
r($result2) && p() && e('0'); //不传参数的情况,删除id为0的匹配数据,为空则跳过
|
||||
Regular → Executable
+14
-3
@@ -2,7 +2,6 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/personnel.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,8 +9,20 @@ title=测试 personnelModel->deleteProductWhitelist();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
删除了产品10的白名单,这里有个条件,source必须为sync,同步过来的才能删 >> 0
|
||||
|
||||
*/
|
||||
|
||||
$personnel = new personnelTest();
|
||||
$personnel = new personnelTest('admin');
|
||||
|
||||
r($personnel->deleteProductWhitelistTest()) && p() && e();
|
||||
$productID = array();
|
||||
$productID[0] = 10;
|
||||
$peoductID[1] = 11111;
|
||||
|
||||
$account = array();
|
||||
$account[0] = 'admin';
|
||||
$account[1] = 'test111';
|
||||
|
||||
$result1 = $personnel->deleteProductWhitelistTest($productID[0], $account[0]);
|
||||
|
||||
r($result1) && p() && e('0'); //删除了产品10的白名单,这里有个条件,source必须为sync,同步过来的才能删
|
||||
Regular → Executable
+17
-3
@@ -2,7 +2,6 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/personnel.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,8 +9,23 @@ title=测试 personnelModel->deleteProgramWhitelist();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
我这里通过add方法创建了一个id为10的项目集白名单,并修改source为同步,然后删除创建的这条信息 >> 0
|
||||
传入空时这里我删除了一个objectID为0的,program白名单信息,如果没这条数据跳过 >> 0
|
||||
|
||||
*/
|
||||
|
||||
$personnel = new personnelTest();
|
||||
$personnel = new personnelTest('admin');
|
||||
|
||||
r($personnel->deleteProgramWhitelistTest()) && p() && e();
|
||||
$programID = array();
|
||||
$programID[0] = 10;
|
||||
$programID[1] = '';
|
||||
|
||||
$account = array();
|
||||
$account[0] = 'dev10';
|
||||
$account[1] = '';
|
||||
|
||||
$result1 = $personnel->deleteProgramWhitelistTest($programID[0], $account[0]);
|
||||
$result2 = $personnel->deleteProgramWhitelistTest($programID[1], $account[1]);
|
||||
|
||||
r($result1) && p() && e('0'); //我这里通过add方法创建了一个id为10的项目集白名单,并修改source为同步,然后删除创建的这条信息
|
||||
r($result2) && p() && e('0'); //传入空时这里我删除了一个objectID为0的,program白名单信息,如果没这条数据跳过
|
||||
Regular → Executable
+17
-3
@@ -2,7 +2,6 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/personnel.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,8 +9,23 @@ title=测试 personnelModel->deleteProjectWhitelist();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
通过add方法创建一个白名单,这里判断了objectType为sprint的情况,正常传入无法删除 >> 0
|
||||
传入空的情况时,删除为objectID为0的数据,如果空,则跳过 >> 0
|
||||
|
||||
*/
|
||||
|
||||
$personnel = new personnelTest();
|
||||
$personnel = new personnelTest('admin');
|
||||
|
||||
r($personnel->deleteProjectWhitelistTest()) && p() && e();
|
||||
$projectID = array();
|
||||
$projectID[0] = 15;
|
||||
$projectID[1] = '';
|
||||
|
||||
$account = array();
|
||||
$account[0] = 'dev15';
|
||||
$account[1] = '';
|
||||
|
||||
$result1 = $personnel->deleteProjectWhitelistTest($projectID[0], $account[0]);
|
||||
$result2 = $personnel->deleteProjectWhitelistTest($projectID[1], $account[1]);
|
||||
|
||||
r($result1) && p() && e('0'); //通过add方法创建一个白名单,这里判断了objectType为sprint的情况,正常传入无法删除
|
||||
r($result2) && p() && e('0'); //传入空的情况时,删除为objectID为0的数据,如果空,则跳过
|
||||
Regular → Executable
+33
-3
@@ -2,7 +2,6 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/personnel.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,8 +9,39 @@ title=测试 personnelModel->deleteWhitelist();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
创建删除objectID为2的项目白名单 >> 0
|
||||
创建删除objectID为2的产品白名单 >> 0
|
||||
创建删除objectID为10的项目集白名单 >> 0
|
||||
创建删除objectID为11的执行白名单 >> 0
|
||||
|
||||
*/
|
||||
|
||||
$personnel = new personnelTest();
|
||||
$personnel = new personnelTest('admin');
|
||||
|
||||
r($personnel->deleteWhitelistTest()) && p() && e();
|
||||
$users = array();
|
||||
$users[0] = 'dev17';
|
||||
|
||||
$objectType = array();
|
||||
$objectType[0] = 'project';
|
||||
$objectType[1] = 'product';
|
||||
$objectType[2] = 'program';
|
||||
$objectType[3] = 'sprint';
|
||||
|
||||
$objectID = array();
|
||||
$objectID[0] = '2';
|
||||
$objectID[1] = '10';
|
||||
$objectID[2] = '11';
|
||||
|
||||
$groupID = array();
|
||||
$groupID[0] = '1';
|
||||
$groupID[1] = '2';
|
||||
|
||||
$result1 = $personnel->deleteWhitelistTest($users, $objectType[0], $objectID[0]);
|
||||
$result2 = $personnel->deleteWhitelistTest($users, $objectType[1], $objectID[0]);
|
||||
$result3 = $personnel->deleteWhitelistTest($users, $objectType[2], $objectID[1]);
|
||||
$result4 = $personnel->deleteWhitelistTest($users, $objectType[3], $objectID[2]);
|
||||
|
||||
r($result1) && p() && e('0'); //创建删除objectID为2的项目白名单
|
||||
r($result2) && p() && e('0'); //创建删除objectID为2的产品白名单
|
||||
r($result3) && p() && e('0'); //创建删除objectID为10的项目集白名单
|
||||
r($result4) && p() && e('0'); //创建删除objectID为11的执行白名单
|
||||
@@ -10,6 +10,11 @@ title=测试 personnelModel->getAccessiblePersonnel();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试取出结果集中的一个对象里的名字programID=1 >> 测试1
|
||||
测试取出匹配的数量 >> 10
|
||||
测试取出结果集中的一个对象里的名字programID=2 >> 开发11
|
||||
测试取出匹配的数量 >> 10
|
||||
|
||||
*/
|
||||
|
||||
$personnel = new personnelTest('admin');
|
||||
@@ -38,4 +43,4 @@ $getnumber2 = count($personnel->getAccessiblePersonnelTest($programID[1], $dep
|
||||
r($getrealname1) && p('realname') && e('测试1'); //测试取出结果集中的一个对象里的名字programID=1
|
||||
r($getnumber1) && p() && e('10'); //测试取出匹配的数量
|
||||
r($getrealname2) && p('realname') && e('开发11'); //测试取出结果集中的一个对象里的名字programID=2
|
||||
r($getnumber2) && p() && e('10'); //测试取出匹配的数量
|
||||
r($getnumber2) && p() && e('10'); //测试取出匹配的数量
|
||||
Regular → Executable
+4
-3
@@ -2,7 +2,6 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/personnel.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,8 +9,10 @@ title=测试 personnelModel->getBugAndStoryInvest();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
$personnel = new personnelTest();
|
||||
$personnel = new personnelTest('admin');
|
||||
|
||||
r($personnel->getBugAndStoryInvestTest()) && p() && e();
|
||||
//r($personnel->getBugAndStoryInvestTest()) && p() && e();
|
||||
Regular → Executable
+42
-3
@@ -2,7 +2,6 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/personnel.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,8 +9,48 @@ title=测试 personnelModel->getCopiedObjects();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
取出匹配的项目数量 >> 20
|
||||
取出其中一个匹配的项目 >> 独立项目20
|
||||
取出匹配的产品数量 >> 119
|
||||
取出其中一个匹配的产品 >> 多平台产品100
|
||||
取出匹配的项目集数量 >> 9
|
||||
取出其中一个匹配的项目集 >> 项目集10
|
||||
取出匹配的执行数量 >> 10
|
||||
取出其中一个匹配的执行 >> 独立项目20
|
||||
传入不存在的objectID匹配的执行数量 >> 0
|
||||
传入空值时取出匹配的执行数量 >> 0
|
||||
|
||||
*/
|
||||
|
||||
$personnel = new personnelTest();
|
||||
$personnel = new personnelTest('admin');
|
||||
|
||||
r($personnel->getCopiedObjectsTest()) && p() && e();
|
||||
$objectID = array();
|
||||
$objectID[0] = 1;
|
||||
$objectID[1] = 2;
|
||||
$objectID[2] = 11111;
|
||||
$objectID[3] = '';
|
||||
|
||||
$objectType = array();
|
||||
$objectType[0] = 'project';
|
||||
$objectType[1] = 'product';
|
||||
$objectType[2] = 'program';
|
||||
$objectType[3] = 'sprint';
|
||||
|
||||
$result1 = $personnel->getCopiedObjectsTest($objectID[0], $objectType[0]);
|
||||
$result2 = $personnel->getCopiedObjectsTest($objectID[0], $objectType[1]);
|
||||
$result3 = $personnel->getCopiedObjectsTest($objectID[1], $objectType[2]);
|
||||
$result4 = $personnel->getCopiedObjectsTest($objectID[1], $objectType[3]);
|
||||
$result5 = $personnel->getCopiedObjectsTest($objectID[2], $objectType[3]);
|
||||
$result6 = $personnel->getCopiedObjectsTest($objectID[2], $objectType[3]);
|
||||
|
||||
//a($result);die;
|
||||
r(count($result1)) && p() && e('20'); //取出匹配的项目数量
|
||||
r($result1) && p('750') && e('独立项目20'); //取出其中一个匹配的项目
|
||||
r(count($result2)) && p() && e('119'); //取出匹配的产品数量
|
||||
r($result2) && p('100') && e('多平台产品100'); //取出其中一个匹配的产品
|
||||
r(count($result3)) && p() && e('9'); //取出匹配的项目集数量
|
||||
r($result3) && p('10') && e('项目集10'); //取出其中一个匹配的项目集
|
||||
r(count($result4)) && p() && e('10'); //取出匹配的执行数量
|
||||
r($result4) && p('750') && e(' 独立项目20'); //取出其中一个匹配的执行
|
||||
r(count($result5)) && p() && e('0'); //传入不存在的objectID匹配的执行数量
|
||||
r(count($result6)) && p() && e('0'); //传入空值时取出匹配的执行数量
|
||||
@@ -10,6 +10,8 @@ title=测试 personnelModel->getInvest();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
$personnel = new personnelTest('admin');
|
||||
@@ -22,4 +24,4 @@ $invest1 = count($personnel->getInvestTest($programID[0]));
|
||||
$invest2 = count($personnel->getInvestTest($programID[1]));
|
||||
|
||||
r($invest1) && p($invest1) && e(''); //获得项目id=1的授权用户数量
|
||||
r($invest2) && p($invest2) && e(''); //获得项目id=2的授权用户数量
|
||||
r($invest2) && p($invest2) && e(''); //获得项目id=2的授权用户数量
|
||||
@@ -2,7 +2,6 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/personnel.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,12 +9,22 @@ title=测试 personnelModel->getInvolvedExecutions();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
涉及到执行的人员计数 >> 8
|
||||
取出其中一个 >> 1
|
||||
传入不存在的id >> 0
|
||||
|
||||
*/
|
||||
|
||||
$personnel = new personnelTest('admin');
|
||||
|
||||
$project = array();
|
||||
$project[0] = 101;
|
||||
$project[1] = 102;
|
||||
$project[0] = array(11, 12);
|
||||
$project[1] = 12222;
|
||||
|
||||
r($personnel->getInvolvedExecutionsTest($project)) && p() && e(''); //
|
||||
$result1 = count($personnel->getInvolvedExecutionsTest($project[0]));
|
||||
$result2 = $personnel->getInvolvedExecutionsTest($project[0]);
|
||||
$result3 = $personnel->getInvolvedExecutionsTest($project[1]);
|
||||
|
||||
r($result1) && p() && e('8'); //涉及到执行的人员计数
|
||||
r($result2) && p('pm72') && e('1'); //取出其中一个
|
||||
r($result3) && p() && e('0'); //传入不存在的id
|
||||
Regular → Executable
+16
-3
@@ -2,7 +2,6 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/personnel.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,8 +9,22 @@ title=测试 personnelModel->getInvolvedProjects();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
计数project11,12的团队人员个数 >> 4
|
||||
取出其中一个角色 >> 1
|
||||
传入不存在的ID >> 0
|
||||
|
||||
*/
|
||||
|
||||
$personnel = new personnelTest();
|
||||
$personnel = new personnelTest('admin');
|
||||
|
||||
r($personnel->getInvolvedProjectsTest()) && p() && e();
|
||||
$projectID = array();
|
||||
$projectID[0] = array(11, 12);
|
||||
$projectID[1] = array(1111);
|
||||
|
||||
$result1 = count($personnel->getInvolvedProjectsTest($projectID[0]));
|
||||
$result2 = $personnel->getInvolvedProjectsTest($projectID[0]);
|
||||
$result3 = count($personnel->getInvolvedProjectsTest($projectID[1]));
|
||||
|
||||
r($result1) && p() && e('4'); //计数project11,12的团队人员个数
|
||||
r($result2) && p('admin') && e('1'); //取出其中一个角色
|
||||
r($result3) && p() && e('0'); //传入不存在的ID
|
||||
Regular → Executable
+3
-2
@@ -2,7 +2,6 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/personnel.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,8 +9,10 @@ title=测试 personnelModel->getIssueInvest();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
$personnel = new personnelTest();
|
||||
$personnel = new personnelTest('admin');
|
||||
|
||||
r($personnel->getIssueInvestTest()) && p() && e();
|
||||
Regular → Executable
+20
-3
@@ -2,7 +2,6 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/personnel.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,8 +9,26 @@ title=测试 personnelModel->getProjectTaskInvest();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
次方法为页面上的项目信息,人员,创建人物 >> 0
|
||||
次方法为页面上的项目信息,人员,已完成任务 >> 0
|
||||
次方法为页面上的项目信息,人员,待处理 >> 0
|
||||
次方法为页面上的项目信息,人员,任务消耗 >> 0
|
||||
|
||||
*/
|
||||
|
||||
$personnel = new personnelTest();
|
||||
$personnel = new personnelTest('admin');
|
||||
|
||||
r($personnel->getProjectTaskInvestTest()) && p() && e();
|
||||
$projectID = array();
|
||||
$projectID[0] = 11;
|
||||
$projectID[1] = 12;
|
||||
|
||||
$account = array();
|
||||
$account[0] = 'admin';
|
||||
$account[1] = 'user3';
|
||||
|
||||
$result1 = $personnel->getProjectTaskInvestTest($projectID, $account);
|
||||
|
||||
r($result1) && p('0:createdTask') && e('0'); //次方法为页面上的项目信息,人员,创建人物
|
||||
r($result1) && p('0:finishedTask') && e('0'); //次方法为页面上的项目信息,人员,已完成任务
|
||||
r($result1) && p('0:pendingTask') && e('0'); //次方法为页面上的项目信息,人员,待处理
|
||||
r($result1) && p('0:consumedTask') && e('0'); //次方法为页面上的项目信息,人员,任务消耗
|
||||
@@ -10,10 +10,12 @@ title=测试 personnelModel->getRiskInvest();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
$personnel = new personnelTest('admin');
|
||||
|
||||
var_dump($personnel->getRiskInvestTest(array('test2', 'test3'), array(1, 2, 3)));die;
|
||||
|
||||
r($personnel->getRiskInvestTest()) && p() && e();
|
||||
r($personnel->getRiskInvestTest()) && p() && e();
|
||||
Regular → Executable
+4
-3
@@ -2,7 +2,6 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/personnel.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,8 +9,10 @@ title=测试 personnelModel->getSprintAndStage();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
$personnel = new personnelTest();
|
||||
$personnel = new personnelTest('admin');
|
||||
|
||||
r($personnel->getSprintAndStageTest()) && p() && e();
|
||||
//r($personnel->getSprintAndStageTest()) && p() && e();
|
||||
Regular → Executable
+13
-2
@@ -10,8 +10,19 @@ title=测试 personnelModel->getUserEffortHours();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
正常传入的情况 >> 0
|
||||
传入不存在的情况 >> 0
|
||||
|
||||
*/
|
||||
|
||||
$personnel = new personnelTest();
|
||||
$personnel = new personnelTest('admin');
|
||||
|
||||
r($personnel->getUserEffortHoursTest()) && p() && e();
|
||||
$projectID = array();
|
||||
$projectID[0] = 11;
|
||||
$projectID[1] = 11111;
|
||||
|
||||
$result1 = $personnel->getUserEffortHoursTest($projectID[0]);
|
||||
$result2 = $personnel->getUserEffortHoursTest($projectID[1]);
|
||||
|
||||
r($result1) && p() && e('0'); //正常传入的情况
|
||||
r($result2) && p() && e('0'); //传入不存在的情况
|
||||
Regular → Executable
+33
-2
@@ -10,8 +10,39 @@ title=测试 personnelModel->getUserHours();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
取出admin工时 >> 4
|
||||
取出po82的工时 >> 3
|
||||
取出匹配的人员数量 >> 2
|
||||
当传入一个存在的角色一个不存在的角色时,打印其中存在的角色工时 >> 4
|
||||
其中一个为空时,取出匹配的人员数量 >> 1
|
||||
当传入task不存在时 >> 0
|
||||
当task不存在时,取出匹配个数 >> 0
|
||||
|
||||
*/
|
||||
|
||||
$personnel = new personnelTest();
|
||||
$personnel = new personnelTest('admin');
|
||||
|
||||
r($personnel->getUserHoursTest()) && p() && e();
|
||||
$userTask = array();
|
||||
$userTask['po82'] = array(1);
|
||||
$userTask['admin'] = array(2);
|
||||
|
||||
$userTask1 = array();
|
||||
$userTask1['test111'] = array(1);
|
||||
$userTask1['admin'] = array(2);
|
||||
|
||||
$userTask2 = array();
|
||||
$userTask2['admin'] = array(1111);
|
||||
$userTask2['po82'] = array(1112);
|
||||
|
||||
$result1 = $personnel->getUserHoursTest($userTask);
|
||||
$result2 = count($personnel->getUserHoursTest($userTask));
|
||||
$result3 = $personnel->getUserHoursTest($userTask1);
|
||||
$result4 = $personnel->getUserHoursTest($userTask2);
|
||||
|
||||
r($result1) && p('admin:consumed') && e('4'); //取出admin工时
|
||||
r($result1) && p('po82:consumed') && e('3'); //取出po82的工时
|
||||
r($result2) && p() && e('2'); //取出匹配的人员数量
|
||||
r($result3) && p('admin:consumed') && e('4'); //当传入一个存在的角色一个不存在的角色时,打印其中存在的角色工时
|
||||
r(count($result3)) && p() && e('1'); //其中一个为空时,取出匹配的人员数量
|
||||
r($result4) && p('admin:consumed') && e('0'); //当传入task不存在时
|
||||
r(count($result4)) && p() && e('0'); //当task不存在时,取出匹配个数
|
||||
Regular → Executable
+31
-3
@@ -2,7 +2,6 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/personnel.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,8 +9,37 @@ title=测试 personnelModel->getWhitelist();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
取出对应object1的项目人员数量 >> 2
|
||||
取出其中一个人员项目经理10 >> 项目经理10
|
||||
取出另一个人员admin >> admin
|
||||
取出对应object2的执行人员数量 >> 0
|
||||
当传入不存在的objectID时,取出匹配执行人员数量 >> 0
|
||||
当传入空时,查看匹配执行的人员数量 >> 0
|
||||
|
||||
*/
|
||||
|
||||
$personnel = new personnelTest();
|
||||
$personnel = new personnelTest('admin');
|
||||
|
||||
r($personnel->getWhitelistTest()) && p() && e();
|
||||
$objectID = array();
|
||||
$objectID[0] = 1;
|
||||
$objectID[1] = 2;
|
||||
$objectID[2] = 11111;
|
||||
$objectID[3] = '';
|
||||
|
||||
$objectType = array();
|
||||
$objectType[0] = 'project';
|
||||
$objectType[1] = 'program';
|
||||
$objectType[2] = 'product';
|
||||
$objectType[3] = 'sprint';
|
||||
|
||||
$result1 = $personnel->getWhitelistTest($objectID[0], $objectType[1]);
|
||||
$result2 = $personnel->getWhitelistTest($objectID[1], $objectType[3]);
|
||||
$result3 = $personnel->getWhitelistTest($objectID[2], $objectType[3]);
|
||||
$result4 = $personnel->getWhitelistTest($objectID[3], $objectType[1]);
|
||||
|
||||
r(count($result1)) && p() && e('2'); //取出对应object1的项目人员数量
|
||||
r($result1) && p('0:realname') && e('项目经理10'); //取出其中一个人员项目经理10
|
||||
r($result1) && p('1:realname') && e('admin'); //取出另一个人员admin
|
||||
r(count($result2)) && p() && e('0'); //取出对应object2的执行人员数量
|
||||
r(count($result3)) && p() && e('0'); //当传入不存在的objectID时,取出匹配执行人员数量
|
||||
r(count($result4)) && p() && e('0'); //当传入空时,查看匹配执行的人员数量
|
||||
Regular → Executable
+31
-3
@@ -2,7 +2,6 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/personnel.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,8 +9,37 @@ title=测试 personnelModel->getWhitelistAccount();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
这是一个正常测试,统计关联白名单人员数量 >> 2
|
||||
取出其中一个数据admin >> admin
|
||||
取出另一个数据dev10 >> dev10
|
||||
取出objectid2的白名单数量 >> 0
|
||||
当objectID不存在时,统计匹配数量 >> 0
|
||||
当传入参数为空时,统计匹配人员数量 >> 0
|
||||
|
||||
*/
|
||||
|
||||
$personnel = new personnelTest();
|
||||
$personnel = new personnelTest('admin');
|
||||
|
||||
r($personnel->getWhitelistAccountTest()) && p() && e();
|
||||
$objectID = array();
|
||||
$objectID[0] = 1;
|
||||
$objectID[1] = 2;
|
||||
$objectID[2] = 1111;
|
||||
$objectID[3] = '';
|
||||
|
||||
$objectType = array();
|
||||
$objectType[0] = 'project';
|
||||
$objectType[1] = 'program';
|
||||
$objectType[2] = 'product';
|
||||
$objectType[3] = 'sprint';
|
||||
|
||||
$result1 = $personnel->getWhitelistAccountTest($objectID[0], $objectType[1]);
|
||||
$result2 = $personnel->getWhitelistAccountTest($objectID[1], $objectType[2]);
|
||||
$result3 = $personnel->getWhitelistAccountTest($objectID[2], $objectType[3]);
|
||||
$result4 = $personnel->getWhitelistAccountTest($objectID[3], $objectType[0]);
|
||||
|
||||
r(count($result1)) && p() && e('2'); //这是一个正常测试,统计关联白名单人员数量
|
||||
r($result1) && p('admin') && e('admin'); //取出其中一个数据admin
|
||||
r($result1) && p('dev10') && e('dev10'); //取出另一个数据dev10
|
||||
r(count($result2)) && p() && e('0'); //取出objectid2的白名单数量
|
||||
r(count($result3)) && p() && e('0'); //当objectID不存在时,统计匹配数量
|
||||
r(count($result4)) && p() && e('0'); //当传入参数为空时,统计匹配人员数量
|
||||
Regular → Executable
+39
-3
@@ -2,7 +2,6 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/personnel.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,8 +9,45 @@ title=测试 personnelModel->updateWhitelist();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
传入已有参数时,数据变更类型source为add >> 0
|
||||
传入已有参数时,数据变更type为blacklist >> 0
|
||||
传入没有的参数时,新建一条source为sync的数据 >> 0
|
||||
|
||||
*/
|
||||
|
||||
$personnel = new personnelTest();
|
||||
$personnel = new personnelTest('admin');
|
||||
|
||||
r($personnel->updateWhitelistTest()) && p() && e();
|
||||
$user = array();
|
||||
$user[0] = array('admin', 'dev10');
|
||||
$user[1] = array('test1', 'test2');
|
||||
|
||||
$objectType = array();
|
||||
$objectType[0] = 'project';
|
||||
$objectType[1] = 'program';
|
||||
$objectType[2] = 'product';
|
||||
$objectType[3] = 'sprint';
|
||||
|
||||
$objectID = array();
|
||||
$objectID[0] = 1;
|
||||
$objectID[1] = 2;
|
||||
|
||||
$type = array();
|
||||
$type[0] = 'whitelist';
|
||||
$type[1] = 'blacklist';
|
||||
|
||||
$source = array();
|
||||
$source[0] = 'update';
|
||||
$source[1] = 'add';
|
||||
$source[2] = 'sync';
|
||||
|
||||
$updateType = array();
|
||||
$updateType[0] = 'increase';
|
||||
$updateType[1] = 'replace';
|
||||
|
||||
$result1 = $personnel->updateWhitelistTest($user[0], $objectType[0], $objectID[1], $type[0], $source[1], $updateType[0]);
|
||||
$result2 = $personnel->updateWhitelistTest($user[0], $objectType[1], $objectID[0], $type[1], $source[0], $updateType[1]);
|
||||
$result3 = $personnel->updateWhitelistTest($user[1], $objectType[0], $objectID[0], $type[0], $source[2], $updateType[0]);
|
||||
|
||||
r($result1) && p() && e('0'); //传入已有参数时,数据变更类型source为add
|
||||
r($result2) && p() && e('0'); //传入已有参数时,数据变更type为blacklist
|
||||
r($result3) && p() && e('0'); //传入没有的参数时,新建一条source为sync的数据
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user