* Adjust the doc module.

This commit is contained in:
leiyong
2020-11-13 09:58:53 +08:00
parent 1065817f17
commit 90f9182ddc
2 changed files with 26 additions and 2 deletions
+1 -1
View File
@@ -147,7 +147,7 @@ $lang->doc->orderLib = '文档库排序';
$lang->doc->customShowLibs = '显示设置';
$lang->doc->customShowLibsList['zero'] = '显示空文档的库';
$lang->doc->customShowLibsList['children'] = '显示子分类的文档';
$lang->doc->customShowLibsList['unclosed'] = '只显示未关闭的项目';
$lang->doc->customShowLibsList['unclosed'] = '只显示未关闭的' . $lang->projectCommon;
$lang->doc->confirmDelete = "您确定删除该文档吗?";
$lang->doc->confirmDeleteLib = "您确定删除该文档库吗?";
+25 -1
View File
@@ -1471,6 +1471,28 @@ class docModel extends model
return $teams;
}
/**
* Get project-related document library IDs.
*
* @param $projectID
* @access public
* @return array
*/
public function getLibIDByProject($projectID = 0)
{
$products = $this->loadModel('product')->getProductIDByProject($projectID, false);
$projects = $this->loadModel('project')->getProjectIDByProgram($projectID);
$projectLibs = array();
$productLibs = array();
if($projects) $projectLibs = $this->dao->select('id')->from(TABLE_DOCLIB)->where('project')->in($projects)->fetchPairs();
if($products) $productLibs = $this->dao->select('id')->from(TABLE_DOCLIB)->where('product')->in($products)->fetchPairs();
$customLibs = $this->dao->select('id')->from(TABLE_DOCLIB)->where('type')->eq('custom')->fetchPairs();
$libIDList = array_merge($customLibs, $projectLibs, $productLibs);
return $libIDList;
}
/**
* Get statistic information.
*
@@ -1479,7 +1501,9 @@ class docModel extends model
*/
public function getStatisticInfo()
{
$docIdList = $this->getPrivDocs();
$libID = 0;
if($this->session->PRJ) $libID = $this->getLibIDByProject($this->session->PRJ);
$docIdList = $this->getPrivDocs($libID);
$today = date('Y-m-d');
$lately = date('Y-m-d', strtotime('-3 day'));