* Modify page style.
This commit is contained in:
@@ -23,3 +23,35 @@ $config->admin->menuModuleGroup['model']['custom|required'] = array('project',
|
||||
$config->admin->menuModuleGroup['feature']['custom|set'] = array('todo', 'feedback', 'user', 'block', 'story', 'task', 'bug', 'testcase', 'testtask', 'feedback', 'user');
|
||||
$config->admin->menuModuleGroup['feature']['custom|required'] = array('bug', 'doc', 'product', 'story', 'productplan', 'release', 'task', 'bug', 'testcase', 'testsuite', 'testtask', 'testreport', 'caselib', 'doc', 'feedback', 'user');
|
||||
$config->admin->menuModuleGroup['template']['custom|set'] = array('baseline');
|
||||
|
||||
$config->admin->plugIns[203] = new stdClass();
|
||||
$config->admin->plugIns[203]->name = '人力资源日历';
|
||||
$config->admin->plugIns[203]->desc = '禅道人力资源日历插件可以帮助项目管理者查看不同维度下的消耗工时、未完成工作量、并行工作量及负载率,同时组织维度待处理状态下实现了模拟负载的功能,帮助管理者详细了解成员的工作负载情况,更好的进行项目人力资源调度。';
|
||||
$config->admin->plugIns[203]->viewLink = 'https://www.zentao.net/extension-viewExt-203.html';
|
||||
|
||||
$config->admin->plugIns[198] = new stdClass();
|
||||
$config->admin->plugIns[198]->name = '需求池插件';
|
||||
$config->admin->plugIns[198]->desc = '本插件为禅道需求池管理插件,包括:创建需求池 需求池权限管理 收集需求并向需求池录入需求 记录需求提出人信息 评审需求 拆分用户需求、研发需求 需求跟踪矩阵';
|
||||
$config->admin->plugIns[198]->viewLink = 'https://www.zentao.net/extension-viewExt-198.html';
|
||||
|
||||
$config->admin->plugIns[27] = new stdClass();
|
||||
$config->admin->plugIns[27]->name = 'Excel导出/导入';
|
||||
$config->admin->plugIns[27]->desc = '安装该插件可以支持Excel导出和任务、需求、Bug、用例导入功能。更新提示:新增任务、需求、Bug的excel导入功能。';
|
||||
$config->admin->plugIns[27]->viewLink = 'https://www.zentao.net/extension-viewExt-27.html';
|
||||
|
||||
$config->admin->plugIns[26] = new stdClass();
|
||||
$config->admin->plugIns[26]->name = '甘特图';
|
||||
$config->admin->plugIns[26]->desc = '禅道甘特图插件 运用此插件可以查看甘特图,维护任务关系。';
|
||||
$config->admin->plugIns[26]->viewLink = 'https://www.zentao.net/extension-viewExt-26.html';
|
||||
|
||||
$config->admin->plugIns[30] = new stdClass();
|
||||
$config->admin->plugIns[30]->name = '日志日历';
|
||||
$config->admin->plugIns[30]->desc = '运用此插件可以实现工作日志的添加、编辑、查看、删除、导出等功能,方便用户管理工作日志。';
|
||||
$config->admin->plugIns[30]->viewLink = 'https://www.zentao.net/extension-viewExt-30.html';
|
||||
|
||||
//$config->admin->plugIns[] = new stdClass();
|
||||
//$config->admin->plugIns[]->name = '';
|
||||
//$config->admin->plugIns[]->desc = '';
|
||||
//$config->admin->plugIns[]->viewLink = 'https://www.zentao.net/extension-viewExt-203.html';
|
||||
|
||||
$config->admin->apiRoot = 'https://www.zentao.net/';
|
||||
|
||||
@@ -34,11 +34,25 @@ class admin extends control
|
||||
|
||||
$this->loadModel('misc');
|
||||
|
||||
$extensions = $this->loadModel('extension')->getExtensionsByAPI('byUpdatedTime', '', 0, 6);
|
||||
/* Check internet. */
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_URL, 'https://api.zentao.net/extension-apiGetExtensions.json');
|
||||
curl_setopt($curl, CURLOPT_TIMEOUT_MS, 1000);
|
||||
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT_MS, 1000);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
|
||||
$connected = (bool)curl_exec($curl);
|
||||
curl_close($curl);
|
||||
|
||||
$this->view->title = $this->lang->admin->common;
|
||||
$this->view->position[] = $this->lang->admin->index;
|
||||
$this->view->extensions = isset($extensions->extensions) ? (array)$extensions->extensions : array();
|
||||
$clientLang = $this->app->getClientLang();
|
||||
|
||||
$this->view->title = $this->lang->admin->common;
|
||||
$this->view->position[] = $this->lang->admin->index;
|
||||
$this->view->extensions = $this->admin->getExtensionsByAPI('extension', 6, $connected);
|
||||
$this->view->hasInternet = $connected;
|
||||
$this->view->publicClass = ($connected and strpos($clientLang, 'zh') === 0) ? $this->admin->getPublicClassByAPI() : array();
|
||||
$this->view->clientLang = $clientLang;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,11 @@
|
||||
<?php
|
||||
class adminModel extends model
|
||||
{
|
||||
/**
|
||||
* The extension manager version. Don't change it.
|
||||
*/
|
||||
const EXT_MANAGER_VERSION = '1.3';
|
||||
|
||||
/**
|
||||
* The api root.
|
||||
*
|
||||
@@ -306,4 +311,92 @@ class adminModel extends model
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get extensions from zentao.net.
|
||||
*
|
||||
* @param string $type extension|patch
|
||||
* @param int $limit
|
||||
* @param bool $hasInternet
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getExtensionsByAPI($type = 'extension', $limit = 6, $hasInternet = true)
|
||||
{
|
||||
if($hasInternet)
|
||||
{
|
||||
$searchType = $type == 'extension' ? 'byUpdatedTime' : 'byModule';
|
||||
$param = $type == 'extension' ? '' : 'MTIxOA==';
|
||||
$extensions = $this->loadModel('extension')->getExtensionsByAPI($searchType, $param, 0, $limit);
|
||||
$extensions = isset($extensions->extensions) ? (array)$extensions->extensions : array();
|
||||
}
|
||||
else
|
||||
{
|
||||
if($this->config->edition == 'open')
|
||||
{
|
||||
$extensions = array(
|
||||
$this->config->admin->plugIns[27],
|
||||
$this->config->admin->plugIns[26],
|
||||
$this->config->admin->plugIns[30]
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$extensions = array(
|
||||
$this->config->admin->plugIns[198],
|
||||
$this->config->admin->plugIns[203]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $extensions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch data from an api.
|
||||
*
|
||||
* @param string $url
|
||||
* @access public
|
||||
* @return mixed
|
||||
*/
|
||||
public function fetchAPI($url)
|
||||
{
|
||||
$version = $this->loadModel('upgrade')->getOpenVersion(str_replace('.', '_', $this->config->version));
|
||||
$version = str_replace('_', '.', $version);
|
||||
|
||||
$url .= (strpos($url, '?') === false ? '?' : '&') . 'lang=' . str_replace('-', '_', $this->app->getClientLang()) . '&managerVersion=' . self::EXT_MANAGER_VERSION . '&zentaoVersion=' . $version;
|
||||
$result = json_decode(preg_replace('/[[:cntrl:]]/mu', '', common::http($url)));
|
||||
|
||||
if(!isset($result->status)) return false;
|
||||
if($result->status != 'success') return false;
|
||||
if(isset($result->data)) return json_decode($result->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get public class from zentao.net.
|
||||
*
|
||||
* @param int $limit
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getPublicClassByAPI($limit = 2)
|
||||
{
|
||||
$apiURL = $this->config->admin->apiRoot . "publicclass.json";
|
||||
$data = $this->fetchAPI($apiURL);
|
||||
$courses = $data->videos;
|
||||
|
||||
$index = 1;
|
||||
$publicClass = array();
|
||||
foreach($courses as $course)
|
||||
{
|
||||
if($index > $limit) return $publicClass;
|
||||
|
||||
$publicClass[$index] = new stdClass();
|
||||
$publicClass[$index]->name = $course->title;
|
||||
$publicClass[$index]->image = $this->config->admin->apiRoot . $course->image->list[0]->smallURL;
|
||||
$publicClass[$index]->viewLink = $this->config->admin->apiRoot . "{$course->alias}-{$course->id}.html";
|
||||
$index++;
|
||||
}
|
||||
return $publicClass;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php js::set('hasInternet', $hasInternet);?>
|
||||
<div id='mainContent' class='main-content admin'>
|
||||
<div class="main">
|
||||
<div class="settings panel">
|
||||
@@ -28,6 +29,8 @@
|
||||
<div class="setting-box">10</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if($extensions):?>
|
||||
<div class="plug panel">
|
||||
<div class="panel-title"><?php echo $lang->admin->pluginRecommendation?></div>
|
||||
<div class="plugin-list">
|
||||
@@ -40,34 +43,38 @@
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<div class="flex bottom">
|
||||
<div class="panel official">
|
||||
<div class="panel-title"><?php echo $lang->admin->officialAccount?></div>
|
||||
<div class="flex main-panel">
|
||||
<div class="official-img"></div>
|
||||
<div class="official-content">
|
||||
<div class="title"><?php echo $lang->admin->followUs?></div>
|
||||
<div class="flex main-panel">
|
||||
<div class="official-img"></div>
|
||||
<div class="official-content">
|
||||
<div class="title"><?php echo $lang->admin->followUs?></div>
|
||||
<div class="content"> <?php echo $lang->admin->followUsContent?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if($publicClass):?>
|
||||
<div class="panel publicClass">
|
||||
<div class="panel-title"><?php echo $lang->admin->publicClass?></div>
|
||||
<div class="classList flex">
|
||||
<div class="classItem flex">
|
||||
<div class="classImg"></div>
|
||||
<div class="classContent"></div>
|
||||
</div>
|
||||
<div class="classItem flex">
|
||||
<div class="classImg"></div>
|
||||
<div class="classContent"></div>
|
||||
<div class="classList flex">
|
||||
<?php foreach($publicClass as $class):?>
|
||||
<div class="classItem flex">
|
||||
<div class="classImg" style="background-image: url('<?php echo $class->image;?>');"></div>
|
||||
<div class="classContent"><?php echo $class->name;?></div>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if($hasInternet and strpos($clientLang, 'zh') === 0):?>
|
||||
<div class="side panel">
|
||||
<div class="panel-title"><?php echo $lang->admin->zentaoInfo?></div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
Reference in New Issue
Block a user