Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms into cyy_fixbug
This commit is contained in:
+6
-6
File diff suppressed because one or more lines are too long
+24
-25
@@ -75,6 +75,14 @@ class doc extends control
|
||||
$this->loadModel('search');
|
||||
|
||||
list($libs, $libID, $object, $objectID, $objectDropdown) = $this->doc->setMenuByType('mine', 0, $libID);
|
||||
if($type != 'mine')
|
||||
{
|
||||
$objectTitle = '';
|
||||
if($type == 'view') $objectTitle = $this->lang->doc->myView;
|
||||
if($type == 'collect') $objectTitle = $this->lang->doc->myCollection;
|
||||
if($type == 'createdby') $objectTitle = $this->lang->doc->myCreation;
|
||||
if($objectTitle) $objectDropdown = "<div id='sidebarHeader'><div class='title' title='{$objectTitle}'>{$objectTitle}</div></div>";
|
||||
}
|
||||
|
||||
/* Build the search form. */
|
||||
$queryID = $browseType == 'bysearch' ? (int)$param : 0;
|
||||
@@ -107,21 +115,22 @@ class doc extends control
|
||||
$docs = $this->doc->getMineList($type, $browseType, $orderBy, $pager, $queryID);
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->doc->common;
|
||||
$this->view->moduleID = $moduleID;
|
||||
$this->view->docs = $docs;
|
||||
$this->view->users = $this->user->getPairs('noletter');
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->param = $param;
|
||||
$this->view->libID = $libID;
|
||||
$this->view->lib = $this->doc->getLibById($libID);
|
||||
$this->view->libTree = $this->doc->getLibTree($type != 'mine' ? 0 : $libID, $libs, 'mine', $moduleID, 0, $browseType);
|
||||
$this->view->pager = $pager;
|
||||
$this->view->type = $type;
|
||||
$this->view->objectID = 0;
|
||||
$this->view->canExport = ($this->config->edition != 'open' and common::hasPriv('doc', 'mine2export') and $type == 'mine');
|
||||
$this->view->libType = 'lib';
|
||||
$this->view->title = $this->lang->doc->common;
|
||||
$this->view->moduleID = $moduleID;
|
||||
$this->view->docs = $docs;
|
||||
$this->view->users = $this->user->getPairs('noletter');
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->param = $param;
|
||||
$this->view->libID = $libID;
|
||||
$this->view->lib = $this->doc->getLibById($libID);
|
||||
$this->view->libTree = $this->doc->getLibTree($type != 'mine' ? 0 : $libID, $libs, 'mine', $moduleID, 0, $browseType);
|
||||
$this->view->pager = $pager;
|
||||
$this->view->type = $type;
|
||||
$this->view->objectID = 0;
|
||||
$this->view->canExport = ($this->config->edition != 'open' and common::hasPriv('doc', 'mine2export') and $type == 'mine');
|
||||
$this->view->libType = 'lib';
|
||||
$this->view->objectDropdown = $objectDropdown;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
@@ -1212,15 +1221,6 @@ class doc extends control
|
||||
$methodName = 'mySpace';
|
||||
}
|
||||
|
||||
$crumbs[] = html::a($this->createLink($moduleName, $methodName, $linkParams), html::image("static/svg/wiki-file-lib.svg") . $lib->name, '', 'title =' . $lib -> name);
|
||||
|
||||
$moduleList = $this->loadModel('tree')->getParents($doc->module);
|
||||
foreach($moduleList as $module)
|
||||
{
|
||||
$withModuleParams = $linkParams . "&moduleID=$module->id";
|
||||
$crumbs[] = html::a(inLink($methodName, $withModuleParams), $module->name . ' ', '', 'title =' . $module->name);
|
||||
}
|
||||
|
||||
$spaceType = $objectType . 'Space';
|
||||
$this->view->title = isset($this->lang->doc->{$spaceType}) ? $this->lang->doc->{$spaceType} : $this->lang->doc->common;
|
||||
$this->view->docID = $docID;
|
||||
@@ -1231,7 +1231,6 @@ class doc extends control
|
||||
$this->view->objectType = $objectType;
|
||||
$this->view->type = $type;
|
||||
$this->view->libID = $libID;
|
||||
$this->view->crumbs = $crumbs;
|
||||
$this->view->lib = isset($libs[$libID]) ? $libs[$libID] : new stdclass();
|
||||
$this->view->libs = $this->doc->getLibsByObject($type, $objectID);
|
||||
$this->view->canBeChanged = common::canModify($type, $object); // Determines whether an object is editable.
|
||||
|
||||
@@ -61,12 +61,6 @@
|
||||
#mainContent > .panel {margin-bottom: 0; overflow-y: auto;}
|
||||
#mainContent > .main-col{flex: auto;}
|
||||
|
||||
.info .version, .info .crumbs {float: left;}
|
||||
.crumbs img {margin-right: 3px; margin-bottom: 4px;}
|
||||
.crumbs {float: left; display: flex;height: 32px; width: 640px; align-items: center; overflow: hidden;}
|
||||
.crumbs .crumb-item {padding: 6px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; display: flex;}
|
||||
.crumb-item .separator {flex: 0 0 15px; display: flex; justify-content: center; align-items: center;}
|
||||
.crumb-item a {flex: none}
|
||||
.main-col {position: relative;}
|
||||
#autoBox {display: flex; overflow: hidden; text-overflow: ellipsis; padding-right: 15px; position: relative;}
|
||||
#autoBox > .ellipsis {position: absolute; top: 3px; right: 0; width: 10px; background: #F4F5F7; height: 100%;}
|
||||
|
||||
@@ -402,33 +402,3 @@ function submit(object)
|
||||
setTimeout(function(){$(object).attr('type', 'button').removeAttr('disabled')}, 2000);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update crumbs.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function updateCrumbs()
|
||||
{
|
||||
var $crumbs = $('#crumbs');
|
||||
var $crumbItems = $('#crumbs > .crumb-item');
|
||||
var crumbMaxWidth = 660;
|
||||
if($crumbs.width < crumbMaxWidth || $crumbItems.length == 1) return;
|
||||
|
||||
/* last crumbItem width major */
|
||||
var $lastChild = $($crumbItems[$crumbItems.length -1]);
|
||||
var widthSum = 0 + $lastChild.width();
|
||||
for(var i = 0; i < $crumbItems.length - 1; i++)
|
||||
{
|
||||
var crumbItem = $crumbItems[i];
|
||||
var widthSum = widthSum + $(crumbItem).width();
|
||||
if(widthSum >= crumbMaxWidth)
|
||||
{
|
||||
$(crumbItem).addClass('in-auto-box');
|
||||
var $autoCrumbItems = $('#crumbs > .in-auto-box');
|
||||
$lastChild.before('<div id="autoBox" class="flex-auto"><div class="ellipsis">...<div></div>');
|
||||
$('#autoBox').prepend($autoCrumbItems);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2765,6 +2765,11 @@ class docModel extends model
|
||||
{
|
||||
$libs = $this->getLibsByObject($type, 0, '', $appendLib);
|
||||
if($libID == 0 and !empty($libs)) $libID = reset($libs)->id;
|
||||
if(isset($libs[$libID]))
|
||||
{
|
||||
$objectTitle = zget($libs[$libID], 'name', '');
|
||||
$objectDropdown = "<div id='sidebarHeader'><div class='title' title='{$objectTitle}'>{$objectTitle}</div></div>";
|
||||
}
|
||||
|
||||
$object = new stdclass();
|
||||
$object->id = 0;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
<?php js::set('treeData', $libTree)?>
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div id="leftBar" class="btn-toolbar pull-left">
|
||||
<?php echo $objectDropdown;?>
|
||||
<?php if(!empty($libTree)):?>
|
||||
<?php foreach($lang->doc->featureBar['tableContents'] as $barType => $barName):?>
|
||||
<?php $active = $barType == $browseType ? 'btn-active-text' : '';?>
|
||||
|
||||
@@ -26,14 +26,6 @@
|
||||
<?php echo $objectDropdown;?>
|
||||
<?php echo html::backButton("<i class='icon icon-back icon-sm'></i> " . $lang->goback, "id='backBtn'", 'btn btn-link')?>
|
||||
</div>
|
||||
<div id="crumbs" class="crumbs">
|
||||
<?php foreach($crumbs as $crumbKey => $crumb):?>
|
||||
<div class="crumb-item">
|
||||
<?php if($crumbKey != 0) echo '<div class="separator">> </div>'?>
|
||||
<?php echo $crumb;?>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
<div class="btn-toolbar pull-right">
|
||||
<?php
|
||||
if($canExport) echo html::a($this->createLink('doc', $exportMethod, "libID=$libID&moduleID=0&docID=$docID"), "<i class='icon-export muted'> </i>" . $lang->export, 'hiddenwin', "class='btn btn-link' id='docExport'");
|
||||
|
||||
@@ -469,7 +469,7 @@ $config->delete['18_4'][] = 'extension/max/group/ext/lang/de/crystal.php';
|
||||
$config->delete['18_4'][] = 'extension/max/group/ext/lang/fr/crystal.php';
|
||||
$config->delete['18_4'][] = 'extension/max/group/ext/lang/zh-tw/crystal.php';
|
||||
|
||||
$config->upgrade->openModules = array('action', 'admin', 'api', 'automation', 'backup', 'block', 'branch', 'budget', 'bug', 'build', 'caselib', 'chart', 'ci', 'client', 'common', 'company', 'compile', 'convert', 'cron', 'custom', 'datatable', 'dept', 'design', 'dev', 'dimension', 'doc', 'durationestimation', 'entry', 'execution', 'extension', 'file', 'git', 'gitlab', 'group', 'holiday', 'im', 'index', 'index.html', 'install', 'issue', 'jenkins', 'job', 'kanban', 'license', 'mail', 'message', 'misc', 'mr', 'my', 'personnel', 'pipeline', 'product', 'productplan', 'productset', 'program', 'programplan', 'project', 'projectbuild', 'projectplan', 'projectrelease', 'projectstory', 'pivot', 'qa', 'release', 'repo', 'report', 'risk', 'score', 'screen', 'search', 'setting', 'sonarqube', 'sso', 'stage', 'stakeholder', 'story', 'subject', 'svn', 'task', 'testcase', 'testreport', 'testsuite', 'testtask', 'todo', 'tree', 'tutorial', 'upgrade', 'user', 'webhook', 'weekly', 'workestimation', 'gitea', 'gogs', 'transfer', 'zahost', 'zanode', 'editor');
|
||||
$config->upgrade->openModules = array('action', 'admin', 'api', 'automation', 'backup', 'block', 'branch', 'budget', 'bug', 'build', 'caselib', 'chart', 'ci', 'client', 'common', 'company', 'compile', 'convert', 'cron', 'custom', 'datatable', 'dataview', 'dept', 'design', 'dev', 'dimension', 'doc', 'durationestimation', 'entry', 'execution', 'extension', 'file', 'git', 'gitlab', 'group', 'holiday', 'im', 'index', 'index.html', 'install', 'issue', 'jenkins', 'job', 'kanban', 'license', 'mail', 'message', 'misc', 'mr', 'my', 'personnel', 'pipeline', 'product', 'productplan', 'productset', 'program', 'programplan', 'project', 'projectbuild', 'projectplan', 'projectrelease', 'projectstory', 'pivot', 'qa', 'release', 'repo', 'report', 'risk', 'score', 'screen', 'search', 'setting', 'sonarqube', 'sso', 'stage', 'stakeholder', 'story', 'subject', 'svn', 'task', 'testcase', 'testreport', 'testsuite', 'testtask', 'todo', 'tree', 'tutorial', 'upgrade', 'user', 'webhook', 'weekly', 'workestimation', 'gitea', 'gogs', 'transfer', 'zahost', 'zanode', 'editor');
|
||||
|
||||
$config->upgrade->unsetModules = array('design', 'program', 'programplan', 'projectbuild', 'projectrelease', 'stage', 'stakeholder', 'product', 'branch', 'productplan', 'release', 'build', 'qa', 'bug', 'testcase', 'testtask', 'testreport', 'testsuite', 'caselib', 'automation', 'repo', 'ci', 'compile', 'jenkins', 'job', 'svn', 'gitlab', 'sonarqube', 'mr', 'git', 'report', 'sqlbuilder', 'feedback', 'faq', 'attend', 'holiday', 'leave', 'makeup', 'overtime', 'lieu', 'ops', 'host', 'serverroom', 'account', 'domain', 'service', 'deploy', 'conference', 'traincourse', 'pssp', 'baseline', 'classify', 'cm', 'cmcl', 'auditcl', 'reviewcl', 'process', 'activity', 'zoutput', 'auditplan', 'nc', 'subject', 'weekly', 'workestimation', 'issue', 'durationestimation', 'risk', 'opportunity', 'trainplan', 'gapanalysis', 'researchplan', 'researchreport', 'meeting', 'meetingroom', 'budget', 'reviewissue', 'reviewsetting', 'review', 'milestone', 'measurement', 'measrecord', 'assetlib', 'setting', 'im', 'client', 'ldap', 'dev', 'api', 'gitea', 'gogs', 'zanode', 'zahost');
|
||||
|
||||
|
||||
+5
-12
@@ -114,25 +114,18 @@ class zahostModel extends model
|
||||
*/
|
||||
public function ping($address)
|
||||
{
|
||||
if (strcasecmp(PHP_OS, 'WINNT') === 0)
|
||||
if(!filter_var($address, FILTER_VALIDATE_IP) && !filter_var(gethostbyname($address), FILTER_VALIDATE_IP)) return false;
|
||||
|
||||
if(strcasecmp(PHP_OS, 'WINNT') === 0)
|
||||
{
|
||||
exec("ping -n 1 {$address}", $outcome, $status);
|
||||
}
|
||||
elseif (strcasecmp(PHP_OS, 'Linux') === 0)
|
||||
elseif(strcasecmp(PHP_OS, 'Linux') === 0)
|
||||
{
|
||||
exec("ping -c 1 {$address}", $outcome, $status);
|
||||
}
|
||||
|
||||
if (0 == $status)
|
||||
{
|
||||
$status = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$status = false;
|
||||
}
|
||||
|
||||
return $status;
|
||||
return 0 == $status;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user