+add & *fix for task #437
This commit is contained in:
@@ -331,4 +331,27 @@ class extension extends control
|
||||
$url = helper::safe64Decode($url);
|
||||
$this->locate($url);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the extension score
|
||||
*
|
||||
* @param int $score
|
||||
* @param string $installUrl
|
||||
* @param string $downloadUrl
|
||||
* @param string $zentaoVersion
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function checkScore($score, $installUrl, $downloadUrl, $zentaoVersion)
|
||||
{
|
||||
if($score)
|
||||
{
|
||||
$resetLink = inlink('obtain');
|
||||
$downloadUrl = helper::safe64Decode($downloadUrl);
|
||||
$this->view->error = sprintf($this->lang->extension->errorCheckScore, $downloadUrl, $resetLink);
|
||||
$this->view->header->title = $this->lang->extension->needScore;
|
||||
die($this->display());
|
||||
}
|
||||
else $this->locate(inlink('waring', "url=$installUrl&zentaoVersion=$zentaoVersion"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ $lang->extension->byUpdatedTime = '最近更新';
|
||||
$lang->extension->bySearch = '搜索';
|
||||
$lang->extension->byCategory = '分类浏览';
|
||||
|
||||
$lang->extension->needScore = '无法安装,需要积分';
|
||||
$lang->extension->waringInstall = '安装警告:';
|
||||
$lang->extension->installFailed = '安装失败,错误原因如下:';
|
||||
$lang->extension->installFinished = '恭喜您,插件顺利的安装成功!';
|
||||
@@ -61,6 +62,7 @@ $lang->extension->viewInstalled = '查看已安装插件';
|
||||
$lang->extension->viewAvailable = '查看可安装插件';
|
||||
$lang->extension->viewDeactivated = '查看已禁用插件';
|
||||
|
||||
$lang->extension->errorCheckScore = '该插件下载需要积分。您要下载后进行上传安装<h3><a href="%s">下载</a> <a href="#" onclick=parent.location.href="%s">取消</a></h3>';
|
||||
$lang->extension->errorCheckIncompatible = '该插件与禅道版本不兼容,安装后可能无法使用。。<h3>是否继续,<a href="%s">强制安装</a> <a href="#" onclick=parent.location.href="%s">取消</a></h3>';
|
||||
$lang->extension->errorDownloadPathNotFound = '插件下载存储路径<strong>%s</strong>不存在。<br />linux下面请执行命令:<strong>mkdir -p %s</strong>来修正。';
|
||||
$lang->extension->errorDownloadPathNotWritable = '插件下载存储路径<strong>%s</strong>不可写。<br />linux下面请执行命令:<strong>sudo chmod 777 %s</strong>来修正。';
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* The install view file of extension module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2011 QingDao Nature Easy Soft Network Technology Co,LTD (www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package extension
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.lite.html.php';?>
|
||||
<table class='table-1'>
|
||||
<caption><?php echo $header->title;?></caption>
|
||||
<tr>
|
||||
<td valign='middle'>
|
||||
<?php if($error):?>
|
||||
<?php
|
||||
echo "<h3 class='error'>{$lang->extension->needSorce}</h3>";
|
||||
echo "<p>$error</p>";
|
||||
?>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -62,8 +62,10 @@
|
||||
<td>
|
||||
<?php
|
||||
$installLink = inlink('install', "extension=$extension->code&downLink=" . helper::safe64Encode($extension->downLink) . "&md5=$extension->md5");
|
||||
echo html::a(inlink('waring',"url=" . helper::safe64Encode($installLink) . "&zentaoVersion=$extension->zentaoVersion"), $lang->extension->installAB, '', "class='button-c iframe'");
|
||||
echo html::a(inlink('waring',"url=" . helper::safe64Encode($extension->downLink) . "&zentaoVersion=$extension->zentaoVersion"), $lang->extension->downloadAB, '', "class='button-c iframe'");
|
||||
$downLink = substr($extension->downLink, 0, strpos($extension->downLink, '/')) . "/file-download-$extension->fileId.html";
|
||||
if(!isset($extension->score))$extension->score = 0;
|
||||
echo html::a(inlink('checkScore',"score=$extension->score&installUrl=" . helper::safe64Encode($installLink) . "&downloadUrl=" . helper::safe64Encode($downLink) . "&zentaoVersion=$extension->zentaoVersion"), $lang->extension->installAB, '', "class='button-c iframe'");
|
||||
echo html::a(inlink('waring',"url=" . helper::safe64Encode($downLink) . "&zentaoVersion=$extension->zentaoVersion"), $lang->extension->downloadAB, '', "class='button-c iframe'");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user