diff --git a/lib/front/front.class.php b/lib/front/front.class.php
index 0cae6b372e..10a8f29085 100644
--- a/lib/front/front.class.php
+++ b/lib/front/front.class.php
@@ -224,10 +224,7 @@ class html extends baseHTML
if($stringLength == 0) return 0;
$code = 0;
- for($i = 0; $i < $stringLength; ++$i)
- {
- $code += ($i + 1) * ord($string[$i]);
- }
+ for($i = 0; $i < $stringLength; ++ $i) $code += ($i + 1) * ord($string[$i]);
return $code;
}
diff --git a/module/common/model.php b/module/common/model.php
index f613f7e3ae..135d734ca1 100644
--- a/module/common/model.php
+++ b/module/common/model.php
@@ -378,6 +378,8 @@ class commonModel extends model
if(common::hasPriv($objectType, $createMethod))
{
+ if($objectType == 'doc' and !common::hasPriv('doc', 'tableContents')) continue;
+
/* Determines whether to print a divider. */
if($needPrintDivider and $showCreateList)
{
diff --git a/module/custom/control.php b/module/custom/control.php
index 3f7af07206..f4e63b7601 100644
--- a/module/custom/control.php
+++ b/module/custom/control.php
@@ -122,6 +122,13 @@ class custom extends control
if($review->needReview) $data = fixer::input('post')->join('forceNotReview', ',')->remove('forceReview')->get();
if(!$review->needReview) $data = fixer::input('post')->join('forceReview', ',')->remove('forceNotReview')->get();
$this->loadModel('setting')->setItems("system.$module", $data);
+
+ $reviewCase = isset($review->reviewCase) ? $review->reviewCase : 0;
+ if($review->needReview == 0 and $reviewCase)
+ {
+ $waitCases = $this->loadModel('testcase')->getByStatus(0, 0, 'all', 'wait');
+ $this->testcase->batchReview(array_keys($waitCases), 'pass');
+ }
}
elseif($module == 'task' and $field == 'hours')
{
diff --git a/module/custom/js/set.js b/module/custom/js/set.js
index 0236338696..244532a04d 100644
--- a/module/custom/js/set.js
+++ b/module/custom/js/set.js
@@ -34,4 +34,33 @@ $('[name*=unitList]').change(function()
$("#defaultCurrency").trigger("chosen:updated");
});
+$('#submit').click(function()
+{
+ if(module == 'testcase' && field == 'review' && stopSubmit)
+ {
+ var needReview = $('input:radio[name="needReview"]:checked').val();
+ stopSubmit = false;
+
+ if(needReview == 0)
+ {
+ $.post(createLink('testcase', 'ajaxGetReviewCount'), function(count)
+ {
+ if(count == 0)
+ {
+ $('#submit').click();
+ return true;
+ }
+
+ bootbox.confirm(confirmReviewCase, function(result)
+ {
+ if(result) $('#submit').append("");
+ $('#submit').click();
+ })
+ })
+
+ return false;
+ }
+ }
+})
+
$('[name*=unitList]').change();
diff --git a/module/custom/lang/en.php b/module/custom/lang/en.php
index ade50a8647..562bde2fd0 100644
--- a/module/custom/lang/en.php
+++ b/module/custom/lang/en.php
@@ -174,6 +174,7 @@ $lang->custom->notice->readOnlyOfProduct = 'If Change Forbidden, any change on
$lang->custom->notice->readOnlyOfExecution = "If Change Forbidden, any change on tasks, builds, efforts and stories of the closed {$lang->executionCommon} is also forbidden.";
$lang->custom->notice->URSREmpty = 'Custom requirement name can not be empty!';
$lang->custom->notice->confirmDelete = 'Are you sure you want to delete it?';
+$lang->custom->notice->confirmReviewCase = 'Set the case in Wait to Normal?';
$lang->custom->notice->indexPage['product'] = "ZenTao 8.2+ has Product Home. Do you want to go to Product Home?";
$lang->custom->notice->indexPage['project'] = "ZenTao 8.2+ has Project Home. Do you want to go to Project Home?";
diff --git a/module/custom/lang/zh-cn.php b/module/custom/lang/zh-cn.php
index 92f8d55d87..4e41e05db9 100644
--- a/module/custom/lang/zh-cn.php
+++ b/module/custom/lang/zh-cn.php
@@ -174,6 +174,7 @@ $lang->custom->notice->readOnlyOfProduct = '禁止修改后,已关闭' . $la
$lang->custom->notice->readOnlyOfExecution = "禁止修改后,已关闭{$lang->custom->execution}下的任务、版本、日志以及关联需求都禁止修改。";
$lang->custom->notice->URSREmpty = '自定义需求名称不能为空!';
$lang->custom->notice->confirmDelete = '您确定要删除吗?';
+$lang->custom->notice->confirmReviewCase = '是否将待评审的用例修改为正常状态?';
$lang->custom->notice->indexPage['product'] = "从8.2版本起增加了产品主页视图,是否默认进入产品主页?";
$lang->custom->notice->indexPage['project'] = "从8.2版本起增加了项目主页视图,是否默认进入项目主页?";
diff --git a/module/custom/view/set.html.php b/module/custom/view/set.html.php
index ea2287d284..c89902d8a5 100644
--- a/module/custom/view/set.html.php
+++ b/module/custom/view/set.html.php
@@ -31,6 +31,8 @@ EOT;
+custom->notice->confirmReviewCase)?>
+
diff --git a/module/doc/view/content.html.php b/module/doc/view/content.html.php
index 863b12f3cd..9768f7324c 100644
--- a/module/doc/view/content.html.php
+++ b/module/doc/view/content.html.php
@@ -110,7 +110,7 @@ $sessionString .= session_name() . '=' . session_id();
id}");?>" alt="title?>" title="title;?>">
diff --git a/module/doc/view/view.html.php b/module/doc/view/view.html.php
index ca4f0ac048..891013a206 100644
--- a/module/doc/view/view.html.php
+++ b/module/doc/view/view.html.php
@@ -130,7 +130,7 @@ js::set('docID', $doc->id);
id}");?>" alt="title?>" title="title;?>">
diff --git a/module/execution/model.php b/module/execution/model.php
index 3341621a83..b9108f8aa1 100644
--- a/module/execution/model.php
+++ b/module/execution/model.php
@@ -63,7 +63,7 @@ class executionModel extends model
*/
public function setMenu($executionID, $buildID = 0, $extra = '')
{
- if(!$this->app->user->admin and strpos(",{$this->app->user->view->sprints},", ",$executionID,") === false and !defined('TUTORIAL')) die(js::error($this->lang->execution->accessDenied) . js::locate('back'));
+ if(!$this->app->user->admin and strpos(",{$this->app->user->view->sprints},", ",$executionID,") === false and !defined('TUTORIAL') and $executionID != 0) die(js::error($this->lang->execution->accessDenied) . js::locate('back'));
$executions = $this->loadModel('execution')->getPairs(0, 'all', 'nocode');
if(!$executionID and $this->session->execution) $executionID = $this->session->execution;
diff --git a/module/product/model.php b/module/product/model.php
index 4c13391b76..ed1443a4ae 100644
--- a/module/product/model.php
+++ b/module/product/model.php
@@ -1984,7 +1984,7 @@ class productModel extends model
*/
public function setMenu($productID, $branch = 0, $module = 0, $moduleType = '', $extra = '')
{
- if(!$this->app->user->admin and strpos(",{$this->app->user->view->products},", ",$productID,") === false) die(js::error($this->lang->product->accessDenied) . js::locate('back'));
+ if(!$this->app->user->admin and strpos(",{$this->app->user->view->products},", ",$productID,") === false and $productID != 0) die(js::error($this->lang->product->accessDenied) . js::locate('back'));
$product = $this->getByID($productID);
$params = array('branch' => $branch);
diff --git a/module/qa/model.php b/module/qa/model.php
index 09c1099ae5..4d917fbf75 100644
--- a/module/qa/model.php
+++ b/module/qa/model.php
@@ -23,7 +23,7 @@ class qaModel extends model
*/
public function setMenu($products, $productID, $branch = 0, $extra = '')
{
- if(!$this->app->user->admin and strpos(",{$this->app->user->view->products},", ",$productID,") === false)
+ if(!$this->app->user->admin and strpos(",{$this->app->user->view->products},", ",$productID,") === false and $productID != 0)
{
$this->app->loadLang('product');
die(js::error($this->lang->product->accessDenied) . js::locate('back'));
diff --git a/module/task/control.php b/module/task/control.php
index db3740bcb6..51ec0bc928 100644
--- a/module/task/control.php
+++ b/module/task/control.php
@@ -230,6 +230,7 @@ class task extends control
$this->view->executions = $this->config->systemMode == 'classic' ? $executions : $this->execution->getByProject(0, 'all', 0, true);
$this->view->task = $task;
$this->view->users = $users;
+ $this->view->storyID = $storyID;
$this->view->stories = $stories;
$this->view->testStoryIdList = $this->loadModel('story')->getTestStories(array_keys($stories), $execution->id);
$this->view->members = $members;
diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php
index 20969b791b..7d83737290 100644
--- a/module/task/view/create.html.php
+++ b/module/task/view/create.html.php
@@ -15,6 +15,9 @@
id));?>
+
+
+