Merge branch 'sprint/206_liumengyi_fixbug' into 'master'

* Fix bug #24246, #24214.

See merge request easycorp/zentaopms!4127
This commit is contained in:
王怡栋
2022-06-24 01:17:33 +00:00
3 changed files with 22 additions and 10 deletions
+2 -2
View File
@@ -73,11 +73,11 @@ class api extends control
if($libs) $this->lang->modulePageNav = $this->generateLibsDropMenu($libs, $libID, $release);
$this->setMenu($libID, $moduleID);
if($apiID == 0) $this->lang->TRActions = '<a class="btn btn-link querybox-toggle" id="bysearchTab"><i class="icon icon-search muted"></i> ' . $this->lang->api->search . '</a>' . $this->lang->TRActions;
$this->lang->TRActions = '<a class="btn btn-link querybox-toggle" id="bysearchTab"><i class="icon icon-search muted"></i> ' . $this->lang->api->search . '</a>' . $this->lang->TRActions;
/* Build the search form. */
$queryID = $param == 'bySearch' ? (int)$queryID : 0;
$actionURL = $this->createLink('api', 'index', "libID=$libID&moduleID=$moduleID&apiID=$apiID&version=$version&release=$release&appendLib=$appendLib&queryID=myQueryID&param=bySearch");
$actionURL = $this->createLink('api', 'index', "libID=$libID&moduleID=0&apiID=0&version=0&release=0&appendLib=0&queryID=myQueryID&param=bySearch");
$this->api->buildSearchForm($lib,$queryID, $actionURL);
if($param == 'bySearch')
+8 -2
View File
@@ -904,10 +904,12 @@ class doc extends control
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @param string $searchTitle
*
* @access public
* @return void
*/
public function showFiles($type, $objectID, $viewType = '', $orderBy = 't1.id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
public function showFiles($type, $objectID, $viewType = '', $orderBy = 't1.id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1, $searchTitle = '')
{
if(empty($viewType)) $viewType = !empty($_COOKIE['docFilesViewType']) ? $this->cookie->docFilesViewType : 'card';
setcookie('docFilesViewType', $viewType, $this->config->cookieLife, $this->config->webRoot, '', false, true);
@@ -923,8 +925,12 @@ class doc extends control
$table = $this->config->objectTables[$type];
$object = $this->dao->select('id,name,status')->from($table)->where('id')->eq($objectID)->fetch();
if(!empty($_POST)) $searchTitle = $this->post->title;
if(empty($_POST) and !empty($searchTitle)) $this->post->title = $searchTitle;
$this->lang->TRActions = $this->doc->buildCollectButton4Doc();
$this->lang->TRActions .= $this->doc->buildBrowseSwitch($type, $objectID, $viewType);
$this->lang->TRActions .= $this->doc->buildBrowseSwitch($type, $objectID, $viewType, $orderBy, $recTotal, $recPerPage, $pageID, $searchTitle);
if($this->app->tab == 'doc') $this->app->rawMethod = $type;
/* Load pager. */
$this->app->loadClass('pager', $static = true);
+12 -6
View File
@@ -2215,17 +2215,23 @@ class docModel extends model
/**
* Build browse switch button.
*
* @param int $type
* @param int $objectID
* @param int $viewType
* @param int $type
* @param int $objectID
* @param int $viewType
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @param string $searchTitle
*
* @access public
* @return void
*/
public function buildBrowseSwitch($type, $objectID, $viewType)
public function buildBrowseSwitch($type, $objectID, $viewType, $orderBy = 't1.id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1, $searchTitle = '')
{
$html = "<div class='btn-group'>";
$html .= html::a(inlink('showFiles', "type=$type&objectID=$objectID&viewType=card"), "<i class='icon icon-cards-view'></i>", '', "title={$this->lang->doc->browseTypeList['grid']} class='btn btn-icon" . ($viewType != 'list' ? ' text-primary' : '') . "' data-app='{$this->app->tab}'");
$html .= html::a(inlink('showFiles', "type=$type&objectID=$objectID&viewType=list"), "<i class='icon icon-bars'></i>", '', "title={$this->lang->doc->browseTypeList['list']} class='btn btn-icon" . ($viewType == 'list' ? ' text-primary' : '') . "' data-app='{$this->app->tab}'");
$html .= html::a(inlink('showFiles', "type=$type&objectID=$objectID&viewType=card&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID&searchTitle=$searchTitle"), "<i class='icon icon-cards-view'></i>", '', "title={$this->lang->doc->browseTypeList['grid']} class='btn btn-icon" . ($viewType != 'list' ? ' text-primary' : '') . "' data-app='{$this->app->tab}'");
$html .= html::a(inlink('showFiles', "type=$type&objectID=$objectID&viewType=list&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID&searchTitle=$searchTitle"), "<i class='icon icon-bars'></i>", '', "title={$this->lang->doc->browseTypeList['list']} class='btn btn-icon" . ($viewType == 'list' ? ' text-primary' : '') . "' data-app='{$this->app->tab}'");
$html .= "</div>";
return $html;