From 9b863fe98201d5f45c4e5398e19fd1b6bedc5c1a Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 17 Jul 2017 16:49:59 +0800 Subject: [PATCH] * fix bugs. --- framework/base/router.class.php | 2 +- module/bug/model.php | 2 +- module/install/view/step1.html.php | 14 +++++++------- module/testtask/view/linkcase.html.php | 2 +- module/testtask/view/results.html.php | 2 +- module/todo/js/common.js | 10 +++++++--- module/todo/view/batchedit.html.php | 1 + module/user/model.php | 5 +++-- 8 files changed, 22 insertions(+), 16 deletions(-) diff --git a/framework/base/router.class.php b/framework/base/router.class.php index 317865d808..bd89e80c0d 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -2236,7 +2236,7 @@ class baseRouter * Set the error info. **/ $errorLog = "\n" . date('H:i:s') . " $message in $file on line $line "; - $errorLog .= "when visiting " . $this->getURI() . "\n"; + $errorLog .= "when visiting " . htmlspecialchars($this->getURI()) . "\n"; /* * 为了安全起见,对公网环境隐藏脚本路径。 diff --git a/module/bug/model.php b/module/bug/model.php index ee362bf857..2aaa7453c5 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -588,7 +588,7 @@ class bugModel extends model } /* Initialize bugs from the post data.*/ - $oldBugs = $bugIDList ? $this->getList($bugIDList) : array(); + $oldBugs = $bugIDList ? $this->getByList($bugIDList) : array(); foreach($bugIDList as $bugID) { $oldBug = $oldBugs[$bugID]; diff --git a/module/install/view/step1.html.php b/module/install/view/step1.html.php index 2b06e24faa..735e3dbc29 100644 --- a/module/install/view/step1.html.php +++ b/module/install/view/step1.html.php @@ -27,25 +27,25 @@ install->phpVersion;?> install->$phpResult;?> - install->phpFail;?> + install->phpFail;?> install->pdo;?> install->loaded) : printf($lang->install->unloaded);?> install->$pdoResult;?> - install->pdoFail;?> + install->pdoFail;?> install->pdoMySQL;?> install->loaded) : printf($lang->install->unloaded);?> install->$pdoMySQLResult;?> - install->pdoMySQLFail;?> + install->pdoMySQLFail;?> install->json;?> install->loaded) : printf($lang->install->unloaded);?> install->$jsonResult;?> - install->jsonFail;?> + install->jsonFail;?> install->tmpRoot;?> @@ -58,7 +58,7 @@ ?> install->$tmpRootResult;?> - + install->$dataRootResult;?> - + install->$sessionResult;?> - + testcase->typeList[$case->type];?> openedBy];?> - lastRunner;?> + lastRunner];?> lastRunDate)) echo date(DT_MONTHTIME1, strtotime($case->lastRunDate));?> lastRunResult) echo $lang->testcase->resultList[$case->lastRunResult];?> testcase->statusList[$case->status];?> diff --git a/module/testtask/view/results.html.php b/module/testtask/view/results.html.php index e760c6bc2a..0e8051b94a 100644 --- a/module/testtask/view/results.html.php +++ b/module/testtask/view/results.html.php @@ -47,7 +47,7 @@ files)) echo html::a("#caseResult{$result->id}", $lang->files . $fileCount, '', "data-toggle='modal' data-type='iframe'")?> - id,projectID=$testtask->project,buildID=$testtask->build" : '';?> + id,projectID=$testtask->project,buildID=$testtask->build" : '';?>
product&branch=$case->branch&extras=caseID=$case->id,version=$case->version,resultID=$result->id,runID=$runID" . $params)?>' target='_blank' method='post'> diff --git a/module/todo/js/common.js b/module/todo/js/common.js index f2c00f56d6..63e08a04c6 100644 --- a/module/todo/js/common.js +++ b/module/todo/js/common.js @@ -36,10 +36,14 @@ function loadList(type, id) if(type == 'bug' || type == 'task') { - $.get(link,function(data,status) { - if(data) { + $.get(link, function(data, status) + { + if(data) + { $(divClass).html(data); - } else { + } + else + { alert(noTodo); $("#type").val("custom"); $(divClass).html($(divID).html()); diff --git a/module/todo/view/batchedit.html.php b/module/todo/view/batchedit.html.php index cae87e63ca..6d705795b0 100644 --- a/module/todo/view/batchedit.html.php +++ b/module/todo/view/batchedit.html.php @@ -12,6 +12,7 @@ ?> +todo->noTodo);?>
icons['todo']);?> diff --git a/module/user/model.php b/module/user/model.php index f6702bc186..95302bd138 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -704,6 +704,7 @@ class userModel extends model $projectAllow = false; foreach($groups as $group) { + $acl = json_decode($group->acl, true); if(empty($group->acl)) { $productAllow = true; @@ -711,9 +712,9 @@ class userModel extends model $viewAllow = true; break; } - $acl = json_decode($group->acl, true); if(empty($acl['products'])) $productAllow = true; if(empty($acl['projects'])) $projectAllow = true; + if(empty($acl['views'])) $viewAllow = true; if(empty($acls) and !empty($acl)) { $acls = $acl; @@ -727,7 +728,7 @@ class userModel extends model if($productAllow) $acls['products'] = array(); if($projectAllow) $acls['projects'] = array(); - if($viewAllow) $acls = array(); + if($viewAllow) $acls['views'] = array(); $sql = $this->dao->select('module, method')->from(TABLE_USERGROUP)->alias('t1')->leftJoin(TABLE_GROUPPRIV)->alias('t2') ->on('t1.group = t2.group')