Merge branch 'sprint/fixbug_hufangzhou_15656' into 'master'
* Fix bug #15656. See merge request easycorp/zentaopms!2907
This commit is contained in:
@@ -1366,7 +1366,7 @@ class actionModel extends model
|
||||
$appendLib = $docLib->deleted == '1' ? $action->objectID : 0;
|
||||
if($docLib->type == 'api')
|
||||
{
|
||||
$action->objectLink = helper::createLink('api', 'index', "libID={$action->objectID}");
|
||||
$action->objectLink = helper::createLink('api', 'index', "libID={$action->objectID}&moduleID=0&apiID=0&version=0&release=0&appendLib={$appendLib}");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+10
-7
@@ -22,18 +22,21 @@ class api extends control
|
||||
/**
|
||||
* Api doc index page.
|
||||
*
|
||||
* @param int $libID
|
||||
* @param int $moduleID
|
||||
* @param int $apiID
|
||||
* @param int $version
|
||||
* @param int $release
|
||||
* @param int $libID
|
||||
* @param int $moduleID
|
||||
* @param int $apiID
|
||||
* @param int $version
|
||||
* @param int $release
|
||||
* @param int $appendLib
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function index($libID = 0, $moduleID = 0, $apiID = 0, $version = 0, $release = 0)
|
||||
public function index($libID = 0, $moduleID = 0, $apiID = 0, $version = 0, $release = 0, $appendLib = 0)
|
||||
{
|
||||
/* Get all api doc libraries. */
|
||||
$libs = $this->doc->getApiLibs();
|
||||
$lib = $this->doc->getLibById($libID);
|
||||
$appendLib = (!empty($lib) and $lib->deleted == '1') ? $libID : 0;
|
||||
$libs = $this->doc->getApiLibs($appendLib);
|
||||
|
||||
/* Generate bread crumbs dropMenu. */
|
||||
if($libs)
|
||||
|
||||
@@ -374,11 +374,11 @@ class doc extends control
|
||||
/**
|
||||
* Edit a doc.
|
||||
*
|
||||
* @param int $docID
|
||||
* @param bool $comment
|
||||
* @param string $objectType
|
||||
* @param int $objectID
|
||||
* @param int $libID
|
||||
* @param int $docID
|
||||
* @param bool $comment
|
||||
* @param string $objectType
|
||||
* @param int $objectID
|
||||
* @param int $libID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -466,7 +466,8 @@ class doc extends control
|
||||
}
|
||||
|
||||
$objects = $this->doc->getOrderedObjects($objectType);
|
||||
$libs = $this->doc->getLibsByObject($objectType, $objectID);
|
||||
$appendLib = (!empty($lib) and $lib->deleted == '1') ? $libID : 0;
|
||||
$libs = $this->doc->getLibsByObject($objectType, $objectID, '', $appendLib);
|
||||
$this->lang->modulePageNav = $this->doc->select($objectType, $objects, $objectID, $libs, $libID);
|
||||
$this->lang->TRActions = common::hasPriv('doc', 'create') ? $this->doc->buildCreateButton4Doc($objectType, $objectID, $libID) : '';
|
||||
|
||||
@@ -1020,7 +1021,7 @@ class doc extends control
|
||||
|
||||
/* Add the anchor to the element. */
|
||||
$content[$index] = str_replace('<' . $includeHeadElement[0] . $headElement[2] . '>', '<' . $includeHeadElement[0] . $headElement[2] . " id='anchor{$index}'" . '>', $content[$index]);
|
||||
$outline .= '<li class="text-ellipsis">' . html::a('#anchor' . $index, strip_tags($headElement[3]), '', "title='" . strip_tags($headElement[3]) . "'");
|
||||
$outline .= '<li class="text-ellipsis">' . html::a('#anchor' . $index, strip_tags($headElement[3]), '', "title='" . strip_tags($headElement[3]) . "'");
|
||||
|
||||
$preElement = $headElement[1];
|
||||
}
|
||||
@@ -1031,7 +1032,7 @@ class doc extends control
|
||||
|
||||
/* Add the anchor to the element. */
|
||||
$content[$index] = str_replace('<' . $includeHeadElement[1] . $headElement[2] . '>', '<' . $includeHeadElement[1] . $headElement[2] . " id='anchor{$index}'" . '>', $content[$index]);
|
||||
$outline .= '<li class="text-ellipsis">' . html::a('#anchor' . $index, strip_tags($headElement[3]), '', "title='" . strip_tags($headElement[3]) . "'") . '</li>';
|
||||
$outline .= '<li class="text-ellipsis">' . html::a('#anchor' . $index, strip_tags($headElement[3]), '', "title='" . strip_tags($headElement[3]) . "'") . '</li>';
|
||||
|
||||
$preElement = $includeHeadElement[1];
|
||||
}
|
||||
|
||||
@@ -38,14 +38,16 @@ class docModel extends model
|
||||
/**
|
||||
* Get api Libraries.
|
||||
*
|
||||
* @param int $appendLib
|
||||
* @return array
|
||||
* @author thanatos thanatos915@163.com
|
||||
*/
|
||||
public function getApiLibs()
|
||||
public function getApiLibs($appendLib = 0)
|
||||
{
|
||||
$libs = $this->dao->select('*')->from(TABLE_DOCLIB)
|
||||
->where('deleted')->eq(0)
|
||||
->andWhere('type')->eq('api')
|
||||
->beginIF(!empty($appendLib))->orWhere('id')->eq($appendLib)->fi()
|
||||
->orderBy('id_desc')
|
||||
->fetchAll('id');
|
||||
$libs = array_filter($libs, array($this, 'checkPrivLib'));
|
||||
|
||||
Reference in New Issue
Block a user