diff --git a/module/bug/control.php b/module/bug/control.php index 090960e272..498efd42d6 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -353,7 +353,7 @@ class bug extends control if(!empty($_POST)) { $actions = $this->bug->batchCreate($productID); - foreach($actions as $bugID => $action) $this->sendmail($bugID, $actionID); + foreach($actions as $bugID => $actionID) $this->sendmail($bugID, $actionID); die(js::locate($this->session->bugList, 'parent')); } @@ -377,7 +377,6 @@ class bug extends control $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); $this->view->position[] = $this->lang->bug->batchCreate; - $this->view->projectBuilds = $projectBuilds; $this->view->productID = $productID; $this->view->stories = $stories; $this->view->builds = $builds; diff --git a/module/bug/model.php b/module/bug/model.php index edc12912e8..c2b54c6153 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -286,6 +286,7 @@ class bugModel extends model { $oldBug = $this->getByID($bugID); + $bug = new stdclass(); $bug->lastEditedBy = $this->app->user->account; $bug->lastEditedDate = $now; $bug->type = $this->post->types[$bugID]; diff --git a/module/build/model.php b/module/build/model.php index f8771c8c98..225d71712c 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -113,6 +113,7 @@ class buildModel extends model */ public function create($projectID) { + $build = new stdclass(); $build->stories = ''; $build->bugs = ''; @@ -169,16 +170,20 @@ class buildModel extends model */ public function updateLinkedBug($build) { - $bugs = $this->dao->select('*')->from(TABLE_BUG)->where('id')->in($build->bugs)->fetchAll(); + $bugs = empty($build->bugs) ? '' : $this->dao->select('*')->from(TABLE_BUG)->where('id')->in($build->bugs)->fetchAll(); $now = helper::now(); $resolvedPairs = array(); - foreach($this->post->bugs as $key => $bugID) + if(isset($_POST['bugs'])) { - if(isset($_POST['resolvedBy'][$key]))$resolvedPairs[$bugID] = $this->post->resolvedBy[$key]; + foreach($this->post->bugs as $key => $bugID) + { + if(isset($_POST['resolvedBy'][$key]))$resolvedPairs[$bugID] = $this->post->resolvedBy[$key]; + } } $this->loadModel('action'); + if(!$bugs) return false; foreach($bugs as $bug) { if($bug->status == 'resolved') continue; diff --git a/module/group/model.php b/module/group/model.php index aa02e19f17..1fd47ba7bf 100644 --- a/module/group/model.php +++ b/module/group/model.php @@ -224,7 +224,8 @@ class groupModel extends model { foreach($moduleActions as $actionName) { - $data->group = $groupID; + $data = new stdclass(); + $data->group = $groupID; $data->module = $moduleName; $data->method = $actionName; $this->dao->replace(TABLE_GROUPPRIV)->data($data)->exec(); @@ -244,7 +245,8 @@ class groupModel extends model { foreach($moduleActions as $actionName) { - $data->group = $groupID; + $data = new stdclass(); + $data->group = $groupID; $data->module = $moduleName; $data->method = $actionName; $this->dao->insert(TABLE_GROUPPRIV)->data($data)->exec(); @@ -268,6 +270,7 @@ class groupModel extends model { foreach($this->post->groups as $group) { + $data = new stdclass(); $data->group = $group; $data->module = $this->post->module; $data->method = $action; @@ -293,6 +296,7 @@ class groupModel extends model if($this->post->members == false) return; foreach($this->post->members as $account) { + $data = new stdclass(); $data->account = $account; $data->group = $groupID; $this->dao->insert(TABLE_USERGROUP)->data($data)->exec(); diff --git a/module/my/view/testcase.html.php b/module/my/view/testcase.html.php index be3985d65c..ca7a21ee59 100644 --- a/module/my/view/testcase.html.php +++ b/module/my/view/testcase.html.php @@ -62,7 +62,7 @@ lastRunner];?> lastRunDate)) echo date(DT_MONTHTIME1, strtotime($case->lastRunDate));?> lastRunResult) echo $lang->testcase->resultList[$case->lastRunResult];?> - testcase->statusList[$case->status];?> + testcase->statusList[$case->status];?> id&version=$case->version", '', 'list', '', '', 'iframe'); diff --git a/module/product/model.php b/module/product/model.php index f9d71a4b30..7fa4e35290 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -604,8 +604,9 @@ class productModel extends model } $cases = $this->dao->select('DISTINCT story')->from(TABLE_CASE)->where('story')->in($storyIDs)->fetchAll(); + $rate = count($stories) == 0 ? 0 : round(count($cases) / count($stories), 2); - return sprintf($this->lang->product->storySummary, count($stories), $totalEstimate, round(count($cases) / count($stories), 2) * 100 . "%"); + return sprintf($this->lang->product->storySummary, count($stories), $totalEstimate, $rate * 100 . "%"); } /** diff --git a/module/project/view/task.html.php b/module/project/view/task.html.php index b2c4626ea1..8eef85b608 100644 --- a/module/project/view/task.html.php +++ b/module/project/view/task.html.php @@ -16,7 +16,6 @@ - diff --git a/module/qa/lang/en.php b/module/qa/lang/en.php index 90beca73fb..b4cf228238 100644 --- a/module/qa/lang/en.php +++ b/module/qa/lang/en.php @@ -9,5 +9,6 @@ * @version $Id: en.php 4129 2013-01-18 01:58:14Z wwccss $ * @link http://www.zentao.net */ +$lang->qa = new stdclass(); $lang->qa->common = 'Test'; $lang->qa->index = "Index"; diff --git a/module/qa/lang/zh-cn.php b/module/qa/lang/zh-cn.php index 6be68d0573..9335c6594a 100644 --- a/module/qa/lang/zh-cn.php +++ b/module/qa/lang/zh-cn.php @@ -9,5 +9,6 @@ * @version $Id: zh-cn.php 4129 2013-01-18 01:58:14Z wwccss $ * @link http://www.zentao.net */ +$lang->qa = new stdclass(); $lang->qa->common = '测试视图'; $lang->qa->index = "测试首页"; diff --git a/module/release/model.php b/module/release/model.php index 49017c7d9f..1faf3d84bf 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -98,7 +98,7 @@ class releaseModel extends model $this->dao->insert(TABLE_RELEASE)->data($release)->autoCheck()->batchCheck($this->config->release->create->requiredFields, 'notempty')->check('name','unique')->exec(); $releaseID = $this->dao->lastInsertID(); - $this->dao->update(TABLE_STORY)->set('stage')->eq('released')->where('id')->in($release->stories)->exec(); + if($release->stories) $this->dao->update(TABLE_STORY)->set('stage')->eq('released')->where('id')->in($release->stories)->exec(); if(!dao::isError()) return $releaseID; } diff --git a/module/story/model.php b/module/story/model.php index 5e83273df1..79855d7c14 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -222,6 +222,7 @@ class storyModel extends model $storyID = $this->dao->lastInsertID(); $this->setStage($storyID); + $specData[$i] = new stdclass(); $specData[$i]->story = $storyID; $specData[$i]->version = 1; $specData[$i]->title = htmlspecialchars($stories->title[$i]); @@ -230,6 +231,7 @@ class storyModel extends model $this->loadModel('action'); $actionID = $this->action->create('story', $storyID, 'Opened', ''); + $mails[$i] = new stdclass(); $mails[$i]->storyID = $storyID; $mails[$i]->actionID = $actionID; } diff --git a/module/task/control.php b/module/task/control.php index f3150b8936..d5f78a1d42 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -616,6 +616,7 @@ class task extends control $this->action->logHistory($actionID, $changes); $this->sendmail($taskID, $actionID); } + if(isonlybody()) die(js::closeColorbox('parent.parent')); die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); } diff --git a/module/task/model.php b/module/task/model.php index fc538ee2b4..637c9d735f 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -238,6 +238,7 @@ class taskModel extends model { $oldTask = $this->getById($taskID); + $task = new stdclass(); $task->name = htmlspecialchars($this->post->names[$taskID]); $task->module = isset($this->post->modules[$taskID]) ? $this->post->modules[$taskID] : 0; $task->type = $this->post->types[$taskID]; @@ -438,6 +439,7 @@ class taskModel extends model { if(!$record->consumed[$id]) die(js::alert($this->lang->task->error->consumedThisTime)); if($record->left[$id] === '') die(js::alert($this->lang->task->error->left)); + $estimates[$id] = new stdclass(); $estimates[$id]->date = $record->dates[$id]; $estimates[$id]->task = $taskID; $estimates[$id]->consumed = $record->consumed[$id]; diff --git a/module/testcase/model.php b/module/testcase/model.php index 02ac94668f..9ffa244a84 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -285,14 +285,15 @@ class testcaseModel extends model /* Initialize cases from the post data.*/ foreach($caseIDList as $caseID) { + $case = new stdclass(); $case->lastEditedBy = $this->app->user->account; - $caee->lastEditedDate = $now; + $case->lastEditedDate = $now; $case->pri = $this->post->pris[$caseID]; $case->status = $this->post->statuses[$caseID]; $case->module = $this->post->modules[$caseID]; $case->title = htmlspecialchars($this->post->titles[$caseID]); $case->type = $this->post->types[$caseID]; - $case->stage = implode(',', $this->post->stages[$caseID]); + $case->stage = empty($this->post->stages[$caseID]) ? '' : implode(',', $this->post->stages[$caseID]); $cases[$caseID] = $case; unset($case); diff --git a/module/testtask/view/results.html.php b/module/testtask/view/results.html.php index d214a25bc0..999c2111a7 100644 --- a/module/testtask/view/results.html.php +++ b/module/testtask/view/results.html.php @@ -35,9 +35,9 @@ ?> - - - stepResults)):?> + + + a-center'>testcase->resultList[$stepResult['result']];?> diff --git a/module/testtask/view/view.html.php b/module/testtask/view/view.html.php index 31dc19ebaa..9dc7d84c91 100644 --- a/module/testtask/view/view.html.php +++ b/module/testtask/view/view.html.php @@ -13,7 +13,7 @@
-
deleted) echo "class='deleted'";?>>TESTTASK #id . ' ' . $task->title;?>
+
deleted) echo "class='deleted'";?>>TESTTASK #id . ' ' . $task->name;?>
session->testtaskList ? $this->session->testtaskList : $this->createLink('testtask', 'browse', "productID=$task->product"); diff --git a/module/todo/control.php b/module/todo/control.php index e63d5ea566..c6ced3db44 100644 --- a/module/todo/control.php +++ b/module/todo/control.php @@ -59,7 +59,7 @@ class todo extends control $this->view->position[] = $this->lang->todo->common; $this->view->position[] = $this->lang->todo->create; $this->view->date = strftime("%Y-%m-%d", strtotime($date)); - $this->view->time = date::buildTimeList($this->config->todo->times->begin, $this->config->todo->times->end, $this->config->todo->times->delta); + $this->view->times = date::buildTimeList($this->config->todo->times->begin, $this->config->todo->times->end, $this->config->todo->times->delta); $this->view->time = date::now(); $this->display(); } diff --git a/module/user/model.php b/module/user/model.php index 8565a4f9c4..b1cd4077fb 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -329,6 +329,7 @@ class userModel extends model $this->dao->delete()->from(TABLE_USERGROUP)->where('account')->eq($oldUser->account)->exec(); foreach($this->post->groups as $groupID) { + $data = new stdclass(); $data->account = $this->post->account; $data->group = $groupID; $this->dao->insert(TABLE_USERGROUP)->data($data)->exec();