From 2d0dbe98e047f0d5f8cdd72178d48f6875d9b63c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=BB=94=E5=93=A5?=
Date: Wed, 25 Oct 2017 09:49:28 +0800
Subject: [PATCH 1/7] * + score sql
---
db/update9.5.1.sql | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/db/update9.5.1.sql b/db/update9.5.1.sql
index e8021f50e2..2a74dd470b 100644
--- a/db/update9.5.1.sql
+++ b/db/update9.5.1.sql
@@ -44,15 +44,16 @@ ALTER TABLE `zt_user` ADD `score_level` DECIMAL(12,1) NOT NULL DEFAULT '0' AF
CREATE TABLE `zt_score` (
`id` bigint(12) unsigned NOT NULL AUTO_INCREMENT,
- `userID` int(11) NOT NULL DEFAULT '0',
`account` varchar(30) NOT NULL,
`model` varchar(30) NOT NULL,
`method` varchar(30) NOT NULL,
+ `desc` varchar(250) NOT NULL DEFAULT '',
+ `before` decimal(12,1) NOT NULL DEFAULT '0.0',
`score` decimal(12,1) NOT NULL DEFAULT '0.0',
- `type` enum('repeat','one') NOT NULL DEFAULT 'repeat',
+ `after` decimal(12,1) NOT NULL DEFAULT '0.0',
`time` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `account` (`account`),
- KEY `model` (`model`),
- KEY `method` (`method`)
+ KEY `method` (`method`),
+ KEY `model` (`model`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
\ No newline at end of file
From 7a9edad86116c3eb56c0ad001370d819e3016bbb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=BB=94=E5=93=A5?=
Date: Wed, 25 Oct 2017 09:59:35 +0800
Subject: [PATCH 2/7] * + grouptask style add childTask
---
module/project/view/grouptask.html.php | 32 ++++++++++++++++++++++++--
1 file changed, 30 insertions(+), 2 deletions(-)
diff --git a/module/project/view/grouptask.html.php b/module/project/view/grouptask.html.php
index b7c46c93e8..1a33db6826 100644
--- a/module/project/view/grouptask.html.php
+++ b/module/project/view/grouptask.html.php
@@ -65,6 +65,7 @@
if($groupBy == 'assignedTo' and $groupName == '') $groupName = $this->lang->task->noAssigned;
?>
$task)
{
if(isset($currentFilter) and $currentFilter != 'all')
@@ -86,6 +87,8 @@
}
}
+ if(!empty($task->children)) $tdRNum += count($task->children);
+
$groupEstimate += $task->estimate;
$groupConsumed += $task->consumed;
$groupLeft += ($task->status == 'cancel' ? 0 : $task->left);
@@ -96,6 +99,7 @@
if($task->status == 'closed') $groupClosed++;
}
$groupSum = count($groupTasks);
+ $tdRNum += $groupSum;
?>
@@ -103,7 +107,7 @@
createLink('task','view',"taskID=$task->id"); ?>
- |
+ |
" . $groupName, '', "class='expandGroup' data-action='expand' title='$groupName'");?>
assignedTo])) printf($lang->project->memberHours, $users[$task->assignedTo], $members[$task->assignedTo]->totalHours);?>
@@ -113,7 +117,7 @@
| id;?> |
task->priList, $task->pri, $task->pri)?>'>task->priList, $task->pri, $task->pri);?> |
- id", $task->name)) echo $task->name;?> |
+ team)) echo ''.$lang->task->multipleAB.' ';if(!common::printLink('task', 'view', "task=$task->id", $task->name)) echo $task->name;?> |
task->statusList[$task->status];?> |
'>deadline, 0, 4) > 0) echo $task->deadline;?> |
>assignedToRealName;?> |
@@ -128,6 +132,30 @@
project&taskid=$task->id", '', 'list', '', 'hiddenwin');?>
+ children)):?>
+ children);?>
+ children as $key => $child):?>
+ ' data-id=''>
+ | id;?> |
+ task->priList, $child->pri, $task->pri)?>'>task->priList, $child->pri, $child->pri);?> |
+ task->childrenAB;?> id", $child->name)) echo $child->name;?> |
+ task->statusList[$child->status];?> |
+ '>deadline, 0, 4) > 0) echo $child->deadline;?> |
+ >assignedToRealName;?> |
+ finishedBy];?> |
+ estimate;?> |
+ consumed;?> |
+ left;?> |
+ progess . '%';?> |
+ task->typeList[$child->type];?> |
+
+ id", '', 'list');?>
+ project&taskid=$child->id", '', 'list', '', 'hiddenwin');?>
+ |
+
+
+
+
From 729f39daeb1e458ebaa1da223997f7e9be718d9a Mon Sep 17 00:00:00 2001
From: sgm0422 <976204163@qq.com>
Date: Wed, 25 Oct 2017 10:10:24 +0800
Subject: [PATCH 3/7] * Fix Bug #1234.
---
module/story/control.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/module/story/control.php b/module/story/control.php
index bf38cb84be..ca02aed857 100644
--- a/module/story/control.php
+++ b/module/story/control.php
@@ -668,7 +668,7 @@ class story extends control
$this->story->review($storyID);
if(dao::isError()) die(js::error(dao::getError()));
$result = $this->post->result;
- if($this->post->closedReason != '' and strpos('done,postponed,subdivided', $this->post->closedReason) !== false) $result = 'pass';
+ if($this->post->closedReason != '' and strpos('done,postponed,subdivided', $this->post->closedReason) === false) $result = 'pass';
$actionID = $this->action->create('story', $storyID, 'Reviewed', $this->post->comment, ucfirst($result));
$this->story->sendmail($storyID, $actionID);
if($this->post->result == 'reject')
From f560cb7091e00171be956a2c95bf8d06b69b3e0e Mon Sep 17 00:00:00 2001
From: wangyidong
Date: Wed, 25 Oct 2017 10:10:31 +0800
Subject: [PATCH 4/7] =?UTF-8?q?Finish=20task#3277=20=E8=B0=83=E6=95=B4?=
=?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=8A=A5=E5=91=8A,cost:4=20left:0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
module/bug/config.php | 5 ---
module/testreport/control.php | 16 +++-------
module/testreport/lang/en.php | 12 +++++++-
module/testreport/lang/zh-cn.php | 12 +++++++-
module/testreport/model.php | 42 +++++++++++++++-----------
module/testreport/view/create.html.php | 4 +--
module/testreport/view/edit.html.php | 4 +--
module/testreport/view/view.html.php | 4 +--
module/testtask/control.php | 5 ++-
9 files changed, 58 insertions(+), 46 deletions(-)
diff --git a/module/bug/config.php b/module/bug/config.php
index c9596cd8ac..71cc1229c7 100644
--- a/module/bug/config.php
+++ b/module/bug/config.php
@@ -247,11 +247,6 @@ $config->bug->datatable->fieldList['browser']['fixed'] = 'no';
$config->bug->datatable->fieldList['browser']['width'] = '80';
$config->bug->datatable->fieldList['browser']['required'] = 'no';
-$config->bug->datatable->fieldList['found']['title'] = 'found';
-$config->bug->datatable->fieldList['found']['fixed'] = 'no';
-$config->bug->datatable->fieldList['found']['width'] = '80';
-$config->bug->datatable->fieldList['found']['required'] = 'no';
-
$config->bug->datatable->fieldList['mailto']['title'] = 'mailto';
$config->bug->datatable->fieldList['mailto']['fixed'] = 'no';
$config->bug->datatable->fieldList['mailto']['width'] = '100';
diff --git a/module/testreport/control.php b/module/testreport/control.php
index d988165187..a5826ec78f 100644
--- a/module/testreport/control.php
+++ b/module/testreport/control.php
@@ -128,12 +128,8 @@ class testreport extends control
$builds = array();
if($task->build == 'trunk')
{
- $stories = $this->story->getProjectStories($project->id);
- $bugs = $this->testreport->getBugs4Test('trunk', $productID, $project->begin, date('Y-m-d', strtotime($task->begin) - 24 * 3600));
- foreach($stories as $id => $story)
- {
- if($story->product != $task->product) unset($stories[$id]);
- }
+ echo js::alert($this->lang->testreport->errorTrunk);
+ die(js::locate('back'));
}
else
{
@@ -264,12 +260,8 @@ class testreport extends control
$builds = array();
if($task->build == 'trunk')
{
- $stories = $this->story->getProjectStories($project->id);
- $bugs = $this->testreport->getBugs4Test('trunk', $report->product, $project->begin, date('Y-m-d', strtotime($task->begin) - 24 * 3600));
- foreach($stories as $id => $story)
- {
- if($story->product != $task->product) unset($stories[$id]);
- }
+ echo js::alert($this->lang->testreport->errorTrunk);
+ die(js::locate('back'));
}
else
{
diff --git a/module/testreport/lang/en.php b/module/testreport/lang/en.php
index a73d954e22..e8d745527e 100644
--- a/module/testreport/lang/en.php
+++ b/module/testreport/lang/en.php
@@ -54,8 +54,18 @@ $lang->testreport->bugCreateByCaseRate = 'Bug Created in Case Rate (Bugs created
$lang->testreport->caseSummary = ' %s cases in total, %s cases performed, %s results generated, %s cases failed.';
$lang->testreport->buildSummary = ' Tested %s build.';
-$lang->testreport->bugSummary = '%s Bug(s) generated in total and %s Bug(s) remained unresolved. Confirmed bug rate(bug resolution is resolved or delayedg status is resolved or closed): %s,Bug created in case rate(Bugs created in cases / Newly generated bugs): %s';
$lang->testreport->confirmDelete = 'Do you want tot delete this report?';
$lang->testreport->moreNotice = 'More features can be extended with reference to the ZenTao extension mechanism, or you can contact us for customization.';
$lang->testreport->exportNotice = "Export By ZenTaoPMS";
$lang->testreport->noReport = "The report has not yet been generated. Please check it later.";
+$lang->testreport->foundBugTip = "openBuild in builds and create time in test time within the range of Bug number.";
+$lang->testreport->legacyBugTip = "The Bug state is activated, or the settling time of Bug is at the end of the test.";
+$lang->testreport->fromCaseBugTip= "Bug created after failure of use case in test time range.";
+$lang->testreport->errorTrunk = "The trunk version cannot create a test report. Please modify the associated version!";
+
+$lang->testreport->bugSummary = <<%s Bug(s) generated in total ,
+%s Bug(s) remained unresolve ,
+%s Bug(s) failure of case .
+Confirmed bug rate(bug resolution is resolved or delayedg status is resolved or closed): %s,Bug created in caserate(Bugs created in cases / Newly generated bugs): %s'
+EOD;
diff --git a/module/testreport/lang/zh-cn.php b/module/testreport/lang/zh-cn.php
index cc38fe3b45..a639ffd240 100644
--- a/module/testreport/lang/zh-cn.php
+++ b/module/testreport/lang/zh-cn.php
@@ -54,8 +54,18 @@ $lang->testreport->bugCreateByCaseRate = '用例发现Bug率 (用例创建的Bug
$lang->testreport->caseSummary = '共有%s个用例,共执行%s个用例,产生了%s个结果,失败的用例有%s个。';
$lang->testreport->buildSummary = '共测试了%s个版本。';
-$lang->testreport->bugSummary = '共产生%s个Bug,遗留%s个Bug。有效Bug率(方案为已解决或延期 / 状态为已解决或已关闭):%s,用例发现Bug率(用例创建的Bug / 时间区间中新增的Bug):%s';
$lang->testreport->confirmDelete = '是否删除该报告?';
$lang->testreport->moreNotice = '更多功能可以参考禅道扩展机制进行扩展,也可以联系我们进行定制。';
$lang->testreport->exportNotice = "由禅道项目管理软件导出";
$lang->testreport->noReport = "报表还没有生成,请稍候查看。";
+$lang->testreport->foundBugTip = "影响版本在测试轮次内,并且创建时间在测试时间范围内产生的Bug数。";
+$lang->testreport->legacyBugTip = "Bug状态是激活,或Bug的解决时间在测试结束时间之后。";
+$lang->testreport->fromCaseBugTip= "测试时间范围内,用例执行失败后创建的Bug";
+$lang->testreport->errorTrunk = "主干版本不能创建测试报告,请修改关联版本!";
+
+$lang->testreport->bugSummary = <<%s个Bug ,
+遗留%s个Bug 。
+用例执行产生%s个Bug 。
+有效Bug率(方案为已解决或延期 / 状态为已解决或已关闭):%s,用例发现Bug率(用例创建的Bug / 发现Bug数):%s
+EOD;
diff --git a/module/testreport/model.php b/module/testreport/model.php
index b33faad021..7dcfaac737 100644
--- a/module/testreport/model.php
+++ b/module/testreport/model.php
@@ -93,8 +93,8 @@ class testreportModel extends model
$data = $this->loadModel('file')->processImgURL($data, $this->config->testreport->editor->create['id'], $this->post->uid);
$this->dao->insert(TABLE_TESTREPORT)->data($data)->autocheck()
->batchCheck($this->config->testreport->create->requiredFields, 'notempty')
- ->batchCheck('start,end', 'notempty')
- ->check('end', 'ge', $data->start)
+ ->batchCheck('begin,end', 'notempty')
+ ->check('end', 'ge', $data->begin)
->exec();
if(dao::isError()) return false;
$reportID = $this->dao->lastInsertID();
@@ -125,8 +125,8 @@ class testreportModel extends model
$data = $this->loadModel('file')->processImgURL($data, $this->config->testreport->editor->edit['id'], $this->post->uid);
$this->dao->update(TABLE_TESTREPORT)->data($data)->autocheck()
->batchCheck($this->config->testreport->edit->requiredFields, 'notempty')
- ->batchCheck('start,end', 'notempty')
- ->check('end', 'ge', $data->start)
+ ->batchCheck('begin,end', 'notempty')
+ ->check('end', 'ge', $data->begin)
->where('id')->eq($reportID)
->exec();
if(dao::isError()) return false;
@@ -186,10 +186,25 @@ class testreportModel extends model
*/
public function getBugInfo($tasks, $productIdList, $begin, $end, $builds)
{
- $bugsByTask = $this->dao->select('*')->from(TABLE_BUG)->where('testtask')->in(array_keys($tasks))->andWhere('testtask')->ne(0)->andWhere('`case`')->ne(0)->andWhere('deleted')->eq(0)->fetchAll('id');
+ $allNewBugs = $this->dao->select('*')->from(TABLE_BUG)->where('product')->in($productIdList)->andWhere('openedDate')->ge($begin)->andWhere('openedDate')->le("$end 23:59:59")->andWhere('deleted')->eq(0)->fetchAll();
+ $foundBugs = array();
+ $legacyBugs = array();
+ $byCaseNum = 0;
+ $buildIdList = array_keys($builds);
+ $taskIdList = array_keys($tasks);
+ foreach($allNewBugs as $bug)
+ {
+ if(!array_diff(explode(',', $bug->openedBuild), $buildIdList))
+ {
+ $foundBugs[$bug->id] = $bug;
+ if($bug->status == 'active' OR $bug->resolvedDate > "$end 23:59:59") $legacyBugs[$bug->id] = $bug;
+ }
+ if($bug->case and !empty($bug->testtask) and in_array($bug->testtask, $taskIdList)) $byCaseNum ++;
+ }
+
$severityGroups = $statusGroups = $openedByGroups = $resolvedByGroups = $resolutionGroups = $moduleGroups = $typeGroups = array();
$resolvedBugs = 0;
- foreach($bugsByTask as $bug)
+ foreach($foundBugs as $bug)
{
$severityGroups[$bug->severity] = isset($severityGroups[$bug->severity]) ? $severityGroups[$bug->severity] + 1 : 1;
$typeGroups[$bug->type] = isset($typeGroups[$bug->type]) ? $typeGroups[$bug->type] + 1 : 1;
@@ -201,20 +216,11 @@ class testreportModel extends model
if($bug->status == 'resolved' or $bug->status == 'closed') $resolvedBugs ++;
}
- $newBugs = $this->dao->select('*')->from(TABLE_BUG)->where('product')->in($productIdList)->andWhere('openedDate')->ge($begin)->andWhere('openedDate')->le("$end 23:59:59")->andWhere('deleted')->eq(0)->fetchAll();
- $legacyBugs = array();
- $byCaseNum = 0;
- $buildIdList = array_keys($builds) + array('trunk' => 'trunk');
- foreach($newBugs as $bug)
- {
- if(!array_diff(explode(',', $bug->openedBuild), $buildIdList) and ($bug->status == 'active' OR $bug->resolvedDate > "$end 23:59:59")) $legacyBugs[$bug->id] = $bug;
- if($bug->case) $byCaseNum ++;
- }
-
+ $bugInfo['foundBugs'] = count($foundBugs);
$bugInfo['legacyBugs'] = $legacyBugs;
- $bugInfo['countBugByTask'] = count($bugsByTask);
+ $bugInfo['countBugByTask'] = $byCaseNum;
$bugInfo['bugConfirmedRate'] = empty($resolvedBugs) ? 0 : round((zget($resolutionGroups, 'fixed', 0) + zget($resolutionGroups, 'postponed', 0)) / $resolvedBugs * 100, 2);
- $bugInfo['bugCreateByCaseRate'] = empty($byCaseNum) ? 0 : round($byCaseNum / count($newBugs) * 100, 2);
+ $bugInfo['bugCreateByCaseRate'] = empty($byCaseNum) ? 0 : round($byCaseNum / count($foundBugs) * 100, 2);
$this->app->loadLang('bug');
$users = $this->loadModel('user')->getPairs('noclosed|noletter|nodeleted');
diff --git a/module/testreport/view/create.html.php b/module/testreport/view/create.html.php
index 2cdfd794f0..ebeb8e5b4b 100644
--- a/module/testreport/view/create.html.php
+++ b/module/testreport/view/create.html.php
@@ -68,8 +68,8 @@
' . $storySummary . '
';
echo '' . sprintf($lang->testreport->buildSummary, empty($builds) ? 1 : count($builds)) . $caseSummary . '
';
- echo '' . sprintf($lang->testreport->bugSummary, $bugInfo['countBugByTask'], count($legacyBugs), $bugInfo['bugConfirmedRate'] . '%', $bugInfo['bugCreateByCaseRate'] . '%') . '
';
- unset($bugInfo['countBugByTask']); unset($bugInfo['bugConfirmedRate']); unset($bugInfo['bugCreateByCaseRate']);
+ echo '' . sprintf($lang->testreport->bugSummary, $bugInfo['foundBugs'], count($legacyBugs), $bugInfo['countBugByTask'], $bugInfo['bugConfirmedRate'] . '%', $bugInfo['bugCreateByCaseRate'] . '%') . '
';
+ unset($bugInfo['countBugByTask']); unset($bugInfo['bugConfirmedRate']); unset($bugInfo['bugCreateByCaseRate']); unset($bugInfo['foundBugs']);
?>
diff --git a/module/testreport/view/edit.html.php b/module/testreport/view/edit.html.php
index 5a8f13445a..8a1eda0b86 100644
--- a/module/testreport/view/edit.html.php
+++ b/module/testreport/view/edit.html.php
@@ -63,8 +63,8 @@
' . $storySummary . '';
echo '' . sprintf($lang->testreport->buildSummary, empty($builds) ? 1 : count($builds)) . $caseSummary . '
';
- echo '' . sprintf($lang->testreport->bugSummary, $bugInfo['countBugByTask'], count($legacyBugs), $bugInfo['bugConfirmedRate'] . '%', $bugInfo['bugCreateByCaseRate'] . '%') . '
';
- unset($bugInfo['countBugByTask']); unset($bugInfo['bugConfirmedRate']); unset($bugInfo['bugCreateByCaseRate']);
+ echo '' . sprintf($lang->testreport->bugSummary, $bugInfo['foundBugs'], count($legacyBugs), $bugInfo['countBugByTask'], $bugInfo['bugConfirmedRate'] . '%', $bugInfo['bugCreateByCaseRate'] . '%') . '
';
+ unset($bugInfo['countBugByTask']); unset($bugInfo['bugConfirmedRate']); unset($bugInfo['bugCreateByCaseRate']); unset($bugInfo['foundBugs']);
?>
diff --git a/module/testreport/view/view.html.php b/module/testreport/view/view.html.php
index 28d1db3a18..6fa20014e6 100644
--- a/module/testreport/view/view.html.php
+++ b/module/testreport/view/view.html.php
@@ -84,8 +84,8 @@
' . $storySummary . '';
echo '' . sprintf($lang->testreport->buildSummary, empty($builds) ? 1 : count($builds)) . $caseSummary . '
';
- echo '' . sprintf($lang->testreport->bugSummary, $bugInfo['countBugByTask'], count($legacyBugs), $bugInfo['bugConfirmedRate'] . '%', $bugInfo['bugCreateByCaseRate'] . '%') . '
';
- unset($bugInfo['countBugByTask']); unset($bugInfo['bugConfirmedRate']); unset($bugInfo['bugCreateByCaseRate']);
+ echo '' . sprintf($lang->testreport->bugSummary, $bugInfo['foundBugs'], count($legacyBugs), $bugInfo['countBugByTask'], $bugInfo['bugConfirmedRate'] . '%', $bugInfo['bugCreateByCaseRate'] . '%') . '
';
+ unset($bugInfo['countBugByTask']); unset($bugInfo['bugConfirmedRate']); unset($bugInfo['bugCreateByCaseRate']); unset($bugInfo['foundBugs']);
?>
diff --git a/module/testtask/control.php b/module/testtask/control.php
index 2859cf64c0..60e5601185 100644
--- a/module/testtask/control.php
+++ b/module/testtask/control.php
@@ -134,14 +134,13 @@ class testtask extends control
$productID = $productID ? $productID : key($products);
$projects = $this->dao->select('id, name')->from(TABLE_PROJECT)->where('id')->eq($projectID)->andWhere('deleted')->eq(0)->fetchPairs('id');
$builds = $this->dao->select('id, name')->from(TABLE_BUILD)->where('project')->eq($projectID)->andWhere('deleted')->eq(0)->fetchPairs('id');
- $builds = array('trunk' => $this->lang->trunk) + $builds;
}
/* Create testtask from testtask of test.*/
if($projectID == 0)
{
$projects = $this->product->getProjectPairs($productID, $branch = 0, $params = 'nodeleted');
- $builds = $this->loadModel('build')->getProductBuildPairs($productID);
+ $builds = $this->loadModel('build')->getProductBuildPairs($productID, 0, 'notrunk');
}
/* Set menu. */
@@ -442,7 +441,7 @@ class testtask extends control
$this->view->task = $task;
$this->view->projects = $this->product->getProjectPairs($productID);
- $this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID, $branch = 0, $params = '');
+ $this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID, $branch = 0, $params = 'notrunk');
$this->view->users = $this->loadModel('user')->getPairs('nodeleted', $task->owner);
$this->view->contactLists = $this->user->getContactLists($this->app->user->account, 'withnote');
From 04528419bd3c35a2a21d121a93c8f6487805904c Mon Sep 17 00:00:00 2001
From: wangyidong
Date: Wed, 25 Oct 2017 10:26:25 +0800
Subject: [PATCH 5/7] =?UTF-8?q?Finish=20task#3272=20=E5=90=8E=E5=8F=B0-?=
=?UTF-8?q?=E4=BA=8C=E6=AC=A1=E5=BC=80=E5=8F=91-=E7=BC=96=E8=BE=91?=
=?UTF-8?q?=E5=99=A8=20=E5=AD=98=E5=9C=A8=E5=AE=89=E5=85=A8=E6=BC=8F?=
=?UTF-8?q?=E6=B4=9E,cost:1=20left:0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
module/editor/control.php | 2 ++
module/editor/lang/en.php | 1 +
module/editor/lang/zh-cn.php | 1 +
3 files changed, 4 insertions(+)
diff --git a/module/editor/control.php b/module/editor/control.php
index b08c48dc80..639ab89409 100644
--- a/module/editor/control.php
+++ b/module/editor/control.php
@@ -58,6 +58,7 @@ class editor extends control
if($filePath)
{
$filePath = helper::safe64Decode($filePath);
+ if(strpos(strtolower($filePath), strtolower($this->app->getBasePath())) !== 0) die($this->lang->editor->editFileError);
if($action == 'extendOther' and file_exists($filePath))
{
$this->view->showContent = htmlspecialchars(file_get_contents($filePath));
@@ -142,6 +143,7 @@ class editor extends control
if($filePath and $_POST)
{
$filePath = helper::safe64Decode($filePath);
+ if(strpos(strtolower($filePath), strtolower($this->app->getBasePath())) !== 0) die($this->lang->editor->editFileError);
if($action != 'edit' and $action != 'newPage') $filePath = $this->editor->getSavePath($filePath, $action);
if($action != 'edit' and $action != 'newPage' and file_exists($filePath) and !$this->post->override) die(js::error($this->lang->editor->repeatFile));
$this->editor->save($filePath);
diff --git a/module/editor/lang/en.php b/module/editor/lang/en.php
index 13bd185819..df246a4d04 100644
--- a/module/editor/lang/en.php
+++ b/module/editor/lang/en.php
@@ -31,6 +31,7 @@ $lang->editor->extendConfirm = 'Do you want to use original code?';
$lang->editor->repeatFile = 'File Name Dupliceted';
$lang->editor->repeatPage = 'Page existed. Do you want to override it?';
$lang->editor->noticeOkFile = 'For security reasons, your Admin account has to be confirmed. \n Please login ZenTao server and create %sFile.\n Note:\n 1. File is blank.\n 2. If the file existed, delete it and then create a new one.';
+$lang->editor->editFileError = 'You can only modify Zentao files!';
$lang->editor->notWritable = "Not wirtable. Privilege is required. Please try chmod 777 -R ";
$lang->editor->notDelete = 'Cannot be deleted. Please check your permission!';
diff --git a/module/editor/lang/zh-cn.php b/module/editor/lang/zh-cn.php
index 7ca78af15d..9fe3cd7f5b 100644
--- a/module/editor/lang/zh-cn.php
+++ b/module/editor/lang/zh-cn.php
@@ -31,6 +31,7 @@ $lang->editor->extendConfirm = '是否要重用原来代码?';
$lang->editor->repeatFile = '文件名重复';
$lang->editor->repeatPage = '已经有此页面。是否覆盖?';
$lang->editor->noticeOkFile = '为了安全起见,系统需要确认您的管理员身份。\n 请登录禅道所在的服务器,创建%s文件。\n 注意:\n 1. 文件内容为空。\n 2. 如果之前文件存在,删除之后重新创建。';
+$lang->editor->editFileError = '只能修改禅道文件!';
$lang->editor->notWritable = "无法写入,可能没有权限。请尝试执行 chmod 777 -R ";
$lang->editor->notDelete = '无法删除,请检查权限!';
From 39b46a01cf2835bf4354e1def1c40dc8ea1b2042 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=BB=94=E5=93=A5?=
Date: Wed, 25 Oct 2017 10:49:05 +0800
Subject: [PATCH 6/7] + add score switch of custom
---
module/custom/control.php | 18 ++++++++++++++++
module/custom/lang/en.php | 4 ++++
module/custom/lang/zh-cn.php | 4 ++++
module/custom/lang/zh-tw.php | 4 ++++
module/custom/view/header.html.php | 4 +++-
module/custom/view/score.html.php | 34 ++++++++++++++++++++++++++++++
6 files changed, 67 insertions(+), 1 deletion(-)
create mode 100644 module/custom/view/score.html.php
diff --git a/module/custom/control.php b/module/custom/control.php
index f6d9afdd76..8d260f6bbb 100644
--- a/module/custom/control.php
+++ b/module/custom/control.php
@@ -275,6 +275,24 @@ class custom extends control
$this->display();
}
+ /**
+ * Set score display switch
+ *
+ * @access public
+ * @return void
+ */
+ public function score()
+ {
+ if($_POST)
+ {
+ $this->loadModel('setting')->setItem('system.common.global.score', $this->post->score);
+ die(js::reload('parent'));
+ }
+
+ $this->view->title = $this->lang->custom->score;
+ $this->display();
+ }
+
/**
* Ajax save custom fields.
*
diff --git a/module/custom/lang/en.php b/module/custom/lang/en.php
index e8e23962d1..b2eab52bc7 100644
--- a/module/custom/lang/en.php
+++ b/module/custom/lang/en.php
@@ -15,6 +15,7 @@ $lang->custom->section = 'Section';
$lang->custom->lang = 'Language';
$lang->custom->setPublic = 'Set Public';
$lang->custom->required = 'Required';
+$lang->custom->score = 'Score';
$lang->custom->object['story'] = 'Story';
$lang->custom->object['task'] = 'Task';
@@ -121,3 +122,6 @@ $lang->custom->workingList['onlyTask'] = 'Task';
$lang->custom->menuTip = 'Click to show/hide navigation bar. Drag to swtich display order.';
$lang->custom->saveFail = 'Failed to save!';
+
+$lang->custom->scoreList['off'] = 'Off';
+$lang->custom->scoreList['on'] = 'On';
diff --git a/module/custom/lang/zh-cn.php b/module/custom/lang/zh-cn.php
index fad9789299..cd74c491d5 100644
--- a/module/custom/lang/zh-cn.php
+++ b/module/custom/lang/zh-cn.php
@@ -15,6 +15,7 @@ $lang->custom->section = '附加部分';
$lang->custom->lang = '所属语言';
$lang->custom->setPublic = '设为公共';
$lang->custom->required = '必填项';
+$lang->custom->score = '积分';
$lang->custom->object['story'] = '需求';
$lang->custom->object['task'] = '任务';
@@ -121,3 +122,6 @@ $lang->custom->workingList['onlyTask'] = '任务管理工具';
$lang->custom->menuTip = '点击显示或隐藏导航条目,拖拽来更改显示顺序。';
$lang->custom->saveFail = '保存失败!';
+
+$lang->custom->scoreList['off'] = '关闭';
+$lang->custom->scoreList['on'] = '开启';
\ No newline at end of file
diff --git a/module/custom/lang/zh-tw.php b/module/custom/lang/zh-tw.php
index 1b0a627055..63cd97f9b7 100644
--- a/module/custom/lang/zh-tw.php
+++ b/module/custom/lang/zh-tw.php
@@ -13,6 +13,7 @@ $lang->custom->owner = '所有者';
$lang->custom->module = '模組';
$lang->custom->section = '附加部分';
$lang->custom->lang = '所屬語言';
+$lang->custom->score = '積分';
$lang->custom->object['story'] = '需求';
$lang->custom->object['task'] = '任務';
@@ -119,3 +120,6 @@ $lang->custom->workingList['onlyTask'] = '任務管理工具';
$lang->custom->menuTip = '點擊顯示或隱藏導航條目,拖拽來更改顯示順序。';
$lang->custom->saveFail = '保存失敗!';
+
+$lang->custom->scoreList['off'] = '關閉';
+$lang->custom->scoreList['on'] = '開啓';
diff --git a/module/custom/view/header.html.php b/module/custom/view/header.html.php
index 53e96d64b7..ca515e1f44 100644
--- a/module/custom/view/header.html.php
+++ b/module/custom/view/header.html.php
@@ -13,7 +13,9 @@
echo "";
common::printLink('custom', 'working', '', $lang->custom->working);
echo "";
- common::printLink('custom', 'required', '', $lang->custom->required);
+ common::printLink('custom', 'required', '', $lang->custom->required);
+ echo "";
+ common::printLink('custom', 'score', '', $lang->custom->score);
echo '';
?>
diff --git a/module/custom/view/score.html.php b/module/custom/view/score.html.php
new file mode 100644
index 0000000000..65143cf911
--- /dev/null
+++ b/module/custom/view/score.html.php
@@ -0,0 +1,34 @@
+
+ * @package custom
+ * @version $Id$
+ * @link http://www.zentao.net
+ */
+?>
+
+
+
+
\ No newline at end of file
From 66ff400d7acb66d4d09e63a60b526a136d6ed045 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=BB=94=E5=93=A5?=
Date: Wed, 25 Oct 2017 11:09:54 +0800
Subject: [PATCH 7/7] * add score admin authority
---
module/custom/lang/en.php | 4 ++--
module/custom/lang/zh-cn.php | 4 ++--
module/custom/lang/zh-tw.php | 4 ++--
module/custom/model.php | 3 +--
module/custom/view/score.html.php | 2 +-
5 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/module/custom/lang/en.php b/module/custom/lang/en.php
index b2eab52bc7..11c4861bb0 100644
--- a/module/custom/lang/en.php
+++ b/module/custom/lang/en.php
@@ -123,5 +123,5 @@ $lang->custom->workingList['onlyTask'] = 'Task';
$lang->custom->menuTip = 'Click to show/hide navigation bar. Drag to swtich display order.';
$lang->custom->saveFail = 'Failed to save!';
-$lang->custom->scoreList['off'] = 'Off';
-$lang->custom->scoreList['on'] = 'On';
+$lang->custom->scoreList[0] = 'Off';
+$lang->custom->scoreList[1] = 'On';
diff --git a/module/custom/lang/zh-cn.php b/module/custom/lang/zh-cn.php
index cd74c491d5..724a8eab32 100644
--- a/module/custom/lang/zh-cn.php
+++ b/module/custom/lang/zh-cn.php
@@ -123,5 +123,5 @@ $lang->custom->workingList['onlyTask'] = '任务管理工具';
$lang->custom->menuTip = '点击显示或隐藏导航条目,拖拽来更改显示顺序。';
$lang->custom->saveFail = '保存失败!';
-$lang->custom->scoreList['off'] = '关闭';
-$lang->custom->scoreList['on'] = '开启';
\ No newline at end of file
+$lang->custom->scoreList[0] = '关闭';
+$lang->custom->scoreList[1] = '开启';
\ No newline at end of file
diff --git a/module/custom/lang/zh-tw.php b/module/custom/lang/zh-tw.php
index 63cd97f9b7..72ee63581c 100644
--- a/module/custom/lang/zh-tw.php
+++ b/module/custom/lang/zh-tw.php
@@ -121,5 +121,5 @@ $lang->custom->workingList['onlyTask'] = '任務管理工具';
$lang->custom->menuTip = '點擊顯示或隱藏導航條目,拖拽來更改顯示順序。';
$lang->custom->saveFail = '保存失敗!';
-$lang->custom->scoreList['off'] = '關閉';
-$lang->custom->scoreList['on'] = '開啓';
+$lang->custom->scoreList[0] = '關閉';
+$lang->custom->scoreList[1] = '開啓';
diff --git a/module/custom/model.php b/module/custom/model.php
index 56357abac1..9da99345ac 100644
--- a/module/custom/model.php
+++ b/module/custom/model.php
@@ -281,15 +281,14 @@ class customModel extends model
global $app, $lang, $config;
$allMenu = $module == 'main' ? $lang->menu : (isset($lang->$module->menu) ? $lang->$module->menu : $lang->my->menu);
if($module == 'product' and isset($allMenu->branch)) $allMenu->branch = str_replace('@branch@', $lang->custom->branch, $allMenu->branch);
-
if($module != 'main' and isset($lang->menugroup->$module)) $module = $lang->menugroup->$module;
+ if($module == 'admin' and empty($config->global->score)) unset($allMenu->score);
$flowModule = $config->global->flow . '_' . $module;
$customMenu = isset($config->customMenu->$flowModule) ? $config->customMenu->$flowModule : array();
if(commonModel::isTutorialMode() && $module === 'main')$customMenu = 'my,product,project,qa,company';
if(!empty($customMenu) && is_string($customMenu) && substr($customMenu, 0, 1) === '[') $customMenu = json_decode($customMenu);
$menu = self::setMenuByConfig($allMenu, $customMenu, $module);
-
return $menu;
}
diff --git a/module/custom/view/score.html.php b/module/custom/view/score.html.php
index 65143cf911..3449b9a501 100644
--- a/module/custom/view/score.html.php
+++ b/module/custom/view/score.html.php
@@ -15,7 +15,7 @@