diff --git a/.gitignore b/.gitignore index 93a4a42186..47603db43b 100644 --- a/.gitignore +++ b/.gitignore @@ -12,8 +12,12 @@ tmp/log/* tmp/model/* tmp/cache/* tmp/extension/* +extension/pro/* +extension/biz/* +extension/max/* +extension/xuan/* +extension/custom/* test/data/sql/ -.gitkeep .bak .idea .vscode @@ -27,3 +31,4 @@ composer.lock CodeSniffer.conf test/runtime/* test/www +!/**/.gitkeep diff --git a/Makefile b/Makefile index f60407c075..ddc32cd9ae 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,9 @@ XUANPATH = $(shell head -n 1 XUANPATH) XUANVERSION = $(shell head -n 1 XUANVERSION) XVERSION = $(shell head -n 1 XVERSION) +BUILD_PATH := $(if $(ZENTAO_BUILD_PATH), $(ZENTAO_BUILD_PATH), $(shell pwd)) +RELEASE_PATH := $(if $(ZENTAO_RELEASE_PATH), $(ZENTAO_RELEASE_PATH), $(shell pwd)) + all: pms clean: rm -fr zentaopms @@ -13,6 +16,7 @@ clean: rm -fr *.zip rm -fr build/linux/lampp rm -fr lampp + rm -fr zentaoxx common: mkdir zentaopms cp -fr api zentaopms/ @@ -23,6 +27,7 @@ common: cp -fr framework zentaopms/ cp -fr lib zentaopms/ cp -fr module zentaopms/ + cp -fr extension zentaopms/ cp -fr sdk zentaopms/ cp -fr www zentaopms && rm -fr zentaopms/www/data/ && mkdir -p zentaopms/www/data/upload && mkdir zentaopms/www/data/course mkdir zentaopms/tmp @@ -50,11 +55,11 @@ zentaoxx: #xuanxuan mkdir -p zentaoxx/config/ext mkdir -p zentaoxx/lib - mkdir -p zentaoxx/module + mkdir -p zentaoxx/extension/xuan mkdir -p zentaoxx/framework mkdir -p zentaoxx/db mkdir -p zentaoxx/www - mkdir -p zentaoxx/module/common/ext/model/ + mkdir -p zentaoxx/extension/xuan/common/ext/model/ cd $(XUANPATH); git archive --format=zip --prefix=xuan/ $(XUANVERSION) > xuan.zip mv $(XUANPATH)/xuan.zip . unzip xuan.zip @@ -62,25 +67,25 @@ zentaoxx: cp -r xuan/xxb/lib/phpaes zentaoxx/lib/ cp -r xuan/xxb/framework/xuanxuan.class.php zentaoxx/framework/ cp -r xuan/xxb/db/*.sql zentaoxx/db/ - cp -r xuan/xxb/module/im zentaoxx/module/ - cp -r xuan/xxb/module/client zentaoxx/module/ - cp -r xuan/xxb/module/license zentaoxx/module/ - cp -r xuan/xxb/module/owt zentaoxx/module/ - mkdir -p zentaoxx/module/common/view - cp -r xuan/xxb/module/common/view/header.modal.html.php zentaoxx/module/common/view - cp -r xuan/xxb/module/common/view/marked.html.php zentaoxx/module/common/view - cp -r xuan/xxb/module/common/view/footer.modal.html.php zentaoxx/module/common/view - cp -r xuan/xxb/module/common/view/version.html.php zentaoxx/module/common/view - cp -r xuan/xxb/module/license zentaoxx/module/ + cp -r xuan/xxb/module/im zentaoxx/extension/xuan/ + cp -r xuan/xxb/module/client zentaoxx/extension/xuan/ + cp -r xuan/xxb/module/license zentaoxx/extension/xuan/ + cp -r xuan/xxb/module/owt zentaoxx/extension/xuan/ + mkdir -p zentaoxx/extension/xuan/common/view + cp -r xuan/xxb/module/common/view/header.modal.html.php zentaoxx/extension/xuan/common/view + cp -r xuan/xxb/module/common/view/marked.html.php zentaoxx/extension/xuan/common/view + cp -r xuan/xxb/module/common/view/footer.modal.html.php zentaoxx/extension/xuan/common/view + cp -r xuan/xxb/module/common/view/version.html.php zentaoxx/extension/xuan/common/view + cp -r xuan/xxb/module/license zentaoxx/extension/xuan/ mkdir -p zentaoxx/www/js/ cp -r xuan/xxb/www/js/markedjs zentaoxx/www/js/ cp -r xuan/xxb/www/js/version.js zentaoxx/www/js/ cp -r xuan/xxb/www/x.php zentaoxx/www/ - mkdir zentaoxx/module/action - cp -r xuan/xxb/module/action/ext zentaoxx/module/action + mkdir zentaoxx/extension/xuan/action + cp -r xuan/xxb/module/action/ext zentaoxx/extension/xuan/action cp -r xuan/xxb/config/ext/_1_maps.php zentaoxx/config/ext/ cp -r xuanxuan/config/* zentaoxx/config/ - cp -r xuanxuan/module/* zentaoxx/module/ + cp -r xuanxuan/extension/xuan/* zentaoxx/extension/xuan/ cp -r xuanxuan/www/* zentaoxx/www/ mv zentaoxx/db/ zentaoxx/db_bak mkdir zentaoxx/db/ @@ -88,40 +93,40 @@ zentaoxx: rm -rf zentaoxx/db_bak/ sed -i 's/XXBVERSION/$(XVERSION)/g' zentaoxx/config/ext/_0_xuanxuan.php sed -i "/\$$config->xuanxuan->backend /c\\\$$config->xuanxuan->backend = 'zentao';" zentaoxx/config/ext/_0_xuanxuan.php - sed -i 's/site,//' zentaoxx/module/im/model/user.php - sed -i 's/admin, g/g/' zentaoxx/module/im/model/user.php - sed -i '/password = md5/d' zentaoxx/module/im/model/user.php - sed -i 's/md5(\$$user->password.*$$/\$$user->password;/g' zentaoxx/module/im/model/user.php - sed -i '/getSignedTime/d' zentaoxx/module/im/control.php - sed -i "/loadModel('push')/d" zentaoxx/module/im/control.php - sed -i "/this->push/d" zentaoxx/module/im/control.php - sed -i "s/(int)(microtime/(double)(microtime/" zentaoxx/module/im/control.php - sed -i "s/'yahoo', //g" zentaoxx/module/im/config.php - sed -i "s/'gtalk', //g" zentaoxx/module/im/config.php - sed -i "s/'wangwang', //g" zentaoxx/module/im/config.php - sed -i "s/'site', //g" zentaoxx/module/im/config.php - sed -i "s/'reload'/inlink('browse')/g" zentaoxx/module/client/control.php - sed -i 's/tree/dept/' zentaoxx/module/im/model.php - sed -i 's/tree/dept/' zentaoxx/module/im/control.php + sed -i 's/site,//' zentaoxx/extension/xuan/im/model/user.php + sed -i 's/admin, g/g/' zentaoxx/extension/xuan/im/model/user.php + sed -i '/password = md5/d' zentaoxx/extension/xuan/im/model/user.php + sed -i 's/md5(\$$user->password.*$$/\$$user->password;/g' zentaoxx/extension/xuan/im/model/user.php + sed -i '/getSignedTime/d' zentaoxx/extension/xuan/im/control.php + sed -i "/loadModel('push')/d" zentaoxx/extension/xuan/im/control.php + sed -i "/this->push/d" zentaoxx/extension/xuan/im/control.php + sed -i "s/(int)(microtime/(double)(microtime/" zentaoxx/extension/xuan/im/control.php + sed -i "s/'yahoo', //g" zentaoxx/extension/xuan/im/config.php + sed -i "s/'gtalk', //g" zentaoxx/extension/xuan/im/config.php + sed -i "s/'wangwang', //g" zentaoxx/extension/xuan/im/config.php + sed -i "s/'site', //g" zentaoxx/extension/xuan/im/config.php + sed -i "s/'reload'/inlink('browse')/g" zentaoxx/extension/xuan/client/control.php + sed -i 's/tree/dept/' zentaoxx/extension/xuan/im/model.php + sed -i 's/tree/dept/' zentaoxx/extension/xuan/im/control.php sed -i 's/im_/zt_im_/g' zentaoxx/db/*.sql sed -i 's/xxb_user/zt_user/g' zentaoxx/db/*.sql sed -i 's/xxb_file/zt_file/g' zentaoxx/db/*.sql sed -i '/xxb_entry/d' zentaoxx/db/*.sql sed -i '/deviceToken/d' zentaoxx/db/*.sql sed -i '/deviceType/d' zentaoxx/db/*.sql - sed -i "/fetch('push', 'pushMessage');/d" zentaoxx/module/im/control.php - #sed -i "s/marked\.html\.php';?>/marked\.html\.php';?>\n - maxVersion)):?> + config->edition == 'max'):?>
block->createdRisks;?>
createLink('my', 'contribute', 'mode=risk'), (int)$data['createdRisks']);?>
diff --git a/module/block/view/recentprojectblock.html.php b/module/block/view/recentprojectblock.html.php index 01d4ef74e1..d55e356c80 100644 --- a/module/block/view/recentprojectblock.html.php +++ b/module/block/view/recentprojectblock.html.php @@ -44,13 +44,11 @@
- maxVersion)):?> model === 'waterfall'): ?> project->waterfall; ?> project->scrum; ?> - name);?>
idAB;?> - priAB;?> + pri;?>>priAB;?> bug->product;?> bug->title;?> bug->statusAB;?> diff --git a/module/build/control.php b/module/build/control.php index 7d4ebf4b1e..b4ec04530f 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -217,7 +217,7 @@ class build extends control if(!$build) { if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'code' => 404, 'message' => '404 Not found')); - die(js::error($this->lang->notFound) . js::locate($this->createLink('execution', 'all'))); + return print(js::error($this->lang->notFound) . js::locate($this->createLink('execution', 'all'))); } $this->session->project = $build->project; @@ -306,7 +306,7 @@ class build extends control { if($confirm == 'no') { - die(js::confirm($this->lang->build->confirmDelete, $this->createLink('build', 'delete', "buildID=$buildID&confirm=yes"))); + return print(js::confirm($this->lang->build->confirmDelete, $this->createLink('build', 'delete', "buildID=$buildID&confirm=yes"))); } else { @@ -333,7 +333,7 @@ class build extends control $link = $this->app->tab == 'project' ? $this->createLink('project', 'build', "projectID=$build->project") : $this->createLink('execution', 'build', "executionID=$build->execution"); if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success')); - die(js::locate($link, 'parent')); + return print(js::locate($link, 'parent')); } } @@ -356,21 +356,21 @@ class build extends control { $params = ($type == 'all') ? 'noempty,withbranch' : 'noempty, noterminate, nodone, withbranch'; $builds = $this->build->getBuildPairs($productID, $branch, $params); - if($isJsonView) die(json_encode($builds)); - else die(html::select($varName . '[]', $builds, $build, 'size=4 class=form-control multiple')); + if($isJsonView) return print(json_encode($builds)); + return print(html::select($varName . '[]', $builds, $build, 'size=4 class=form-control multiple')); } if($varName == 'openedBuilds' ) { $builds = $this->build->getBuildPairs($productID, $branch, 'noempty'); - if($isJsonView) die(json_encode($builds)); - else die(html::select($varName . "[$index][]", $builds, $build, 'size=4 class=form-control multiple')); + if($isJsonView) return print(json_encode($builds)); + return print(html::select($varName . "[$index][]", $builds, $build, 'size=4 class=form-control multiple')); } if($varName == 'resolvedBuild') { $params = ($type == 'all') ? 'withbranch' : 'noterminate, nodone, withbranch'; $builds = $this->build->getBuildPairs($productID, $branch, $params); - if($isJsonView) die(json_encode($builds)); - else die(html::select($varName, $builds, $build, "class='form-control'")); + if($isJsonView) return print(json_encode($builds)); + return print(html::select($varName, $builds, $build, "class='form-control'")); } } @@ -396,8 +396,8 @@ class build extends control $params = ($type == 'all') ? 'noempty, withbranch' : 'noempty, noterminate, nodone, withbranch'; $builds = $this->build->getBuildPairs($productID, $branch, $params, $projectID, 'project', $build); - if($isJsonView) die(json_encode($builds)); - die(html::select($varName . '[]', $builds , '', 'size=4 class=form-control multiple')); + if($isJsonView) return print(json_encode($builds)); + return print(html::select($varName . '[]', $builds , '', 'size=4 class=form-control multiple')); } if($varName == 'resolvedBuild') { @@ -405,8 +405,8 @@ class build extends control $params = ($type == 'all') ? 'withbranch' : 'noterminate, nodone, withbranch'; $builds = $this->build->getBuildPairs($productID, $branch, $params, $projectID, 'project', $build); - if($isJsonView) die(json_encode($builds)); - die(html::select($varName, $builds, $build, "class='form-control'")); + if($isJsonView) return print(json_encode($builds)); + return print(html::select($varName, $builds, $build, "class='form-control'")); } } @@ -432,16 +432,16 @@ class build extends control $params = ($type == 'all') ? 'noempty' : 'noempty, noterminate, nodone'; $builds = $this->build->getBuildPairs($productID, $branch, $params, $executionID, 'execution', $build); - if($isJsonView) die(json_encode($builds)); - else die(html::select($varName . '[]', $builds , '', 'size=4 class=form-control multiple')); + if($isJsonView) return print(json_encode($builds)); + return print(html::select($varName . '[]', $builds , '', 'size=4 class=form-control multiple')); } if($varName == 'openedBuilds') { if(empty($executionID)) $this->ajaxGetProductBuilds($productID, $varName, $build, $branch, $index, $type); $builds = $this->build->getBuildPairs($productID, $branch, 'noempty', $executionID, 'execution'); - if($isJsonView) die(json_encode($builds)); - else die(html::select($varName . "[$index][]", $builds , $build, 'size=4 class=form-control multiple')); + if($isJsonView) return print(json_encode($builds)); + return print(html::select($varName . "[$index][]", $builds , $build, 'size=4 class=form-control multiple')); } if($varName == 'resolvedBuild') { @@ -449,13 +449,13 @@ class build extends control $params = ($type == 'all') ? '' : 'noterminate, nodone'; $builds = $this->build->getBuildPairs($productID, $branch, $params, $executionID, 'execution', $build); - if($isJsonView) die(json_encode($builds)); - else die(html::select($varName, $builds, $build, "class='form-control'")); + if($isJsonView) return print(json_encode($builds)); + return print(html::select($varName, $builds, $build, "class='form-control'")); } if($varName == 'testTaskBuild') { $builds = $this->build->getBuildPairs($productID, $branch, 'noempty,notrunk', $executionID, 'execution'); - if($isJsonView) die(json_encode($builds)); + if($isJsonView) return print(json_encode($builds)); if(empty($builds)) { @@ -464,20 +464,20 @@ class build extends control $html = html::a($this->createLink('build', 'create', "executionID=$executionID&productID=$productID&projectID=$projectID", '', $onlybody = true), $this->lang->build->create, '', "data-toggle='modal' data-type='iframe'"); $html .= '  '; $html .= html::a("javascript:loadExecutionBuilds($executionID)", $this->lang->refresh); - die($html); + return print($html); } - die(html::select('build', array('') + $builds, $build, "class='form-control'")); + return print(html::select('build', array('') + $builds, $build, "class='form-control'")); } if($varName == 'dropdownList') { $builds = $this->build->getBuildPairs($productID, $branch, 'noempty,notrunk', $executionID, 'execution'); - if($isJsonView) die(json_encode($builds)); + if($isJsonView) return print(json_encode($builds)); $list = "
"; foreach($builds as $buildID => $buildName) $list .= html::a(inlink('view', "buildID={$buildID}"), $buildName); $list .= '
'; - die($list); + return print($list); } } @@ -498,7 +498,7 @@ class build extends control if(!empty($_POST['stories'])) { $this->build->linkStory($buildID); - die(js::locate(inlink('view', "buildID=$buildID&type=story"), 'parent')); + return print(js::locate(inlink('view', "buildID=$buildID&type=story"), 'parent')); } $this->session->set('storyList', inlink('view', "buildID=$buildID&type=story&link=true¶m=" . helper::safe64Encode("&browseType=$browseType&queryID=$param")), $this->app->tab); @@ -588,7 +588,7 @@ class build extends control } return $this->send($response); } - die(js::reload('parent')); + return print(js::reload('parent')); } /** @@ -601,7 +601,7 @@ class build extends control public function batchUnlinkStory($buildID) { $this->build->batchUnlinkStory($buildID); - die(js::locate($this->createLink('build', 'view', "buildID=$buildID&type=story"), 'parent')); + return print(js::locate($this->createLink('build', 'view', "buildID=$buildID&type=story"), 'parent')); } /** @@ -621,7 +621,7 @@ class build extends control if(!empty($_POST['bugs'])) { $this->build->linkBug($buildID); - die(js::locate(inlink('view', "buildID=$buildID&type=bug"), 'parent')); + return print(js::locate(inlink('view', "buildID=$buildID&type=bug"), 'parent')); } $this->session->set('bugList', inlink('view', "buildID=$buildID&type=bug&link=true¶m=" . helper::safe64Encode("&browseType=$browseType&queryID=$param")), 'qa'); @@ -711,7 +711,7 @@ class build extends control } return $this->send($response); } - die(js::reload('parent')); + return print(js::reload('parent')); } /** @@ -724,6 +724,6 @@ class build extends control public function batchUnlinkBug($buildID) { $this->build->batchUnlinkBug($buildID); - die(js::locate($this->createLink('build', 'view', "buildID=$buildID&type=bug"), 'parent')); + return print(js::locate($this->createLink('build', 'view', "buildID=$buildID&type=bug"), 'parent')); } } diff --git a/module/build/view/linkbug.html.php b/module/build/view/linkbug.html.php index b4364e65d8..bdd39c2c5a 100644 --- a/module/build/view/linkbug.html.php +++ b/module/build/view/linkbug.html.php @@ -27,7 +27,7 @@ idAB;?> - priAB;?> + pri;?>> priAB;?> bug->title;?> openedByAB;?> bug->resolvedBy;?> diff --git a/module/build/view/linkstory.html.php b/module/build/view/linkstory.html.php index 3ce47e1e51..d874361a28 100644 --- a/module/build/view/linkstory.html.php +++ b/module/build/view/linkstory.html.php @@ -27,7 +27,7 @@ idAB;?> - priAB;?> + pri;?>>priAB;?> story->title;?> openedByAB;?> assignedToAB;?> diff --git a/module/build/view/view.html.php b/module/build/view/view.html.php index d10b01c3e0..101bd6b0fb 100644 --- a/module/build/view/view.html.php +++ b/module/build/view/view.html.php @@ -89,7 +89,7 @@ tbody tr td:first-child input {display: none;} idAB);?> - priAB);?> + pri;?>>priAB);?> story->title);?> openedByAB);?> story->estimateAB);?> @@ -244,7 +244,7 @@ tbody tr td:first-child input {display: none;} idAB);?> - bug->severityAB);?> + bug->severity;?>>bug->severityAB);?> bug->title);?> bug->status);?> openedByAB);?> diff --git a/module/caselib/control.php b/module/caselib/control.php index 8aae891edf..586b756ccb 100644 --- a/module/caselib/control.php +++ b/module/caselib/control.php @@ -124,7 +124,7 @@ class caselib extends control { if($confirm == 'no') { - die(js::confirm($this->lang->caselib->libraryDelete, inlink('delete', "libID=$libID&confirm=yes"))); + return print(js::confirm($this->lang->caselib->libraryDelete, inlink('delete', "libID=$libID&confirm=yes"))); } else { @@ -147,7 +147,7 @@ class caselib extends control } return $this->send($response); } - die(js::reload('parent')); + return print(js::reload('parent')); } } @@ -252,20 +252,20 @@ class caselib extends control $this->config->testcase->create->requiredFields = $this->config->caselib->createcase->requiredFields; setcookie('lastLibCaseModule', (int)$this->post->module, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, false); $caseResult = $this->testcase->create($bugID = 0); - if(!$caseResult or dao::isError()) die(js::error(dao::getError())); + if(!$caseResult or dao::isError()) return print(js::error(dao::getError())); $caseID = $caseResult['id']; if($caseResult['status'] == 'exists') { echo js::alert(sprintf($this->lang->duplicate, $this->lang->testcase->common)); - die(js::locate($this->createLink('testcase', 'view', "caseID=$caseID"), 'parent')); + return print(js::locate($this->createLink('testcase', 'view', "caseID=$caseID"), 'parent')); } $this->loadModel('action')->create('case', $caseID, 'Opened'); /* If link from no head then reload. */ - if(isonlybody()) die(js::reload('parent')); - die(js::locate($this->createLink('caselib', 'browse', "libID={$libID}&browseType=byModule¶m={$_POST['module']}"), 'parent')); + if(isonlybody()) return print(js::reload('parent')); + return print(js::locate($this->createLink('caselib', 'browse', "libID={$libID}&browseType=byModule¶m={$_POST['module']}"), 'parent')); } /* Set lib menu. */ $libraries = $this->caselib->getLibraries(); @@ -340,9 +340,9 @@ class caselib extends control if(!empty($_POST)) { $caseID = $this->caselib->batchCreateCase($libID); - if(dao::isError()) die(js::error(dao::getError())); - if(isonlybody()) die(js::closeModal('parent.parent', 'this')); - die(js::locate($this->createLink('caselib', 'browse', "libID=$libID&browseType=byModule¶m=$moduleID"), 'parent')); + if(dao::isError()) return print(js::error(dao::getError())); + if(isonlybody()) return print(js::closeModal('parent.parent', 'this')); + return print(js::locate($this->createLink('caselib', 'browse', "libID=$libID&browseType=byModule¶m=$moduleID"), 'parent')); } $libraries = $this->caselib->getLibraries(); @@ -378,7 +378,7 @@ class caselib extends control { $libID = (int)$libID; $lib = $this->caselib->getById($libID, true); - if(!isset($lib->id)) die(js::error($this->lang->notFound) . js::locate($this->createLink('qa', 'index'))); + if(!isset($lib->id)) return print(js::error($this->lang->notFound) . js::locate($this->createLink('qa', 'index'))); /* Set lib menu. */ $libraries = $this->caselib->getLibraries(); @@ -555,12 +555,12 @@ class caselib extends control if(!isset($fields[$title])) continue; $columnKey[] = $fields[$title]; } - if(count($columnKey) != count($header)) die(js::alert($this->lang->testcase->errorEncode)); + if(count($columnKey) != count($header)) return print(js::alert($this->lang->testcase->errorEncode)); } $this->session->set('fileImport', $fileName); - die(js::locate(inlink('showImport', "libID=$libID"), 'parent.parent')); + return print(js::locate(inlink('showImport', "libID=$libID"), 'parent.parent')); } $this->display(); } @@ -589,11 +589,11 @@ class caselib extends control if($this->post->isEndPage) { unlink($tmpFile); - die(js::locate(inlink('browse', "libID=$libID"), 'parent')); + return print(js::locate(inlink('browse', "libID=$libID"), 'parent')); } else { - die(js::locate(inlink('showImport', "libID=$libID&pagerID=" . ($this->post->pagerID + 1) . "&maxImport=$maxImport&insert=" . zget($_POST, 'insert', '')), 'parent')); + return print(js::locate(inlink('showImport', "libID=$libID&pagerID=" . ($this->post->pagerID + 1) . "&maxImport=$maxImport&insert=" . zget($_POST, 'insert', '')), 'parent')); } } @@ -759,7 +759,7 @@ class caselib extends control unlink($this->session->fileImport); unset($_SESSION['fileImport']); echo js::alert($this->lang->error->noData); - die(js::locate($this->createLink('caselib', 'browse', "libID=$libID"))); + return print(js::locate($this->createLink('caselib', 'browse', "libID=$libID"))); } $allCount = count($caseData); @@ -771,13 +771,13 @@ class caselib extends control $this->view->allCount = $allCount; $this->view->maxImport = $maxImport; $this->view->libID = $libID; - die($this->display()); + return print($this->display()); } $allPager = ceil($allCount / $maxImport); $caseData = array_slice($caseData, ($pagerID - 1) * $maxImport, $maxImport, true); } - if(empty($caseData)) die(js::locate(inlink('browse', "libID=$libID"))); + if(empty($caseData)) return print(js::locate(inlink('browse', "libID=$libID"))); /* Judge whether the items is too large and set session. */ $countInputVars = count($caseData) * 9 + (isset($stepVars) ? $stepVars : 0); diff --git a/module/caselib/model.php b/module/caselib/model.php index 89ed3045e2..c7f3d043ba 100644 --- a/module/caselib/model.php +++ b/module/caselib/model.php @@ -389,7 +389,7 @@ class caselibModel extends model $cases[$key] = $caseData; $line++; } - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); $forceNotReview = $this->testcase->forceNotReview(); foreach($cases as $key => $caseData) @@ -537,7 +537,7 @@ class caselibModel extends model foreach($cases->title as $i => $title) { - if(!empty($cases->title[$i]) and empty($cases->type[$i])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->testcase->type))); + if(!empty($cases->title[$i]) and empty($cases->type[$i])) return print(js::alert(sprintf($this->lang->error->notempty, $this->lang->testcase->type))); } $module = 0; @@ -582,7 +582,7 @@ class caselibModel extends model if(dao::isError()) { echo js::error(dao::getError()); - die(js::reload('parent')); + return print(js::reload('parent')); } $caseID = $this->dao->lastInsertID(); diff --git a/module/caselib/view/browse.html.php b/module/caselib/view/browse.html.php index e4e94f5217..5fc8f8174d 100644 --- a/module/caselib/view/browse.html.php +++ b/module/caselib/view/browse.html.php @@ -124,7 +124,7 @@ js::set('flow', $config->global->flow); idAB);?> - priAB);?> + pri;?>>priAB);?> testcase->title);?> typeAB);?> openedByAB);?> diff --git a/module/common/lang/common.php b/module/common/lang/common.php index 84ae09cae3..38d73ae72d 100644 --- a/module/common/lang/common.php +++ b/module/common/lang/common.php @@ -174,7 +174,6 @@ $lang->createIcons['program'] = 'program'; $lang->createIcons['kanbanspace'] = 'cube'; $lang->createIcons['kanban'] = 'kanban'; - $lang->noMenuModule = array('report', 'my', 'todo', 'effort', 'program', 'product', 'execution', 'task', 'build', 'productplan', 'project', 'projectrelease', 'projectstory', 'story', 'branch', 'release', 'attend', 'leave', 'makeup', 'overtime', 'lieu', 'custom', 'admin', 'mail', 'extension', 'dev', 'backup', 'action', 'cron', 'pssp', 'sms', 'message', 'webhook', 'search', 'score', 'stage', 'entry', 'jenkins', 'gitlab'); if(isset($_SESSION['tutorialMode']) and $_SESSION['tutorialMode'] and !defined('TUTORIAL')) define('TUTORIAL', true); diff --git a/module/common/lang/en.php b/module/common/lang/en.php index e6fdabf436..6a7f7e9bad 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -88,6 +88,7 @@ $lang->history = 'History'; $lang->attatch = 'Files'; $lang->reverse = 'Inverse'; $lang->switchDisplay = 'Toggle'; +$lang->switchTo = 'Switch To'; $lang->expand = 'Expand'; $lang->collapse = 'Collapse'; $lang->saveSuccess = 'Saved'; @@ -145,6 +146,9 @@ $lang->assignedToAB = 'AssignedTo'; $lang->typeAB = 'Type'; $lang->nameAB = 'Name'; +$lang->pri = 'Priority'; +$lang->delayed = 'Delayed'; + $lang->common->common = 'Common Module'; $lang->my->common = 'My'; $lang->program->common = 'Program'; @@ -319,6 +323,10 @@ $lang->exportFileTypeList['html'] = 'html'; $lang->exportTypeList['all'] = 'All Data'; $lang->exportTypeList['selected'] = 'Selected Data'; +$lang->visionList = array(); +$lang->visionList['rnd'] = 'R&D'; +$lang->visionList['lite'] = 'Lite'; + $lang->createObjects['todo'] = 'Todo'; $lang->createObjects['effort'] = 'Effort'; $lang->createObjects['bug'] = 'Bug'; diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index 2bd0ba479d..4e56bd276a 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -88,6 +88,7 @@ $lang->history = '历史记录'; $lang->attatch = '附件'; $lang->reverse = '切换顺序'; $lang->switchDisplay = '切换显示'; +$lang->switchTo = '切换到'; $lang->expand = '展开全部'; $lang->collapse = '收起'; $lang->saveSuccess = '保存成功'; @@ -145,6 +146,9 @@ $lang->assignedToAB = '指派'; $lang->typeAB = '类型'; $lang->nameAB = '名称'; +$lang->pri = '优先级'; +$lang->delayed = '已延期'; + $lang->common->common = '公有模块'; $lang->my->common = '地盘'; $lang->program->common = '项目集'; @@ -319,6 +323,10 @@ $lang->exportFileTypeList['html'] = 'html'; $lang->exportTypeList['all'] = '全部记录'; $lang->exportTypeList['selected'] = '选中记录'; +$lang->visionList = array(); +$lang->visionList['rnd'] = '研发综合界面'; +$lang->visionList['lite'] = '迅捷界面'; + $lang->createObjects['todo'] = '待办'; $lang->createObjects['effort'] = '日志'; $lang->createObjects['bug'] = 'Bug'; diff --git a/module/common/model.php b/module/common/model.php index 4a70f7907c..0694bbb2bf 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -31,7 +31,7 @@ class commonModel extends model $this->loadConfigFromDB(); $this->app->setTimezone(); $this->loadCustomFromDB(); - if(!$this->checkIP()) die($this->lang->ipLimited); + if(!$this->checkIP()) return print($this->lang->ipLimited); $this->app->loadLang('company'); } } @@ -259,7 +259,7 @@ class commonModel extends model { /* Get configs of system and current user. */ $account = isset($this->app->user->account) ? $this->app->user->account : ''; - if($this->config->db->name) $config = $this->loadModel('setting')->getSysAndPersonalConfig($account); + if($this->config->db->name) $config = $this->loadModel('setting')->getSysAndPersonalConfig($account); $this->config->system = isset($config['system']) ? $config['system'] : array(); $this->config->personal = isset($config[$account]) ? $config[$account] : array(); @@ -359,7 +359,7 @@ class commonModel extends model { echo js::locate($denyLink); } - exit; + helper::end(); } /** @@ -393,9 +393,6 @@ class commonModel extends model { $isGuest = $app->user->account == 'guest'; - echo ""; - echo html::avatar($app->user); - echo ''; echo "'; + + echo ""; + echo html::avatar($app->user); + echo ''; + } + } + + /** + * Print vision switcher. + * + * @static + * @access public + * @return void + */ + public static function printVisionSwitcher() + { + global $lang, $app; + + if(isset($app->user)) + { + $currentVision = $app->config->vision; + $userVisions = array_filter(explode(',', $app->user->visions)); + if(count($userVisions) < 2) return print("
{$lang->visionList[$currentVision]}
"); + + echo "'; + + echo ""; + echo "
{$lang->visionList[$currentVision]}
"; + echo '
'; } } @@ -467,9 +506,7 @@ class commonModel extends model { global $app, $config, $lang; - $html = ""; - $html .= ""; - $html .= "
user->passwordStrengthList)?> diff --git a/module/story/view/batchedit.html.php b/module/story/view/batchedit.html.php index 09f99ddc88..4dc2268e8a 100644 --- a/module/story/view/batchedit.html.php +++ b/module/story/view/batchedit.html.php @@ -50,7 +50,7 @@ foreach(explode(',', $showFields) as $field) story->title;?> '> story->estimateAB;?> story->category;?> - '> priAB;?> + ' title=story->pri;?>> priAB;?> '> story->assignedTo;?> '> story->source;?> '> story->sourceNote;?> diff --git a/module/story/view/bugs.html.php b/module/story/view/bugs.html.php index 9edbb6ed71..8101b47228 100644 --- a/module/story/view/bugs.html.php +++ b/module/story/view/bugs.html.php @@ -12,7 +12,7 @@ idAB;?> bug->title;?> - priAB;?> + story->pri;?>>priAB;?> bug->type;?> statusAB;?> bug->assignedTo;?> diff --git a/module/story/view/cases.html.php b/module/story/view/cases.html.php index 154e24dcf9..d36a419aef 100644 --- a/module/story/view/cases.html.php +++ b/module/story/view/cases.html.php @@ -12,7 +12,7 @@ idAB;?> testcase->title;?> - priAB;?> + story->pri;?>>priAB;?> testcase->type;?> statusAB;?> testcase->lastRunner;?> diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index 5fa2732c73..b09be2c579 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -146,12 +146,25 @@ - config->URAndSR):?> + + config->URAndSR):?> story->requirement;?> - + + +
+
story->parent;?>
+ +
+ + + + + story->parent;?> + + story->title;?> diff --git a/module/story/view/linkstory.html.php b/module/story/view/linkstory.html.php index 0260e58510..3c9d8effda 100644 --- a/module/story/view/linkstory.html.php +++ b/module/story/view/linkstory.html.php @@ -35,7 +35,7 @@
idAB;?> - priAB;?> + story->pri;?>>priAB;?> story->title;?> story->status;?> type == 'requirement'):?> diff --git a/module/story/view/tasks.html.php b/module/story/view/tasks.html.php index 64ef8d78a9..8f6d580a05 100644 --- a/module/story/view/tasks.html.php +++ b/module/story/view/tasks.html.php @@ -15,7 +15,7 @@ include '../../common/view/chart.html.php'; idAB;?> task->name;?> - priAB;?> + story->pri;?>>priAB;?> statusAB;?> task->assignedToAB;?> task->estimateAB;?> diff --git a/module/story/view/track.html.php b/module/story/view/track.html.php index 2ab44014d9..bde9c55a86 100644 --- a/module/story/view/track.html.php +++ b/module/story/view/track.html.php @@ -42,11 +42,11 @@ story->story;?> story->tasks;?> - maxVersion)):?> + edition == 'max'):?> story->design;?> story->case;?> - maxVersion)):?> + edition == 'max'):?> story->repoCommit;?> story->bug;?> @@ -78,7 +78,7 @@ createLink('task', 'view', "taskID=$taskID"), $task->name, '', "title='$task->name'") . '
';?> - maxVersion)):?> + edition == 'max'):?> designs as $designID => $design):?> createLink('design', 'view', "designID=$designID"), $design->name, '', "title='$design->name'") . '
';?> @@ -90,7 +90,7 @@ createLink('testcase', 'view', "caseID=$caseID"), $case->title, '', "title='$case->title'") . '
';?> - maxVersion)):?> + edition == 'max'):?> revisions as $revision => $repoID):?> story->id;?> - priAB;?> + story->pri;?>>priAB;?> story->title;?> story->assignedTo;?> story->estimate;?> @@ -215,7 +215,7 @@ common::printIcon('story', 'assignTo', "storyID=$story->id", $story, 'button', '', '', 'iframe showinonlybody', true); common::printIcon('story', 'close', "storyID=$story->id", $story, 'button', '', '', 'iframe showinonlybody', true); common::printIcon('story', 'activate', "storyID=$story->id", $story, 'button', '', '', 'iframe showinonlybody', true); - if(isset($this->config->maxVersion) and $this->app->tab == 'project' and common::hasPriv('story', 'importToLib')) echo html::a('#importToLib', " " . $this->lang->story->importToLib, '', 'class="btn" data-toggle="modal"'); + if($this->config->edition == 'max' and $this->app->tab == 'project' and common::hasPriv('story', 'importToLib')) echo html::a('#importToLib', " " . $this->lang->story->importToLib, '', 'class="btn" data-toggle="modal"'); if($story->parent >= 0 and $story->type != 'requirement' and (common::hasPriv('testcase', 'create', $story) or common::hasPriv('testcase', 'batchCreate', $story))) { diff --git a/module/story/view/zerocase.html.php b/module/story/view/zerocase.html.php index e90d63132c..9694f36be8 100644 --- a/module/story/view/zerocase.html.php +++ b/module/story/view/zerocase.html.php @@ -33,7 +33,7 @@
idAB);?> - priAB);?> + story->pri;?>>priAB);?> story->title);?> story->planAB);?> story->source);?> diff --git a/module/svn/control.php b/module/svn/control.php index 2ffa0bab50..0cd0cc92a3 100644 --- a/module/svn/control.php +++ b/module/svn/control.php @@ -124,8 +124,7 @@ class svn extends control $parsedObjects['tasks'] = array_unique($parsedObjects['tasks']); $parsedObjects['bugs'] = array_unique($parsedObjects['bugs']); $this->view->parsedObjects = $parsedObjects; - $this->display(); - exit; + return $this->display(); } } @@ -144,7 +143,7 @@ class svn extends control $files = $this->post->files; /* Ignore git. */ - if(strpos($repoUrl, '://') === false) die(); + if(strpos($repoUrl, '://') === false) return; $parsedFiles = array(); $repoDirs = explode('/', trim($repoUrl, '/')); @@ -182,7 +181,6 @@ class svn extends control $log->files = $parsedFiles; $this->repo->saveAction2PMS($objects, $log, $repoUrl); } - die(); } /** @@ -194,6 +192,6 @@ class svn extends control public function ajaxGetRepos() { $repos = $this->svn->getRepos(); - die(json_encode($repos)); + echo json_encode($repos); } } diff --git a/module/task/config.php b/module/task/config.php index 17bb90c08f..b21af79708 100644 --- a/module/task/config.php +++ b/module/task/config.php @@ -60,6 +60,7 @@ $config->task->datatable->fieldList['pri']['title'] = 'priAB'; $config->task->datatable->fieldList['pri']['fixed'] = 'left'; $config->task->datatable->fieldList['pri']['width'] = '50'; $config->task->datatable->fieldList['pri']['required'] = 'no'; +$config->task->datatable->fieldList['pri']['name'] = $lang->task->pri; $config->task->datatable->fieldList['name']['title'] = 'name'; $config->task->datatable->fieldList['name']['fixed'] = 'left'; @@ -189,6 +190,11 @@ $config->task->datatable->fieldList['lastEditedDate']['fixed'] = 'no'; $config->task->datatable->fieldList['lastEditedDate']['width'] = '120'; $config->task->datatable->fieldList['lastEditedDate']['required'] = 'no'; +$config->task->datatable->fieldList['activatedDate']['title'] = 'activatedDate'; +$config->task->datatable->fieldList['activatedDate']['fixed'] = 'no'; +$config->task->datatable->fieldList['activatedDate']['width'] = '90'; +$config->task->datatable->fieldList['activatedDate']['required'] = 'no'; + $config->task->datatable->fieldList['actions']['title'] = 'actions'; $config->task->datatable->fieldList['actions']['fixed'] = 'right'; $config->task->datatable->fieldList['actions']['width'] = '180'; diff --git a/module/task/control.php b/module/task/control.php index cc8865b957..3a077b1610 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -53,7 +53,7 @@ class task extends control if(strpos(",{$limitedExecutions},", ",$executionID,") !== false) { echo js::alert($this->lang->task->createDenied); - die(js::locate($this->createLink('execution', 'task', "executionID=$executionID"))); + return print(js::locate($this->createLink('execution', 'task', "executionID=$executionID"))); } $task = new stdClass(); @@ -219,6 +219,8 @@ class task extends control } $stories = $this->story->getExecutionStoryPairs($executionID, 0, 'all', $moduleIdList, 'full', 'unclosed'); + if($this->config->vision == 'lite') $stories = $stories + array('', ''); + /* Get block id of assinge to me. */ $blockID = 0; if(isonlybody()) @@ -236,6 +238,8 @@ class task extends control $position[] = $this->lang->task->common; $position[] = $this->lang->task->create; + $projectID = $execution ? $execution->project : 0; + /* Set Custom*/ foreach(explode(',', $this->config->task->customCreateFields) as $field) $customFields[$field] = $this->lang->task->$field; if($execution->type == 'ops') unset($customFields['story']); @@ -248,7 +252,7 @@ class task extends control $this->view->position = $position; $this->view->gobackLink = (isset($output['from']) and $output['from'] == 'global') ? $this->createLink('execution', 'task', "executionID=$executionID") : ''; $this->view->execution = $execution; - $this->view->executions = $this->config->systemMode == 'classic' ? $executions : $this->execution->getByProject(0, 'undone', 0, true); + $this->view->executions = $this->config->systemMode == 'classic' ? $executions : $this->execution->getByProject($projectID, 'undone', 0, true); $this->view->task = $task; $this->view->users = $users; $this->view->storyID = $storyID; @@ -280,7 +284,7 @@ class task extends control if(strpos(",{$limitedExecutions},", ",$executionID,") !== false) { echo js::alert($this->lang->task->createDenied); - die(js::locate($this->createLink('execution', 'task', "executionID=$executionID"))); + return print(js::locate($this->createLink('execution', 'task', "executionID=$executionID"))); } $execution = $this->execution->getById($executionID); @@ -445,7 +449,7 @@ class task extends control { $confirmURL = $this->createLink('bug', 'view', "id=$task->fromBug"); $cancelURL = $this->server->HTTP_REFERER; - die(js::confirm(sprintf($this->lang->task->remindBug, $task->fromBug), $confirmURL, $cancelURL, 'parent', 'parent')); + return print(js::confirm(sprintf($this->lang->task->remindBug, $task->fromBug), $confirmURL, $cancelURL, 'parent', 'parent')); } } } @@ -472,7 +476,7 @@ class task extends control } else { - die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); + return print(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); } } @@ -521,7 +525,7 @@ class task extends control if($this->post->names) { $allChanges = $this->task->batchUpdate(); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if(!empty($allChanges)) { @@ -556,7 +560,7 @@ class task extends control { $confirmURL = $this->createLink('bug', 'view', "id=$task->fromBug"); $cancelURL = $this->server->HTTP_REFERER; - die(js::confirm(sprintf($this->lang->task->remindBug, $task->fromBug), $confirmURL, $cancelURL, 'parent', 'parent')); + return print(js::confirm(sprintf($this->lang->task->remindBug, $task->fromBug), $confirmURL, $cancelURL, 'parent', 'parent')); } } } @@ -564,11 +568,12 @@ class task extends control } } $this->loadModel('score')->create('ajax', 'batchOther'); - die(js::locate($this->session->taskList, 'parent')); + return print(js::locate($this->session->taskList, 'parent')); } - $taskIDList = $this->post->taskIDList ? $this->post->taskIDList : die(js::locate($this->session->taskList, 'parent')); - $taskIDList = array_unique($taskIDList); + if(!$this->post->taskIDList) return print(js::locate($this->session->taskList, 'parent')); + + $taskIDList = array_unique($this->post->taskIDList); /* The tasks of execution. */ if($executionID) @@ -654,7 +659,7 @@ class task extends control if(dao::isError()) { if($this->viewType == 'json' or (defined('RUN_MODE') && RUN_MODE == 'api')) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - die(js::error(dao::getError())); + return print(js::error(dao::getError())); } $actionID = $this->action->create('task', $taskID, 'Assigned', $this->post->comment, $this->post->assignedTo); @@ -718,7 +723,7 @@ class task extends control $taskIDList = array_unique($taskIDList); unset($_POST['taskIDList']); $allChanges = $this->task->batchChangeModule($taskIDList, $moduleID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); foreach($allChanges as $taskID => $changes) { $this->loadModel('action'); @@ -727,7 +732,7 @@ class task extends control } if(!dao::isError()) $this->loadModel('score')->create('ajax', 'batchOther'); } - die(js::reload('parent')); + echo js::reload('parent'); } /** @@ -745,7 +750,7 @@ class task extends control $taskIDList = $this->post->taskIDList; $taskIDList = array_unique($taskIDList); unset($_POST['taskIDList']); - if(!is_array($taskIDList)) die(js::locate($this->createLink('execution', 'task', "executionID=$execution"), 'parent')); + if(!is_array($taskIDList)) return print(js::locate($this->createLink('execution', 'task', "executionID=$execution"), 'parent')); $taskIDList = array_unique($taskIDList); $muletipleTasks = $this->dao->select('root , account')->from(TABLE_TEAM)->where('type')->eq('task')->andWhere('root')->in($taskIDList)->fetchGroup('root', 'account'); @@ -757,12 +762,12 @@ class task extends control if(isset($muletipleTasks[$taskID]) and !isset($muletipleTasks[$taskID][$this->post->assignedTo])) continue; $changes = $this->task->assign($taskID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); $actionID = $this->action->create('task', $taskID, 'Assigned', $this->post->comment, $this->post->assignedTo); $this->action->logHistory($actionID, $changes); } if(!dao::isError()) $this->loadModel('score')->create('ajax', 'batchOther'); - die(js::reload('parent')); + return print(js::reload('parent')); } } @@ -777,12 +782,14 @@ class task extends control { $this->session->set('executionList', $this->app->getURI(true), 'execution'); + $this->commonAction($taskID); + $taskID = (int)$taskID; $task = $this->task->getById($taskID, true); if(!$task) { if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'code' => 404, 'message' => '404 Not found')); - die(js::error($this->lang->notFound) . js::locate($this->createLink('execution', 'all'))); + return print(js::error($this->lang->notFound) . js::locate($this->createLink('execution', 'all'))); } $this->session->project = $task->project; @@ -850,7 +857,7 @@ class task extends control $this->executeHooks($taskID); - die(js::reload('parent')); + echo js::reload('parent'); } /** @@ -878,7 +885,7 @@ class task extends control if(dao::isError()) { if($this->viewType == 'json' or (defined('RUN_MODE') && RUN_MODE == 'api')) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - die(js::error(dao::getError())); + return print(js::error(dao::getError())); } if($this->post->comment != '' or !empty($changes)) @@ -901,7 +908,7 @@ class task extends control $confirmURL = $this->createLink('bug', 'view', "id=$task->fromBug"); unset($_GET['onlybody']); $cancelURL = $this->createLink('task', 'view', "taskID=$taskID"); - die(js::confirm(sprintf($this->lang->task->remindBug, $task->fromBug), $confirmURL, $cancelURL, 'parent', 'parent.parent')); + return print(js::confirm(sprintf($this->lang->task->remindBug, $task->fromBug), $confirmURL, $cancelURL, 'parent', 'parent.parent')); } } } @@ -924,7 +931,7 @@ class task extends control return print(js::closeModal('parent.parent', 'this', "function(){parent.parent.location.reload();}")); } } - die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); + return print(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); } $this->view->title = $this->view->execution->name . $this->lang->colon .$this->lang->task->start; @@ -950,7 +957,7 @@ class task extends control if(!empty($_POST)) { $changes = $this->task->recordEstimate($taskID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); $this->loadModel('common')->syncPPEStatus($taskID); @@ -965,7 +972,7 @@ class task extends control $confirmURL = $this->createLink('bug', 'view', "id=$task->fromBug"); unset($_GET['onlybody']); $cancelURL = $this->createLink('task', 'view', "taskID=$taskID"); - die(js::confirm(sprintf($this->lang->task->remindBug, $task->fromBug), $confirmURL, $cancelURL, 'parent', 'parent.parent')); + return print(js::confirm(sprintf($this->lang->task->remindBug, $task->fromBug), $confirmURL, $cancelURL, 'parent', 'parent.parent')); } } } @@ -1010,13 +1017,13 @@ class task extends control if(!empty($_POST)) { $changes = $this->task->updateEstimate($estimateID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); $actionID = $this->loadModel('action')->create('task', $estimate->task, 'EditEstimate', $this->post->work); $this->action->logHistory($actionID, $changes); $url = $this->session->estimateList ? $this->session->estimateList : inlink('record', "taskID={$estimate->task}"); - die(js::locate($url, 'parent')); + return print(js::locate($url, 'parent')); } $estimate = $this->task->getEstimateById($estimateID); @@ -1039,17 +1046,17 @@ class task extends control { if($confirm == 'no') { - die(js::confirm($this->lang->task->confirmDeleteEstimate, $this->createLink('task', 'deleteEstimate', "estimateID=$estimateID&confirm=yes"))); + return print(js::confirm($this->lang->task->confirmDeleteEstimate, $this->createLink('task', 'deleteEstimate', "estimateID=$estimateID&confirm=yes"))); } else { $estimate = $this->task->getEstimateById($estimateID); $changes = $this->task->deleteEstimate($estimateID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); $actionID = $this->loadModel('action')->create('task', $estimate->task, 'DeleteEstimate'); $this->action->logHistory($actionID, $changes); - die(js::reload('parent')); + return print(js::reload('parent')); } } @@ -1075,7 +1082,7 @@ class task extends control if(dao::isError()) { if($this->viewType == 'json' or (defined('RUN_MODE') && RUN_MODE == 'api')) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - die(js::error(dao::getError())); + return print(js::error(dao::getError())); } $files = $this->loadModel('file')->saveUpload('task', $taskID); @@ -1098,7 +1105,7 @@ class task extends control $confirmURL = $this->createLink('bug', 'view', "id=$task->fromBug", '', true); unset($_GET['onlybody']); $cancelURL = $this->createLink('task', 'view', "taskID=$taskID"); - die(js::confirm(sprintf($this->lang->task->remindBug, $task->fromBug), $confirmURL, $cancelURL, 'parent', 'parent.parent')); + return print(js::confirm(sprintf($this->lang->task->remindBug, $task->fromBug), $confirmURL, $cancelURL, 'parent', 'parent.parent')); } } } @@ -1127,7 +1134,7 @@ class task extends control } else { - die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); + return print(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); } } @@ -1180,7 +1187,7 @@ class task extends control { $this->loadModel('action'); $changes = $this->task->pause($taskID, $extra); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($this->post->comment != '' or !empty($changes)) { @@ -1235,7 +1242,7 @@ class task extends control { $this->loadModel('action'); $changes = $this->task->start($taskID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($this->post->comment != '' or !empty($changes)) { @@ -1294,7 +1301,7 @@ class task extends control $this->loadModel('action'); $changes = $this->task->close($taskID, $extra); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($this->post->comment != '' or !empty($changes)) { @@ -1328,7 +1335,7 @@ class task extends control } else { - die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); + return print(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); } } @@ -1371,7 +1378,7 @@ class task extends control } } - die(js::reload('parent')); + echo js::reload('parent'); } /** @@ -1419,11 +1426,12 @@ class task extends control $skipTasks = join(',', $skipTasks); $confirmURL = $this->createLink('task', 'batchClose', "skipTaskIdList=$skipTasks"); $cancelURL = $this->server->HTTP_REFERER; - die(js::confirm(sprintf($this->lang->task->error->skipClose, $skipTasks), $confirmURL, $cancelURL, 'self', 'parent')); + return print(js::confirm(sprintf($this->lang->task->error->skipClose, $skipTasks), $confirmURL, $cancelURL, 'self', 'parent')); } if(!dao::isError()) $this->loadModel('score')->create('ajax', 'batchOther'); } - die(js::reload('parent')); + + echo js::reload('parent'); } /** @@ -1445,7 +1453,7 @@ class task extends control { $this->loadModel('action'); $changes = $this->task->cancel($taskID, $extra); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($this->post->comment != '' or !empty($changes)) { @@ -1472,7 +1480,7 @@ class task extends control return print(js::closeModal('parent.parent', 'this')); } } - die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); + return print(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); } $this->view->title = $this->view->execution->name . $this->lang->colon .$this->lang->task->cancel; @@ -1501,7 +1509,7 @@ class task extends control { $this->loadModel('action'); $changes = $this->task->activate($taskID, $extra); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($this->post->comment != '' or !empty($changes)) { @@ -1603,8 +1611,8 @@ class task extends control if(isset($suspendedTasks[$taskid])) unset($tasks[$taskid]); } - if($id) die(html::select("tasks[$id]", $tasks, '', 'class="form-control"')); - die(html::select('task', $tasks, '', 'class=form-control')); + if($id) return print(html::select("tasks[$id]", $tasks, '', 'class="form-control"')); + echo html::select('task', $tasks, '', 'class=form-control'); } /** @@ -1618,7 +1626,7 @@ class task extends control public function ajaxGetExecutionTasks($executionID, $taskID = 0) { $tasks = $this->task->getExecutionTaskPairs((int)$executionID); - die(html::select('task', empty($tasks) ? array('' => '') : $tasks, $taskID, "class='form-control'")); + echo html::select('task', empty($tasks) ? array('' => '') : $tasks, $taskID, "class='form-control'"); } /** @@ -1912,7 +1920,7 @@ class task extends control } } } - if(isset($this->config->bizVersion)) list($fields, $tasks) = $this->loadModel('workflowfield')->appendDataFromFlow($fields, $tasks); + if($this->config->edition != 'open') list($fields, $tasks) = $this->loadModel('workflowfield')->appendDataFromFlow($fields, $tasks); $this->post->set('fields', $fields); $this->post->set('rows', $tasks); @@ -1959,6 +1967,6 @@ class task extends control $stage = $this->dao->select('*')->from(TABLE_STORY)->where('id')->eq($task->story)->andWhere('version')->eq($task->storyVersion)->fetch('stage'); $task->storyStage = zget($this->lang->story->stageList, $stage); } - die(json_encode($task)); + echo json_encode($task); } } diff --git a/module/task/lang/zh-cn.php b/module/task/lang/zh-cn.php index 4fb358e04c..3b669129b4 100644 --- a/module/task/lang/zh-cn.php +++ b/module/task/lang/zh-cn.php @@ -40,6 +40,7 @@ $lang->task->cancel = "取消"; $lang->task->cancelAction = "取消任务"; $lang->task->activateAction = "激活任务"; $lang->task->activate = "激活"; +$lang->task->activatedDate = "激活日期"; $lang->task->export = "导出数据"; $lang->task->exportAction = "导出任务"; $lang->task->reportChart = "报表统计"; @@ -110,7 +111,6 @@ $lang->task->assignedDate = '指派日期'; $lang->task->openedBy = '由谁创建'; $lang->task->openedDate = '创建日期'; $lang->task->openedDateAB = '创建'; -$lang->task->activatedDate = '激活日期'; $lang->task->finishedBy = '由谁完成'; $lang->task->finishedByAB = '完成者'; $lang->task->finishedDate = '实际完成'; diff --git a/module/task/model.php b/module/task/model.php index fcb6490ce0..db403f24ae 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -64,7 +64,7 @@ class taskModel extends model ->cleanINT('execution,story,module') ->stripTags($this->config->task->editor->create['id'], $this->config->allowedTags) ->join('mailto', ',') - ->remove('after,files,labels,assignedTo,uid,storyEstimate,storyDesc,storyPri,team,teamEstimate,teamMember,multiple,teams,contactListMenu,selectTestStory,testStory,testPri,testEstStarted,testDeadline,testAssignedTo,testEstimate,sync') + ->remove('after,files,labels,assignedTo,uid,storyEstimate,storyDesc,storyPri,team,teamEstimate,teamMember,multiple,teams,contactListMenu,selectTestStory,testStory,testPri,testEstStarted,testDeadline,testAssignedTo,testEstimate,sync,otherLane,region') ->add('version', 1) ->get(); @@ -247,6 +247,13 @@ class taskModel extends model $preStory = 0; $tasks = fixer::input('post')->get(); + if($this->config->vision == 'lite') + { + $lanes = $tasks->lane; + $columns = $tasks->column; + unset($tasks->lane); + unset($tasks->column); + } $extra = str_replace(array(',', ' '), array('&', ''), $extra); parse_str($extra, $output); @@ -319,6 +326,7 @@ class taskModel extends model $data[$i]->openedBy = $this->app->user->account; $data[$i]->openedDate = $now; $data[$i]->parent = $tasks->parent[$i]; + $data[$i]->vision = isset($tasks->vision[$i]) ? $tasks->vision[$i] : 'common'; if($story) $data[$i]->storyVersion = $this->loadModel('story')->getVersion($data[$i]->story); if($assignedTo) $data[$i]->assignedDate = $now; if(strpos($this->config->task->create->requiredFields, 'estStarted') !== false and empty($estStarted)) $data[$i]->estStarted = ''; @@ -404,7 +412,14 @@ class taskModel extends model $this->executeHooks($taskID); - if(isset($output['laneID']) and isset($output['columnID'])) $this->kanban->addKanbanCell($executionID, $output['laneID'], $output['columnID'], 'task', $taskID); + if($this->config->vision == 'lite') + { + $this->kanban->addKanbanCell($executionID, $lanes[$i], $columns[$i], 'task', $taskID); + } + else + { + if(isset($output['laneID']) and isset($output['columnID'])) $this->kanban->addKanbanCell($executionID, $output['laneID'], $output['columnID'], 'task', $taskID); + } $actionID = $this->action->create('task', $taskID, 'Opened', ''); if(!dao::isError()) $this->loadModel('score')->create('task', 'create', $taskID); @@ -458,7 +473,7 @@ class taskModel extends model if(!empty($changes)) $this->action->logHistory($actionID, $changes); } - if(!isset($output['laneID']) or !isset($output['columnID'])) $this->kanban->updateLane($executionID, 'task'); + if(!isset($output['laneID']) or !isset($output['columnID']) or !isset($lanes)) $this->kanban->updateLane($executionID, 'task'); return $mails; } @@ -851,7 +866,7 @@ class taskModel extends model { $taskConsumed = 0; $taskConsumed = $this->dao->select('consumed')->from(TABLE_TASK)->where('id')->eq($this->post->parent)->andWhere('parent')->eq(0)->fetch('consumed'); - if($taskConsumed > 0) die(js::error($this->lang->task->error->alreadyConsumed)); + if($taskConsumed > 0) return print(js::error($this->lang->task->error->alreadyConsumed)); } $now = helper::now(); @@ -900,7 +915,7 @@ class taskModel extends model ->remove('comment,files,labels,uid,multiple,team,teamEstimate,teamConsumed,teamLeft,contactListMenu') ->get(); - if($task->consumed < $oldTask->consumed) die(js::error($this->lang->task->error->consumedSmall)); + if($task->consumed < $oldTask->consumed) return print(js::error($this->lang->task->error->consumedSmall)); /* Fix bug#1388, Check children task executionID and moduleID. */ if(isset($task->execution) and $task->execution != $oldTask->execution) @@ -1151,7 +1166,7 @@ class taskModel extends model $task->{$extendField->field} = htmlSpecialString($task->{$extendField->field}); $message = $this->checkFlowRule($extendField, $task->{$extendField->field}); - if($message) die(js::alert($message)); + if($message) return print(js::alert($message)); } if($data->consumeds[$taskID]) @@ -1230,9 +1245,9 @@ class taskModel extends model /* Check field not empty. */ foreach($tasks as $taskID => $task) { - if($task->status == 'done' and $task->consumed == false) die(js::error('task#' . $taskID . sprintf($this->lang->error->notempty, $this->lang->task->consumedThisTime))); + if($task->status == 'done' and $task->consumed == false) return print(js::error('task#' . $taskID . sprintf($this->lang->error->notempty, $this->lang->task->consumedThisTime))); if($task->status == 'cancel') continue; - if(!empty($task->deadline) and $task->estStarted > $task->deadline) die(js::error('task#' . $taskID . $this->lang->task->error->deadlineSmall)); + if(!empty($task->deadline) and $task->estStarted > $task->deadline) return print(js::error('task#' . $taskID . $this->lang->task->error->deadlineSmall)); foreach(explode(',', $this->config->task->edit->requiredFields) as $field) { $field = trim($field); @@ -1300,7 +1315,7 @@ class taskModel extends model } else { - die(js::error('task#' . $taskID . dao::getError(true))); + return print(js::error('task#' . $taskID . dao::getError(true))); } } if(!dao::isError()) $this->loadModel('score')->create('ajax', 'batchEdit'); @@ -1518,8 +1533,8 @@ class taskModel extends model if(!empty($record->work[$id]) or !empty($record->consumed[$id])) { - if(!$record->consumed[$id]) die(js::alert($this->lang->task->error->consumedThisTime)); - if($record->left[$id] === '') die(js::alert($this->lang->task->error->left)); + if(!$record->consumed[$id]) return print(js::alert($this->lang->task->error->consumedThisTime)); + if($record->left[$id] === '') return print(js::alert($this->lang->task->error->left)); $estimates[$id] = new stdclass(); $estimates[$id]->date = $record->dates[$id]; @@ -1905,6 +1920,7 @@ class taskModel extends model ->setDefault('lastEditedBy', $this->app->user->account) ->setDefault('lastEditedDate', helper::now()) ->setDefault('assignedDate', helper::now()) + ->setDefault('activatedDate', helper::now()) ->remove('comment') ->get(); @@ -2103,6 +2119,26 @@ class taskModel extends model } $parents = $this->dao->select('*')->from(TABLE_TASK)->where('id')->in($parents)->fetchAll('id'); + $lanes = array(); + $cardsWhere = ''; + foreach($tasks as $task) + { + if(empty($cardsWhere)) + { + $cardsWhere = "cards like '%,{$task->id},%'"; + } + else + { + $cardsWhere .= " or cards like '%,{$task->id},%'"; + } + } + $lanes = $this->dao->select('t1.lane,t2.name,t1.cards') + ->from(TABLE_KANBANCELL)->alias('t1') + ->leftJoin(TABLE_KANBANLANE)->alias('t2')->on('t1.lane = t2.id') + ->where('t1.kanban')->eq($executionID) + ->andWhere("($cardsWhere)") + ->fetchAll('cards'); + foreach($tasks as $task) { if($task->parent > 0) @@ -2118,6 +2154,15 @@ class taskModel extends model $task->parentName = $parent->name; } } + + $task->lane = ''; + if(!empty($lanes)) + { + foreach($lanes as $lane) + { + if(strpos($lane->cards, $task->id) !== false) $task->lane = $lane->name; + } + } } return $this->processTasks($tasks); @@ -2195,6 +2240,8 @@ class taskModel extends model ->leftJoin(TABLE_PROJECT)->alias('t4')->on("t1.project = t4.id") ->where('t1.deleted')->eq(0) ->andWhere('t2.deleted')->eq(0) + ->andWhere('t4.deleted')->eq(0) + ->beginIF($this->config->vision)->andWhere('t1.vision')->eq($this->config->vision)->fi() ->beginIF($type != 'closedBy' and $this->app->moduleName == 'block')->andWhere('t1.status')->ne('closed')->fi() ->beginIF($projectID)->andWhere('t1.project')->eq($projectID)->fi() ->beginIF($type == 'finishedBy') @@ -2242,6 +2289,7 @@ class taskModel extends model ->leftjoin(TABLE_PROJECT)->alias('t2')->on('t1.execution = t2.id') ->where('t1.assignedTo')->eq($account) ->andWhere('t1.deleted')->eq(0) + ->beginIF($this->config->vision)->andWhere('t1.vision')->eq($this->config->vision)->fi() ->beginIF($status != 'all')->andWhere('t1.status')->in($status)->fi() ->beginIF(!empty($skipExecutionIDList))->andWhere('t1.execution')->notin($skipExecutionIDList)->fi() ->query(); @@ -2272,6 +2320,7 @@ class taskModel extends model ->orWhere('t3.status')->eq('suspended') ->markRight(1) ->andWhere('t1.deleted')->eq(0) + ->beginIF($this->config->vision)->andWhere('t1.vision')->eq($this->config->vision)->fi() ->andWhere('t2.deleted')->eq(0) ->beginIF($this->config->systemMode == 'new')->andWhere('t3.deleted')->eq(0)->fi() ->fetchAll('id'); @@ -2477,7 +2526,7 @@ class taskModel extends model $this->dao->update(TABLE_TASK)->data($data)->where('id')->eq($task->id)->exec(); if($task->parent > 0) $this->updateParentStatus($task->id); - if($task->story) $this->loadModel('story')->setStage($oldTask->story); + if($task->story) $this->loadModel('story')->setStage($task->story); $oldTask = new stdClass(); $oldTask->consumed = $task->consumed; @@ -2506,7 +2555,7 @@ class taskModel extends model $lastEstimate = $this->dao->select('*')->from(TABLE_TASKESTIMATE)->where('task')->eq($estimate->task)->orderBy('date desc,id desc')->limit(1)->fetch(); $consumed = $task->consumed - $estimate->consumed; - $left = $lastEstimate->left ? $lastEstimate->left : $estimate->left; + $left = isset($lastEstimate->left) ? $lastEstimate->left : $estimate->left; $data = new stdclass(); $data->consumed = $consumed; @@ -2531,7 +2580,7 @@ class taskModel extends model $this->dao->update(TABLE_TASK)->data($data) ->where('id')->eq($estimate->task)->exec(); if($task->parent > 0) $this->updateParentStatus($task->id); - if($task->story) $this->loadModel('story')->setStage($oldTask->story); + if($task->story) $this->loadModel('story')->setStage($task->story); $oldTask = new stdClass(); $oldTask->consumed = $task->consumed; @@ -3081,6 +3130,7 @@ class taskModel extends model if($id == 'deadline') $class .= ' text-center'; if($id == 'deadline' and isset($task->delay)) $class .= ' delayed'; if($id == 'assignedTo') $class .= ' has-btn text-left'; + if($id == 'lane') $class .= ' text-left'; if(strpos('progress', $id) !== false) $class .= ' text-right'; $title = ''; @@ -3097,7 +3147,7 @@ class taskModel extends model } echo ""; - if(isset($this->config->bizVersion)) $this->loadModel('flow')->printFlowCell('task', $task, $id); + if($this->config->edition != 'open') $this->loadModel('flow')->printFlowCell('task', $task, $id); switch($id) { case 'id': @@ -3162,6 +3212,9 @@ class taskModel extends model case 'assignedTo': $this->printAssignedHtml($task, $users); break; + case 'lane': + echo trim($task->lane); + break; case 'assignedDate': echo substr($task->assignedDate, 5, 11); break; diff --git a/module/task/view/batchcreate.html.php b/module/task/view/batchcreate.html.php index 723c676fff..3611a5b4a1 100644 --- a/module/task/view/batchcreate.html.php +++ b/module/task/view/batchcreate.html.php @@ -33,6 +33,7 @@ createLink('custom', 'ajaxSaveCustomFields', 'module=task§ion=custom&key=batchCreateFields')?> +
task->ditto);?> + + +';?> + diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php index d161c2f6f0..d269a0193a 100644 --- a/module/task/view/create.html.php +++ b/module/task/view/create.html.php @@ -35,7 +35,7 @@ ?>
- type != 'kanban'):?> + type != 'kanban' or $this->config->vision == 'lite'):?> diff --git a/module/task/view/view.html.php b/module/task/view/view.html.php index db70071df6..495e9739f3 100644 --- a/module/task/view/view.html.php +++ b/module/task/view/view.html.php @@ -209,8 +209,23 @@
task->execution;?> id, "class='form-control chosen' onchange='loadAll(this.value)' required");?>
+ config->vision == 'lite') $method = 'kanban'; + ?> - + diff --git a/module/testcase/config.php b/module/testcase/config.php index be18fd7b87..74c780eb55 100644 --- a/module/testcase/config.php +++ b/module/testcase/config.php @@ -87,6 +87,7 @@ $config->testcase->datatable->fieldList['pri']['title'] = 'priAB'; $config->testcase->datatable->fieldList['pri']['fixed'] = 'left'; $config->testcase->datatable->fieldList['pri']['width'] = '40'; $config->testcase->datatable->fieldList['pri']['required'] = 'no'; +$config->testcase->datatable->fieldList['pri']['name'] = $lang->testcase->pri; $config->testcase->datatable->fieldList['title']['title'] = 'title'; $config->testcase->datatable->fieldList['title']['fixed'] = 'left'; diff --git a/module/testcase/control.php b/module/testcase/control.php index b0a98b8155..fb710409a1 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -61,7 +61,7 @@ class testcase extends control { $products = $this->product->getPairs(); } - if(empty($products) and !helper::isAjaxRequest()) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$tab&activeMenu=testcase&objectID=$objectID"))); + if(empty($products) and !helper::isAjaxRequest()) return print($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$tab&activeMenu=testcase&objectID=$objectID"))); } else { @@ -537,7 +537,7 @@ class testcase extends control $currentModule = $this->app->tab == 'project' ? 'project' : 'testcase'; $currentMethod = $this->app->tab == 'project' ? 'testcase' : 'browse'; $projectParam = $this->app->tab == 'project' ? "projectID={$this->session->project}&" : ''; - die(js::locate($this->createLink($currentModule, $currentMethod, $projectParam . "productID=$productID&branch=$branch&browseType=all¶m=0&orderBy=id_desc"), 'parent')); + return print(js::locate($this->createLink($currentModule, $currentMethod, $projectParam . "productID=$productID&branch=$branch&browseType=all¶m=0&orderBy=id_desc"), 'parent')); } if(empty($this->products)) $this->locate($this->createLink('product', 'create')); @@ -649,7 +649,7 @@ class testcase extends control $results = $this->testtask->getResults(0, $caseID); } - if(!$case) die(js::error($this->lang->notFound) . js::locate('back', 'parent')); + if(!$case) return print(js::error($this->lang->notFound) . js::locate('back', 'parent')); $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->createBug; $this->view->runID = $runID; @@ -677,7 +677,7 @@ class testcase extends control if(!$case) { if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'message' => '404 Not found')); - die(js::error($this->lang->notFound) . js::locate($this->createLink('qa', 'index'))); + return print(js::error($this->lang->notFound) . js::locate($this->createLink('qa', 'index'))); } if($case->auto == 'unit') { @@ -783,7 +783,7 @@ class testcase extends control if($comment == false) { $changes = $this->testcase->update($caseID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); $files = $this->loadModel('file')->saveUpload('testcase', $caseID); } if($this->post->comment != '' or !empty($changes) or !empty($files)) @@ -804,12 +804,12 @@ class testcase extends control } else { - die(js::locate($this->createLink('testcase', 'view', "caseID=$caseID"), 'parent')); + return print(js::locate($this->createLink('testcase', 'view', "caseID=$caseID"), 'parent')); } } $case = $this->testcase->getById($caseID); - if(!$case) die(js::error($this->lang->notFound) . js::locate('back')); + if(!$case) return print(js::error($this->lang->notFound) . js::locate('back')); if($case->auto == 'unit') { $this->lang->testcase->subMenu->testcase->feature['alias'] = ''; @@ -935,11 +935,11 @@ class testcase extends control } } - die(js::locate($this->session->caseList, 'parent')); + return print(js::locate($this->session->caseList, 'parent')); } - $caseIDList = $this->post->caseIDList ? $this->post->caseIDList : die(js::locate($this->session->caseList)); - $caseIDList = array_unique($caseIDList); + if(!$this->post->caseIDList) return print(js::locate($this->session->caseList)); + $caseIDList = array_unique($this->post->caseIDList); $branchProduct = false; if($this->app->tab == 'project') $this->loadModel('project')->setMenu($this->session->project); @@ -1085,7 +1085,7 @@ class testcase extends control if($_POST) { $changes = $this->testcase->review($caseID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($changes or $this->post->comment != '') { @@ -1096,7 +1096,7 @@ class testcase extends control $this->executeHooks($caseID); - die(js::reload('parent.parent')); + return print(js::reload('parent.parent')); } $this->view->users = $this->user->getPairs('noletter|noclosed|nodeleted'); @@ -1114,12 +1114,12 @@ class testcase extends control */ public function batchReview($result) { - $caseIdList = $this->post->caseIDList ? $this->post->caseIDList : die(js::locate($this->session->caseList, 'parent')); - $caseIdList = array_unique($caseIdList); + if(!$this->post->caseIDList) return print(js::locate($this->session->caseList, 'parent')); + $caseIdList = array_unique($this->post->caseIDList); $actions = $this->testcase->batchReview($caseIdList, $result); - if(dao::isError()) die(js::error(dao::getError())); - die(js::locate($this->session->caseList, 'parent')); + if(dao::isError()) return print(js::error(dao::getError())); + echo js::locate($this->session->caseList, 'parent'); } /** @@ -1134,7 +1134,7 @@ class testcase extends control { if($confirm == 'no') { - die(js::confirm($this->lang->testcase->confirmDelete, inlink('delete', "caseID=$caseID&confirm=yes"))); + return print(js::confirm($this->lang->testcase->confirmDelete, inlink('delete', "caseID=$caseID&confirm=yes"))); } else { @@ -1161,7 +1161,7 @@ class testcase extends control $locateLink = $this->session->caseList ? $this->session->caseList : inlink('browse', "productID={$case->product}"); if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success')); - die(js::locate($locateLink, 'parent')); + return print(js::locate($locateLink, 'parent')); } } @@ -1174,11 +1174,11 @@ class testcase extends control */ public function batchDelete($productID = 0) { - $caseIDList = $this->post->caseIDList ? $this->post->caseIDList : die(js::locate($this->session->caseList)); - $caseIDList = array_unique($caseIDList); + if(!$this->post->caseIDList) return print(js::locate($this->session->caseList)); + $caseIDList = array_unique($this->post->caseIDList); foreach($caseIDList as $caseID) $this->testcase->delete(TABLE_CASE, $caseID); - die(js::locate($this->session->caseList)); + echo js::locate($this->session->caseList); } /** @@ -1196,7 +1196,7 @@ class testcase extends control $caseIDList = array_unique($caseIDList); unset($_POST['caseIDList']); $allChanges = $this->testcase->batchChangeBranch($caseIDList, $branchID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); foreach($allChanges as $caseID => $changes) { $this->loadModel('action'); @@ -1205,7 +1205,7 @@ class testcase extends control } } - die(js::locate($this->session->caseList, 'parent')); + echo js::locate($this->session->caseList, 'parent'); } /** @@ -1223,7 +1223,7 @@ class testcase extends control $caseIDList = array_unique($caseIDList); unset($_POST['caseIDList']); $allChanges = $this->testcase->batchChangeModule($caseIDList, $moduleID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); foreach($allChanges as $caseID => $changes) { $this->loadModel('action'); @@ -1232,7 +1232,7 @@ class testcase extends control } } - die(js::locate($this->session->caseList, 'parent')); + echo js::locate($this->session->caseList, 'parent'); } /** @@ -1244,12 +1244,12 @@ class testcase extends control */ public function batchCaseTypeChange($result) { - $caseIdList = $this->post->caseIDList ? $this->post->caseIDList : die(js::locate($this->session->caseList, 'parent')); - $caseIDList = array_unique($caseIDList); + if(!$this->post->caseIDList) return print(js::locate($this->session->caseList, 'parent')); + $caseIdList = array_unique($this->post->caseIDList); $this->testcase->batchCaseTypeChange($caseIdList, $result); - if(dao::isError()) die(js::error(dao::getError())); - die(js::locate($this->session->caseList, 'parent')); + if(dao::isError()) return print(js::error(dao::getError())); + echo js::locate($this->session->caseList, 'parent'); } /** @@ -1305,8 +1305,8 @@ class testcase extends control { $case = $this->testcase->getById($caseID); $this->dao->update(TABLE_TESTRUN)->set('version')->eq($case->version)->where('`case`')->eq($caseID)->exec(); - if($from == 'view') die(js::locate(inlink('view', "caseID=$caseID&version=$case->version&from=testtask&taskID=$taskID"), 'parent')); - die(js::reload('parent')); + if($from == 'view') return print(js::locate(inlink('view', "caseID=$caseID&version=$case->version&from=testtask&taskID=$taskID"), 'parent')); + echo js::reload('parent'); } /** @@ -1331,7 +1331,7 @@ class testcase extends control $step->version = $version; $this->dao->insert(TABLE_CASESTEP)->data($step)->exec(); } - die(js::locate($this->createLink('testcase', 'view', "caseID=$caseID&version=$version"), 'parent')); + echo js::locate($this->createLink('testcase', 'view', "caseID=$caseID&version=$version"), 'parent'); } /** @@ -1343,9 +1343,9 @@ class testcase extends control */ public function ignoreLibcaseChange($caseID) { - $case = $this->testcase->getById($caseID); + $case = $this->testcase->getById($caseID); $this->dao->update(TABLE_CASE)->set('fromCaseVersion')->eq($case->version)->where('id')->eq($caseID)->exec(); - die(js::reload('parent')); + echo js::reload('parent'); } /** @@ -1360,7 +1360,7 @@ class testcase extends control $case = $this->testcase->getById($caseID); $this->dao->update(TABLE_CASE)->set('storyVersion')->eq($case->latestStoryVersion)->where('id')->eq($caseID)->exec(); $this->loadModel('action')->create('case', $caseID, 'confirmed', '', $case->latestStoryVersion); - if($reload) die(js::reload('parent')); + if($reload) return print(js::reload('parent')); } /** @@ -1372,11 +1372,11 @@ class testcase extends control */ public function batchConfirmStoryChange($productID = 0) { - $caseIDList = $this->post->caseIDList ? $this->post->caseIDList : die(js::locate($this->session->caseList)); - $caseIDList = array_unique($caseIDList); + if(!$this->post->caseIDList) return print(js::locate($this->session->caseList)); + $caseIDList = array_unique($this->post->caseIDList); foreach($caseIDList as $caseID) $this->confirmStoryChange($caseID,false); - die(js::locate($this->session->caseList)); + echo js::locate($this->session->caseList); } /** @@ -1593,7 +1593,7 @@ class testcase extends control } } } - if(isset($this->config->bizVersion)) list($fields, $cases) = $this->loadModel('workflowfield')->appendDataFromFlow($fields, $cases); + if($this->config->edition != 'open') list($fields, $cases) = $this->loadModel('workflowfield')->appendDataFromFlow($fields, $cases); $this->post->set('fields', $fields); $this->post->set('rows', $cases); @@ -1644,9 +1644,9 @@ class testcase extends control $projectID = $this->app->tab == 'project' ? $this->session->project : 0; $branches = $this->loadModel('branch')->getPairs($productID, '' , $projectID); - $modules = array(); - $this->loadModel('tree'); + $modules = $product->type == 'normal' ? $this->tree->getOptionMenu($productID, 'case', 0, 0) : array(); + foreach($branches as $branchID => $branchName) { $branches[$branchID] = $branchName . "(#$branchID)"; @@ -1741,13 +1741,14 @@ class testcase extends control if(!isset($fields[$title])) continue; $columnKey[] = $fields[$title]; } - if(count($columnKey) == 0) die(js::alert($this->lang->testcase->errorEncode)); + if(count($columnKey) == 0) return print(js::alert($this->lang->testcase->errorEncode)); } $this->session->set('fileImport', $fileName); - die(js::locate(inlink('showImport', "productID=$productID&branch=$branch"), 'parent.parent')); + return print(js::locate(inlink('showImport', "productID=$productID&branch=$branch"), 'parent.parent')); } + $this->display(); } @@ -1777,7 +1778,7 @@ class testcase extends control if($_POST) { $this->testcase->importFromLib($productID); - die(js::reload('parent')); + return print(js::reload('parent')); } $this->app->tab == 'project' ? $this->loadModel('project')->setMenu($this->session->project) : $this->testcase->setMenu($this->products, $productID, $branch); @@ -1786,7 +1787,7 @@ class testcase extends control if(empty($libraries)) { echo js::alert($this->lang->testcase->noLibrary); - die(js::locate($this->session->caseList)); + return print(js::locate($this->session->caseList)); } if(empty($libID) or !isset($libraries[$libID])) $libID = key($libraries); @@ -1854,16 +1855,16 @@ class testcase extends control if($this->app->tab == 'project') { - die(js::locate($this->createLink('project', 'testcase', "projectID={$this->session->project}&productID=$productID"), 'parent')); + return print(js::locate($this->createLink('project', 'testcase', "projectID={$this->session->project}&productID=$productID"), 'parent')); } else { - die(js::locate(inlink('browse', "productID=$productID"), 'parent')); + return print(js::locate(inlink('browse', "productID=$productID"), 'parent')); } } else { - die(js::locate(inlink('showImport', "productID=$productID&branch=$branch&pagerID=" . ($this->post->pagerID + 1) . "&maxImport=$maxImport&insert=" . zget($_POST, 'insert', '')), 'parent')); + return print(js::locate(inlink('showImport', "productID=$productID&branch=$branch&pagerID=" . ($this->post->pagerID + 1) . "&maxImport=$maxImport&insert=" . zget($_POST, 'insert', '')), 'parent')); } } @@ -2030,7 +2031,7 @@ class testcase extends control if(empty($caseData)) { echo js::alert($this->lang->error->noData); - die(js::locate($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch"))); + return print(js::locate($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch"))); } $allCount = count($caseData); @@ -2043,13 +2044,13 @@ class testcase extends control $this->view->maxImport = $maxImport; $this->view->productID = $productID; $this->view->branch = $branch; - die($this->display()); + return print($this->display()); } $allPager = ceil($allCount / $maxImport); $caseData = array_slice($caseData, ($pagerID - 1) * $maxImport, $maxImport, true); } - if(empty($caseData)) die(js::locate(inlink('browse', "productID=$productID&branch=$branch"))); + if(empty($caseData)) return print(js::locate(inlink('browse', "productID=$productID&branch=$branch"))); /* Judge whether the editedCases is too large and set session. */ $countInputVars = count($caseData) * 12 + (isset($stepVars) ? $stepVars : 0); @@ -2105,7 +2106,7 @@ class testcase extends control { $story = $this->dao->select('module')->from(TABLE_STORY)->where('id')->eq($storyID)->fetch(); $moduleID = !empty($story) ? $story->module : 0; - die(json_encode(array('moduleID'=> $moduleID))); + echo json_encode(array('moduleID'=> $moduleID)); } /** @@ -2121,7 +2122,7 @@ class testcase extends control $case = $this->testcase->getByID($caseID); $status = $this->testcase->getStatus($methodName, $case); if($methodName == 'update') $status = zget($status, 1, ''); - die($status); + echo $status; } /** diff --git a/module/testcase/model.php b/module/testcase/model.php index d5d701742e..0fbf2ba868 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -115,7 +115,7 @@ class testcaseModel extends model foreach($cases->title as $i => $title) { - if(!empty($cases->title[$i]) and empty($cases->type[$i])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->testcase->type))); + if(!empty($cases->title[$i]) and empty($cases->type[$i])) return print(js::alert(sprintf($this->lang->error->notempty, $this->lang->testcase->type))); } $module = 0; @@ -176,13 +176,13 @@ class testcaseModel extends model $data[$i]->{$extendField->field} = htmlSpecialString($data[$i]->{$extendField->field}); $message = $this->checkFlowRule($extendField, $data[$i]->{$extendField->field}); - if($message) die(js::alert($message)); + if($message) return print(js::alert($message)); } foreach(explode(',', $this->config->testcase->create->requiredFields) as $field) { $field = trim($field); - if($field and empty($data[$i]->$field)) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->testcase->$field))); + if($field and empty($data[$i]->$field)) return print(js::alert(sprintf($this->lang->error->notempty, $this->lang->testcase->$field))); } } @@ -197,7 +197,7 @@ class testcaseModel extends model if(dao::isError()) { echo js::error(dao::getError()); - die(js::reload('parent')); + return print(js::reload('parent')); } $caseID = $this->dao->lastInsertID(); @@ -793,7 +793,7 @@ class testcaseModel extends model */ public function review($caseID) { - if($this->post->result == false) die(js::alert($this->lang->testcase->mustChooseResult)); + if($this->post->result == false) return print(js::alert($this->lang->testcase->mustChooseResult)); $oldCase = $this->getById($caseID); @@ -932,7 +932,7 @@ class testcaseModel extends model $case->{$extendField->field} = htmlSpecialString($case->{$extendField->field}); $message = $this->checkFlowRule($extendField, $case->{$extendField->field}); - if($message) die(js::alert($message)); + if($message) return print(js::alert($message)); } $cases[$caseID] = $case; @@ -964,7 +964,7 @@ class testcaseModel extends model } else { - die(js::error('case#' . $caseID . dao::getError(true))); + return print(js::error('case#' . $caseID . dao::getError(true))); } } @@ -1199,7 +1199,7 @@ class testcaseModel extends model $cases[$key] = $caseData; $line++; } - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); $forceNotReview = $this->forceNotReview(); foreach($cases as $key => $caseData) @@ -1535,7 +1535,7 @@ class testcaseModel extends model if(strpos(',stage,precondition,keywords,story,', ",{$id},") !== false) $class .= ' text-ellipsis'; echo " - + diff --git a/module/testcase/view/groupcase.html.php b/module/testcase/view/groupcase.html.php index e863be5027..e0f3adfddb 100644 --- a/module/testcase/view/groupcase.html.php +++ b/module/testcase/view/groupcase.html.php @@ -35,7 +35,7 @@ - + diff --git a/module/testcase/view/importfromlib.html.php b/module/testcase/view/importfromlib.html.php index df10fd4979..c0e7e814b8 100644 --- a/module/testcase/view/importfromlib.html.php +++ b/module/testcase/view/importfromlib.html.php @@ -36,8 +36,8 @@ type != 'normal'):?> - - + + diff --git a/module/testcase/view/linkcases.html.php b/module/testcase/view/linkcases.html.php index 0bd00d0d17..ab5e4db49f 100644 --- a/module/testcase/view/linkcases.html.php +++ b/module/testcase/view/linkcases.html.php @@ -32,7 +32,7 @@ idAB;?> - + diff --git a/module/testreport/control.php b/module/testreport/control.php index ca1c40d2e4..57e7b88168 100644 --- a/module/testreport/control.php +++ b/module/testreport/control.php @@ -64,7 +64,7 @@ class testreport extends control { $products = $this->product->getPairs(); } - if(empty($products) and !helper::isAjaxRequest()) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$tab&activeMenu=testreport&objectID=$objectID"))); + if(empty($products) and !helper::isAjaxRequest()) return print($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$tab&activeMenu=testreport&objectID=$objectID"))); } else { @@ -88,7 +88,7 @@ class testreport extends control */ public function browse($objectID = 0, $objectType = 'product', $extra = '', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { - if(strpos('product|execution|project', $objectType) === false) die('Type Error!'); + if(strpos('product|execution|project', $objectType) === false) return print('Type Error!'); $objectID = $this->commonAction($objectID, $objectType); $object = $this->$objectType->getById($objectID); @@ -171,10 +171,10 @@ class testreport extends control if($_POST) { $reportID = $this->testreport->create(); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); $this->loadModel('action')->create('testreport', $reportID, 'Opened'); if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $reportID)); - die(js::locate(inlink('view', "reportID=$reportID"), 'parent')); + return print(js::locate(inlink('view', "reportID=$reportID"), 'parent')); } if($objectType == 'testtask') @@ -195,7 +195,7 @@ class testreport extends control if($testTask->build == 'trunk') continue; $taskPairs[$testTask->id] = $testTask->name; } - if(empty($taskPairs)) die(js::alert($this->lang->testreport->noTestTask) . js::locate('back')); + if(empty($taskPairs)) return print(js::alert($this->lang->testreport->noTestTask) . js::locate('back')); if(empty($objectID)) { @@ -209,10 +209,10 @@ class testreport extends control if($this->app->tab == 'project') $this->project->setMenu($task->project); } - if(empty($objectID)) die(js::alert($this->lang->testreport->noObjectID) . js::locate('back')); + if(empty($objectID)) return print(js::alert($this->lang->testreport->noObjectID) . js::locate('back')); if($objectType == 'testtask') { - if($productID != $task->product) die(js::error($this->lang->error->accessDenied) . js::locate('back')); + if($productID != $task->product) return print(js::error($this->lang->error->accessDenied) . js::locate('back')); $productIdList[$productID] = $productID; $begin = !empty($begin) ? date("Y-m-d", strtotime($begin)) : $task->begin; @@ -222,7 +222,7 @@ class testreport extends control if($task->build == 'trunk') { echo js::alert($this->lang->testreport->errorTrunk); - die(js::locate('back')); + return print(js::locate('back')); } else { @@ -246,7 +246,7 @@ class testreport extends control elseif($objectType == 'execution') { $executionID = $this->commonAction($objectID, $objectType); - if($executionID != $objectID) die(js::error($this->lang->error->accessDenied) . js::locate('back')); + if($executionID != $objectID) return print(js::error($this->lang->error->accessDenied) . js::locate('back')); $execution = $this->execution->getById($executionID); $tasks = $this->testtask->getExecutionTasks($executionID); @@ -270,7 +270,7 @@ class testreport extends control if(count($productIdList) > 1) { echo(js::alert($this->lang->testreport->moreProduct)); - die(js::locate('back')); + return print(js::locate('back')); } if($this->app->tab == 'qa') @@ -355,14 +355,14 @@ class testreport extends control if($_POST) { $changes = $this->testreport->update($reportID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); $files = $this->loadModel('file')->saveUpload('testreport', $reportID); $fileAction = !empty($files) ? $this->lang->addFiles . join(',', $files) . "\n" : ''; $actionID = $this->loadModel('action')->create('testreport', $reportID, 'Edited', $fileAction); if(!empty($changes)) $this->action->logHistory($actionID, $changes); - die(js::locate(inlink('view', "reportID=$reportID"), 'parent')); + return print(js::locate(inlink('view', "reportID=$reportID"), 'parent')); } $report = $this->testreport->getById($reportID); @@ -374,7 +374,7 @@ class testreport extends control { $product = $this->product->getById($report->product); $productID = $this->commonAction($report->product, 'product'); - if($productID != $report->product) die(js::error($this->lang->error->accessDenied) . js::locate('back')); + if($productID != $report->product) return print(js::error($this->lang->error->accessDenied) . js::locate('back')); $browseLink = inlink('browse', "objectID=$productID&objectType=product"); $this->view->position[] = html::a($browseLink, $product->name); @@ -385,12 +385,12 @@ class testreport extends control if($this->app->tab == 'execution') { $objectID = $this->commonAction($report->execution, 'execution'); - if($objectID != $report->execution) die(js::error($this->lang->error->accessDenied) . js::locate('back')); + if($objectID != $report->execution) return print(js::error($this->lang->error->accessDenied) . js::locate('back')); } else { $objectID = $this->commonAction($report->project, 'project'); - if($objectID != $report->project) die(js::error($this->lang->error->accessDenied) . js::locate('back')); + if($objectID != $report->project) return print(js::error($this->lang->error->accessDenied) . js::locate('back')); } $browseLink = inlink('browse', "objectID=$objectID&objectType=execution"); @@ -408,7 +408,7 @@ class testreport extends control if($task->build == 'trunk') { echo js::alert($this->lang->testreport->errorTrunk); - die(js::locate('back')); + return print(js::locate('back')); } else { @@ -483,7 +483,7 @@ class testreport extends control { $reportID = (int)$reportID; $report = $this->testreport->getById($reportID); - if(!$report) die(js::error($this->lang->notFound) . js::locate($this->createLink('qa', 'index'))); + if(!$report) return print(js::error($this->lang->notFound) . js::locate($this->createLink('qa', 'index'))); $this->session->project = $report->project; $browseLink = ''; @@ -492,7 +492,7 @@ class testreport extends control { $product = $this->product->getById($report->product); $productID = $this->commonAction($report->product, 'product'); - if($productID != $report->product) die(js::error($this->lang->error->accessDenied) . js::locate('back')); + if($productID != $report->product) return print(js::error($this->lang->error->accessDenied) . js::locate('back')); $browseLink = inlink('browse', "objectID=$productID&objectType=product"); $this->view->position[] = html::a($browseLink, $product->name); @@ -502,12 +502,12 @@ class testreport extends control if($this->app->tab == 'execution') { $objectID = $this->commonAction($report->execution, 'execution'); - if($objectID != $report->execution) die(js::error($this->lang->error->accessDenied) . js::locate('back')); + if($objectID != $report->execution) return print(js::error($this->lang->error->accessDenied) . js::locate('back')); } else { $objectID = $this->commonAction($report->project, 'project'); - if($objectID != $report->project) die(js::error($this->lang->error->accessDenied) . js::locate('back')); + if($objectID != $report->project) return print(js::error($this->lang->error->accessDenied) . js::locate('back')); } $browseLink = inlink('browse', "objectID=$objectID&objectType=execution"); @@ -589,7 +589,7 @@ class testreport extends control { if($confirm == 'no') { - die(js::confirm($this->lang->testreport->confirmDelete, inlink('delete', "reportID=$reportID&confirm=yes"))); + return print(js::confirm($this->lang->testreport->confirmDelete, inlink('delete', "reportID=$reportID&confirm=yes"))); } else { @@ -597,7 +597,7 @@ class testreport extends control $locateLink = $this->session->reportList ? $this->session->reportList : inlink('browse', "productID={$testreport->product}"); $this->testreport->delete(TABLE_TESTREPORT, $reportID); - die(js::locate($locateLink, 'parent')); + return print(js::locate($locateLink, 'parent')); } } diff --git a/module/testsuite/control.php b/module/testsuite/control.php index 3f9b6e4c6f..7d826b7982 100644 --- a/module/testsuite/control.php +++ b/module/testsuite/control.php @@ -32,7 +32,7 @@ class testsuite extends control parent::__construct($moduleName, $methodName); $this->view->products = $this->products = $this->loadModel('product')->getPairs(); - if(empty($this->products) and !helper::isAjaxRequest()) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=qa&activeMenu=testsuite"))); + if(empty($this->products) and !helper::isAjaxRequest()) return print($this->locate($this->createLink('product', 'showErrorNone', "moduleName=qa&activeMenu=testsuite"))); } /** @@ -158,8 +158,8 @@ class testsuite extends control /* Get test suite, and set menu. */ $suite = $this->testsuite->getById($suiteID, true); - if(!$suite) die(js::error($this->lang->notFound) . js::locate('back')); - if($suite->type == 'private' and $suite->addedBy != $this->app->user->account and !$this->app->user->admin) die(js::error($this->lang->error->accessDenied) . js::locate('back')); + if(!$suite) return print(js::error($this->lang->notFound) . js::locate('back')); + if($suite->type == 'private' and $suite->addedBy != $this->app->user->account and !$this->app->user->admin) return print(js::error($this->lang->error->accessDenied) . js::locate('back')); /* Set product session. */ $productID = $this->product->saveState($suite->product, $this->products); @@ -229,7 +229,7 @@ class testsuite extends control return $this->send($response); } - if($suite->type == 'private' and $suite->addedBy != $this->app->user->account and !$this->app->user->admin) die(js::error($this->lang->error->accessDenied) . js::locate('back')); + if($suite->type == 'private' and $suite->addedBy != $this->app->user->account and !$this->app->user->admin) return print(js::error($this->lang->error->accessDenied) . js::locate('back')); /* Set product session. */ $productID = $this->product->saveState($suite->product, $this->products); @@ -256,12 +256,12 @@ class testsuite extends control { if($confirm == 'no') { - die(js::confirm($this->lang->testsuite->confirmDelete, inlink('delete', "suiteID=$suiteID&confirm=yes"))); + return print(js::confirm($this->lang->testsuite->confirmDelete, inlink('delete', "suiteID=$suiteID&confirm=yes"))); } else { $suite = $this->testsuite->getById($suiteID); - if($suite->type == 'private' and $suite->addedBy != $this->app->user->account and !$this->app->user->admin) die(js::error($this->lang->error->accessDenied) . js::locate('back')); + if($suite->type == 'private' and $suite->addedBy != $this->app->user->account and !$this->app->user->admin) return print(js::error($this->lang->error->accessDenied) . js::locate('back')); $this->testsuite->delete($suiteID); @@ -282,7 +282,7 @@ class testsuite extends control } return $this->send($response); } - die(js::reload('parent')); + return print(js::reload('parent')); } } @@ -358,7 +358,7 @@ class testsuite extends control { if($confirm == 'no') { - die(js::confirm($this->lang->testsuite->confirmUnlinkCase, $this->createLink('testsuite', 'unlinkCase', "rowID=$rowID&confirm=yes"))); + return print(js::confirm($this->lang->testsuite->confirmUnlinkCase, $this->createLink('testsuite', 'unlinkCase', "rowID=$rowID&confirm=yes"))); } else { @@ -392,6 +392,6 @@ class testsuite extends control ->exec(); } - die(js::locate($this->createLink('testsuite', 'view', "suiteID=$suiteID"))); + return print(js::locate($this->createLink('testsuite', 'view', "suiteID=$suiteID"))); } } diff --git a/module/testsuite/lang/en.php b/module/testsuite/lang/en.php index 0b64a3e23d..3171bf426d 100644 --- a/module/testsuite/lang/en.php +++ b/module/testsuite/lang/en.php @@ -24,6 +24,7 @@ $lang->testsuite->deleted = 'Deleted'; $lang->testsuite->successSaved = 'Saved'; $lang->testsuite->id = 'ID'; +$lang->testsuite->pri = 'Priority'; $lang->testsuite->common = 'Test Suite'; $lang->testsuite->project = 'Project'; $lang->testsuite->product = $lang->productCommon; diff --git a/module/testsuite/lang/zh-cn.php b/module/testsuite/lang/zh-cn.php index 1103d4f9eb..349fe18e86 100644 --- a/module/testsuite/lang/zh-cn.php +++ b/module/testsuite/lang/zh-cn.php @@ -24,6 +24,7 @@ $lang->testsuite->deleted = '已删除'; $lang->testsuite->successSaved = '保存成功'; $lang->testsuite->id = '编号'; +$lang->testsuite->pri = '优先级'; $lang->testsuite->common = '套件'; $lang->testsuite->project = '所属项目'; $lang->testsuite->product = '所属' . $lang->productCommon; diff --git a/module/testsuite/view/linkcase.html.php b/module/testsuite/view/linkcase.html.php index 1324d49758..67dced905a 100644 --- a/module/testsuite/view/linkcase.html.php +++ b/module/testsuite/view/linkcase.html.php @@ -40,7 +40,7 @@ idAB;?> - + diff --git a/module/testsuite/view/view.html.php b/module/testsuite/view/view.html.php index 7c5c3d60d5..f4962e9033 100644 --- a/module/testsuite/view/view.html.php +++ b/module/testsuite/view/view.html.php @@ -60,7 +60,7 @@ idAB);?> - + diff --git a/module/testtask/control.php b/module/testtask/control.php index c63bef95ac..5b140c4b6d 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -157,7 +157,7 @@ class testtask extends control $this->lang->scrum->menu->qa['subMenu']->testcase['subModule'] = 'testtask'; $this->lang->scrum->menu->qa['subMenu']->testtask['subModule'] = ''; - if(isset($this->config->maxVersion)) + if($this->config->edition == 'max') { $this->lang->waterfall->menu->qa['subMenu']->testcase['subModule'] = 'testtask'; $this->lang->waterfall->menu->qa['subMenu']->testtask['subModule'] = ''; diff --git a/module/testtask/model.php b/module/testtask/model.php index b9826d3377..322814e16c 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -1414,7 +1414,7 @@ class testtaskModel extends model if($id == 'actions') $class .= 'c-actions'; echo " - + diff --git a/module/testtask/view/linkcase.html.php b/module/testtask/view/linkcase.html.php index 4b58c7ff0f..f2a0a97316 100644 --- a/module/testtask/view/linkcase.html.php +++ b/module/testtask/view/linkcase.html.php @@ -84,7 +84,7 @@ idAB;?> - + diff --git a/module/testtask/view/unitgroup.html.php b/module/testtask/view/unitgroup.html.php index 9b4bed3164..b27448e517 100644 --- a/module/testtask/view/unitgroup.html.php +++ b/module/testtask/view/unitgroup.html.php @@ -15,7 +15,7 @@ - + diff --git a/module/todo/control.php b/module/todo/control.php index 4cfe437bfd..dec411e548 100644 --- a/module/todo/control.php +++ b/module/todo/control.php @@ -46,7 +46,7 @@ class todo extends control if(!empty($_POST)) { $todoID = $this->todo->create($date, $account); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); $this->loadModel('action')->create('todo', $todoID, 'opened'); $date = str_replace('-', '', $this->post->date); @@ -69,9 +69,9 @@ class todo extends control } if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $todoID)); - if($this->viewType == 'xhtml') die(js::locate($this->createLink('todo', 'view', "todoID=$todoID", 'html'), 'parent')); - if(isonlybody()) die(js::closeModal('parent.parent')); - die(js::locate($this->createLink('my', 'todo', "type=all&userID=&status=all&orderBy=id_desc"), 'parent')); + if($this->viewType == 'xhtml') return print(js::locate($this->createLink('todo', 'view', "todoID=$todoID", 'html'), 'parent')); + if(isonlybody()) return print(js::closeModal('parent.parent')); + return print(js::locate($this->createLink('my', 'todo', "type=all&userID=&status=all&orderBy=id_desc"), 'parent')); } unset($this->lang->todo->typeList['cycle']); @@ -97,7 +97,7 @@ class todo extends control if(!empty($_POST)) { $todoIDList = $this->todo->batchCreate(); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); /* Locate the browser. */ $date = str_replace('-', '', $this->post->date); @@ -111,8 +111,8 @@ class todo extends control } if($this->viewType == 'json') return $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')); + if(isonlybody()) return print(js::reload('parent.parent')); + return print(js::locate($this->createLink('my', 'todo', "type=$date"), 'parent')); } /* Set Custom*/ @@ -146,7 +146,7 @@ class todo extends control if(dao::isError()) { if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'message' => dao::getError())); - die(js::error(dao::getError())); + return print(js::error(dao::getError())); } if($changes) { @@ -155,12 +155,12 @@ class todo extends control } if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success')); - die(js::locate($this->session->todoList, 'parent.parent')); + return print(js::locate($this->session->todoList, 'parent.parent')); } /* Judge a private todo or not, If private, die. */ $todo = $this->todo->getById($todoID); - if($todo->private and $this->app->user->account != $todo->account) die('private'); + if($todo->private and $this->app->user->account != $todo->account) return print('private'); unset($this->lang->todo->typeList['cycle']); $todo->date = date("Y-m-d", strtotime($todo->date)); @@ -199,8 +199,8 @@ class todo extends control $bugs = $this->bug->getUserBugPairs($account); $tasks = $this->task->getUserTaskPairs($account, $status); $storys = $this->loadModel('story')->getUserStoryPairs($account); - if(isset($this->config->bizVersion) or isset($this->config->maxVersion)) $this->view->feedbacks = $this->loadModel('feedback')->getUserFeedbackPairs($account); - if(isset($this->config->maxVersion)) + if($this->config->edition != 'open') $this->view->feedbacks = $this->loadModel('feedback')->getUserFeedbackPairs($account); + if($this->config->edition == 'max') { $issues = $this->loadModel('issue')->getUserIssuePairs($account); $risks = $this->loadmodel('risk')->getUserRiskPairs($account); @@ -209,7 +209,7 @@ class todo extends control $testtasks = $this->loadModel('testtask')->getUserTestTaskPairs($account); $reviews = array(); - if(isset($this->config->qcVersion) or isset($this->config->maxVersion)) $reviews = $this->loadModel('review')->getUserReviewPairs($account); + if($this->config->edition == 'max') $reviews = $this->loadModel('review')->getUserReviewPairs($account); $allTodos = $this->todo->getList($type, $account, $status); if($this->post->todoIDList) $todoIDList = $this->post->todoIDList; @@ -243,7 +243,7 @@ class todo extends control $this->view->bugs = $bugs; $this->view->tasks = $tasks; $this->view->storys = $storys; - if(isset($this->config->maxVersion)) + if($this->config->edition == 'max') { $this->view->issues = $issues; $this->view->risks = $risks; @@ -271,7 +271,7 @@ class todo extends control $this->action->logHistory($actionID, $changes); } - die(js::locate($this->session->todoList, 'parent')); + return print(js::locate($this->session->todoList, 'parent')); } } @@ -295,10 +295,11 @@ class todo extends control if($todo->type == 'task') $app = 'execution'; if($todo->type == 'story') $app = 'product'; $cancelURL = $this->server->HTTP_REFERER; - die(js::confirm(sprintf($this->lang->todo->$confirmNote, $todo->idvalue), $confirmURL, $cancelURL, $okTarget, 'parent', $app)); + return print(js::confirm(sprintf($this->lang->todo->$confirmNote, $todo->idvalue), $confirmURL, $cancelURL, $okTarget, 'parent', $app)); } - if(isonlybody())die(js::reload('parent.parent')); - die(js::reload('parent')); + + if(isonlybody())return print(js::reload('parent.parent')); + echo js::reload('parent'); } /** @@ -313,8 +314,8 @@ class todo extends control $todo = $this->todo->getById($todoID); if($todo->status == 'done' or $todo->status == 'closed') $this->todo->activate($todoID); if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success')); - if(isonlybody()) die(js::reload('parent.parent')); - die(js::reload('parent')); + if(isonlybody()) return print(js::reload('parent.parent')); + echo js::reload('parent'); } /** @@ -329,8 +330,8 @@ class todo extends control { $todo = $this->todo->getById($todoID); if($todo->status == 'done') $this->todo->close($todoID); - if(isonlybody()) die(js::reload('parent.parent')); - die(js::reload('parent')); + if(isonlybody()) return print(js::reload('parent.parent')); + echo js::reload('parent'); } /** @@ -345,10 +346,10 @@ class todo extends control { if(!empty($_POST)) { - if(empty($_POST['assignedTo'])) die(js::error($this->lang->todo->noAssignedTo)); + if(empty($_POST['assignedTo'])) return print(js::error($this->lang->todo->noAssignedTo)); $this->todo->assignTo($todoID); - if(dao::isError()) die(js::error(dao::getError())); - die(js::reload('parent.parent')); + if(dao::isError()) return print(js::error(dao::getError())); + return print(js::reload('parent.parent')); } $this->view->todo = $this->todo->getById($todoID); @@ -373,7 +374,7 @@ class todo extends control if(!$todo) { if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'message' => '404 Not found')); - die(js::error($this->lang->notFound) . js::locate('back')); + return print(js::error($this->lang->notFound) . js::locate('back')); } /* Save the session. */ if(!isonlybody()) @@ -426,8 +427,7 @@ class todo extends control { if($confirm == 'no') { - echo js::confirm($this->lang->todo->confirmDelete, $this->createLink('todo', 'delete', "todoID=$todoID&confirm=yes")); - exit; + return print(js::confirm($this->lang->todo->confirmDelete, $this->createLink('todo', 'delete', "todoID=$todoID&confirm=yes"))); } else { @@ -450,10 +450,10 @@ class todo extends control } if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success')); - if(isonlybody()) die(js::reload('parent.parent')); + if(isonlybody()) return print(js::reload('parent.parent')); $browseLink = $this->session->todoList ? $this->session->todoList : $this->createLink('my', 'todo'); - die(js::locate($browseLink, 'parent')); + return print(js::locate($browseLink, 'parent')); } } @@ -478,11 +478,11 @@ class todo extends control if($todo->type == 'story') $app = 'product'; $cancelURL = $this->server->HTTP_REFERER; if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success', 'message' => sprintf($this->lang->todo->$confirmNote, $todo->idvalue), 'locate' => $confirmURL)); - die(js::confirm(sprintf($this->lang->todo->$confirmNote, $todo->idvalue), $confirmURL, $cancelURL, $okTarget, 'parent', $app)); + return print(js::confirm(sprintf($this->lang->todo->$confirmNote, $todo->idvalue), $confirmURL, $cancelURL, $okTarget, 'parent', $app)); } if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success')); - if(isonlybody())die(js::reload('parent.parent')); - die(js::reload('parent')); + if(isonlybody()) return print(js::reload('parent.parent')); + echo js::reload('parent'); } /** @@ -500,7 +500,7 @@ class todo extends control $todo = $this->todo->getById($todoID); if($todo->status != 'done' && $todo->status != 'closed') $this->todo->finish($todoID); } - die(js::reload('parent')); + return print(js::reload('parent')); } } @@ -521,7 +521,7 @@ class todo extends control } if(!empty($waitIdList)) echo js::alert(sprintf($this->lang->todo->unfinishedTodo, implode(',', $waitIdList))); - die(js::reload('parent')); + echo js::reload('parent'); } /** @@ -577,7 +577,7 @@ class todo extends control $bugs = $this->loadModel('bug')->getUserBugPairs($account); $stories = $this->loadModel('story')->getUserStoryPairs($account, 100, 'story'); $tasks = $this->loadModel('task')->getUserTaskPairs($account); - if(isset($this->config->maxVersion)) + if($this->config->edition == 'max') { $issues = $this->loadModel('issue')->getUserIssuePairs($account); $risks = $this->loadModel('risk')->getUserRiskPairs($account); @@ -599,7 +599,7 @@ class todo extends control if($type == 'story') $todo->name = isset($stories[$todo->idvalue]) ? $stories[$todo->idvalue] . "(#$todo->idvalue)" : ''; if($type == 'task') $todo->name = isset($tasks[$todo->idvalue]) ? $tasks[$todo->idvalue] . "(#$todo->idvalue)" : ''; - if(isset($this->config->maxVersion)) + if($this->config->edition == 'max') { if($type == 'issue') $todo->name = isset($issues[$todo->idvalue]) ? $issues[$todo->idvalue] . "(#$todo->idvalue)" : ''; if($type == 'risk') $todo->name = isset($risks[$todo->idvalue]) ? $risks[$todo->idvalue] . "(#$todo->idvalue)" : ''; @@ -617,7 +617,7 @@ class todo extends control unset($todo->idvalue); unset($todo->private); } - if(isset($this->config->bizVersion)) list($fields, $todos) = $this->loadModel('workflowfield')->appendDataFromFlow($fields, $todos); + if($this->config->edition != 'open') list($fields, $todos) = $this->loadModel('workflowfield')->appendDataFromFlow($fields, $todos); $this->post->set('fields', $fields); $this->post->set('rows', $todos); @@ -654,7 +654,7 @@ class todo extends control { $table = $objectType == 'project' ? TABLE_PROJECT : TABLE_PRODUCT; $field = $objectType == 'project' ? 'parent' : 'program'; - die($this->dao->select($field)->from($table)->where('id')->eq($objectID)->fetch($field)); + echo $this->dao->select($field)->from($table)->where('id')->eq($objectID)->fetch($field); } /** @@ -671,7 +671,7 @@ class todo extends control $executions = $this->loadModel('execution')->getByProject($projectID, 'undone'); foreach($executions as $id => $execution) $executions[$id] = $execution->name; - die(html::select('execution', $executions, '', "class='form-control chosen'")); + echo html::select('execution', $executions, '', "class='form-control chosen'"); } /** @@ -686,7 +686,7 @@ class todo extends control $this->session->set('project', $projectID); $products = $this->loadModel('product')->getProductPairsByProject($projectID); - die(html::select('bugProduct', $products, '', "class='form-control chosen'")); + echo html::select('bugProduct', $products, '', "class='form-control chosen'"); } /** diff --git a/module/todo/js/common.js b/module/todo/js/common.js index e2a16621bf..c1cd87d92c 100644 --- a/module/todo/js/common.js +++ b/module/todo/js/common.js @@ -49,6 +49,18 @@ function loadList(type, id) { $(divClass).html($(divID).html()); } + + if(nameBoxLabel) + { + if(type == 'custom') + { + $('#nameBoxLabel').text(nameBoxLabel.custom); + } + else + { + $('#nameBoxLabel').text(nameBoxLabel.idvalue); + } + } } function selectNext() diff --git a/module/todo/model.php b/module/todo/model.php index f565eb985b..66503aa2de 100644 --- a/module/todo/model.php +++ b/module/todo/model.php @@ -30,6 +30,7 @@ class todoModel extends model $todo = fixer::input('post') ->add('account', $this->app->user->account) ->setDefault('idvalue', 0) + ->setDefault('vision', $this->config->vision) ->setDefault('assignedTo', $this->app->user->account) ->setDefault('assignedBy', $this->app->user->account) ->setDefault('assignedDate', helper::now()) @@ -175,6 +176,7 @@ class todoModel extends model $todo->assignedTo = $this->app->user->account; $todo->assignedBy = $this->app->user->account; $todo->assignedDate = $now; + $todo->vision = $this->config->vision; if(in_array($todo->type, $this->config->todo->moduleList)) $todo->idvalue = isset($todos->{$this->config->todo->objectList[$todo->type]}[$i + 1]) ? $todos->{$this->config->todo->objectList[$todo->type]}[$i + 1] : 0; @@ -186,7 +188,7 @@ class todoModel extends model if(isset($object->title)) $todo->name = $object->title; } - if($todo->end < $todo->begin) die(js::alert(sprintf($this->lang->error->gt, $this->lang->todo->end, $this->lang->todo->begin))); + if($todo->end < $todo->begin) return print(js::alert(sprintf($this->lang->error->gt, $this->lang->todo->end, $this->lang->todo->begin))); $validTodos[] = $todo; } @@ -208,7 +210,7 @@ class todoModel extends model if(dao::isError()) { echo js::error(dao::getError()); - die(js::reload('parent')); + return print(js::reload('parent')); } $todoID = $this->dao->lastInsertID(); $todoIDList[] = $todoID; @@ -334,7 +336,7 @@ class todoModel extends model { $todo->idvalue = isset($data->{$this->config->todo->objectList[$todo->type]}[$todoID]) ? $data->{$this->config->todo->objectList[$todo->type]}[$todoID] : 0; } - if($todo->end < $todo->begin) die(js::alert(sprintf($this->lang->error->gt, $this->lang->todo->end, $this->lang->todo->begin))); + if($todo->end < $todo->begin) return print(js::alert(sprintf($this->lang->error->gt, $this->lang->todo->end, $this->lang->todo->begin))); $todos[$todoID] = $todo; } @@ -367,7 +369,7 @@ class todoModel extends model } else { - die(js::error('todo#' . $todoID . dao::getError(true))); + return print(js::error('todo#' . $todoID . dao::getError(true))); } } } @@ -426,10 +428,10 @@ class todoModel extends model if($todo->type == 'story') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_STORY)->fetch('title'); if($todo->type == 'task') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_TASK)->fetch('name'); if($todo->type == 'bug') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_BUG)->fetch('title'); - if($todo->type == 'issue' and isset($this->config->maxVersion)) $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_ISSUE)->fetch('title'); - if($todo->type == 'risk' and isset($this->config->maxVersion)) $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_RISK)->fetch('name'); - if($todo->type == 'opportunity' and isset($this->config->maxVersion)) $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_OPPORTUNITY)->fetch('name'); - if($todo->type == 'review' and isset($this->config->maxVersion)) $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_REVIEW)->fetch('title'); + if($todo->type == 'issue' and $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_ISSUE)->fetch('title'); + if($todo->type == 'risk' and $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_RISK)->fetch('name'); + if($todo->type == 'opportunity' and $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_OPPORTUNITY)->fetch('name'); + if($todo->type == 'review' and $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_REVIEW)->fetch('title'); if($todo->type == 'testtask') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_TESTTASK)->fetch('name'); $todo->date = str_replace('-', '', $todo->date); return $todo; @@ -500,7 +502,7 @@ class todoModel extends model elseif($type == 'before') { $begin = '1970-01-01'; - $end = date::yesterday(); + $end = date::today(); } elseif($type == 'cycle') { @@ -515,6 +517,7 @@ class todoModel extends model $stmt = $this->dao->select('*')->from(TABLE_TODO) ->where('deleted')->eq('0') + ->andWhere('vision')->eq($this->config->vision) ->beginIF($type == 'assignedtoother')->andWhere('account', true)->eq($account)->fi() ->beginIF($type != 'assignedtoother')->andWhere('assignedTo', true)->eq($account)->fi() ->orWhere('finishedBy')->eq($account) @@ -542,10 +545,10 @@ class todoModel extends model if($todo->type == 'task') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_TASK)->fetch('name'); if($todo->type == 'bug') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_BUG)->fetch('title'); if($todo->type == 'testtask') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_TESTTASK)->fetch('name'); - if($todo->type == 'issue' && isset($this->config->maxVersion)) $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_ISSUE)->fetch('title'); - if($todo->type == 'risk' && isset($this->config->maxVersion)) $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_RISK)->fetch('name'); - if($todo->type == 'opportunity' && isset($this->config->maxVersion)) $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_OPPORTUNITY)->fetch('name'); - if($todo->type == 'review' && isset($this->config->maxVersion)) $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_REVIEW)->fetch('title'); + if($todo->type == 'issue' && $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_ISSUE)->fetch('title'); + if($todo->type == 'risk' && $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_RISK)->fetch('name'); + if($todo->type == 'opportunity' && $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_OPPORTUNITY)->fetch('name'); + if($todo->type == 'review' && $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_REVIEW)->fetch('title'); $todo->begin = date::formatTime($todo->begin); $todo->end = date::formatTime($todo->end); @@ -799,6 +802,7 @@ class todoModel extends model return $this->dao->select('count(*) as count')->from(TABLE_TODO) ->where('cycle')->eq('0') ->andWhere('deleted')->eq('0') + ->andWhere('vision')->eq($this->config->vision) ->andWhere('account', true)->eq($account) ->orWhere('assignedTo')->eq($account) ->orWhere('finishedBy')->eq($account) diff --git a/module/todo/view/batchcreate.html.php b/module/todo/view/batchcreate.html.php index 1d1b307da9..4fb05c2e10 100755 --- a/module/todo/view/batchcreate.html.php +++ b/module/todo/view/batchcreate.html.php @@ -14,34 +14,34 @@ todo->moduleList)?> todo->getUserObjectsMethod)?> -'> -
-
-

todo->batchCreate . $lang->todo->common;?>

-
- todo->date;?> - - -
- - -
-
-
-
- createLink('custom', 'ajaxSaveCustomFields', 'module=todo§ion=custom&key=batchCreateFields')?> - -
-
+
+
+

todo->batchCreate . $lang->todo->common;?>

+
+ todo->date;?> + + +
+ + +
+
- +
+ createLink('custom', 'ajaxSaveCustomFields', 'module=todo§ion=custom&key=batchCreateFields')?> + +
+
+
+ + '>
task->execution;?>execution", $execution->name)) echo $execution->name;?> + type != 'kanban') + { + common::printLink('execution', $method, "executionID={$task->execution}", $execution->name); + } + else + { + echo $execution->name; + } + ?> +
task->module;?>"; - if(isset($this->config->bizVersion)) $this->loadModel('flow')->printFlowCell('testcase', $case, $id); + if($this->config->edition != 'open') $this->loadModel('flow')->printFlowCell('testcase', $case, $id); switch($id) { case 'id': @@ -1562,7 +1562,7 @@ class testcaseModel extends model else { $showBranch = isset($this->config->testcase->browse->showBranch) ? $this->config->testcase->browse->showBranch : 1; - } + } if(isset($branches[$case->branch]) and $showBranch) echo "{$branches[$case->branch]} "; if($modulePairs and $case->module and isset($modulePairs[$case->module])) echo "{$modulePairs[$case->module]} "; echo $canView ? ($fromCaseID ? html::a($caseLink, $case->title, null, "style='color: $case->color' data-app='{$this->app->tab}'") . html::a(helper::createLink('testcase', 'view', "caseID=$fromCaseID"), "[#$fromCaseID]", '', "data-app='{$this->app->tab}'") : html::a($caseLink, $case->title, null, "style='color: $case->color' data-app='{$this->app->tab}'")) : "$case->title"; diff --git a/module/testcase/view/bugs.html.php b/module/testcase/view/bugs.html.php index 84da9259f5..93e36b1534 100644 --- a/module/testcase/view/bugs.html.php +++ b/module/testcase/view/bugs.html.php @@ -9,7 +9,7 @@
idAB;?> bug->title;?> priAB;?>pri;?>>priAB;?> bug->type;?> statusAB;?> bug->assignedTo;?> idAB;?> priAB;?>testcase->pri;?>> priAB;?> testcase->title;?> typeAB;?> testtask->lastRunAccount;?>testcase->branch ?> priAB);?> testcase->title);?>pri;?>>priAB);?>testcase->title);?> testcase->fromModule ?> testcase->module ?> testcase->type)?> priAB;?>pri;?>>priAB;?> testcase->product;?> testcase->title;?> testcase->type;?> testsuite->linkVersion;?>priAB;?>pri;?>>priAB;?> testcase->title;?> testcase->type;?> openedByAB;?> priAB);?>testsuite->pri;?>>priAB);?> testcase->module);?> testcase->title);?> testcase->type);?>"; - if(isset($this->config->bizVersion)) $this->loadModel('flow')->printFlowCell('testcase', $run, $id); + if($this->config->edition != 'open') $this->loadModel('flow')->printFlowCell('testcase', $run, $id); switch ($id) { case 'id': diff --git a/module/testtask/view/groupcase.html.php b/module/testtask/view/groupcase.html.php index b5af67b4ab..852b74292a 100644 --- a/module/testtask/view/groupcase.html.php +++ b/module/testtask/view/groupcase.html.php @@ -26,7 +26,7 @@ idAB;?> priAB;?>priAB;?> testcase->title;?> typeAB;?> testtask->assignedTo;?> testtask->linkVersion;?>priAB;?>priAB;?> testcase->title;?> testcase->type;?> openedByAB;?> idAB;?> priAB;?> priAB;?> testcase->title;?> testtask->lastRunAccount;?> testtask->lastRunTime;?>
@@ -88,8 +88,8 @@
'>
- -
+ +