From 648c28140d0548f5c7dd4528cd67331c8fb349ac Mon Sep 17 00:00:00 2001 From: wyd621 Date: Wed, 17 Jul 2013 09:40:41 +0800 Subject: [PATCH] * finish task #1568. --- module/extension/control.php | 21 ++++++++------------- module/extension/lang/zh-cn.php | 2 +- module/extension/model.php | 2 +- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/module/extension/control.php b/module/extension/control.php index 563024970e..0542b77477 100644 --- a/module/extension/control.php +++ b/module/extension/control.php @@ -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¶m=' . helper::safe64Encode($code)), $this->lang->extension->installExt, '_blank') . '
'; } if($noDepends) diff --git a/module/extension/lang/zh-cn.php b/module/extension/lang/zh-cn.php index bfe52a7047..bb213ebd58 100644 --- a/module/extension/lang/zh-cn.php +++ b/module/extension/lang/zh-cn.php @@ -99,6 +99,6 @@ $lang->extension->errorTargetPathNotWritable = '目标路径 %s extension->errorTargetPathNotExists = '目标路径 %s 不存在。'; $lang->extension->errorInstallDB = '执行数据库语句失败。错误信息如下:%s'; $lang->extension->errorConflicts = '与插件“%s”冲突!'; -$lang->extension->errorDepends = '没有安装依赖插件“%s”'; +$lang->extension->errorDepends = '以下依赖插件没有安装或版本不正确:

%s'; $lang->extension->errorIncompatible = '该插件与您的禅道版本不兼容'; $lang->extension->errorUninstallDepends = '插件“%s”依赖该插件,不能卸载'; diff --git a/module/extension/model.php b/module/extension/model.php index 333ab57b39..e49d667692 100644 --- a/module/extension/model.php +++ b/module/extension/model.php @@ -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();