diff --git a/api/v1/entries/projectissues.php b/api/v1/entries/projectissues.php index a1bc18a945..8665b880ff 100644 --- a/api/v1/entries/projectissues.php +++ b/api/v1/entries/projectissues.php @@ -71,6 +71,7 @@ class projectIssuesEntry extends entry $executions = $this->dao->select('project')->from(TABLE_PROJECTPRODUCT)->where('product')->eq($productID)->fetchPairs(); $tasks = $this->dao->select($taskFields)->from(TABLE_TASK)->where('execution')->in(array_values($executions)) ->beginIF($search)->andWhere('name')->like("%$search%")->fi() + ->beginIF($label)->andWhere('type')->eq($label)->fi() ->beginIF($status)->andWhere('status')->in($taskStatus[$status])->fi() ->andWhere('deleted')->eq(0) ->fetchAll(); @@ -78,6 +79,7 @@ class projectIssuesEntry extends entry $stories = $this->dao->select($storyFields)->from(TABLE_STORY)->where('product')->eq($productID) ->beginIF($search)->andWhere('title')->like("%$search%")->fi() + ->beginIF($label)->andWhere('type')->eq($label)->fi() ->beginIF($status)->andWhere('status')->in($storyStatus[$status])->fi() ->andWhere('deleted')->eq(0) ->fetchAll(); @@ -88,6 +90,7 @@ class projectIssuesEntry extends entry $bugs = $this->dao->select($bugFields)->from(TABLE_BUG)->where('product')->eq($productID) ->beginIF($search)->andWhere('title')->like("%$search%")->fi() + ->beginIF($label)->andWhere('type')->eq($label)->fi() ->beginIF($status)->andWhere('status')->in($bugStatus[$status])->fi() ->andWhere('deleted')->eq(0) ->fetchAll(); diff --git a/config/config.php b/config/config.php index c40431462b..a22a58ecc6 100644 --- a/config/config.php +++ b/config/config.php @@ -109,7 +109,7 @@ $config->framework->purifier = true; // 是否对数据做purifier处理 $config->framework->logDays = 14; // 日志文件保存的天数。 The days to save log files. $config->framework->autoRepairTable = true; $config->framework->autoLang = false; -$config->framework->filterCSRF = false; +$config->framework->filterCSRF = true; $config->framework->setCookieSecure = true; $config->framework->sendXCTO = true; // Send X-Content-Type-Options header. $config->framework->sendXXP = true; // Send X-XSS-Protection header. diff --git a/framework/api/helper.class.php b/framework/api/helper.class.php index 6397974167..393952e38d 100644 --- a/framework/api/helper.class.php +++ b/framework/api/helper.class.php @@ -153,10 +153,10 @@ class helper extends baseHelper * @access public * @return string */ - public static function createLink($module, $method, $vars) + static public function createLink($moduleName, $methodName = 'index', $vars = '', $viewType = '', $onlyBody = false) { global $config; - $link = parent::createLink($module, $method, $vars, 'html'); + $link = parent::createLink($moduleName, $methodName, $vars, 'html'); $pos = strpos($link, '.php'); /* The requestTypes are: GET, PATH_INFO2, PATH_INFO */ @@ -172,6 +172,18 @@ class helper extends baseHelper } } +/** + * 检查是否是onlybody模式。 + * Check exist onlybody param. + * + * @access public + * @return void + */ +function isonlybody() +{ + return helper::inOnlyBodyMode(); +} + /** * Format time. * diff --git a/framework/base/router.class.php b/framework/base/router.class.php index 9bfa2a08c4..0ee006df6f 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -610,7 +610,8 @@ class baseRouter { $httpType = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') ? 'https' : 'http'; $httpHost = $_SERVER['HTTP_HOST']; - if((!defined('RUN_MODE') or RUN_MODE != 'api') and strpos($this->server->http_referer, "$httpType://$httpHost") !== 0) $_FILES = $_POST = array(); + $isAPI = (defined('RUN_MODE') && RUN_MODE == 'api') || isset($_GET[$this->config->sessionVar]); + if(!$isAPI && strpos($this->server->http_referer, "$httpType://$httpHost") !== 0) $_FILES = $_POST = array(); } $_FILES = validater::filterFiles(); diff --git a/module/bug/control.php b/module/bug/control.php index d9b2ab1289..7decc3783f 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -742,6 +742,11 @@ class bug extends control $this->repo->setMenu($repos); $this->lang->navGroup->bug = 'devops'; } + if($this->app->openApp == 'product') + { + $this->loadModel('product')->setMenu($bug->product); + $this->lang->product->menu->plan['subModule'] .= ',bug'; + } } /* Get product info. */ diff --git a/module/bug/view/view.html.php b/module/bug/view/view.html.php index 2f3277774f..517e5232b8 100644 --- a/module/bug/view/view.html.php +++ b/module/bug/view/view.html.php @@ -32,7 +32,7 @@
@@ -86,14 +86,20 @@ common::printIcon('bug', 'close', $params, $bug, 'button', '', '', 'text-danger iframe showinonlybody', true); common::printIcon('bug', 'activate', $params, $bug, 'button', '', '', 'text-success iframe showinonlybody', true); - common::printIcon('bug', 'toStory', "product=$bug->product&branch=$bug->branch&module=0&story=0&execution=0&bugID=$bug->id", $bug, 'button', $lang->icons['story'], '', '', '', "data-app='" . ($this->app->openApp == 'project' ? 'project' : 'product') . "'", $lang->bug->toStory); - common::printIcon('bug', 'createCase', $convertParams, $bug, 'button', 'sitemap'); + if($this->app->openApp != 'product') + { + common::printIcon('bug', 'toStory', "product=$bug->product&branch=$bug->branch&module=0&story=0&execution=0&bugID=$bug->id", $bug, 'button', $lang->icons['story'], '', '', '', "data-app='" . ($this->app->openApp == 'project' ? 'project' : 'product') . "'", $lang->bug->toStory); + common::printIcon('bug', 'createCase', $convertParams, $bug, 'button', 'sitemap'); + } echo $this->buildOperateMenu($bug, 'view'); echo ""; common::printIcon('bug', 'edit', $params, $bug); - common::printIcon('bug', 'create', $copyParams, $bug, 'button', 'copy', '', '', false, "data-app='qa'"); + if($this->app->openApp != 'product') + { + common::printIcon('bug', 'create', $copyParams, $bug, 'button', 'copy', '', '', false, "data-app='qa'"); + } common::printIcon('bug', 'delete', $params, $bug, 'button', 'trash', 'hiddenwin'); ?> diff --git a/module/common/lang/.menu.php.swp b/module/common/lang/.menu.php.swp new file mode 100644 index 0000000000..840cbd60ae Binary files /dev/null and b/module/common/lang/.menu.php.swp differ diff --git a/module/company/view/dynamic.html.php b/module/company/view/dynamic.html.php index a96ecd15c0..c9e949c9ef 100644 --- a/module/company/view/dynamic.html.php +++ b/module/company/view/dynamic.html.php @@ -64,7 +64,7 @@ objectType == 'meeting') $openApp = $action->project ? "data-app='project'" : "data-app='my'";?> maxVersion) and strpos($config->action->assetType, $action->objectType) !== false and empty($action->objectName)) + if((isset($config->maxVersion) and strpos($config->action->assetType, $action->objectType) !== false) or empty($action->objectName)) { echo '#' . $action->objectID; } diff --git a/module/doc/control.php b/module/doc/control.php index 7724b65df6..35f930da6f 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -70,7 +70,12 @@ class doc extends control */ public function browse($browseType = 'all', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { - $this->session->set('docList', $this->app->getURI(true), 'doc'); + /* Save session, load module. */ + $uri = $this->app->getURI(true); + $this->session->set('docList', $uri, 'doc'); + $this->session->set('productList', $uri, 'product'); + $this->session->set('executionList', $uri, 'execution'); + $this->session->set('projectList', $uri, 'project'); $this->loadModel('search'); /* Set browseType.*/ diff --git a/module/doc/js/browse.js b/module/doc/js/browse.js index 0b95e564e5..7069c7e805 100644 --- a/module/doc/js/browse.js +++ b/module/doc/js/browse.js @@ -1,4 +1,7 @@ $('.ajaxCollect').click(function() { - window.location.reload(); + if(browseType == 'collectedbyme') + { + window.location.reload(); + } }) diff --git a/module/doc/lang/de.php b/module/doc/lang/de.php index de3c45d8fe..25cd16baa5 100644 --- a/module/doc/lang/de.php +++ b/module/doc/lang/de.php @@ -16,6 +16,7 @@ $lang->doc->product = $lang->productCommon; $lang->doc->execution = $lang->executionCommon; $lang->doc->lib = 'Bibliothek'; $lang->doc->module = 'Modul'; +$lang->doc->object = 'Object'; $lang->doc->title = 'Titel'; $lang->doc->digest = 'Zusammenfassung'; $lang->doc->comment = 'Bemerkung'; diff --git a/module/doc/lang/en.php b/module/doc/lang/en.php index 86ad3fcb9c..95b90e6c8e 100644 --- a/module/doc/lang/en.php +++ b/module/doc/lang/en.php @@ -17,6 +17,7 @@ $lang->doc->project = 'Project'; $lang->doc->execution = $lang->executionCommon; $lang->doc->lib = 'Library'; $lang->doc->module = 'Catalog'; +$lang->doc->object = 'Object'; $lang->doc->title = 'Name'; $lang->doc->digest = 'Summary'; $lang->doc->comment = 'Comment'; diff --git a/module/doc/lang/fr.php b/module/doc/lang/fr.php index b7130464e3..b13b96b2c3 100644 --- a/module/doc/lang/fr.php +++ b/module/doc/lang/fr.php @@ -16,6 +16,7 @@ $lang->doc->product = $lang->productCommon; $lang->doc->execution = $lang->executionCommon; $lang->doc->lib = 'Bibliothèque'; $lang->doc->module = 'Catégorie'; +$lang->doc->object = 'Object'; $lang->doc->title = 'Nom'; $lang->doc->digest = 'Résumé'; $lang->doc->comment = 'Commentaire'; diff --git a/module/doc/lang/vi.php b/module/doc/lang/vi.php index 6104d9e766..d232acb35f 100644 --- a/module/doc/lang/vi.php +++ b/module/doc/lang/vi.php @@ -16,6 +16,7 @@ $lang->doc->product = $lang->productCommon; $lang->doc->execution = $lang->executionCommon; $lang->doc->lib = 'Thư viện'; $lang->doc->module = 'Danh mục'; +$lang->doc->object = 'Object'; $lang->doc->title = 'Tên'; $lang->doc->digest = 'Tóm tắt'; $lang->doc->comment = 'Nhận xét'; diff --git a/module/doc/lang/zh-cn.php b/module/doc/lang/zh-cn.php index 20d4dc8fd4..821eeb15ad 100644 --- a/module/doc/lang/zh-cn.php +++ b/module/doc/lang/zh-cn.php @@ -17,6 +17,7 @@ $lang->doc->project = '所属项目'; $lang->doc->execution = '所属' . $lang->executionCommon; $lang->doc->lib = '所属文档库'; $lang->doc->module = '所属目录'; +$lang->doc->object = '所属对象'; $lang->doc->title = '文档标题'; $lang->doc->digest = '文档摘要'; $lang->doc->comment = '文档备注'; diff --git a/module/doc/model.php b/module/doc/model.php index 6d46b39d42..a30c4b5658 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -255,9 +255,38 @@ class docModel extends model ->fetchAll('id'); } + $projects = $this->dao->select('t1.id, t1.name')->from(TABLE_PROJECT)->alias('t1') + ->leftJoin(TABLE_DOC)->alias('t2')->on('t1.id=t2.project') + ->where('t2.id')->in(array_keys($docs)) + ->andWhere('t2.execution')->eq(0) + ->fetchPairs(); + + $executions = $this->dao->select('t1.id, t1.name')->from(TABLE_EXECUTION)->alias('t1') + ->leftJoin(TABLE_DOC)->alias('t2')->on('t1.id=t2.execution') + ->where('t2.id')->in(array_keys($docs)) + ->fetchPairs(); + + $products = $this->dao->select('t1.id, t1.name')->from(TABLE_PRODUCT)->alias('t1') + ->leftJoin(TABLE_DOC)->alias('t2')->on('t1.id=t2.product') + ->where('t2.id')->in(array_keys($docs)) + ->fetchPairs(); + $docContents = $this->dao->select('*')->from(TABLE_DOCCONTENT)->where('doc')->in(array_keys($docs))->orderBy('version,doc')->fetchAll('doc'); + + $objects = array('product' => 'products', 'execution' => 'executions', 'project' => 'projects'); foreach($docs as $index => $doc) { + foreach($objects as $type => $object) + { + if(!empty($doc->{$type})) + { + $doc->objectID = $doc->{$type}; + $doc->objectName = ${$object}[$doc->{$type}]; + $doc->objectType = $type; + break; + } + } + $docs[$index]->fileSize = 0; if(isset($files[$index])) { diff --git a/module/doc/view/browse.html.php b/module/doc/view/browse.html.php index 2c4a7ad128..2b93faab33 100644 --- a/module/doc/view/browse.html.php +++ b/module/doc/view/browse.html.php @@ -36,6 +36,7 @@