Merge branch 'tsj_fixbug' into 'master'
* Fix bug. See merge request easycorp/zentaopms!7324
This commit is contained in:
@@ -178,24 +178,22 @@ class api extends control
|
||||
/**
|
||||
* Release list.
|
||||
*
|
||||
* @param int $libID
|
||||
* @param int $libID
|
||||
* @param string $orderBy
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function releases($libID, $orderBy = 'id', $recTotal = 0, $recPerPage = 15, $pageID = 1)
|
||||
public function releases($libID, $orderBy = 'id')
|
||||
{
|
||||
$libs = $this->doc->getApiLibs();
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$this->lang->modulePageNav = $this->generateLibsDropMenu($libs[$libID]);
|
||||
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
/* Append id for secend sort. */
|
||||
$sort = common::appendOrder($orderBy);
|
||||
$releases = $this->api->getReleaseByQuery($libID, $pager, $sort);
|
||||
$releases = $this->api->getReleaseByQuery($libID, '', $sort);
|
||||
|
||||
$this->view->releases = $releases;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->title = $this->lang->api->managePublish;
|
||||
$this->view->libID = $libID;
|
||||
@@ -414,8 +412,6 @@ class api extends control
|
||||
*/
|
||||
public function createLib($type = 'product', $objectID = 0)
|
||||
{
|
||||
if(!in_array($type, array('product', 'project'))) $type = 'product';
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$libID = $this->doc->createApiLib();
|
||||
@@ -433,7 +429,8 @@ class api extends control
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('api', 'index', "libID=$libID")));
|
||||
}
|
||||
|
||||
$this->lang->api->aclList['default'] = sprintf($this->lang->api->aclList['default'], $this->lang->{$type}->common);
|
||||
$defaultAclLang = in_array($type, array('product', 'product')) ? $this->lang->{$type}->common : $this->lang->product->common;
|
||||
$this->lang->api->aclList['default'] = sprintf($this->lang->api->aclList['default'], $defaultAclLang);
|
||||
|
||||
$this->view->type = $type;
|
||||
$this->view->objectID = $objectID;
|
||||
|
||||
@@ -3,3 +3,4 @@ form {margin-bottom: 100px;}
|
||||
table {width: 90% !important;}
|
||||
#whiteListBox div.input-group {margin-bottom: 2px;}
|
||||
#whiteListBox .input-group:last-child {margin-top: 10px;}
|
||||
#aclBox > th {vertical-align: top; padding-top: 18px;}
|
||||
|
||||
@@ -2,3 +2,5 @@
|
||||
.c-actions {width: 60px;}
|
||||
|
||||
tbody tr td {white-space: nowrap; overflow: hidden; text-overflow: clip;}
|
||||
#mainContent {max-height: 400px;}
|
||||
#releaseListForm {margin-bottom: 20px;}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
$(document).ready(function()
|
||||
$(function()
|
||||
{
|
||||
$('#apiForm').ajaxForm({
|
||||
success: (data) => {
|
||||
@@ -10,4 +10,6 @@ $(document).ready(function()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
toggleLibType(libType);
|
||||
});
|
||||
|
||||
@@ -79,4 +79,5 @@
|
||||
</div>
|
||||
<?php js::set('productLang', $lang->productCommon);?>
|
||||
<?php js::set('projectLang', $lang->projectCommon);?>
|
||||
<?php js::set('libType', $type);?>
|
||||
<?php include '../../common/view/footer.lite.html.php';?>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
if($libTree and common::hasPriv('api', 'releases')) echo html::a($this->createLink('api', 'releases', "libID=$libID", 'html', true), "<i class='icon-version muted'> </i>" . $lang->api->releases, '', "class='btn btn-link iframe' data-width='800px'");
|
||||
if($libTree and common::hasPriv('api', 'createRelease')) echo html::a($this->createLink('api', 'createRelease', "libID=$libID"), "<i class='icon-publish muted'> </i>" . $lang->api->createRelease, '', "class='btn btn-link iframe' data-width='800px'");
|
||||
if($libTree and common::hasPriv('api', 'export') and $config->edition != 'open') echo html::a($this->createLink('api', 'export', "libID=$libID&version=$version&release=$release", 'html', true), "<i class='icon-export muted'> </i>" . $lang->export, '', "class='btn btn-link export' data-width='480px' id='export'");
|
||||
if(common::hasPriv('api', 'createLib')) echo html::a($this->createLink('api', 'createLib', "type=" . ($objectType == 'project' ? 'project' : 'product') . "&objectID=$objectID"), '<i class="icon icon-plus"></i> ' . $lang->api->createLib, '', 'class="btn btn-secondary iframe" data-width="800px"');
|
||||
if(common::hasPriv('api', 'createLib')) echo html::a($this->createLink('api', 'createLib', "type=" . ($objectType ? $objectType : 'nolink') . "&objectID=$objectID"), '<i class="icon icon-plus"></i> ' . $lang->api->createLib, '', 'class="btn btn-secondary iframe" data-width="800px"');
|
||||
if($libTree and common::hasPriv('api', 'create')) echo html::a($this->createLink('api', 'create', "libID=$libID&moduleID=$moduleID"), '<i class="icon icon-plus"></i> ' . $lang->api->createApi, '', 'class="btn btn-primary"');
|
||||
?>
|
||||
</div>
|
||||
@@ -37,7 +37,7 @@
|
||||
<p>
|
||||
<span class="text-muted"><?php echo $lang->doc->noLib;?></span>
|
||||
<?php
|
||||
if(common::hasPriv('api', 'createLib')) echo html::a(helper::createLink('api', 'createLib', "type=$objectType"), '<i class="icon icon-plus"></i> ' . $lang->api->createLib, '', 'class="btn btn-info iframe" data-width="800px"');
|
||||
if(common::hasPriv('api', 'createLib')) echo html::a(helper::createLink('api', 'createLib', "type=" . ($objectType ? $objectType : 'nolink')), '<i class="icon icon-plus"></i> ' . $lang->api->createLib, '', 'class="btn btn-info iframe" data-width="800px"');
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id='mainContent' class='main-row fade'>
|
||||
<div class='main-col'>
|
||||
<div class="cell" id="queryBox" data-module='user'></div>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->api->managePublish;?></h2>
|
||||
@@ -24,11 +23,11 @@
|
||||
<p><span class="text-muted"><?php echo $lang->noData;?></span></p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<form class='main-table table-user' data-ride='table' method='post' data-checkable='false' id='userListForm'>
|
||||
<table class='table has-sort-head' id='userList'>
|
||||
<form class='main-table' method='post' id='releaseListForm'>
|
||||
<table class='table has-sort-head' id='releaseList'>
|
||||
<thead>
|
||||
<tr>
|
||||
<?php $vars = "libID={$libID}&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";?>
|
||||
<?php $vars = "libID={$libID}&orderBy=%s";?>
|
||||
<th class='c-id'><?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
|
||||
<th class='c-version'><?php common::printOrderLink('version', $orderBy, $vars, $lang->api->version);?></th>
|
||||
<th class='c-name'><?php echo $lang->api->desc;?></th>
|
||||
@@ -52,7 +51,6 @@
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class='table-footer'><?php $pager->show('right', 'pagerjs');?></div>
|
||||
</form>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
|
||||
@@ -163,10 +163,10 @@ class doc extends control
|
||||
}
|
||||
}
|
||||
|
||||
if($type == 'execution') $objects = $this->execution->getPairs(0, 'all', 'multiple,leaf,noprefix');
|
||||
|
||||
if($type == 'execution')
|
||||
{
|
||||
$objects = $this->execution->getPairs(0, 'sprint,stage', 'multiple,leaf,noprefix');
|
||||
$execution = $this->execution->getByID($objectID);
|
||||
if($execution->type == 'stage') $this->lang->doc->execution = str_replace($this->lang->executionCommon, $this->lang->project->stage, $this->lang->doc->execution);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user