Merge branch 'release/zentaopms_18.3' of https://gitlab.zcorp.cc/easycorp/zentaopms into release/zentaopms_18.3
This commit is contained in:
@@ -111,7 +111,6 @@ class api extends control
|
||||
}
|
||||
|
||||
$this->view->lib = $lib;
|
||||
$this->view->isRelease = $release > 0;
|
||||
$this->view->release = $release;
|
||||
$this->view->title = $this->lang->api->pageTitle;
|
||||
$this->view->libID = $libID;
|
||||
|
||||
@@ -985,6 +985,8 @@ class apiModel extends model
|
||||
*/
|
||||
public function getOrderedObjects()
|
||||
{
|
||||
$normalObjects = $closedObjects = array();
|
||||
|
||||
$libs = $this->loadModel('doc')->getApiLibs();
|
||||
$products = $this->dao->select('t1.id, t1.name, t1.status')->from(TABLE_PRODUCT)->alias('t1')
|
||||
->leftjoin(TABLE_DOCLIB)->alias('t2')->on('t2.product=t1.id')
|
||||
@@ -1039,7 +1041,6 @@ class apiModel extends model
|
||||
* @param int $moduleID
|
||||
* @param int $objectID
|
||||
* @param string $browseType bySearch
|
||||
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
@@ -1051,18 +1052,16 @@ class apiModel extends model
|
||||
foreach($libTree as &$tree)
|
||||
{
|
||||
$tree->versions = array();
|
||||
$tree->lastVersion = '';
|
||||
foreach($releases as $index => $release)
|
||||
{
|
||||
if($tree->id == $release->lib)
|
||||
{
|
||||
if(empty($tree->versions)) $tree->lastVersion = $release->version;
|
||||
|
||||
$tree->versions[] = $release->version;
|
||||
$tree->versions[] = $release;
|
||||
unset($releases[$index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $libTree;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,8 +49,8 @@ foreach(array('product', 'project') as $moduleType)
|
||||
|
||||
if($moduleType == 'product')
|
||||
{
|
||||
if($normalObjects['project'] and (!empty($nolinkLibs) or !empty($normalObjects['product']))) $normalObjectsHtml .= '<li class="divider"></li>';
|
||||
if($closedObjects['project'] and !empty($normalObjects['product'])) $closedObjectsHtml .= '<li class="divider"></li>';
|
||||
if(!empty($normalObjects['project']) and (!empty($nolinkLibs) or !empty($normalObjects['product']))) $normalObjectsHtml .= '<li class="divider"></li>';
|
||||
if(!empty($closedObjects['project']) and !empty($normalObjects['product'])) $closedObjectsHtml .= '<li class="divider"></li>';
|
||||
}
|
||||
}
|
||||
$normalObjectsHtml .= '</ul>';
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='text-center form-actions' colspan='2'><?php echo html::submitButton();?></td>
|
||||
<td class='text-center form-actions' colspan='2'><?php echo html::hidden('type', $type) . html::submitButton();?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
@@ -395,7 +395,7 @@ class doc extends control
|
||||
if($objectType == 'project')
|
||||
{
|
||||
$objects = $this->loadModel('project')->getPairs();
|
||||
$this->view->executions = array(0 => '') + $this->loadModel('execution')->getPairs($objectID, 'all', 'multiple');
|
||||
$this->view->executions = array(0 => '') + $this->loadModel('execution')->getPairs($objectID, 'all', 'multiple,leaf,noprefix');
|
||||
}
|
||||
elseif($objectType == 'execution')
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ function loadObjectModules(objectType, objectID)
|
||||
*/
|
||||
function loadExecutions(projectID)
|
||||
{
|
||||
var link = createLink('project', 'ajaxGetExecutions', "projectID=" + projectID + "&executionID=0&mode=multiple");
|
||||
var link = createLink('project', 'ajaxGetExecutions', "projectID=" + projectID + "&executionID=0&mode=multiple,leaf,noprefix");
|
||||
$('#executionBox').load(link, function(){$('#executionBox').find('select').attr('data-placeholder', holders.execution).attr('onchange', "loadObjectModules('execution', this.value)").chosen()});
|
||||
loadObjectModules('project', projectID);
|
||||
}
|
||||
|
||||
@@ -278,16 +278,13 @@ class docModel extends model
|
||||
*/
|
||||
public function updateApiLib($id)
|
||||
{
|
||||
$oldLib = $this->getLibById($id);
|
||||
$libType = $this->post->libType;
|
||||
$oldLib = $this->getLibById($id);
|
||||
|
||||
$data = fixer::input('post')
|
||||
->trim('name')
|
||||
->join('groups', ',')
|
||||
->join('users', ',')
|
||||
->setForce('product', $libType == 'product' ? $this->post->product : 0)
|
||||
->setForce('project', $libType == 'project' ? $this->post->project : 0)
|
||||
->remove('uid,contactListMenu,libType')
|
||||
->remove('uid,contactListMenu,type')
|
||||
->get();
|
||||
|
||||
$this->app->loadLang('api');
|
||||
@@ -298,10 +295,7 @@ class docModel extends model
|
||||
$this->lang->doclib->project = $this->lang->api->project;
|
||||
$this->lang->doclib->product = $this->lang->api->product;
|
||||
|
||||
if($libType == 'product') $this->config->api->createlib->requiredFields .= ',product';
|
||||
if($libType == 'project') $this->config->api->createlib->requiredFields .= ',project';
|
||||
|
||||
$this->checkApiLibName($data, $libType, $id);
|
||||
$this->checkApiLibName($data, $this->post->type, $id);
|
||||
|
||||
if(dao::isError()) return false;
|
||||
|
||||
|
||||
@@ -49,6 +49,15 @@
|
||||
#leftBar .selectBox #currentItem > .text {overflow: hidden; text-align: left; flex: 0 1 100%;}
|
||||
</style>
|
||||
|
||||
<?php
|
||||
/* Release used for api space. */
|
||||
js::set('release', isset($release) ? $release : 0);
|
||||
|
||||
/* ObjectType and objectID used for other space. */
|
||||
js::set('objectType', isset($type) ? $type : '');
|
||||
js::set('objectID', isset($objectID) ? $objectType : '');
|
||||
?>
|
||||
|
||||
<div id="fileTree" class="file-tree">
|
||||
<?php if(isset($type) and $type == 'project'):?>
|
||||
<div class="project-tree">
|
||||
@@ -134,6 +143,8 @@ $(function()
|
||||
var dropdown = '<ul class="dropdown-menu dropdown-in-tree" id="' + option.type + '" style="display: unset; left:' + option.left + 'px; top:' + option.top + 'px;">';
|
||||
dropdown += $(libClass).html().replace(/%libID%/g, option.libID).replace(/%moduleID%/g, option.moduleID).replace(/%hasChildren%/g, option.hasChildren);
|
||||
dropdown += '</ul>';
|
||||
|
||||
if(typeof(option.moduleType) != 'undefined' && option.moduleType == 'api') dropdown = dropdown.replace(/doc/g, 'api');
|
||||
return dropdown;
|
||||
}
|
||||
|
||||
@@ -221,7 +232,8 @@ $(function()
|
||||
type : dropDownID,
|
||||
libID : libID,
|
||||
moduleID : moduleID,
|
||||
hasChildren : hasChildren
|
||||
hasChildren : hasChildren,
|
||||
moduleType : moduleType
|
||||
};
|
||||
|
||||
var dropDown = renderDropdown(option);
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
<?php js::set('linkParams', "type=$type&objectID=$objectID%s");?>
|
||||
<?php js::set('docLang', $lang->doc);?>
|
||||
<?php js::set('libType', 'annex');?>
|
||||
<?php js::set('objectType', $type);?>
|
||||
<?php js::set('objectID', $objectID);?>
|
||||
<?php js::set('canViewFiles', common::hasPriv('doc', 'showfiles'));?>
|
||||
<?php js::set('type', $type);?>
|
||||
<?php js::set('tab', $this->app->tab);?>
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
<?php js::set('linkParams', "type=$type&objectID=$objectID%s&browseType=&orderBy=$orderBy");?>
|
||||
<?php js::set('docLang', $lang->doc);?>
|
||||
<?php js::set('libType', $libType);?>
|
||||
<?php js::set('objectType', $type);?>
|
||||
<?php js::set('objectID', $objectID);?>
|
||||
<?php js::set('canViewFiles', common::hasPriv('doc', 'showfiles'));?>
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div id="leftBar" class="btn-toolbar pull-left">
|
||||
|
||||
@@ -201,7 +201,7 @@ class project extends control
|
||||
{
|
||||
$project = $this->project->getByID($projectID);
|
||||
if(!$project->multiple) return;
|
||||
|
||||
|
||||
$executions = $this->loadModel('execution')->getByProject($projectID, 'undone', 0, true);
|
||||
$executionMembers = $this->dao->select('t1.root,t2.name')->from(TABLE_TEAM)->alias('t1')
|
||||
->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.root=t2.id')
|
||||
|
||||
Reference in New Issue
Block a user