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 @@
app->openApp) !== false ? $this->app->openApp : 'qa';?> - product}&branch={$bug->branch}&extra=moduleID={$bug->module},projectID={$bug->project},executionID={$bug->execution}", " " . $lang->bug->create, '', "class='btn btn-primary' data-app='$openApp'"); ?> + app->openApp != 'product') common::printLink('bug', 'create', "productID={$bug->product}&branch={$bug->branch}&extra=moduleID={$bug->module},projectID={$bug->project},executionID={$bug->execution}", " " . $lang->bug->create, '', "class='btn btn-primary' data-app='$openApp'"); ?>
@@ -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 @@ doc->title;?> + doc->object;?> doc->size;?> doc->addedBy;?> doc->addedDate;?> @@ -49,6 +50,14 @@ collector, ',' . $this->app->user->account . ',') !== false ? $lang->doc->cancelCollection : $lang->doc->collect;?> createLink('doc', 'view', "docID=$doc->id&version=0", '', true), "  " . $doc->title, '', "title={$doc->title} class='iframe' data-width='90%'");?> + + objectType)):?> + {$doc->objectType}->common . ' : ';?> + objectID");?>' data-app="objectType;?>"> + objectName;?> + + + fileSize ? $doc->fileSize : '-';?> addedBy);?> addedDate, 'y-m-d');?> diff --git a/module/execution/view/dynamic.html.php b/module/execution/view/dynamic.html.php index 488962a9be..b7f7185db3 100755 --- a/module/execution/view/dynamic.html.php +++ b/module/execution/view/dynamic.html.php @@ -87,7 +87,7 @@ actionLabel;?> objectLabel;?> objectID;?> - objectLink, $action->objectName);?> + objectName) echo html::a($action->objectLink, $action->objectName);?> diff --git a/module/my/control.php b/module/my/control.php index 2bb5f21477..d27d9ae06e 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -480,9 +480,14 @@ class my extends control public function doc($type = 'openedbyme', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { /* Save session, load lang. */ - if($this->app->viewType != 'json') $this->session->set('docList', $this->app->getURI(true), 'doc'); + $uri = $this->app->getURI(true); + if($this->app->viewType != 'json') $this->session->set('docList', $uri, 'doc'); $this->loadModel('doc'); + $this->session->set('productList', $uri, 'product'); + $this->session->set('executionList', $uri, 'execution'); + $this->session->set('projectList', $uri, 'project'); + /* Load pager. */ $this->app->loadClass('pager', $static = true); $pager = pager::init($recTotal, $recPerPage, $pageID); diff --git a/module/my/view/doc.html.php b/module/my/view/doc.html.php index 7dc567d712..4c777bbdc7 100644 --- a/module/my/view/doc.html.php +++ b/module/my/view/doc.html.php @@ -34,6 +34,7 @@ doc->title;?> + doc->object;?> doc->size;?> doc->addedBy;?> @@ -49,6 +50,14 @@ collector, ',' . $this->app->user->account . ',') !== false ? $lang->doc->cancelCollection : $lang->doc->collect;?> createLink('doc', 'view', "docID=$doc->id&version=0&from={$lang->navGroup->doc}", '', true), "  " . $doc->title, '', "title={$doc->title} class='iframe' data-width='90%'");?> + + objectType)):?> + {$doc->objectType}->common . ' : ';?> + objectID");?>' data-app="objectType;?>"> + objectName;?> + + + fileSize ? $doc->fileSize : '-';?> addedBy);?> diff --git a/module/my/view/dynamic.html.php b/module/my/view/dynamic.html.php index bec16a86e1..e375481f11 100644 --- a/module/my/view/dynamic.html.php +++ b/module/my/view/dynamic.html.php @@ -60,7 +60,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/my/view/task.html.php b/module/my/view/task.html.php index 1c777b2ce0..b5ced4b4ba 100644 --- a/module/my/view/task.html.php +++ b/module/my/view/task.html.php @@ -50,6 +50,7 @@ priAB);?> task->name);?> + my->projects);?> my->executions);?> openedByAB);?> @@ -90,7 +91,8 @@ createLink('task', 'view', "taskID=$task->id", '', '', $task->project), $task->name, null, "style='color: $task->color' data-group='execution'");?> children)) echo '';?> - createLink('execution', 'task', "executionID=$task->execution", '', '', $task->project), $task->executionName, '', "data-group='execution'");?> + createLink('project', 'view', "projectID=$task->project"), zget($projects, $task->project));?> + createLink('execution', 'task', "executionID=$task->execution"), $task->executionName, '', "data-group='execution'");?> openedBy);?> @@ -154,7 +156,8 @@ parent > 0) echo '' . $this->lang->task->childrenAB . ' ';?> createLink('task', 'view', "taskID=$child->id", '', '', $child->project), $child->name, null, "style='color: $child->color' data-group='project'");?> - createLink('execution', 'task', "executionID=$child->project", '', '', $child->project), $child->executionName, '', "data-group='execution'");?> + createLink('project', 'view', "projectID=$child->project"), zget($projects, $child->project));?> + createLink('execution', 'task', "executionID=$child->project"), $child->executionName, '', "data-group='execution'");?> openedBy);?> diff --git a/module/product/view/dynamic.html.php b/module/product/view/dynamic.html.php index 15cfa32eb3..22a202c115 100755 --- a/module/product/view/dynamic.html.php +++ b/module/product/view/dynamic.html.php @@ -86,7 +86,7 @@ actionLabel;?> objectLabel;?> objectID;?> - objectLink, $action->objectName);?> + objectName) echo html::a($action->objectLink, $action->objectName);?> diff --git a/module/productplan/view/.view.html.php.swp b/module/productplan/view/.view.html.php.swp new file mode 100644 index 0000000000..e9826fd45c Binary files /dev/null and b/module/productplan/view/.view.html.php.swp differ diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php index 6ae0af8f1e..08a0c5cc10 100644 --- a/module/productplan/view/view.html.php +++ b/module/productplan/view/view.html.php @@ -392,7 +392,7 @@ bug->priList, $bug->pri, $bug->pri);?> - createLink('bug', 'view', "bugID=$bug->id"), $bug->title);?> + createLink('bug', 'view', "bugID=$bug->id"), $bug->title, '', 'data-app="product"');?> openedBy);?> assignedTo);?> diff --git a/module/program/model.php b/module/program/model.php index 197b011be2..5b891db4f4 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -773,7 +773,7 @@ class programModel extends model $treeMenu = array(); foreach($modules as $module) { - if(strpos($this->app->user->view->programs, $module->id) === false) continue; + if(strpos($this->app->user->view->programs, $module->id) === false and (!$this->app->user->admin)) continue; $moduleName = '/'; $parentModules = explode(',', $module->path); diff --git a/module/project/view/dynamic.html.php b/module/project/view/dynamic.html.php index 1c99f2b2c1..11e7b048d5 100755 --- a/module/project/view/dynamic.html.php +++ b/module/project/view/dynamic.html.php @@ -87,7 +87,7 @@ actionLabel;?> objectLabel;?> objectID;?> - objectLink, $action->objectName);?> + objectName) echo html::a($action->objectLink, $action->objectName);?> diff --git a/module/upgrade/model.php b/module/upgrade/model.php index d7bab9e0da..d850944a5c 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -4701,10 +4701,18 @@ class upgradeModel extends model $today = helper::today(); foreach($projectTeams as $projectID => $projectMember) { + unset($projectMember['']); $project = zget($projects, $projectID, ''); + $users = implode(',', $projectMember); + + $this->dao->update(TABLE_DOCLIB) + ->set('users')->eq($users) + ->where('project')->eq($projectID) + ->andWhere('main')->eq(1) + ->exec(); + foreach($projectMember as $account) { - if(empty($account)) continue; if(!isset($users[$account])) continue; $user = $users[$account]; diff --git a/module/user/view/dynamic.html.php b/module/user/view/dynamic.html.php index 2b15182dd3..e84f294dcb 100644 --- a/module/user/view/dynamic.html.php +++ b/module/user/view/dynamic.html.php @@ -55,7 +55,7 @@ actionLabel;?> objectLabel;?> objectID;?> - objectLink, $action->objectName);?> + objectName) echo html::a($action->objectLink, $action->objectName);?>