* finish task #1568.

This commit is contained in:
wyd621
2013-07-17 09:40:41 +08:00
parent 1be844dbea
commit 648c28140d
3 changed files with 10 additions and 15 deletions
+8 -13
View File
@@ -200,16 +200,13 @@ class extension extends control
$conflictsExt = '';
foreach($conflicts as $code => $limit)
{
$hasConflicts = false;
if(isset($installedExts[$code]))
{
if($this->extension->compare4Limit($installedExts[$code]->version, $limit)) $hasConflicts = true;
if($this->extension->compare4Limit($installedExts[$code]->version, $limit)) $conflictsExt .= $installedExts[$code]->name . " ";
}
if($hasConflicts)$conflictsExt .= $installedExts[$code]->name . " ";
}
if($hasConflicts)
if($conflictsExt)
{
$this->view->error = sprintf($this->lang->extension->errorConflicts, $conflictsExt);
die($this->display());
@@ -234,16 +231,14 @@ class extension extends control
}
$extVersion = '';
if($limit == 'all')
if($limit != 'all')
{
$extVersion = 'all';
$extVersion .= '(';
if(!empty($limit['min'])) $extVersion .= '>=v' . $limit['min'];
if(!empty($limit['max'])) $extVersion .= ' <=v' . $limit['max'];
$extVersion .=')';
}
else
{
if(!empty($limit['min'])) $extVersion .= '>=V' . $limit['min'];
if(!empty($limit['max'])) $extVersion .= ' <=V' . $limit['max'];
}
if($noDepends)$dependsExt .= $code . "($extVersion) ";
if($noDepends)$dependsExt .= $code . $extVersion . ' ' . html::a(inlink('obtain', 'type=bycode&param=' . helper::safe64Encode($code)), $this->lang->extension->installExt, '_blank') . '<br />';
}
if($noDepends)
+1 -1
View File
@@ -99,6 +99,6 @@ $lang->extension->errorTargetPathNotWritable = '目标路径 <strong>%s </stro
$lang->extension->errorTargetPathNotExists = '目标路径 <strong>%s </strong>不存在。';
$lang->extension->errorInstallDB = '执行数据库语句失败。错误信息如下:%s';
$lang->extension->errorConflicts = '与插件“%s”冲突!';
$lang->extension->errorDepends = '没有安装依赖插件“%s”';
$lang->extension->errorDepends = '以下依赖插件没有安装或版本不正确:<br /><br /> %s';
$lang->extension->errorIncompatible = '该插件与您的禅道版本不兼容';
$lang->extension->errorUninstallDepends = '插件“%s”依赖该插件,不能卸载';
+1 -1
View File
@@ -152,7 +152,7 @@ class extensionModel extends model
*/
public function checkIncompatible($versions)
{
$apiURL = $this->apiRoot . 'apiCheckCompatible-' . helper::safe64Encode(json_encode($versions)) . '.json';
$apiURL = $this->apiRoot . 'apiCheckIncompatible-' . helper::safe64Encode(json_encode($versions)) . '.json';
$data = $this->fetchAPI($apiURL);
if(isset($data->incompatibleExts)) return (array)$data->incompatibleExts;
return array();