* Finish task #3184.

This commit is contained in:
pengjiangxiu
2017-08-18 13:51:29 +08:00
parent c06e7bfb03
commit 4732bfaebc
3 changed files with 30 additions and 29 deletions
+12 -12
View File
@@ -56,15 +56,15 @@ class doc extends control
/**
* Browse docs.
*
*
* @param string|int $libID product|project or the int id of custom library
* @param int $moduleID
* @param int $productID
* @param int $projectID
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @param int $moduleID
* @param int $productID
* @param int $projectID
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return void
*/
@@ -75,7 +75,7 @@ class doc extends control
$this->loadModel('search');
/* Set browseType.*/
/* Set browseType.*/
$browseType = strtolower($browseType);
if(($this->cookie->browseType == 'bymenu' or $this->cookie->browseType == 'bytree') and $browseType != 'bysearch') $browseType = $this->cookie->browseType;
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
@@ -128,10 +128,10 @@ class doc extends control
/* Append id for secend sort. */
if($browseType == 'bymenu' and strtolower($orderBy) != 'editeddate_desc' and strtolower($orderBy) != 'addeddate_desc') $orderBy = 'title_asc';
$sort = $this->loadModel('common')->appendOrder($orderBy);
/* Get docs by browse type. */
$docs = $this->doc->getDocsByBrowseType($libID, $browseType, $queryID, $moduleID, $sort, $pager);
/* Build the search form. */
$actionURL = $this->createLink('doc', 'browse', "lib=$libID&browseType=bySearch&queryID=myQueryID&orderBy=$orderBy&from=$from");
$this->doc->buildSearchForm($libID, $this->libs, $queryID, $actionURL, $type);
@@ -637,7 +637,7 @@ class doc extends control
$lib = $this->project->getById($objectID);
if(!$this->project->checkPriv($lib)) $this->accessDenied();
}
$this->doc->setMenu($libID = 0, $moduleID = 0, $crumb);
}
+17 -16
View File
@@ -263,13 +263,13 @@ class docModel extends model
/**
* Get docs.
*
* @param int|string $libID
* @param int $productID
* @param int $projectID
* @param int $module
* @param string $orderBy
* @param object $pager
*
* @param int|string $libID
* @param int $productID
* @param int $projectID
* @param int $module
* @param string $orderBy
* @param object $pager
* @access public
* @return void
*/
@@ -286,9 +286,9 @@ class docModel extends model
/**
* Get priv docs.
*
* @param int $libID
* @param int $module
*
* @param int $libID
* @param int $module
* @access public
* @return void
*/
@@ -298,6 +298,7 @@ class docModel extends model
->where('deleted')->eq(0)
->beginIF($libID)->andWhere('lib')->in($libID)->fi()
->beginIF($module)->andWhere('module')->in($module)->fi()
->beginIF($this->cookie->browseType == 'bymenu')->andWhere('module')->in($module)->fi()
->query();
$docIdList = array();
@@ -310,9 +311,9 @@ class docModel extends model
/**
* Get doc info by id.
*
* @param int $docID
* @param bool $setImgSize
*
* @param int $docID
* @param bool $setImgSize
* @access public
* @return void
*/
@@ -908,9 +909,9 @@ class docModel extends model
/**
* Get lib files.
*
* @param string $type
* @param int $objectID
*
* @param string $type
* @param int $objectID
* @access public
* @return array
*/
+1 -1
View File
@@ -92,7 +92,7 @@ var browseType = '<?php echo $browseType;?>';
<td><?php echo substr($doc->addedDate, 5, 11);?></td>
<td><?php echo substr($doc->editedDate, 5, 11);?></td>
<td>
<?php
<?php
common::printIcon('doc', 'edit', "doc={$doc->id}", '', 'list');
if(common::hasPriv('doc', 'delete'))
{