Merge branch 'master' of https://github.com/easysoft/zentaopms
This commit is contained in:
@@ -1467,7 +1467,7 @@ class bugModel extends model
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return array('title' => $title, 'steps' => $bugSteps, 'storyID' => $run->case->story, 'moduleID' => $run->case->module, 'version' => $run->case->version);
|
||||
}
|
||||
|
||||
@@ -1538,7 +1538,7 @@ class bugModel extends model
|
||||
{
|
||||
$datas = $this->dao->select('module as name, count(module) as value')->from(TABLE_BUG)->where($this->reportCondition())->groupBy('module')->orderBy('value DESC')->fetchAll('name');
|
||||
if(!$datas) return array();
|
||||
$modules = $this->loadModel('tree')->getModulesName(array_keys($datas));
|
||||
$modules = $this->loadModel('tree')->getModulesName(array_keys($datas),true,true);
|
||||
foreach($datas as $moduleID => $data) $data->name = isset($modules[$moduleID]) ? $modules[$moduleID] : '/';
|
||||
return $datas;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
*/
|
||||
$config->git = new stdClass();
|
||||
$config->git->encodings = 'utf-8, gbk';
|
||||
$config->git->encodings = 'utf-8';
|
||||
$config->git->client = '';
|
||||
|
||||
$i = 1;
|
||||
|
||||
@@ -430,6 +430,10 @@ class gitModel extends model
|
||||
if(count($lists) == 2) list($nowRevision, $preRevision) = $lists;
|
||||
$cmd = "$this->client diff $preRevision $nowRevision -- $subPath";
|
||||
$diff = `$cmd`;
|
||||
|
||||
$encodings = isset($repo->encodings) ? $repo->encodings : $this->config->svn->encodings;
|
||||
if($encodings or $encodings != 'utf-8') $diff = helper::convertEncoding($diff, $encodings);
|
||||
|
||||
return $diff;
|
||||
}
|
||||
|
||||
@@ -457,6 +461,10 @@ class gitModel extends model
|
||||
exec("{$this->client} config core.quotepath false");
|
||||
$cmd = "$this->client show $revision:$subPath";
|
||||
$code = `$cmd`;
|
||||
|
||||
$encodings = isset($repo->encodings) ? $repo->encodings : $this->config->git->encodings;
|
||||
if($encodings or $encodings != 'utf-8') $code = helper::convertEncoding($code, $encodings);
|
||||
|
||||
return $code;
|
||||
}
|
||||
|
||||
|
||||
@@ -1268,11 +1268,11 @@ class story extends control
|
||||
|
||||
/**
|
||||
* The report page.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param string $browseType
|
||||
*
|
||||
* @param int $productID
|
||||
* @param string $browseType
|
||||
* @param int $branchID
|
||||
* @param int $moduleID
|
||||
* @param int $moduleID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -1307,12 +1307,12 @@ class story extends control
|
||||
$this->view->checkedCharts = $this->post->charts ? join(',', $this->post->charts) : '';
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get data to export
|
||||
*
|
||||
* @param int $productID
|
||||
* @param string $orderBy
|
||||
*
|
||||
* @param int $productID
|
||||
* @param string $orderBy
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
|
||||
+28
-7
@@ -193,7 +193,7 @@ class storyModel extends model
|
||||
->set('version')->eq(1)
|
||||
->exec();
|
||||
}
|
||||
|
||||
|
||||
if($bugID > 0)
|
||||
{
|
||||
$bug = new stdclass();
|
||||
@@ -1959,7 +1959,7 @@ class storyModel extends model
|
||||
|
||||
/**
|
||||
* Get report data of storys per product
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
@@ -1975,25 +1975,46 @@ class storyModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* Get report data of storys per module
|
||||
*
|
||||
* Get report data of storys per module
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getDataOfStorysPerModule()
|
||||
{
|
||||
$datas = $this->dao->select('module as name, count(module) as value')->from(TABLE_STORY)
|
||||
$datas = $this->dao->select('module as name, count(module) as value, product, branch')->from(TABLE_STORY)
|
||||
->where($this->reportCondition())
|
||||
->groupBy('module')->orderBy('value DESC')->fetchAll('name');
|
||||
if(!$datas) return array();
|
||||
|
||||
$branchIDList = array();
|
||||
foreach($datas as $key => $project)
|
||||
{
|
||||
if(!$project->branch) continue;
|
||||
$branchIDList[] = $project->branch;
|
||||
}
|
||||
|
||||
$branchIDList = array_unique($branchIDList);
|
||||
$branchs = $this->dao->select('id, name')->from(TABLE_BRANCH)->where('id')->in($branchIDList)->andWhere('deleted')->eq(0)->fetchALL('id');
|
||||
$modules = $this->loadModel('tree')->getModulesName(array_keys($datas));
|
||||
foreach($datas as $moduleID => $data) $data->name = isset($modules[$moduleID]) ? $modules[$moduleID] : '/';
|
||||
|
||||
foreach($datas as $moduleID => $data)
|
||||
{
|
||||
$branch = '';
|
||||
if(isset($branchs[$data->branch]->name))
|
||||
{
|
||||
$branch = '/' . $branchs[$data->branch]->name;
|
||||
}
|
||||
|
||||
$data->name = $branch . (isset($modules[$moduleID]) ? $modules[$moduleID] : '/');
|
||||
}
|
||||
|
||||
return $datas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get report data of storys per source
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* client: svn客户端执行文件的路径,windows下面考虑安装Slik-Subversion,然后找到svn.exe的路径。linux下面比如/usr/bin/svn
|
||||
* repos可以是多个,需要设定某一个库的访问路径,以及用户名和密码。
|
||||
*
|
||||
* encodeings: the encoding of the comment,can be a list.
|
||||
* encodings: the encoding of the comment,can be a list.
|
||||
* client: the svn client binary path. You can install Slik-Subversion unser windows, then find the path of svn.exe. under linux, try /usr/bin/svn
|
||||
* Can set multi repos, ervery one should set the path, username and password.
|
||||
*
|
||||
|
||||
@@ -419,6 +419,10 @@ class svnModel extends model
|
||||
|
||||
$cmd = $this->client . " diff -r $oldRevision:$revision $url";
|
||||
$diff = `$cmd`;
|
||||
|
||||
$encodings = isset($repo->encodings) ? $repo->encodings : $this->config->svn->encodings;
|
||||
if($encodings or $encodings != 'utf-8') $diff = helper::convertEncoding($diff, $encodings);
|
||||
|
||||
return $diff;
|
||||
}
|
||||
|
||||
@@ -445,6 +449,10 @@ class svnModel extends model
|
||||
|
||||
$cmd = $this->client . " cat $url@$revision";
|
||||
$code = `$cmd`;
|
||||
|
||||
$encodings = isset($repo->encodings) ? $repo->encodings : $this->config->svn->encodings;
|
||||
if($encodings or $encodings != 'utf-8') $code = helper::convertEncoding($code, $encodings);
|
||||
|
||||
return $code;
|
||||
}
|
||||
|
||||
|
||||
@@ -1088,7 +1088,7 @@ class task extends control
|
||||
*/
|
||||
public function report($projectID, $browseType = 'all')
|
||||
{
|
||||
|
||||
|
||||
$this->loadModel('report');
|
||||
$this->view->charts = array();
|
||||
|
||||
|
||||
@@ -1356,7 +1356,8 @@ class taskModel extends model
|
||||
->orderBy('value DESC')
|
||||
->fetchAll('name');
|
||||
if(!$datas) return array();
|
||||
$modules = $this->loadModel('tree')->getModulesName(array_keys($datas));
|
||||
|
||||
$modules = $this->loadModel('tree')->getModulesName(array_keys($datas),true,true);
|
||||
foreach($datas as $moduleID => $data) $data->name = isset($modules[$moduleID]) ? $modules[$moduleID] : '/';
|
||||
return $datas;
|
||||
}
|
||||
@@ -1422,7 +1423,7 @@ class taskModel extends model
|
||||
|
||||
return $priList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get report data of tasks per deadline
|
||||
*
|
||||
|
||||
@@ -62,11 +62,11 @@
|
||||
<div class='main main-side'>
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->task->legendBasic;?></legend>
|
||||
<table class='table table-form'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->task->project;?></th>
|
||||
<td><?php echo html::select('project', $projects, $task->project, 'class="form-control chosen" onchange="loadAll(this.value)"');?></td>
|
||||
</tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->task->module;?></th>
|
||||
<td id="moduleIdBox"><?php echo html::select('module', $modules, $task->module, 'class="form-control chosen" onchange="loadModuleRelated()"');?></td>
|
||||
|
||||
+20
-5
@@ -1103,18 +1103,21 @@ class treeModel extends model
|
||||
|
||||
/**
|
||||
* Get modules name.
|
||||
*
|
||||
* @param array $moduleIdList
|
||||
* @param bool $allPath
|
||||
*
|
||||
* @param array $moduleIdList
|
||||
* @param bool $allPath
|
||||
* @param bool $branchPath
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getModulesName($moduleIdList, $allPath = true)
|
||||
public function getModulesName($moduleIdList, $allPath = true, $branchPath = false)
|
||||
{
|
||||
if(!$allPath) return $this->dao->select('id, name')->from(TABLE_MODULE)->where('id')->in($moduleIdList)->andWhere('deleted')->eq(0)->fetchPairs('id', 'name');
|
||||
|
||||
$modules = $this->dao->select('id, name, path')->from(TABLE_MODULE)->where('id')->in($moduleIdList)->andWhere('deleted')->eq(0)->fetchAll('path');
|
||||
$modules = $this->dao->select('id, name, path, branch')->from(TABLE_MODULE)->where('id')->in($moduleIdList)->andWhere('deleted')->eq(0)->fetchAll('path');
|
||||
$allModules = $this->dao->select('id, name')->from(TABLE_MODULE)->where('id')->in(join(array_keys($modules)))->andWhere('deleted')->eq(0)->fetchPairs('id', 'name');
|
||||
|
||||
$branchIDList = array();
|
||||
$modulePairs = array();
|
||||
foreach($modules as $module)
|
||||
{
|
||||
@@ -1122,7 +1125,19 @@ class treeModel extends model
|
||||
$moduleName = '';
|
||||
foreach($paths as $path) $moduleName .= '/' . $allModules[$path];
|
||||
$modulePairs[$module->id] = $moduleName;
|
||||
|
||||
if($module->branch) $branchIDList[] = $module->branch;
|
||||
}
|
||||
|
||||
if(!$branchPath) return $modulePairs;
|
||||
|
||||
$branchIDList = array_unique($branchIDList);
|
||||
$branchs = $this->dao->select('id, name')->from(TABLE_BRANCH)->where('id')->in($branchIDList)->andWhere('deleted')->eq(0)->fetchALL('id');
|
||||
foreach($modules as $module)
|
||||
{
|
||||
if(isset($modulePairs[$module->id])) $modulePairs[$module->id] = '/' . $branchs[$module->branch]->name . $modulePairs[$module->id];
|
||||
}
|
||||
|
||||
return $modulePairs;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user