diff --git a/config/filter.php b/config/filter.php index 8b088659f0..f69a51cd97 100644 --- a/config/filter.php +++ b/config/filter.php @@ -28,33 +28,34 @@ $filter->default->cookie['fingerprint'] = 'reg::word'; $filter->default->cookie['hideMenu'] = 'equal::true'; $filter->default->cookie['openApp'] = 'reg::word'; -$filter->bug = new stdclass(); -$filter->caselib = new stdclass(); -$filter->doc = new stdclass(); -$filter->product = new stdclass(); -$filter->branch = new stdclass(); -$filter->qa = new stdclass(); -$filter->story = new stdclass(); -$filter->task = new stdclass(); -$filter->testcase = new stdclass(); -$filter->program = new stdclass(); -$filter->project = new stdclass(); -$filter->testreport = new stdclass(); -$filter->testsuite = new stdclass(); -$filter->todo = new stdclass(); -$filter->testtask = new stdclass(); -$filter->upgrade = new stdclass(); -$filter->sso = new stdclass(); -$filter->misc = new stdclass(); -$filter->mail = new stdclass(); -$filter->user = new stdclass(); -$filter->block = new stdclass(); -$filter->file = new stdclass(); -$filter->repo = new stdclass(); -$filter->webhook = new stdclass(); -$filter->git = new stdclass(); -$filter->svn = new stdclass(); -$filter->search = new stdclass(); +$filter->bug = new stdclass(); +$filter->caselib = new stdclass(); +$filter->doc = new stdclass(); +$filter->product = new stdclass(); +$filter->branch = new stdclass(); +$filter->qa = new stdclass(); +$filter->story = new stdclass(); +$filter->task = new stdclass(); +$filter->testcase = new stdclass(); +$filter->program = new stdclass(); +$filter->project = new stdclass(); +$filter->projectstory = new stdclass(); +$filter->testreport = new stdclass(); +$filter->testsuite = new stdclass(); +$filter->todo = new stdclass(); +$filter->testtask = new stdclass(); +$filter->upgrade = new stdclass(); +$filter->sso = new stdclass(); +$filter->misc = new stdclass(); +$filter->mail = new stdclass(); +$filter->user = new stdclass(); +$filter->block = new stdclass(); +$filter->file = new stdclass(); +$filter->repo = new stdclass(); +$filter->webhook = new stdclass(); +$filter->git = new stdclass(); +$filter->svn = new stdclass(); +$filter->search = new stdclass(); $filter->block->default = new stdclass(); $filter->block->main = new stdclass(); @@ -94,6 +95,7 @@ $filter->project->browse = new stdclass(); $filter->project->story = new stdclass(); $filter->project->export = new stdclass(); $filter->project->task = new stdclass(); +$filter->projectstory->story = new stdclass(); $filter->qa->default = new stdclass(); $filter->story->create = new stdclass(); $filter->story->export = new stdclass(); @@ -194,6 +196,8 @@ $filter->project->task->cookie['projectTaskOrder'] = 'reg::orderBy'; $filter->project->task->cookie['windowWidth'] = 'int'; $filter->project->export->cookie['checkedItem'] = 'reg::checked'; +$filter->projectstory->story->cookie['storyModuleParam'] = 'int'; + $filter->qa->default->cookie['lastProduct'] = 'int'; $filter->qa->default->cookie['preBranch'] = 'int'; $filter->qa->default->cookie['preProductID'] = 'int'; diff --git a/db/update15.0.sql b/db/update15.0.sql index 89ff0d7c93..0454c02f16 100644 --- a/db/update15.0.sql +++ b/db/update15.0.sql @@ -1 +1,3 @@ ALTER TABLE `zt_project` CHANGE `lifetime` `lifetime` char(30) NOT NULL DEFAULT ''; +ALTER TABLE `zt_story` ADD `category` varchar(30) NOT NULL DEFAULT 'feature' AFTER `type`; +ALTER TABLE `zt_testtask` ADD `type` varchar(255) NOT NULL DEFAULT '' AFTER `build`; diff --git a/db/zentao.sql b/db/zentao.sql index 7887d5a9d3..19468f47c2 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -822,6 +822,7 @@ CREATE TABLE IF NOT EXISTS `zt_story` ( `title` varchar(255) NOT NULL, `keywords` varchar(255) NOT NULL, `type` varchar(30) NOT NULL default 'story', + `category` varchar(30) NOT NULL default 'feature', `pri` tinyint(3) unsigned NOT NULL default '3', `estimate` float unsigned NOT NULL, `status` enum('','changed','active','draft','closed') NOT NULL default '', @@ -1050,6 +1051,7 @@ CREATE TABLE IF NOT EXISTS `zt_testtask` ( `name` char(90) NOT NULL, `execution` mediumint(8) unsigned NOT NULL default '0', `build` char(30) NOT NULL, + `type` varchar(255) NOT NULL, `owner` varchar(30) NOT NULL, `pri` tinyint(3) unsigned NOT NULL default '0', `begin` date NOT NULL, diff --git a/module/block/view/dynamic.html.php b/module/block/view/dynamic.html.php index 05b98b0f15..2447f62507 100644 --- a/module/block/view/dynamic.html.php +++ b/module/block/view/dynamic.html.php @@ -2,7 +2,7 @@
block->emptyTip;?>
diff --git a/module/branch/control.php b/module/branch/control.php index b0600d6024..9e39d84210 100644 --- a/module/branch/control.php +++ b/module/branch/control.php @@ -12,9 +12,9 @@ class branch extends control { /** - * Manage branch - * - * @param int $productID + * Manage branch + * + * @param int $productID * @access public * @return void */ @@ -24,7 +24,8 @@ class branch extends control if($_POST) { - $this->branch->manage($productID); + $newBranches = $this->branch->manage($productID); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'idList' => $newBranches)); die(js::reload('parent')); } @@ -40,7 +41,7 @@ class branch extends control /** * Sort branch. - * + * * @access public * @return void */ @@ -51,12 +52,12 @@ class branch extends control /** * Ajax get drop menu. - * - * @param int $productID + * + * @param int $productID * @param int $branch - * @param string $module - * @param string $method - * @param string $extra + * @param string $module + * @param string $method + * @param string $extra * @access public * @return void */ @@ -77,10 +78,10 @@ class branch extends control } /** - * Delete branch - * - * @param int $branchID - * @param string $confirm + * Delete branch + * + * @param int $branchID + * @param string $confirm * @access public * @return void */ @@ -100,9 +101,9 @@ class branch extends control /** * Ajax get branches. - * - * @param int $productID - * @param int $oldBranch + * + * @param int $productID + * @param int $oldBranch * @access public * @return void */ diff --git a/module/branch/model.php b/module/branch/model.php index 67274e61c2..6cfd20c981 100644 --- a/module/branch/model.php +++ b/module/branch/model.php @@ -98,7 +98,8 @@ class branchModel extends model public function manage($productID) { $oldBranches = $this->getPairs($productID, 'noempty'); - $data = fixer::input('post')->get(); + $data = fixer::input('post')->get(); + if(isset($data->branch)) { foreach($data->branch as $branchID => $branch) @@ -106,13 +107,17 @@ class branchModel extends model if($oldBranches[$branchID] != $branch) $this->dao->update(TABLE_BRANCH)->set('name')->eq($branch)->where('id')->eq($branchID)->exec(); } } + + $branches = array(); foreach($data->newbranch as $i => $branch) { if(empty($branch)) continue; $this->dao->insert(TABLE_BRANCH)->set('name')->eq($branch)->set('product')->eq($productID)->set('`order`')->eq(count($data->branch) + $i + 1)->exec(); + $branches[] = $this->dao->lastInsertId(); } - return dao::isError(); + if(dao::isError()) return false; + return $branches; } /** diff --git a/module/bug/control.php b/module/bug/control.php index cccc23e0c0..31bbc18fff 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -385,6 +385,9 @@ class bug extends control $this->executeHooks($bugID); + /* Return bug id when call the API. */ + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $bugID)); + /* If link from no head then reload. */ if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); @@ -613,6 +616,13 @@ class bug extends control { $actions = $this->bug->batchCreate($productID, $branch); + /* Return bug id list when call the API. */ + if($this->viewType == 'json') + { + $bugIDList = array_keys($actions); + $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'idList' => $bugIDList)); + } + setcookie('bugModule', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, false); die(js::locate($this->createLink('bug', 'browse', "productID={$productID}&branch=$branch&browseType=unclosed¶m=0&orderBy=id_desc"), 'parent')); } diff --git a/module/bug/model.php b/module/bug/model.php index 913347b1dc..992abf3804 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -161,7 +161,7 @@ class bugModel extends model $bug->openedBy = $this->app->user->account; $bug->openedDate = $now; $bug->product = (int)$productID; - $bug->branch = (int)$data->branches[$i]; + $bug->branch = isset($data->branches) ? (int)$data->branches[$i] : 0; $bug->module = (int)$data->modules[$i]; $bug->execution = (int)$data->executions[$i]; $bug->openedBuild = implode(',', $data->openedBuilds[$i]); diff --git a/module/build/control.php b/module/build/control.php index d626567243..98a8af08d8 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -37,6 +37,7 @@ class build extends control $this->executeHooks($buildID); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $buildID)); if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.loadExecutionBuilds($executionID)")); // Code for task #5126. $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('build', 'view', "buildID=$buildID"))); } diff --git a/module/caselib/control.php b/module/caselib/control.php index f2e28ecbd8..01030be398 100644 --- a/module/caselib/control.php +++ b/module/caselib/control.php @@ -42,6 +42,14 @@ class caselib extends control $this->send($response); } $this->loadModel('action')->create('caselib', $libID, 'opened'); + + /* Return lib id when call the API. */ + if($this->viewType == 'json') + { + $response['id'] = $libID; + $this->send($response); + } + $response['locate'] = $this->createLink('caselib', 'browse', "libID=$libID"); $this->send($response); } diff --git a/module/dept/control.php b/module/dept/control.php index 4078b36d2e..5125ec0118 100644 --- a/module/dept/control.php +++ b/module/dept/control.php @@ -14,8 +14,8 @@ class dept extends control const NEW_CHILD_COUNT = 10; /** - * Construct function, set menu. - * + * Construct function, set menu. + * * @access public * @return void */ @@ -27,8 +27,8 @@ class dept extends control /** * Browse a department. - * - * @param int $deptID + * + * @param int $deptID * @access public * @return void */ @@ -47,7 +47,7 @@ class dept extends control /** * Update the departments order. - * + * * @access public * @return void */ @@ -62,7 +62,7 @@ class dept extends control /** * Manage childs. - * + * * @access public * @return void */ @@ -70,15 +70,16 @@ class dept extends control { if(!empty($_POST)) { - $this->dept->manageChild($_POST['parentDeptID'], $_POST['depts']); + $deptIDList = $this->dept->manageChild($_POST['parentDeptID'], $_POST['depts']); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'idList' => $deptIDList)); die(js::reload('parent')); } } /** - * Edit dept. - * - * @param int $deptID + * Edit dept. + * + * @param int $deptID * @access public * @return void */ @@ -107,8 +108,8 @@ class dept extends control /** * Delete a department. - * - * @param int $deptID + * + * @param int $deptID * @param string $confirm yes|no * @access public * @return void @@ -133,10 +134,10 @@ class dept extends control } /** - * Ajax get users - * - * @param int $dept - * @param string $user + * Ajax get users + * + * @param int $dept + * @param string $user * @access public * @return void */ diff --git a/module/dept/model.php b/module/dept/model.php index 038f2549c0..29a65424ed 100644 --- a/module/dept/model.php +++ b/module/dept/model.php @@ -318,7 +318,7 @@ class deptModel extends model * @param int $parentDeptID * @param string $childs * @access public - * @return void + * @return array */ public function manageChild($parentDeptID, $childs) { @@ -335,18 +335,21 @@ class deptModel extends model } $i = 1; + $deptIDList = array(); foreach($childs as $deptID => $deptName) { if(empty($deptName)) continue; if(is_numeric($deptID)) { + $dept = new stdclass(); $dept->name = strip_tags($deptName); $dept->parent = $parentDeptID; $dept->grade = $grade; $dept->order = $this->post->maxOrder + $i * 10; $this->dao->insert(TABLE_DEPT)->data($dept)->exec(); - $deptID = $this->dao->lastInsertID(); - $childPath = $parentPath . "$deptID,"; + $deptID = $this->dao->lastInsertID(); + $deptIDList[] = $deptID; + $childPath = $parentPath . "$deptID,"; $this->dao->update(TABLE_DEPT)->set('path')->eq($childPath)->where('id')->eq($deptID)->exec(); $i++; } @@ -356,6 +359,8 @@ class deptModel extends model $this->dao->update(TABLE_DEPT)->set('name')->eq(strip_tags($deptName))->where('id')->eq($deptID)->exec(); } } + + return $deptIDList; } /** diff --git a/module/doc/control.php b/module/doc/control.php index fa5403fa82..9e86e6fd5e 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -142,6 +142,7 @@ class doc extends control $this->action->create('docLib', $libID, 'Created'); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $libID)); die(js::locate($this->createLink('doc', 'objectLibs', "type=$objectType&objectID=$objectID&libID=$libID"), 'parent.parent')); } else @@ -288,6 +289,7 @@ class doc extends control if(!empty($files)) $fileAction = $this->lang->addFiles . join(',', $files) . "\n" ; $this->action->create('doc', $docID, 'Created', $fileAction); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $docID)); $objectID = zget($lib, $lib->type, ''); $params = "type={$lib->type}&objectID=$objectID&libID={$lib->id}&docID=" . $docResult['id']; $link = $this->createLink('doc', 'objectLibs', $params); diff --git a/module/entry/control.php b/module/entry/control.php index 225c1fe48a..e5055a82c0 100644 --- a/module/entry/control.php +++ b/module/entry/control.php @@ -5,19 +5,19 @@ * @copyright Copyright 2009-2017 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com) * @license ZPL (http://zpl.pub/page/zplv12.html) * @author Gang Liu - * @package entry + * @package entry * @version $Id$ * @link http://www.zentao.net */ class entry extends control { /** - * Browse entries. - * - * @param string $orderBy - * @param int $recTotal - * @param int $recPerPage - * @param int $pageID + * Browse entries. + * + * @param string $orderBy + * @param int $recTotal + * @param int $recPerPage + * @param int $pageID * @access public * @return void */ @@ -36,8 +36,8 @@ class entry extends control } /** - * Create an entry. - * + * Create an entry. + * * @access public * @return void */ @@ -49,6 +49,7 @@ class entry extends control if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError())); $this->loadModel('action')->create('entry', $id, 'created'); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $id)); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse'))); } @@ -61,9 +62,9 @@ class entry extends control } /** - * Edit an entry. - * - * @param int $id + * Edit an entry. + * + * @param int $id * @access public * @return void */ @@ -93,9 +94,9 @@ class entry extends control } /** - * Delete an entry. - * - * @param int $id + * Delete an entry. + * + * @param int $id * @access public * @return void */ @@ -108,13 +109,13 @@ class entry extends control } /** - * Browse logs of an entry. - * - * @param int $id - * @param string $orderBy - * @param int $recTotal - * @param int $recPerPage - * @param int $pageID + * Browse logs of an entry. + * + * @param int $id + * @param string $orderBy + * @param int $recTotal + * @param int $recPerPage + * @param int $pageID * @access public * @return void */ diff --git a/module/execution/control.php b/module/execution/control.php index b405dfdaa6..73d5d7214b 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1287,6 +1287,8 @@ class execution extends control $this->executeHooks($executionID); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $executionID)); + if($this->app->openApp == 'doc') { $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('doc', 'objectLibs', "type=execution"))); diff --git a/module/execution/view/view.html.php b/module/execution/view/view.html.php index bb36fc1174..d9ff7abf36 100644 --- a/module/execution/view/view.html.php +++ b/module/execution/view/view.html.php @@ -229,7 +229,7 @@ totalConsumed + $execution->totalLeft) ? floor($execution->totalConsumed / ($execution->totalConsumed + $execution->totalLeft) * 1000) / 1000 * 100 : 0;?> - execution->progress;?> percent;?>   + execution->progress;?> percent;?>  
@@ -239,23 +239,23 @@ execution->begin;?> begin;?> execution->totalEstimate;?> - totalEstimate . $lang->execution->workHour;?> + totalEstimate . $lang->execution->workHour;?> execution->end;?> end;?> execution->totalConsumed;?> - totalConsumed . $lang->execution->workHour;?> + totalConsumed . $lang->execution->workHour;?> execution->totalDays;?> days;?> execution->totalLeft;?> - totalLeft . $lang->execution->workHour;?> + totalLeft . $lang->execution->workHour;?> execution->totalHours;?> - totalHours . $lang->execution->workHour;?> + totalHours . $lang->execution->workHour;?> @@ -268,11 +268,11 @@ story->common;?> - storyCount;?> + storyCount;?> task->common;?> - taskCount;?> + taskCount;?> bug->common;?> - bugCount;?> + bugCount;?> diff --git a/module/group/control.php b/module/group/control.php index 1705d62172..afabc0c35e 100644 --- a/module/group/control.php +++ b/module/group/control.php @@ -57,8 +57,9 @@ class group extends control { if(!empty($_POST)) { - $this->group->create(); + $groupID = $this->group->create(); if(dao::isError()) die(js::error(dao::getError())); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $groupID)); if(isonlybody()) die(js::closeModal('parent.parent', 'this')); die(js::locate($this->createLink('group', 'browse'), 'parent')); } diff --git a/module/group/model.php b/module/group/model.php index 9e3b720773..109b1e94f6 100644 --- a/module/group/model.php +++ b/module/group/model.php @@ -27,7 +27,8 @@ class groupModel extends model unset($group->limited); $group->role = 'limited'; } - return $this->dao->insert(TABLE_GROUP)->data($group)->batchCheck($this->config->group->create->requiredFields, 'notempty')->exec(); + $this->dao->insert(TABLE_GROUP)->data($group)->batchCheck($this->config->group->create->requiredFields, 'notempty')->exec(); + return $this->dao->lastInsertId(); } /** diff --git a/module/jenkins/control.php b/module/jenkins/control.php index ea52501ccb..70c030d2a4 100644 --- a/module/jenkins/control.php +++ b/module/jenkins/control.php @@ -61,8 +61,9 @@ class jenkins extends control { if($_POST) { - $this->jenkins->create(); + $jenkinsID = $this->jenkins->create(); if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError())); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $jenkinsID)); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse'))); } @@ -116,8 +117,8 @@ class jenkins extends control /** * Ajax get tasks. - * - * @param int $id + * + * @param int $id * @access public * @return void */ diff --git a/module/jenkins/model.php b/module/jenkins/model.php index 452a9ce10a..2d12469a3f 100644 --- a/module/jenkins/model.php +++ b/module/jenkins/model.php @@ -60,8 +60,8 @@ class jenkinsModel extends model /** * Get jenkins tasks. - * - * @param int $id + * + * @param int $id * @access public * @return array */ @@ -107,7 +107,8 @@ class jenkinsModel extends model ->batchCheck("url", 'URL') ->autoCheck() ->exec(); - return !dao::isError(); + if(dao::isError()) return false; + return $this->dao->lastInsertId(); } /** diff --git a/module/job/control.php b/module/job/control.php index 0413a49e89..cc5ab162b0 100644 --- a/module/job/control.php +++ b/module/job/control.php @@ -63,8 +63,9 @@ class job extends control { if($_POST) { - $this->job->create(); + $jobID = $this->job->create(); if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError())); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $jobID)); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse'))); } diff --git a/module/job/model.php b/module/job/model.php index 4c7c8f7a63..5d19e6c298 100644 --- a/module/job/model.php +++ b/module/job/model.php @@ -12,9 +12,9 @@ class jobModel extends model { /** - * Get by id. - * - * @param int $id + * Get by id. + * + * @param int $id * @access public * @return object */ @@ -25,7 +25,7 @@ class jobModel extends model /** * Get job list. - * + * * @param string $orderBy * @param object $pager * @access public @@ -44,7 +44,7 @@ class jobModel extends model /** * Get list by triggerType field. - * + * * @param string $triggerType * @param array $repoIdList * @access public @@ -107,7 +107,7 @@ class jobModel extends model /** * Create a job. - * + * * @access public * @return bool */ @@ -164,13 +164,13 @@ class jobModel extends model $id = $this->dao->lastInsertId(); $this->initJob($id, $job, $this->post->repoType); - return true; + return $id; } /** * Update a job. - * - * @param int $id + * + * @param int $id * @access public * @return bool */ @@ -236,10 +236,10 @@ class jobModel extends model /** * Init when create or update job. - * - * @param int $id - * @param object $job - * @param string $repoType + * + * @param int $id + * @param object $job + * @param string $repoType * @access public * @return bool */ @@ -281,8 +281,8 @@ class jobModel extends model /** * Exec job. - * - * @param int $id + * + * @param int $id * @access public * @return bool */ diff --git a/module/my/view/project.html.php b/module/my/view/project.html.php index 0f43c5afb9..56eadc4e81 100644 --- a/module/my/view/project.html.php +++ b/module/my/view/project.html.php @@ -92,7 +92,7 @@
diff --git a/module/product/control.php b/module/product/control.php index 7a4b1c24bb..7146d7157b 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -151,13 +151,15 @@ class product extends control if($browseType == 'bymodule' or $browseType == '') { setcookie('storyModule', (int)$param, 0, $this->config->webRoot, '', $this->config->cookieSecure, false); + if($this->app->openApp == 'project') setcookie('storyModuleParam', (int)$param, 0, $this->config->webRoot, '', $this->config->cookieSecure, false); $_COOKIE['storyBranch'] = 0; setcookie('storyBranch', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, false); if($browseType == '') setcookie('treeBranch', (int)$branch, 0, $this->config->webRoot, '', $this->config->cookieSecure, false); } if($browseType == 'bybranch') setcookie('storyBranch', (int)$branch, 0, $this->config->webRoot, '', $this->config->cookieSecure, false); - $moduleID = ($browseType == 'bymodule') ? (int)$param : (($browseType == 'bysearch' or $browseType == 'bybranch') ? 0 : ($this->cookie->storyModule ? $this->cookie->storyModule : 0)); + $cookieModule = $this->app->openApp == 'project' ? $this->cookie->storyModuleParam : $this->cookie->storyModule; + $moduleID = ($browseType == 'bymodule') ? (int)$param : (($browseType == 'bysearch' or $browseType == 'bybranch') ? 0 : ($cookieModule ? $cookieModule : 0)); $queryID = ($browseType == 'bysearch') ? (int)$param : 0; /* Set menu. The projectstory module does not execute. */ @@ -319,6 +321,7 @@ class product extends control $this->loadModel('action')->create('product', $productID, 'opened'); $this->executeHooks($productID); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $productID)); $openApp = $this->app->openApp; $moduleName = $openApp == 'program'? 'program' : $this->moduleName; diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index 52255f52fe..891e914a25 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -74,7 +74,7 @@ $projectIDParam = $isProjectStory ? "projectID=$projectID&" : ''; createLink($this->app->rawModule, $this->app->rawMethod, $projectIDParam . "productID=$productID&branch=$branch&browseType=$browseType¶m=0&storyType=$storyType&orderBy=$orderBy&recTotal=0&recPerPage={$pager->recPerPage}") : 'javascript:removeCookieByKey("storyModule")'; + $removeLink = $browseType == 'bymodule' ? $this->createLink($this->app->rawModule, $this->app->rawMethod, $projectIDParam . "productID=$productID&branch=$branch&browseType=$browseType¶m=0&storyType=$storyType&orderBy=$orderBy&recTotal=0&recPerPage={$pager->recPerPage}") : 'javascript:removeCookieByKey("storyModuleParam")'; echo html::a($removeLink, "", '', "class='text-muted btn btn-link' style='padding-left: 0;'"); } ?> diff --git a/module/productplan/control.php b/module/productplan/control.php index c1ad06ae9b..3a54d382f2 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -54,6 +54,7 @@ class productplan extends control $this->executeHooks($planID); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $planID)); if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => 'parent.refreshPlan()')); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('productplan', 'browse', "productID=$productID&branch=$branchID"))); } diff --git a/module/program/control.php b/module/program/control.php index b9c7e7be63..08d9c34aaf 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -124,10 +124,11 @@ class program extends control if($_POST) { - $projectID = $this->program->create(); + $programID = $this->program->create(); if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError())); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $programID)); - $this->loadModel('action')->create('program', $projectID, 'opened'); + $this->loadModel('action')->create('program', $programID, 'opened'); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse'))); } diff --git a/module/program/view/browsebylist.html.php b/module/program/view/browsebylist.html.php index 2d7694fbf5..aebfc2438d 100644 --- a/module/program/view/browsebylist.html.php +++ b/module/program/view/browsebylist.html.php @@ -96,7 +96,7 @@ - id&from=browse", $program, 'list', 'edit', '', '', '', "data-app='project'", '', $program->id);?> + id", $program, 'list', 'edit', '', 'iframe', true, '', '', $program->id);?> id", $program, 'list', 'group', '', '', '', 'data-app="project"', '', $program->id);?> id", $program, 'list', 'lock', '', '', '', 'data-app="project"', '', $program->id);?> diff --git a/module/project/control.php b/module/project/control.php index 817cad57bc..540d4b68d4 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -299,6 +299,8 @@ class project extends control } } + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $projectID)); + if($this->app->openApp == 'program') { $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('program', 'browse'))); @@ -388,7 +390,7 @@ class project extends control * @access public * @return void */ - public function edit($projectID = 0, $from = 'project') + public function edit($projectID = 0) { $this->loadModel('action'); $this->loadModel('custom'); @@ -426,10 +428,9 @@ class project extends control $this->loadModel('productplan')->linkProject($projectID, $_POST['plans'], $oldPlanStories); } + if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); + $locateLink = $this->session->projectList ? $this->session->projectList : inLink('view', "projectID=$projectID"); - if($from == 'projectView') $locateLink = $this->createLink('project', 'view', "projectID=$projectID"); - if($from == 'program') $locateLink = $this->createLink('program', 'browse'); - if($from == 'programProject') $locateLink = $this->session->programProject ? $this->session->programProject : $this->createLink('program', 'project', "projectID=$projectID"); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locateLink)); } @@ -472,7 +473,6 @@ class project extends control $this->view->unmodifiableProducts = $unmodifiableProducts; $this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($linkedProducts), '', $linkedBranches); $this->view->URSRPairs = $this->custom->getURSRPairs(); - $this->view->from = $from; $this->view->parentProject = $parentProject; $this->view->parentProgram = $this->program->getByID($project->parent); $this->view->availableBudget = $this->program->getBudgetLeft($parentProject) + (float)$project->budget; @@ -614,8 +614,9 @@ class project extends control if(!empty($_POST)) { $_POST['project'] = $projectID; - $this->group->create(); + $groupID = $this->group->create(); if(dao::isError()) die(js::error(dao::getError())); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $groupID)); die(js::closeModal('parent.parent')); } diff --git a/module/project/model.php b/module/project/model.php index fa72f03ac8..296b4e2dd3 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1373,8 +1373,10 @@ class projectModel extends model echo ""; } - $from = $project->from == 'project' ? 'project' : 'pgmproject'; - common::printIcon('project', 'edit', "projectID=$project->id&from=$from", $project, 'list', 'edit', '', '', '', "data-app=project", '', $project->id); + $from = $project->from == 'project' ? 'project' : 'pgmproject'; + $iframe = $this->app->openApp == 'program' ? 'iframe' : ''; + $onlyBody = $this->app->openApp == 'program' ? true : ''; + common::printIcon('project', 'edit', "projectID=$project->id", $project, 'list', 'edit', '', $iframe, $onlyBody, "data-app=project", '', $project->id); common::printIcon('project', 'manageMembers', "projectID=$project->id", $project, 'list', 'group', '', '', '', "data-app=project", $this->lang->execution->team, $project->id); if($this->config->systemMode == 'new') common::printIcon('project', 'group', "projectID=$project->id&programID=$programID", $project, 'list', 'lock', '', '', '', "data-app=project", '', $project->id); diff --git a/module/project/view/edit.html.php b/module/project/view/edit.html.php index 811c71079f..1293fecea0 100644 --- a/module/project/view/edit.html.php +++ b/module/project/view/edit.html.php @@ -18,7 +18,6 @@ parent);?> id);?> project->longTime);?> - project->notAllowRemoveProducts);?> project->linkedProjectsTip);?> @@ -161,7 +160,7 @@ echo html::hidden('model', $project->model); echo html::submitButton(); $browseLink = $this->session->projectList ? $this->session->projectList : $this->createLink('project', 'browse'); - echo html::a($browseLink, $lang->goback, '', 'class="btn btn-back btn-wide"'); + echo isonlybody() ? html::backButton() : html::a($browseLink, $lang->goback, '', 'class="btn btn-back btn-wide"'); ?> diff --git a/module/project/view/view.html.php b/module/project/view/view.html.php index 1971fd3e05..c62d77ab46 100644 --- a/module/project/view/view.html.php +++ b/module/project/view/view.html.php @@ -104,7 +104,7 @@ echo $this->buildOperateMenu($project, 'view'); echo "
"; - common::printIcon('project', 'edit', $params . '&from=projectView', $project, 'button', 'edit', '', '', '', '', $lang->edit); + common::printIcon('project', 'edit', $params, $project, 'button', 'edit', '', '', '', '', $lang->edit); common::printIcon('project', 'delete', $params, $project, 'button', 'trash', 'hiddenwin', '', '', '', $lang->delete); } ?> @@ -169,7 +169,7 @@ totalConsumed + $workhour->totalLeft) ? floor($workhour->totalConsumed / ($workhour->totalConsumed + $workhour->totalLeft) * 1000) / 1000 * 100 : 0;?> - project->progress;?> percent;?>   + project->progress;?> percent;?>  
@@ -179,23 +179,23 @@ project->begin;?> begin;?> execution->totalEstimate;?> - totalEstimate . $lang->execution->workHour;?> + totalEstimate . $lang->execution->workHour;?> project->end;?> end;?> execution->totalConsumed;?> - totalConsumed . $lang->execution->workHour;?> + totalConsumed . $lang->execution->workHour;?> execution->totalDays;?> days;?> execution->totalLeft;?> - totalLeft . $lang->execution->workHour;?> + totalLeft . $lang->execution->workHour;?> execution->totalHours;?> - totalHours . $lang->execution->workHour;?> + totalHours . $lang->execution->workHour;?> @@ -208,11 +208,11 @@ story->common;?> - storyCount;?> + storyCount;?> task->common;?> - taskCount;?> + taskCount;?> bug->common;?> - bugCount;?> + bugCount;?> diff --git a/module/projectrelease/control.php b/module/projectrelease/control.php index 49798c600d..6ea6de21f8 100644 --- a/module/projectrelease/control.php +++ b/module/projectrelease/control.php @@ -108,6 +108,8 @@ class projectrelease extends control $this->loadModel('action')->create('release', $releaseID, 'opened'); $this->executeHooks($releaseID); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $releaseID)); + $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "releaseID=$releaseID"))); } diff --git a/module/release/control.php b/module/release/control.php index 92c6fc264e..9d1d2998cb 100644 --- a/module/release/control.php +++ b/module/release/control.php @@ -70,6 +70,7 @@ class release extends control $this->executeHooks($releaseID); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $releaseID)); if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.loadProductBuilds($productID)")); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "releaseID=$releaseID"))); } diff --git a/module/repo/control.php b/module/repo/control.php index 411c1b0bc5..9d45d72988 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -119,6 +119,7 @@ class repo extends control if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError())); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $repoID)); $link = $this->repo->createLink('showSyncCommit', "repoID=$repoID&objectID=$objectID", '', false); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $link)); } diff --git a/module/sso/control.php b/module/sso/control.php index e36f7ec4af..d72a994fa7 100644 --- a/module/sso/control.php +++ b/module/sso/control.php @@ -280,6 +280,7 @@ class sso extends control if($_POST) { $result = $this->sso->createUser(); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $result['id'])); if($result['status'] != 'success') die($result['data']); die('success'); } diff --git a/module/sso/model.php b/module/sso/model.php index 8d902b3107..88389b0853 100644 --- a/module/sso/model.php +++ b/module/sso/model.php @@ -3,7 +3,7 @@ class ssoModel extends model { /** * Check Key. - * + * * @access public * @return bool */ @@ -16,8 +16,8 @@ class ssoModel extends model /** * Get bind user. - * - * @param string $user + * + * @param string $user * @access public * @return object */ @@ -28,7 +28,7 @@ class ssoModel extends model /** * Get bind users with ranzhi. - * + * * @access public * @return array */ @@ -38,8 +38,8 @@ class ssoModel extends model } /** - * Bind user. - * + * Bind user. + * * @access public * @return object */ @@ -83,14 +83,14 @@ class ssoModel extends model /** * Create a user from ranzhi. - * + * * @access public * @return void */ public function createUser() { $user = $this->dao->select('*')->from(TABLE_USER)->where('account')->eq($this->post->account)->fetch(); - if($user) return array('status' => 'fail', 'data' => $this->lang->sso->bindHasAccount); + if($user) return array('status' => 'fail', 'data' => $this->lang->sso->bindHasAccount); $user = new stdclass(); $user->account = $this->post->account; @@ -101,7 +101,7 @@ class ssoModel extends model $this->dao->insert(TABLE_USER)->data($user)->autoCheck()->exec(); - if(dao::isError()) return array('status' => 'fail', 'data' => dao::getError()); - return array('status' => 'success'); + if(dao::isError()) return array('status' => 'fail', 'data' => dao::getError()); + return array('status' => 'success', 'id' => $this->dao->lastInsertId()); } } diff --git a/module/stakeholder/control.php b/module/stakeholder/control.php index becb22b674..f2e9965177 100644 --- a/module/stakeholder/control.php +++ b/module/stakeholder/control.php @@ -61,6 +61,7 @@ class stakeholder extends control } $actionID = $this->loadModel('action')->create('stakeholder', $stakeholderID, 'added'); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $stakeholderID)); $moduleName = $this->app->openApp == 'program' ? 'program' : $this->moduleName; $methodName = $this->app->openApp == 'program' ? 'stakeholder' : 'browse'; @@ -102,7 +103,8 @@ class stakeholder extends control { if($_POST) { - $this->stakeholder->batchCreate(); + $stakeholderList = $this->stakeholder->batchCreate(); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'idList' => $stakeholderList)); die(js::locate($this->createLink('stakeholder', 'browse', "projectID=$projectID"), 'parent')); } diff --git a/module/stakeholder/model.php b/module/stakeholder/model.php index 813a80dc6c..c19b685f08 100644 --- a/module/stakeholder/model.php +++ b/module/stakeholder/model.php @@ -104,7 +104,7 @@ class stakeholderModel extends model * Batch create stakeholders for a project. * * @access public - * @return void + * @return array */ public function batchCreate() { @@ -116,6 +116,7 @@ class stakeholderModel extends model $oldJoin = $this->dao->select('`user`, createdDate')->from(TABLE_STAKEHOLDER)->where('objectID')->eq((int)$this->session->project)->andWhere('objectType')->eq('project')->fetchPairs(); $this->dao->delete()->from(TABLE_STAKEHOLDER)->where('objectID')->eq((int)$this->session->project)->andWhere('objectType')->eq('project')->exec(); + $stakeholderList = array(); foreach($accounts as $key => $account) { if(empty($account)) continue; @@ -130,7 +131,8 @@ class stakeholderModel extends model $this->dao->insert(TABLE_STAKEHOLDER)->data($stakeholder)->exec(); - $stakeholderID = $this->dao->lastInsertId(); + $stakeholderID = $this->dao->lastInsertId(); + $stakeholderList[] = $stakeholderID; $this->action->create('stakeholder', $stakeholderID, 'added'); } @@ -141,6 +143,8 @@ class stakeholderModel extends model $changedAccounts = array_unique($changedAccounts); $this->loadModel('user')->updateUserView($this->session->project, 'project', $changedAccounts); + + return $stakeholderList; } /** diff --git a/module/story/control.php b/module/story/control.php index 70759ad1da..b00a7aa1ca 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -146,6 +146,8 @@ class story extends control $this->executeHooks($storyID); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $storyID)); + /* If link from no head then reload. */ if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); @@ -404,6 +406,7 @@ class story extends control if(dao::isError()) die(js::error(dao::getError())); } + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'idList' => $stories)); if(isonlybody()) die(js::closeModal('parent.parent', 'this')); if($storyID) @@ -1274,7 +1277,7 @@ class story extends control $response['result'] = 'success'; $response['message'] = $this->lang->story->successToTask; - $this->story->batchToTask($executionID, $this->session->project); + $tasks = $this->story->batchToTask($executionID, $this->session->project); if(dao::isError()) { @@ -1283,6 +1286,7 @@ class story extends control $this->send($response); } + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'idList' => $tasks)); $response['locate'] = $this->createLink('execution', 'task', "executionID=$executionID"); $this->send($response); } diff --git a/module/story/js/change.js b/module/story/js/change.js index b94ee6d026..b8d766e61e 100644 --- a/module/story/js/change.js +++ b/module/story/js/change.js @@ -2,7 +2,7 @@ $(function() { $('#needNotReview').on('change', function() { - $('#assignedTo').attr('disabled', $(this).is(':checked') ? 'disabled' : null).trigger('chosen:updated'); + $('#reviewedBy').attr('disabled', $(this).is(':checked') ? 'disabled' : null).trigger('chosen:updated'); getStatus('change', "storyID=" + storyID + ",changed=" + changed + ",needNotReview=" + ($(this).prop('checked') ? 1 : 0)); }); $('#needNotReview').change(); diff --git a/module/story/js/create.js b/module/story/js/create.js index dcd3dd2c56..63418b7f26 100644 --- a/module/story/js/create.js +++ b/module/story/js/create.js @@ -2,7 +2,7 @@ $(function() { $('#needNotReview').on('change', function() { - $('#assignedTo').attr('disabled', $(this).is(':checked') ? 'disabled' : null).trigger('chosen:updated'); + $('#reviewedBy').attr('disabled', $(this).is(':checked') ? 'disabled' : null).trigger('chosen:updated'); getStatus('create', "product=" + $('#product').val() + ",execution=" + executionID + ",needNotReview=" + ($(this).prop('checked') ? 1 : 0)); }); $('#needNotReview').change(); diff --git a/module/story/lang/de.php b/module/story/lang/de.php index ca78829929..dba7c58afd 100644 --- a/module/story/lang/de.php +++ b/module/story/lang/de.php @@ -259,6 +259,7 @@ $lang->story->successSaved = "Story wurde gespeichrt!"; $lang->story->confirmDelete = "Möchten Sie diese Story löschen?"; $lang->story->errorEmptyChildStory = '『Unterteilte Story』 darf nicht leer sein.'; $lang->story->errorNotSubdivide = "If the status is not active, or the stage is not wait, or a sub story, it cannot be subdivided."; +$lang->story->errorEmptyReviewedBy = "『ReviewedBy』darf nicht leer sein."; $lang->story->mustChooseResult = 'Ergebnis wählen'; $lang->story->mustChoosePreVersion = 'Version wählen um es umzukhren.'; $lang->story->noStory = 'Keine Storys. '; diff --git a/module/story/lang/en.php b/module/story/lang/en.php index c87ede4369..e47f016cd3 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -260,6 +260,7 @@ $lang->story->successSaved = "Story is saved!"; $lang->story->confirmDelete = "Do you want to delete this story?"; $lang->story->errorEmptyChildStory = '『Decomposed Stories』canot be blank.'; $lang->story->errorNotSubdivide = "If the status is not active, or the stage is not wait, or a sub story, it cannot be subdivided."; +$lang->story->errorEmptyReviewedBy = "『ReviewedBy』canot be blank."; $lang->story->mustChooseResult = 'Select Result'; $lang->story->mustChoosePreVersion = 'Select a version to revert to.'; $lang->story->noStory = 'No stories yet. '; diff --git a/module/story/lang/fr.php b/module/story/lang/fr.php index e74d5d0c31..495eb497cb 100644 --- a/module/story/lang/fr.php +++ b/module/story/lang/fr.php @@ -259,6 +259,7 @@ $lang->story->successSaved = "Story est sauvegardée !"; $lang->story->confirmDelete = "Voulez-vous vraiment supprimer cette story ?"; $lang->story->errorEmptyChildStory = '『Decomposed Stories』ne peuvent être vides.'; $lang->story->errorNotSubdivide = "Si le statut n'est pas actif, ou l'étape n'est pas en attente, ou si c'est une sous-story, elle ne peut pas être subdivisée."; +$lang->story->errorEmptyReviewedBy = "『ReviewedBy』ne peuvent être vides." $lang->story->mustChooseResult = 'Sélect Résultat'; $lang->story->mustChoosePreVersion = 'Sélect une version pour revenir en arrière.'; $lang->story->noStory = "Aucune story pour l'instant. "; diff --git a/module/story/lang/vi.php b/module/story/lang/vi.php index e8e3e44dc8..e1b566d4ca 100644 --- a/module/story/lang/vi.php +++ b/module/story/lang/vi.php @@ -259,6 +259,7 @@ $lang->story->successSaved = "Câu chuyện đã lưu lại!"; $lang->story->confirmDelete = "Bạn có muốn xóa câu chuyện này?"; $lang->story->errorEmptyChildStory = '『Câu chuyện đã phân rã』 không thể để trống.'; $lang->story->errorNotSubdivide = "Nếu tình trạng này là chưa kích hoạt, hoặc giai đoạn này chưa đợi, hoặc một câu chuyện con, nó không thể bị chia nhỏ."; +$lang->story->errorEmptyReviewedBy = "『ReviewedBy』 không thể để trống."; $lang->story->mustChooseResult = 'Chọn kết quả'; $lang->story->mustChoosePreVersion = 'Chọn một phiên bản để chuyển thành.'; $lang->story->noStory = 'Không có câu chuyện nào'; diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 0b54cf23fe..ad0e4534e0 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -260,6 +260,7 @@ $lang->story->successSaved = "{$lang->SRCommon}成功添加,"; $lang->story->confirmDelete = "您确认删除该{$lang->SRCommon}吗?"; $lang->story->errorEmptyChildStory = "『细分{$lang->SRCommon}』不能为空。"; $lang->story->errorNotSubdivide = "状态不是激活,或者阶段不是未开始的{$lang->SRCommon},或者是子需求,则不能细分。"; +$lang->story->errorEmptyReviewedBy = "『由谁评审』不能为空。"; $lang->story->mustChooseResult = '必须选择评审结果'; $lang->story->mustChoosePreVersion = '必须选择回溯的版本'; $lang->story->noStory = "暂时没有{$lang->SRCommon}。"; diff --git a/module/story/lang/zh-tw.php b/module/story/lang/zh-tw.php index 903c3587f2..3f3aeb2b73 100644 --- a/module/story/lang/zh-tw.php +++ b/module/story/lang/zh-tw.php @@ -260,6 +260,7 @@ $lang->story->successSaved = "{$lang->SRCommon}成功添加,"; $lang->story->confirmDelete = "您確認刪除該{$lang->SRCommon}嗎?"; $lang->story->errorEmptyChildStory = "『細分{$lang->SRCommon}』不能為空。"; $lang->story->errorNotSubdivide = "狀態不是激活,或者階段不是未開始的{$lang->SRCommon},或者是子需求,則不能細分。"; +$lang->story->errorEmptyReviewedBy = "『由誰評審』不能為空。"; $lang->story->mustChooseResult = '必須選擇評審結果'; $lang->story->mustChoosePreVersion = '必須選擇回溯的版本'; $lang->story->noStory = "暫時沒有{$lang->SRCommon}。"; diff --git a/module/story/model.php b/module/story/model.php index 8277649b58..b7bd72cde1 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -186,6 +186,12 @@ class storyModel extends model */ public function create($executionID = 0, $bugID = 0, $from = '') { + if(!$this->post->needNotReview and empty(array_filter($_POST['reviewedBy']))) + { + dao::$errors[] = $this->lang->story->errorEmptyReviewedBy; + return false; + } + $now = helper::now(); $story = fixer::input('post') ->cleanInt('product,module,pri,plan') @@ -196,6 +202,7 @@ class storyModel extends model ->setDefault('plan,verify', '') ->setDefault('openedBy', $this->app->user->account) ->setDefault('openedDate', $now) + ->setDefault('reviewedBy', '') ->setIF($this->post->assignedTo != '', 'assignedDate', $now) ->setIF($this->post->needNotReview or $executionID > 0, 'status', 'active') ->setIF($this->post->plan > 0, 'stage', 'planned') @@ -203,6 +210,7 @@ class storyModel extends model ->setIF($executionID > 0, 'stage', 'projected') ->setIF($bugID > 0, 'fromBug', $bugID) ->join('mailto', ',') + ->join('reviewedBy', ',') ->stripTags($this->config->story->editor->create['id'], $this->config->allowedTags) ->remove('files,labels,needNotReview,newStory,uid,contactListMenu,URS') ->get(); @@ -519,6 +527,12 @@ class storyModel extends model return false; } + if(!$this->post->needNotReview and empty(array_filter($_POST['reviewedBy']))) + { + dao::$errors[] = $this->lang->story->errorEmptyReviewedBy; + return false; + } + $story = fixer::input('post')->stripTags($this->config->story->editor->change['id'], $this->config->allowedTags)->get(); if($story->spec != $oldStory->spec or $story->verify != $oldStory->verify or $story->title != $oldStory->title or $this->loadModel('file')->getCount()) $specChanged = true; @@ -526,9 +540,8 @@ class storyModel extends model $story = fixer::input('post') ->callFunc('title', 'trim') ->setDefault('lastEditedBy', $this->app->user->account) + ->setDefault('reviewedBy', '') ->add('lastEditedDate', $now) - ->setIF($this->post->assignedTo == '', 'assignedTo', $oldStory->assignedTo) - ->setIF($this->post->assignedTo != '' and $this->post->assignedTo != $oldStory->assignedTo, 'assignedDate', $now) ->setIF($specChanged, 'version', $oldStory->version + 1) ->setIF($specChanged and $oldStory->status == 'active' and $this->post->needNotReview == false, 'status', 'changed') ->setIF($specChanged and $oldStory->status == 'draft' and $this->post->needNotReview, 'status', 'active') @@ -538,6 +551,7 @@ class storyModel extends model ->setIF($specChanged and $oldStory->reviewedBy, 'reviewedDate', '0000-00-00') ->setIF($specChanged and $oldStory->closedBy, 'closedDate', '0000-00-00') ->stripTags($this->config->story->editor->change['id'], $this->config->allowedTags) + ->join('reviewedBy', ',') ->remove('files,labels,comment,needNotReview,uid') ->get(); if($specChanged and $story->status == 'active' and $this->checkForceReview()) $story->status = 'changed'; @@ -1552,7 +1566,7 @@ class storyModel extends model * @param int $executionID * @param int $projectID * @access public - * @return bool + * @return bool|array */ public function batchToTask($executionID, $projectID = 0) { @@ -1578,6 +1592,7 @@ class storyModel extends model if(dao::isError()) return false; /* Create tasks. */ + $tasks = array(); $stories = $this->getByList($data->storyIdList); foreach($stories as $story) { @@ -1615,9 +1630,11 @@ class storyModel extends model ->exec(); if(dao::isError()) return false; - $taskID = $this->dao->lastInsertID(); + $taskID = $this->dao->lastInsertID(); + $tasks[] = $taskID; $this->action->create('task', $taskID, 'Opened', ''); } + return $tasks; } /** diff --git a/module/story/view/change.html.php b/module/story/view/change.html.php index c8d9bf4a07..a3c57110e2 100644 --- a/module/story/view/change.html.php +++ b/module/story/view/change.html.php @@ -24,9 +24,9 @@ - - diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index f7aeab84ea..ad3e2091ff 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -100,10 +100,10 @@ - + + + + + + + + + + + + + + + + + + + + type) as $type) $testType .= zget($lang->testtask->typeList, $type) . ' ';?> + + diff --git a/module/todo/control.php b/module/todo/control.php index 732ef0b358..1d3808939d 100644 --- a/module/todo/control.php +++ b/module/todo/control.php @@ -69,7 +69,8 @@ class todo extends control $this->send(array('result' => 'success', 'id' => $todoID, 'name' => $todo->name, 'pri' => $todo->pri, 'priName' => $this->lang->todo->priList[$todo->pri], 'time' => date(DT_DATE4, strtotime($todo->date)) . ' ' . $todo->begin)); } - if($this->app->getViewType() == 'xhtml') die(js::locate($this->createLink('todo', 'view', "todoID=$todoID"), 'parent')); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $todoID)); + if($this->viewType == 'xhtml') die(js::locate($this->createLink('todo', 'view', "todoID=$todoID"), 'parent')); if(isonlybody()) die(js::closeModal('parent.parent')); die(js::locate($this->createLink('my', 'todo', "type=all&userID=&status=all&orderBy=id_desc"), 'parent')); } @@ -96,7 +97,7 @@ class todo extends control if($date == 'today') $date = date(DT_DATE1, time()); if(!empty($_POST)) { - $this->todo->batchCreate(); + $todoIDList = $this->todo->batchCreate(); if(dao::isError()) die(js::error(dao::getError())); /* Locate the browser. */ @@ -109,6 +110,8 @@ class todo extends control { $date= 'today'; } + + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'idList' => $todoIDList)); if(isonlybody())die(js::reload('parent.parent')); die(js::locate($this->createLink('my', 'todo', "type=$date"), 'parent')); } diff --git a/module/todo/model.php b/module/todo/model.php index d73ef85c02..df64c634f8 100644 --- a/module/todo/model.php +++ b/module/todo/model.php @@ -101,7 +101,7 @@ class todoModel extends model * Create batch todo * * @access public - * @return void + * @return array */ public function batchCreate() { @@ -164,6 +164,7 @@ class todoModel extends model } } + $todoIDList = array(); foreach($validTodos as $todo) { $this->dao->insert(TABLE_TODO)->data($todo)->autoCheck()->exec(); @@ -172,10 +173,13 @@ class todoModel extends model echo js::error(dao::getError()); die(js::reload('parent')); } - $todoID = $this->dao->lastInsertID(); + $todoID = $this->dao->lastInsertID(); + $todoIDList[] = $todoID; $this->loadModel('score')->create('todo', 'create', $todoID); $this->loadModel('action')->create('todo', $todoID, 'opened'); } + + return $todoIDList; } /** diff --git a/module/tree/control.php b/module/tree/control.php index eaf069b278..e02f14bf6c 100644 --- a/module/tree/control.php +++ b/module/tree/control.php @@ -371,8 +371,9 @@ class tree extends control { if(!empty($_POST)) { - $this->tree->manageChild($rootID, $viewType); + $moduleIDList = $this->tree->manageChild($rootID, $viewType); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'idList' => $moduleIDList)); if($viewType == 'doc' and isonlybody()) die(js::reload('parent.parent')); if(isonlybody()) die(js::closeModal('parent.parent', '', "function(){parent.parent.$('a.refresh').click()}")); diff --git a/module/tree/model.php b/module/tree/model.php index 1042dead60..9bfb5e20c5 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -1542,7 +1542,7 @@ class treeModel extends model * @param int $rootID * @param string $type * @access public - * @return void + * @return array */ public function manageChild($rootID, $type) { @@ -1580,6 +1580,8 @@ class treeModel extends model $parentPath = ','; } $i = 1; + + $moduleIDList = array(); foreach($childs as $moduleID => $moduleName) { if(empty($moduleName)) continue; @@ -1607,8 +1609,9 @@ class treeModel extends model $module->type = $type; $module->order = $order; $this->dao->insert(TABLE_MODULE)->data($module)->exec(); - $moduleID = $this->dao->lastInsertID(); - $childPath = $parentPath . "$moduleID,"; + $moduleID = $this->dao->lastInsertID(); + $moduleIDList[] = $moduleID; + $childPath = $parentPath . "$moduleID,"; $this->dao->update(TABLE_MODULE)->set('path')->eq($childPath)->where('id')->eq($moduleID)->limit(1)->exec(); } else @@ -1619,6 +1622,8 @@ class treeModel extends model $this->dao->update(TABLE_MODULE)->set('name')->eq(strip_tags(trim($moduleName)))->set('short')->eq($short)->set('order')->eq($order)->where('id')->eq($moduleID)->limit(1)->exec(); } } + + return $moduleIDList; } /** diff --git a/module/user/control.php b/module/user/control.php index 04aba479ba..da4a04c6f3 100644 --- a/module/user/control.php +++ b/module/user/control.php @@ -516,9 +516,10 @@ class user extends control $this->send(array('result' => 'fail', 'message' => str_replace('ID ', '', sprintf($this->lang->user->error->reserved, $_POST['account'])))); } - $this->user->create(); + $userID = $this->user->create(); if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError())); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $userID)); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('company', 'browse'))); } @@ -568,7 +569,9 @@ class user extends control if(!empty($_POST)) { - $this->user->batchCreate(); + $userIDList = $this->user->batchCreate(); + + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'idList' => $userIDList)); die(js::locate($this->createLink('company', 'browse'), 'parent')); } diff --git a/module/user/model.php b/module/user/model.php index b21d70430b..aafa1289d0 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -233,7 +233,7 @@ class userModel extends model * Create a user. * * @access public - * @return void + * @return int */ public function create() { @@ -302,6 +302,8 @@ class userModel extends model $this->loadModel('action')->create('user', $userID, 'Created'); $this->loadModel('mail'); if($this->config->mail->mta == 'sendcloud' and !empty($user->email)) $this->mail->syncSendCloud('sync', $user->email, $user->realname); + + return $usereID; } } @@ -310,7 +312,7 @@ class userModel extends model * * @param int $users * @access public - * @return void + * @return array */ public function batchCreate() { @@ -400,6 +402,7 @@ class userModel extends model } $this->loadModel('mail'); + $userIDList = array(); foreach($data as $user) { if($user->group) @@ -413,7 +416,8 @@ class userModel extends model $this->dao->insert(TABLE_USER)->data($user)->autoCheck()->exec(); /* Fix bug #2941 */ - $userID = $this->dao->lastInsertID(); + $userID = $this->dao->lastInsertID(); + $userIDList[] = $userID; $this->loadModel('action')->create('user', $userID, 'Created'); if(dao::isError()) @@ -427,6 +431,7 @@ class userModel extends model if($this->config->mail->mta == 'sendcloud' and !empty($user->email)) $this->mail->syncSendCloud('sync', $user->email, $user->realname); } } + return $userIDList; } /** diff --git a/module/webhook/control.php b/module/webhook/control.php index df969f3426..0e4762b49c 100644 --- a/module/webhook/control.php +++ b/module/webhook/control.php @@ -62,8 +62,9 @@ class webhook extends control { if($_POST) { - $this->webhook->create(); + $webhookID = $this->webhook->create(); if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError())); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $webhookID)); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse'))); } diff --git a/module/webhook/model.php b/module/webhook/model.php index 306d100d21..d68eae960f 100644 --- a/module/webhook/model.php +++ b/module/webhook/model.php @@ -211,7 +211,7 @@ class webhookModel extends model ->batchCheck($this->config->webhook->create->requiredFields, 'notempty') ->autoCheck() ->exec(); - return !dao::isError(); + return $this->dao->lastInsertId(); } /**
story->reviewedBy;?> +
- reviewedBy, 'class="form-control chosen"');?> + reviewedBy, 'class="form-control chosen" multiple');?> story->checkForceReview()):?> story->needNotReview, '', "id='needNotReview' {$needReview}");?> @@ -34,7 +34,6 @@
story->status;?>
story->reviewedBy;?> +
- PO : '', "class='form-control chosen'");?> + PO : '', "class='form-control chosen' multiple");?>
story->checkForceReview()):?>
diff --git a/module/task/control.php b/module/task/control.php index 762703d031..c86f3c476d 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -131,6 +131,9 @@ class task extends control $this->executeHooks($taskID); + /* Return task id when call the API. */ + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $taskID)); + /* If link from no head then reload. */ if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); @@ -284,6 +287,12 @@ class task extends control $mails = $this->task->batchCreate($executionID); if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError())); + $taskIDList = array(); + foreach($mails as $mail) $taskIDList[] = $mail->taskID; + + /* Return task id list when call the API. */ + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'idList' => $taskIDList)); + /* Locate the browser. */ if(!empty($iframe)) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $taskLink)); diff --git a/module/testcase/control.php b/module/testcase/control.php index ee0a1ec24e..c613b0c0a4 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -324,6 +324,7 @@ class testcase extends control $this->executeHooks($caseID); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $caseID)); /* If link from no head then reload. */ if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true)); @@ -473,10 +474,12 @@ class testcase extends control $this->loadModel('story'); if(!empty($_POST)) { - $caseID = $this->testcase->batchCreate($productID, $branch, $storyID); + $caseIDList = $this->testcase->batchCreate($productID, $branch, $storyID); if(dao::isError()) die(js::error(dao::getError())); if(isonlybody()) die(js::closeModal('parent.parent', 'this')); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'idList' => $caseIDList)); + setcookie('caseModule', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, false); $currentModule = $this->app->openApp == 'project' ? 'project' : 'testcase'; $currentMethod = $this->app->openApp == 'project' ? 'testcase' : 'browse'; diff --git a/module/testcase/model.php b/module/testcase/model.php index 4d8bc59ec6..f60252da2a 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -97,9 +97,10 @@ class testcaseModel extends model * Batch create cases. * * @param int $productID + * @param int $branch * @param int $storyID * @access public - * @return void + * @return array */ function batchCreate($productID, $branch, $storyID) { @@ -181,6 +182,7 @@ class testcaseModel extends model } } + $caseIDList = array(); foreach($data as $i => $case) { $this->dao->insert(TABLE_CASE)->data($case) @@ -194,7 +196,8 @@ class testcaseModel extends model die(js::reload('parent')); } - $caseID = $this->dao->lastInsertID(); + $caseID = $this->dao->lastInsertID(); + $caseIDList[] = $caseID; /* If the story is linked project, make the case link the project. */ $this->syncCase2Project($case, $caseID); @@ -206,6 +209,7 @@ class testcaseModel extends model if($this->app->openApp == 'execution') $this->action->create('case', $caseID, 'linked2execution', '', $this->session->execution); } if(!dao::isError()) $this->loadModel('score')->create('ajax', 'batchCreate'); + return $caseIDList; } /** diff --git a/module/testreport/control.php b/module/testreport/control.php index c82957a115..e13c21359a 100644 --- a/module/testreport/control.php +++ b/module/testreport/control.php @@ -165,6 +165,7 @@ class testreport extends control $reportID = $this->testreport->create(); if(dao::isError()) die(js::error(dao::getError())); $this->loadModel('action')->create('testreport', $reportID, 'Opened'); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $reportID)); die(js::locate(inlink('view', "reportID=$reportID"), 'parent')); } diff --git a/module/testsuite/control.php b/module/testsuite/control.php index b2e1e312ce..be08277c8a 100644 --- a/module/testsuite/control.php +++ b/module/testsuite/control.php @@ -122,6 +122,8 @@ class testsuite extends control $this->executeHooks($suiteID); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $suiteID)); + $response['locate'] = $this->createLink('testsuite', 'browse', "productID=$productID"); $this->send($response); } diff --git a/module/testtask/control.php b/module/testtask/control.php index 6660051352..5d502fa5cd 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -216,6 +216,8 @@ class testtask extends control $this->loadModel('action')->create('testtask', $taskID, 'opened'); $this->executeHooks($taskID); + if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $taskID)); + $task = $this->dao->findById($taskID)->from(TABLE_TESTTASK)->fetch(); if($this->app->openApp == 'project') $link = $this->createLink('project', 'testtask', "projectID=$task->project"); if($this->app->openApp == 'execution') $link = $this->createLink('execution', 'testtask', "executionID=$task->execution"); diff --git a/module/testtask/lang/de.php b/module/testtask/lang/de.php index 2d3cd8e457..d12016a28d 100644 --- a/module/testtask/lang/de.php +++ b/module/testtask/lang/de.php @@ -59,6 +59,7 @@ $lang->testtask->common = 'Testaufgabe'; $lang->testtask->product = $lang->productCommon; $lang->testtask->project = 'Project'; $lang->testtask->execution = $lang->execution->common; +$lang->testtask->type = 'Typ'; $lang->testtask->build = 'Build'; $lang->testtask->owner = 'Besitzer'; $lang->testtask->executor = 'Executor'; @@ -193,3 +194,9 @@ $lang->testtask->unitTag['thisWeek'] = 'This week'; $lang->testtask->unitTag['lastWeek'] = 'Last week'; $lang->testtask->unitTag['thisMonth'] = 'This month'; $lang->testtask->unitTag['lastMonth'] = 'Last month'; + +$lang->testtask->typeList['integrate'] = 'Integrate'; +$lang->testtask->typeList['system'] = 'System'; +$lang->testtask->typeList['acceptance'] = 'Acceptance'; +$lang->testtask->typeList['performance'] = 'Performance'; +$lang->testtask->typeList['safety'] = 'Safety'; diff --git a/module/testtask/lang/en.php b/module/testtask/lang/en.php index afb1798101..057257218e 100644 --- a/module/testtask/lang/en.php +++ b/module/testtask/lang/en.php @@ -62,6 +62,7 @@ $lang->testtask->common = 'Request'; $lang->testtask->product = $lang->productCommon; $lang->testtask->project = 'Project'; $lang->testtask->execution = $lang->execution->common; +$lang->testtask->type = 'Type'; $lang->testtask->build = 'Build'; $lang->testtask->owner = 'Owner'; $lang->testtask->executor = 'Executor'; @@ -196,3 +197,9 @@ $lang->testtask->unitTag['thisWeek'] = 'This week'; $lang->testtask->unitTag['lastWeek'] = 'Last week'; $lang->testtask->unitTag['thisMonth'] = 'This month'; $lang->testtask->unitTag['lastMonth'] = 'Last month'; + +$lang->testtask->typeList['integrate'] = 'Integrate'; +$lang->testtask->typeList['system'] = 'System'; +$lang->testtask->typeList['acceptance'] = 'Acceptance'; +$lang->testtask->typeList['performance'] = 'Performance'; +$lang->testtask->typeList['safety'] = 'Safety'; diff --git a/module/testtask/lang/fr.php b/module/testtask/lang/fr.php index fa45220580..1169714119 100644 --- a/module/testtask/lang/fr.php +++ b/module/testtask/lang/fr.php @@ -59,6 +59,7 @@ $lang->testtask->common = 'Recette'; $lang->testtask->product = $lang->productCommon; $lang->testtask->project = 'Project'; $lang->testtask->execution = $lang->execution->common; +$lang->testtask->type = 'Type'; $lang->testtask->build = 'Build'; $lang->testtask->owner = 'Owner'; $lang->testtask->executor = 'Executeur'; @@ -193,3 +194,9 @@ $lang->testtask->unitTag['thisWeek'] = 'This week'; $lang->testtask->unitTag['lastWeek'] = 'Last week'; $lang->testtask->unitTag['thisMonth'] = 'This month'; $lang->testtask->unitTag['lastMonth'] = 'Last month'; + +$lang->testtask->typeList['integrate'] = 'Integrate'; +$lang->testtask->typeList['system'] = 'System'; +$lang->testtask->typeList['acceptance'] = 'Acceptance'; +$lang->testtask->typeList['performance'] = 'Performance'; +$lang->testtask->typeList['safety'] = 'Safety'; diff --git a/module/testtask/lang/vi.php b/module/testtask/lang/vi.php index 5f2ed5aeae..95907cb5f6 100644 --- a/module/testtask/lang/vi.php +++ b/module/testtask/lang/vi.php @@ -59,6 +59,7 @@ $lang->testtask->common = 'Yêu cầu'; $lang->testtask->product = $lang->productCommon; $lang->testtask->project = 'Project'; $lang->testtask->execution = $lang->execution->common; +$lang->testtask->type = 'Kiểu'; $lang->testtask->build = 'Bản dựng'; $lang->testtask->owner = 'Sở hữu'; $lang->testtask->executor = 'Executor'; @@ -193,3 +194,9 @@ $lang->testtask->unitTag['thisWeek'] = 'This week'; $lang->testtask->unitTag['lastWeek'] = 'Last week'; $lang->testtask->unitTag['thisMonth'] = 'This month'; $lang->testtask->unitTag['lastMonth'] = 'Last month'; + +$lang->testtask->typeList['integrate'] = 'Integrate'; +$lang->testtask->typeList['system'] = 'System'; +$lang->testtask->typeList['acceptance'] = 'Acceptance'; +$lang->testtask->typeList['performance'] = 'Performance'; +$lang->testtask->typeList['safety'] = 'Safety'; diff --git a/module/testtask/lang/zh-cn.php b/module/testtask/lang/zh-cn.php index 99fd6a3e23..13e956d258 100644 --- a/module/testtask/lang/zh-cn.php +++ b/module/testtask/lang/zh-cn.php @@ -62,6 +62,7 @@ $lang->testtask->common = '测试单'; $lang->testtask->product = '所属' . $lang->productCommon; $lang->testtask->project = '所属项目'; $lang->testtask->execution = '所属' . $lang->execution->common; +$lang->testtask->type = '测试类型'; $lang->testtask->build = '版本'; $lang->testtask->owner = '负责人'; $lang->testtask->executor = '执行人'; @@ -196,3 +197,9 @@ $lang->testtask->unitTag['thisWeek'] = '本周'; $lang->testtask->unitTag['lastWeek'] = '上周'; $lang->testtask->unitTag['thisMonth'] = '本月'; $lang->testtask->unitTag['lastMonth'] = '上月'; + +$lang->testtask->typeList['integrate'] = '集成测试'; +$lang->testtask->typeList['system'] = '系统测试'; +$lang->testtask->typeList['acceptance'] = '验收测试'; +$lang->testtask->typeList['performance'] = '性能测试'; +$lang->testtask->typeList['safety'] = '安全测试'; diff --git a/module/testtask/lang/zh-tw.php b/module/testtask/lang/zh-tw.php index d33811642e..0642b1dab4 100644 --- a/module/testtask/lang/zh-tw.php +++ b/module/testtask/lang/zh-tw.php @@ -62,6 +62,7 @@ $lang->testtask->common = '測試單'; $lang->testtask->product = '所屬' . $lang->productCommon; $lang->testtask->project = '所屬項目'; $lang->testtask->execution = '所屬' . $lang->execution->common; +$lang->testtask->type = '測試類型'; $lang->testtask->build = '版本'; $lang->testtask->owner = '負責人'; $lang->testtask->executor = '執行人'; @@ -196,3 +197,9 @@ $lang->testtask->unitTag['thisWeek'] = '本週'; $lang->testtask->unitTag['lastWeek'] = '上周'; $lang->testtask->unitTag['thisMonth'] = '本月'; $lang->testtask->unitTag['lastMonth'] = '上月'; + +$lang->testtask->typeList['integrate'] = '集成測試'; +$lang->testtask->typeList['system'] = '系統測試'; +$lang->testtask->typeList['acceptance'] = '接受度測試'; +$lang->testtask->typeList['performance'] = '性能測試'; +$lang->testtask->typeList['safety'] = '安全測試'; diff --git a/module/testtask/model.php b/module/testtask/model.php index 02109736cc..aa7c293c6f 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -33,7 +33,8 @@ class testtaskModel extends model ->setIF($this->config->systemMode == 'new', 'project', $projectID) ->stripTags($this->config->testtask->editor->create['id'], $this->config->allowedTags) ->join('mailto', ',') - ->remove('uid,contactListMenu') + ->join('type', ',') + ->remove('files,labels,uid,contactListMenu') ->get(); $task = $this->loadModel('file')->processImgURL($task, $this->config->testtask->editor->create['id'], $this->post->uid); @@ -49,6 +50,7 @@ class testtaskModel extends model { $taskID = $this->dao->lastInsertID(); $this->file->updateObjectID($this->post->uid, $taskID, 'testtask'); + $this->file->saveUpload('testtask', $taskID); return $taskID; } } @@ -267,6 +269,7 @@ class testtaskModel extends model $task = $this->loadModel('file')->replaceImgURL($task, 'desc'); if($setImgSize) $task->desc = $this->loadModel('file')->setImgSize($task->desc); + $task->files = $this->loadModel('file')->getByObject('testtask', $task->id); return $task; } @@ -730,7 +733,7 @@ class testtaskModel extends model public function update($taskID) { $oldTask = $this->dao->select("*")->from(TABLE_TESTTASK)->where('id')->eq((int)$taskID)->fetch(); - $task = fixer::input('post')->stripTags($this->config->testtask->editor->edit['id'], $this->config->allowedTags)->join('mailto', ',')->remove('uid,comment,contactListMenu')->get(); + $task = fixer::input('post')->stripTags($this->config->testtask->editor->edit['id'], $this->config->allowedTags)->join('mailto', ',')->join('type', ',')->remove('files,labels,uid,comment,contactListMenu')->get(); $task = $this->loadModel('file')->processImgURL($task, $this->config->testtask->editor->edit['id'], $this->post->uid); $this->dao->update(TABLE_TESTTASK)->data($task) ->autoCheck() @@ -741,6 +744,7 @@ class testtaskModel extends model if(!dao::isError()) { $this->file->updateObjectID($this->post->uid, $taskID, 'testtask'); + $this->file->saveUpload('testtask', $taskID); return common::createChanges($oldTask, $task); } } diff --git a/module/testtask/view/browse.html.php b/module/testtask/view/browse.html.php index c63321b09b..a2beb118cd 100644 --- a/module/testtask/view/browse.html.php +++ b/module/testtask/view/browse.html.php @@ -107,7 +107,7 @@ $status = $this->session->testTaskVersionStatus; common::printIcon('testtask', 'linkCase', "taskID=$task->id&type=all¶m=myQueryID", $task, 'list', 'link'); common::printIcon('testreport', 'browse', "objectID=$task->product&objectType=product&extra=$task->id", $task, 'list','flag'); echo '
'; - common::printIcon('testtask', 'view', "taskID=$task->id", '', 'list', 'list-alt','','iframe',true); + common::printIcon('testtask', 'view', "taskID=$task->id", '', 'list', 'list-alt','','iframe',true, "data-width='90%'"); common::printIcon('testtask', 'edit', "taskID=$task->id", $task, 'list'); if(common::hasPriv('testtask', 'delete', $task)) { diff --git a/module/testtask/view/create.html.php b/module/testtask/view/create.html.php index fd35e0498b..0820726f43 100644 --- a/module/testtask/view/create.html.php +++ b/module/testtask/view/create.html.php @@ -50,6 +50,10 @@
testtask->type;?>testtask->typeList, '', "class='form-control chosen' multiple");?>
testtask->owner;?> @@ -82,6 +86,10 @@ testtask->desc;?>
files;?>fetch('file', 'buildform');?>
testtask->mailto;?> diff --git a/module/testtask/view/edit.html.php b/module/testtask/view/edit.html.php index 05ad141a09..9eeaad1b15 100644 --- a/module/testtask/view/edit.html.php +++ b/module/testtask/view/edit.html.php @@ -39,6 +39,10 @@ build, "class='form-control chosen'");?>
testtask->type;?>testtask->typeList, $task->type, "class='form-control chosen' multiple");?>
testtask->owner;?> @@ -75,6 +79,10 @@ comment;?>
files;?>fetch('file', 'buildform');?>
testtask->mailto;?> diff --git a/module/testtask/view/view.html.php b/module/testtask/view/view.html.php index 20c0914883..a98f1d9a40 100644 --- a/module/testtask/view/view.html.php +++ b/module/testtask/view/view.html.php @@ -33,6 +33,7 @@
testtask->desc;?>
desc) ? $task->desc : $lang->noData;?>
+ fetch('file', 'printFiles', array('files' => $task->files, 'fieldset' => 'true', 'object' => $task));?> report):?>
testtask->report;?>
@@ -97,6 +98,12 @@ ?>
testtask->type;?>
testtask->owner;?> owner);?>