diff --git a/module/doc/config.php b/module/doc/config.php index 46870b09ff..28310b0a3c 100644 --- a/module/doc/config.php +++ b/module/doc/config.php @@ -13,6 +13,7 @@ $config->doc->create->requiredFields = 'title'; $config->doc->edit->requiredFields = 'title'; $config->doc->customObjectLibs = 'files,customFiles'; +$config->doc->notArticleType = ''; $config->doc->custom = new stdclass(); $config->doc->custom->objectLibs = $config->doc->customObjectLibs; diff --git a/module/doc/model.php b/module/doc/model.php index 2971b0bb8f..2a9f989037 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -103,7 +103,6 @@ class docModel extends model $actions = $this->setFastMenu($fastLib); $actions .= common::hasPriv('doc', 'createLib') ? html::a(helper::createLink('doc', 'createLib', "type={$type}&objectID={$currentLib}"), " " . $this->lang->doc->createLib, '', "class='btn btn-secondary iframe'") : ''; - if($libID and common::hasPriv('doc', 'create')) $actions .= html::a(helper::createLink('doc', 'create', "libID=$libID"), " " . $this->lang->doc->create, '', "class='btn btn-primary'"); $this->lang->modulePageActions = $actions; } @@ -284,6 +283,7 @@ class docModel extends model ->beginIF($this->config->global->flow == 'onlyStory' || $this->config->global->flow == 'onlyTest')->andWhere('project')->eq(0)->fi() ->beginIF($libID)->andWhere('lib')->in($libID)->fi() ->andWhere('lib')->in($allLibs) + ->beginIF($this->config->doc->notArticleType)->andWhere('type')->notIN($this->config->doc->notArticleType)->fi() ->andWhere('addedBy')->eq($this->app->user->account) ->orderBy($sort) ->page($pager) @@ -296,6 +296,7 @@ class docModel extends model ->beginIF($this->config->global->flow == 'onlyTask')->andWhere('product')->eq(0)->fi() ->beginIF($this->config->global->flow == 'onlyStory' || $this->config->global->flow == 'onlyTest')->andWhere('project')->eq(0)->fi() ->andWhere('id')->in($docIdList) + ->beginIF($this->config->doc->notArticleType)->andWhere('type')->notIN($this->config->doc->notArticleType)->fi() ->andWhere('lib')->in($allLibs) ->orderBy('editedDate_desc') ->page($pager) @@ -309,6 +310,7 @@ class docModel extends model ->beginIF($this->config->global->flow == 'onlyStory' || $this->config->global->flow == 'onlyTest')->andWhere('project')->eq(0)->fi() ->beginIF($libID)->andWhere('lib')->in($libID)->fi() ->andWhere('lib')->in($allLibs) + ->beginIF($this->config->doc->notArticleType)->andWhere('type')->notIN($this->config->doc->notArticleType)->fi() ->andWhere('collector')->like("%,{$this->app->user->account},%") ->orderBy($sort) ->page($pager) @@ -353,6 +355,7 @@ class docModel extends model $docs = $this->dao->select('*')->from(TABLE_DOC)->where($docQuery) ->beginIF(!$libCond)->andWhere("lib")->eq($libID)->fi() + ->beginIF($this->config->doc->notArticleType)->andWhere('type')->notIN($this->config->doc->notArticleType)->fi() ->andWhere('deleted')->eq(0) ->fetchAll('id'); foreach($docs as $docID => $doc) @@ -377,6 +380,7 @@ class docModel extends model ->beginIF($this->config->global->flow == 'onlyStory' || $this->config->global->flow == 'onlyTest')->andWhere('project')->eq(0)->fi() ->beginIF(!empty($docIdList))->andWhere('t1.id')->in($docIdList)->fi() ->andWhere('t1.title', true)->like("%{$this->session->searchDoc}%") + ->beginIF($this->config->doc->notArticleType)->andWhere('type')->notIN($this->config->doc->notArticleType)->fi() ->orWhere('t2.content')->like("%{$this->session->searchDoc}%")->markRight(1) ->andWhere('t1.lib')->in($allLibs) ->orderBy($sort) @@ -454,6 +458,7 @@ class docModel extends model { $stmt = $this->dao->select('*')->from(TABLE_DOC) ->where('deleted')->eq(0) + ->beginIF($this->config->doc->notArticleType)->andWhere('type')->notIN($this->config->doc->notArticleType)->fi() ->beginIF($libID)->andWhere('lib')->in($libID)->fi() ->beginIF(!empty($module))->andWhere('module')->in($module)->fi() ->query(); diff --git a/module/doc/view/browse.html.php b/module/doc/view/browse.html.php index db58844c62..948518eec6 100644 --- a/module/doc/view/browse.html.php +++ b/module/doc/view/browse.html.php @@ -38,16 +38,23 @@ var browseType = ''; - + +