* adjust for task #83746.
This commit is contained in:
+11
-4
@@ -54,10 +54,17 @@ $config->admin->plugins[194]->name = '应用巡检报告';
|
||||
$config->admin->plugins[194]->desc = '每日生成公司级禅道应用巡检报告,促进项目管理持续改进。';
|
||||
$config->admin->plugins[194]->viewLink = 'https://www.zentao.net/extension-viewExt-194.html';
|
||||
|
||||
$config->admin->apiRoot = 'https://www.zentao.net/';
|
||||
$config->admin->classURL = 'https://www.zentao.net/publicclass.html';
|
||||
$config->admin->extensionURL = 'https://www.zentao.net/extension-browse.html';
|
||||
$config->admin->liteMenuList = array('system', 'user', 'feature', 'message', 'extension', 'dev');
|
||||
$config->admin->apiRoot = 'https://www.zentao.net';
|
||||
$config->admin->cdnRoot = 'https://cdn.easycorp.cn/web';
|
||||
$config->admin->classURL = 'https://www.zentao.net/publicclass.html';
|
||||
$config->admin->dynamicURL = 'https://www.zentao.net/download.html';
|
||||
$config->admin->extensionURL = 'https://www.zentao.net/extension-browse.html';
|
||||
$config->admin->apiSite = 'https://api.zentao.net/';
|
||||
$config->admin->extAPIURL = $config->admin->apiSite . 'extension-apiGetExtensions-';
|
||||
$config->admin->patchAPIURL = $config->admin->apiSite . 'extension-apiGetExtensions-bymodule-MTIxOA==-0-100-1.json';
|
||||
$config->admin->downloadAPIURL = $config->admin->apiSite . 'download.json';
|
||||
$config->admin->videoAPIURL = $config->admin->apiSite . 'publicclass.json';
|
||||
$config->admin->liteMenuList = array('system', 'user', 'feature', 'message', 'extension', 'dev');
|
||||
|
||||
$config->admin->helpURL['system'] = 'https://www.zentao.net/book/zentaopms/538.html';
|
||||
$config->admin->helpURL['user'] = 'https://www.zentao.net/book/zentaopms/538.html';
|
||||
|
||||
@@ -41,8 +41,10 @@ class admin extends control
|
||||
$this->view->title = $this->lang->admin->common;
|
||||
$this->view->position[] = $this->lang->admin->index;
|
||||
$this->view->plugins = $this->admin->getExtensionsByAPI('plugin', $langNotCN ? 5 : 6, $hasInternet);
|
||||
$this->view->patches = $this->admin->getExtensionsByAPI('patch', 3, $hasInternet);
|
||||
$this->view->patches = $this->admin->getExtensionsByAPI('patch', 5, $hasInternet);
|
||||
$this->view->usedTime = $this->admin->getUsedTime();
|
||||
$this->view->hasInternet = $hasInternet;
|
||||
$this->view->dynamics = ($hasInternet and !$langNotCN) ? $this->admin->getDynamicsByAPI(3) : array();
|
||||
$this->view->publicClass = ($hasInternet and !$langNotCN) ? $this->admin->getPublicClassByAPI(3) : array();
|
||||
$this->view->langNotCN = $langNotCN;
|
||||
$this->display();
|
||||
|
||||
@@ -153,6 +153,6 @@ if($config->vision == 'lite')
|
||||
unset($lang->admin->menuList->feature['menuOrder']['15']);
|
||||
unset($lang->admin->menuList->feature['menuOrder']['20']);
|
||||
|
||||
$lang->admin->menuList->feature['subMenu']['project'] = array('link' => "{$lang->project->common}|custom|execution|");
|
||||
$lang->admin->menuList->feature['menuOrder']['15'] = 'project';
|
||||
$lang->admin->menuList->feature['subMenu']['project'] = array('link' => "{$lang->project->common}|custom|execution|");
|
||||
$lang->admin->menuList->feature['menuOrder']['15'] = 'project';
|
||||
}
|
||||
|
||||
@@ -172,8 +172,23 @@ $lang->admin->menuSetting['convert']['desc'] = '第三方系统的数据导入
|
||||
|
||||
$lang->admin->mon = '月';
|
||||
$lang->admin->day = '日';
|
||||
$lang->admin->usedTime = '您已使用禅道';
|
||||
$lang->admin->updateDynamics = '更新动态';
|
||||
$lang->admin->updatePatch = '补丁更新';
|
||||
$lang->admin->upgradeRecommend = '推荐升级';
|
||||
|
||||
$lang->admin->openTag = '禅道';
|
||||
$lang->admin->bizTag = '禅道企业版';
|
||||
$lang->admin->maxTag = '禅道旗舰版';
|
||||
|
||||
$lang->admin->bizInfoURL = 'https://www.zentao.net/page/enterprise.html';
|
||||
$lang->admin->maxInfoURL = 'https://www.zentao.net/page/max.html';
|
||||
$lang->admin->productDetail = '查看详情';
|
||||
$lang->admin->productFeature['biz'][] = '工时管理、甘特图、导入导出';
|
||||
$lang->admin->productFeature['biz'][] = '40+内置统计报表、自定义报表功能';
|
||||
$lang->admin->productFeature['biz'][] = '强大的自定义工作流、反馈管理功能';
|
||||
$lang->admin->productFeature['max'][] = '瀑布模型功能更全面';
|
||||
$lang->admin->productFeature['max'][] = '完整CMMI流程';
|
||||
$lang->admin->productFeature['max'][] = '资产库管理';
|
||||
|
||||
include dirname(__FILE__) . '/menu.php';
|
||||
|
||||
+62
-8
@@ -409,11 +409,15 @@ class adminModel extends model
|
||||
{
|
||||
if($hasInternet)
|
||||
{
|
||||
$searchType = $type == 'plugin' ? 'byUpdatedTime' : 'byModule';
|
||||
$searchType = $type == 'plugin' ? 'byUpdatedTime,offcial' : 'byModule';
|
||||
$param = $type == 'plugin' ? '' : 'MTIxOA==';
|
||||
$extensions = $this->loadModel('extension')->getExtensionsByAPI($searchType, $param, 0, $limit);
|
||||
$plugins = isset($extensions->extensions) ? (array)$extensions->extensions : array();
|
||||
foreach($plugins as $plugin) $plugin->viewLink = str_replace(array('info', 'client'), '', $plugin->viewLink);
|
||||
foreach($plugins as $id => $plugin)
|
||||
{
|
||||
$plugin->viewLink = str_replace(array('info', 'client'), '', $plugin->viewLink);
|
||||
if($type == 'patch' and !isset($plugin->compatibleRelease)) unset($plugins[$id]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -450,7 +454,7 @@ class adminModel extends model
|
||||
$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;
|
||||
$url .= (strpos($url, '?') === false ? '?' : '&') . 'lang=' . str_replace('-', '_', $this->app->getClientLang()) . '&managerVersion=' . self::EXT_MANAGER_VERSION . '&zentaoVersion=' . $version . '&edition=' . $this->config->edition;
|
||||
$result = json_decode(preg_replace('/[[:cntrl:]]/mu', '', common::http($url)));
|
||||
|
||||
if(!isset($result->status)) return false;
|
||||
@@ -467,7 +471,7 @@ class adminModel extends model
|
||||
*/
|
||||
public function getPublicClassByAPI($limit = 2)
|
||||
{
|
||||
$apiURL = $this->config->admin->apiRoot . "publicclass.json";
|
||||
$apiURL = $this->config->admin->videoAPIURL;
|
||||
$data = $this->fetchAPI($apiURL);
|
||||
$courses = $data->videos;
|
||||
|
||||
@@ -475,17 +479,67 @@ class adminModel extends model
|
||||
$publicClass = array();
|
||||
foreach($courses as $course)
|
||||
{
|
||||
if($index > $limit) return $publicClass;
|
||||
if($index > $limit) break;
|
||||
|
||||
$publicClass[$index] = new stdClass();
|
||||
$publicClass[$index]->name = $course->title;
|
||||
$publicClass[$index]->image = $this->config->admin->apiRoot . $course->image->list[0]->largeURL;
|
||||
$publicClass[$index]->viewLink = $this->config->admin->apiRoot . 'publicclass/' . ($course->alias ? "{$course->alias}-" : '') . "{$course->id}.html";
|
||||
$publicClass[$index]->image = $this->config->admin->cdnRoot . $course->image->list[0]->middleURL . '.' . $course->image->list[0]->extension;
|
||||
$publicClass[$index]->viewLink = $this->config->admin->apiRoot . '/publicclass/' . ($course->alias ? "{$course->alias}-" : '') . "{$course->id}.html";
|
||||
$index ++;
|
||||
}
|
||||
return $publicClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get dynamics by API.
|
||||
*
|
||||
* @param int $limit
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getDynamicsByAPI($limit = 2)
|
||||
{
|
||||
$apiURL = $this->config->admin->downloadAPIURL;
|
||||
$data = $this->fetchAPI($apiURL);
|
||||
$articles = $data->articles;
|
||||
|
||||
$index = 1;
|
||||
$downloads = array();
|
||||
foreach($articles as $article)
|
||||
{
|
||||
if($index > $limit) break;
|
||||
|
||||
$tagKey = $this->config->edition . 'Tag';
|
||||
if(!isset($this->lang->admin->$tagKey)) break;
|
||||
if(!preg_match("/{$this->lang->admin->$tagKey}\d/", $article->title)) continue;
|
||||
|
||||
$downloads[$index] = new stdClass();
|
||||
$downloads[$index]->id = $article->id;
|
||||
$downloads[$index]->title = $article->title;
|
||||
$downloads[$index]->addedDate = $article->addedDate;
|
||||
$downloads[$index]->link = $this->config->admin->apiRoot . "/download/{$article->alias}-{$article->id}.html";
|
||||
$index ++;
|
||||
}
|
||||
return $downloads;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get used time for this account.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getUsedTime()
|
||||
{
|
||||
$firstDate = $this->dao->select('id,date')->from(TABLE_ACTION)->where('actor')->eq($this->app->user->account)->orderBy('`date`')->limit(1)->fetch('date');
|
||||
$days = helper::diffDate(helper::now(), $firstDate);
|
||||
$year = floor($days / 365);
|
||||
$days = $days % 365;
|
||||
$month = floor($days / 30);
|
||||
$days = $days % 30;
|
||||
return array('year' => $year, 'month' => $month, 'day' => $days);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check internet.
|
||||
*
|
||||
@@ -495,7 +549,7 @@ class adminModel extends model
|
||||
public function checkInternet()
|
||||
{
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_URL, 'https://api.zentao.net/extension-apiGetExtensions.json');
|
||||
curl_setopt($curl, CURLOPT_URL, $this->config->admin->apiSite);
|
||||
curl_setopt($curl, CURLOPT_TIMEOUT_MS, 1000);
|
||||
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT_MS, 1000);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
|
||||
|
||||
@@ -90,32 +90,31 @@
|
||||
<div class="side panel">
|
||||
<div class="h-56 flex align-center justify-between">
|
||||
<div class="panel-title"><?php echo $lang->admin->zentaoInfo?></div>
|
||||
<div class="time-count color-gray">您已使用禅道<span class="time-block">05</span><?php echo $lang->year?><span class="time-block">09</span><?php echo $lang->admin->day?><span class="time-block">19</span>日</div>
|
||||
<div class="time-count color-gray">
|
||||
<?php echo $lang->admin->usedTime;?>
|
||||
<?php if($usedTime['year']) echo "<span class='time-block'>{$usedTime['year']}</span>{$lang->year}";?>
|
||||
<?php if($usedTime['month']) echo "<span class='time-block'>{$usedTime['month']}</span>{$lang->admin->mon}";?>
|
||||
<?php if($usedTime['day']) echo "<span class='time-block'>{$usedTime['day']}</span>{$lang->admin->day}";?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border-gray mb-16">
|
||||
<div class="h-40 pl-16 flex align-center justify-between">
|
||||
<div class="panel-title"><?php echo $lang->admin->updateDynamics?></div>
|
||||
<?php echo html::a($config->admin->extensionURL, "{$lang->more} <i class='icon icon-caret-right'></i>", '_blank', 'class="more text-muted flex align-center"');?>
|
||||
<?php echo html::a($config->admin->dynamicURL, "{$lang->more} <i class='icon icon-caret-right'></i>", '_blank', 'class="more text-muted flex align-center"');?>
|
||||
</div>
|
||||
<?php foreach($dynamics as $dynamic):?>
|
||||
<div class="dynamic-block">
|
||||
<div class="dynamic-content"><i class="icon icon-horn text-primary"></i>禅道18.0发布,新增自动化测试方案、使用帮助及全新IDE风格</div>
|
||||
<div class="dynamic-time">2022-03-12</div>
|
||||
</div>
|
||||
<div class="dynamic-block">
|
||||
<div class="dynamic-content"><i class="icon icon-horn text-primary"></i>禅道18.0发布,新增自动化测试方案、使用帮助及全新IDE风格</div>
|
||||
<div class="dynamic-time">2022-03-12</div>
|
||||
</div>
|
||||
<div class="dynamic-block">
|
||||
<div class="dynamic-content"><i class="icon icon-horn text-primary"></i>禅道18.0发布,新增自动化测试方案、使用帮助及全新IDE风格</div>
|
||||
<div class="dynamic-time">2022-03-12</div>
|
||||
<div class="dynamic-content"><i class="icon icon-horn text-primary"></i><?php echo html::a($dynamic->link, $dynamic->title, '_blank');?></div>
|
||||
<div class="dynamic-time"><?php echo substr($dynamic->addedDate, 0, 10);?></div>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
<div class="border-gray mb-16">
|
||||
<div class="h-40 pl-16 flex align-center justify-between">
|
||||
<div class="panel-title"><?php echo $lang->admin->updatePatch?></div>
|
||||
<?php echo html::a($config->admin->extensionURL, "{$lang->more} <i class='icon icon-caret-right'></i>", '_blank', 'class="more text-muted flex align-center"');?>
|
||||
</div>
|
||||
<?php foreach($this->view->patches as $patch):?>
|
||||
<?php foreach($patches as $patch):?>
|
||||
<div class="patch-block">
|
||||
<div class="title flex justify-between">
|
||||
<div class="panel-title"><?php echo $patch->name?></div>
|
||||
@@ -127,31 +126,34 @@
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
<?php if($config->edition != 'max'):?>
|
||||
<div class="border-gray mb-16">
|
||||
<div class="h-40 pl-16 flex align-center justify-between">
|
||||
<div class="panel-title"><?php echo $lang->admin->upgradeRecommend?></div>
|
||||
<?php echo html::a($config->admin->extensionURL, "{$lang->more} <i class='icon icon-caret-right'></i>", '_blank', 'class="more text-muted flex align-center"');?>
|
||||
<?php echo html::a($config->admin->apiRoot, "{$lang->more} <i class='icon icon-caret-right'></i>", '_blank', 'class="more text-muted flex align-center"');?>
|
||||
</div>
|
||||
<?php if($config->edition != 'biz'):?>
|
||||
<div class="upgrade-block">
|
||||
<div class="title text-primary flex justify-between">
|
||||
<div>禅道企业版</div>
|
||||
<div class="flex align-center"><div>查看详情</div><i class="icon icon-caret-right text-primary"></i></div>
|
||||
<div class="title text-primary flex justify-between">
|
||||
<div><?php echo $lang->admin->bizTag?></div>
|
||||
<div class="flex align-center"><div><?php echo html::a($lang->admin->bizInfoURL, $lang->admin->productDetail, '_blank', "class='text-primary'");?></div><i class="icon icon-caret-right text-primary"></i></div>
|
||||
</div>
|
||||
<div class="upgrade-content color-gray">工时管理、甘特图、导入导出</div>
|
||||
<div class="upgrade-content color-gray">40+内置统计报表、自定义报表功能</div>
|
||||
<div class="upgrade-content color-gray">强大的自定义工作流、反馈管理功能</div>
|
||||
<?php foreach($lang->admin->productFeature['biz'] as $feature):?>
|
||||
<div class="upgrade-content color-gray"><?php echo $feature;?></div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<div class="upgrade-block">
|
||||
<div class="title text-primary flex justify-between">
|
||||
<div>禅道旗舰版</div>
|
||||
<div class="flex align-center"><div>查看详情</div><i class="icon icon-caret-right text-primary"></i></div>
|
||||
<div class="title text-primary flex justify-between">
|
||||
<div><?php echo $lang->admin->maxTag?></div>
|
||||
<div class="flex align-center"><div><?php echo html::a($lang->admin->maxInfoURL, $lang->admin->productDetail, '_blank', "class='text-primary'");?></div><i class="icon icon-caret-right text-primary"></i></div>
|
||||
</div>
|
||||
<div class="upgrade-content color-gray">工时管理、甘特图、导入导出</div>
|
||||
<div class="upgrade-content color-gray">40+内置统计报表、自定义报表功能</div>
|
||||
<div class="upgrade-content color-gray">强大的自定义工作流、反馈管理功能</div>
|
||||
<div class="upgrade-content color-gray">工时管理、甘特图、导入导出</div>
|
||||
<?php foreach($lang->admin->productFeature['max'] as $feature):?>
|
||||
<div class="upgrade-content color-gray"><?php echo $feature;?></div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
|
||||
@@ -60,7 +60,7 @@ class extensionModel extends model
|
||||
$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;
|
||||
$url .= (strpos($url, '?') === false ? '?' : '&') . 'lang=' . str_replace('-', '_', $this->app->getClientLang()) . '&managerVersion=' . self::EXT_MANAGER_VERSION . '&zentaoVersion=' . $version . '&edition=' . $this->config->edition;
|
||||
$result = json_decode(common::http($url));
|
||||
|
||||
if(!isset($result->status)) return false;
|
||||
|
||||
Reference in New Issue
Block a user