diff --git a/Makefile b/Makefile
index 49c3731579..f1718a17f1 100644
--- a/Makefile
+++ b/Makefile
@@ -46,12 +46,14 @@ pms:
mkdir -p buildxx/framework
mkdir -p buildxx/db
mkdir -p buildxx/www
+ mkdir -p buildxx/module/common/ext/model/
svn export https://github.com/easysoft/xuanxuan.git/branches/master/ranzhi/
cp ranzhi/config/ext/xuanxuan.php buildxx/config/ext/
cp -r ranzhi/lib/phpaes buildxx/lib/
cp -r ranzhi/framework/xuanxuan.class.php buildxx/framework/
cp -r ranzhi/db/xuanxuan.sql buildxx/db/
cp -r ranzhi/app/sys/chat buildxx/module/
+ cp -r ranzhi/app/sys/common/ext/model/hook buildxx/module/common/ext/model/
cp -r ranzhi/app/sys/action buildxx/module/
cp -r xuanxuan/module/* buildxx/module/
cp -r xuanxuan/www/* buildxx/www/
diff --git a/config/config.php b/config/config.php
index 9bb69f45ff..ec8aa2bf6a 100644
--- a/config/config.php
+++ b/config/config.php
@@ -29,7 +29,7 @@ $config->moduleVar = 'm'; // 请求类型为GET:模块变量
$config->methodVar = 'f'; // 请求类型为GET:模块变量名。 requestType=GET: the method var name.
$config->viewVar = 't'; // 请求类型为GET:视图变量名。 requestType=GET: the view var name.
$config->sessionVar = 'zentaosid'; // 请求类型为GET:session变量名。 requestType=GET: the session var name.
-$config->views = ',html,json,mhtml,'; // 支持的视图类型。 Supported view formats.
+$config->views = ',html,json,mhtml,xhtml,'; // 支持的视图类型。 Supported view formats.
/* 支持的主题和语言。Supported thems and languages. */
$config->themes['default'] = 'default';
@@ -39,6 +39,7 @@ $config->langs['en'] = 'English';
/* 设备类型视图文件前缀。The prefix for view file for different device. */
$config->devicePrefix['mhtml'] = '';
+$config->devicePrefix['xhtml'] = 'x.';
/* 默认值设置。Default settings. */
$config->default = new stdclass();
diff --git a/framework/control.class.php b/framework/control.class.php
index 848194f79b..bd70b5db6c 100644
--- a/framework/control.class.php
+++ b/framework/control.class.php
@@ -20,4 +20,121 @@
include dirname(__FILE__) . '/base/control.class.php';
class control extends baseControl
{
+ /**
+ * 设置视图文件:主视图文件,扩展视图文件, 站点扩展视图文件,以及钩子脚本。
+ * Set view files: the main file, extension view file, site extension view file and hook files.
+ *
+ * @param string $moduleName module name
+ * @param string $methodName method name
+ * @access public
+ * @return string the view file
+ */
+ public function setViewFile($moduleName, $methodName)
+ {
+ $moduleName = strtolower(trim($moduleName));
+ $methodName = strtolower(trim($methodName));
+
+ $modulePath = $this->app->getModulePath($this->appName, $moduleName);
+ $viewExtPath = $this->app->getModuleExtPath($this->appName, $moduleName, 'view');
+
+ $viewType = ($this->viewType == 'mhtml' or $this->viewType == 'xhtml') ? 'html' : $this->viewType;
+ $mainViewFile = $modulePath . 'view' . DS . $this->devicePrefix . $methodName . '.' . $viewType . '.php';
+
+ /* If the main view file doesn't exist, set the device prefix to empty and reset the main view file. */
+ if($this->viewType == 'mhtml' or $this->viewType == 'xhtml')
+ {
+ if(!file_exists($mainViewFile))
+ {
+ if($this->viewType == 'xhtml') $this->app->viewType = 'html';
+ $this->devicePrefix = '';
+ $mainViewFile = $modulePath . 'view' . DS . $this->devicePrefix . $methodName . '.' . $viewType . '.php';
+ }
+ }
+
+ $viewFile = $mainViewFile;
+
+ if(!empty($viewExtPath))
+ {
+ $commonExtViewFile = $viewExtPath['common'] . $this->devicePrefix . $methodName . ".{$viewType}.php";
+ $siteExtViewFile = empty($viewExtPath['site']) ? '' : $viewExtPath['site'] . $this->devicePrefix . $methodName . ".{$viewType}.php";
+
+ $viewFile = file_exists($commonExtViewFile) ? $commonExtViewFile : $mainViewFile;
+ $viewFile = (!empty($siteExtViewFile) and file_exists($siteExtViewFile)) ? $siteExtViewFile : $viewFile;
+ if(!is_file($viewFile)) $this->app->triggerError("the view file $viewFile not found", __FILE__, __LINE__, $exit = true);
+
+ $commonExtHookFiles = glob($viewExtPath['common'] . $this->devicePrefix . $methodName . ".*.{$viewType}.hook.php");
+ $siteExtHookFiles = empty($viewExtPath['site']) ? '' : glob($viewExtPath['site'] . $this->devicePrefix . $methodName . ".*.{$viewType}.hook.php");
+ $extHookFiles = array_merge((array) $commonExtHookFiles, (array) $siteExtHookFiles);
+ }
+
+ if(!empty($extHookFiles)) return array('viewFile' => $viewFile, 'hookFiles' => $extHookFiles);
+ return $viewFile;
+ }
+
+ /**
+ * 默认渲染方法,适用于viewType = html的时候。
+ * Default parse method when viewType != json, like html.
+ *
+ * @param string $moduleName module name
+ * @param string $methodName method name
+ * @access public
+ * @return void
+ */
+ public function parseDefault($moduleName, $methodName)
+ {
+ /**
+ * 设置视图文件。(PHP7有一个bug,不能直接$viewFile = $this->setViewFile())。
+ * Set viewFile. (Can't assign $viewFile = $this->setViewFile() directly because one php7's bug.)
+ */
+ $results = $this->setViewFile($moduleName, $methodName);
+ $viewFile = $results;
+ if(is_array($results)) extract($results);
+
+ /**
+ * 获得当前页面的CSS和JS。
+ * Get css and js codes for current method.
+ */
+ $css = $this->getCSS($moduleName, $methodName);
+ $js = $this->getJS($moduleName, $methodName);
+ /* If the js or css file doesn't exist, set the device prefix to empty and reset the js or css file. */
+ if($this->viewType == 'xhtml')
+ {
+ if(!$css)
+ {
+ $this->devicePrefix = '';
+ $css = $this->getCSS($moduleName, $methodName);
+ }
+ if(!$js)
+ {
+ $this->devicePrefix = '';
+ $js = $this->getJS($moduleName, $methodName);
+ }
+ }
+ if($css) $this->view->pageCSS = $css;
+ if($js) $this->view->pageJS = $js;
+
+ /**
+ * 切换到视图文件所在的目录,以保证视图文件里面的include语句能够正常运行。
+ * Change the dir to the view file to keep the relative pathes work.
+ */
+ $currentPWD = getcwd();
+ chdir(dirname($viewFile));
+
+ /**
+ * 使用extract安定ob方法渲染$viewFile里面的代码。
+ * Use extract and ob functions to eval the codes in $viewFile.
+ */
+ extract((array)$this->view);
+ ob_start();
+ include $viewFile;
+ if(isset($hookFiles)) foreach($hookFiles as $hookFile) if(file_exists($hookFile)) include $hookFile;
+ $this->output .= ob_get_contents();
+ ob_end_clean();
+
+ /**
+ * 渲染完毕后,再切换回之前的路径。
+ * At the end, chang the dir to the previous.
+ */
+ chdir($currentPWD);
+ }
}
diff --git a/framework/router.class.php b/framework/router.class.php
index 87c03113c4..34509bacc9 100755
--- a/framework/router.class.php
+++ b/framework/router.class.php
@@ -156,4 +156,38 @@ class router extends baseRouter
$this->session->set('rand', $this->session->random);
echo json_encode($view);
}
+
+ /**
+ * PATH_INFO方式解析,获取$URI和$viewType。
+ * Parse PATH_INFO, get the $URI and $viewType.
+ *
+ * @access public
+ * @return void
+ */
+ public function parsePathInfo()
+ {
+ parent::parsePathInfo();
+
+ if($this->get->display == 'card')
+ {
+ $this->viewType = 'xhtml';
+ }
+ }
+
+ /**
+ * GET请求方式解析,获取$URI和$viewType。
+ * Parse GET, get $URI and $viewType.
+ *
+ * @access public
+ * @return void
+ */
+ public function parseGET()
+ {
+ parent::parseGET();
+
+ if($this->get->display == 'card')
+ {
+ $this->viewType = 'xhtml';
+ }
+ }
}
diff --git a/module/common/model.php b/module/common/model.php
index 266c05714b..f2f9ed9149 100644
--- a/module/common/model.php
+++ b/module/common/model.php
@@ -699,7 +699,7 @@ class commonModel extends model
public static function printClientLink()
{
global $lang;
- echo html::a(helper::createLink('misc', 'downloadClient', '', '', true), "", '', "title='$lang->downloadClient' class='text-primary iframe' data-width='400'") . ' ';
+ echo html::a(helper::createLink('misc', 'downloadClient', '', '', true), "", '', "title='$lang->downloadClient' class='text-primary iframe' data-width='600'") . ' ';
}
/**
diff --git a/module/common/view/footer.html.php b/module/common/view/footer.html.php
index 3f8a1bae88..410772b229 100755
--- a/module/common/view/footer.html.php
+++ b/module/common/view/footer.html.php
@@ -48,7 +48,7 @@ $(function()
if(data)
{
if(typeof data == 'string') data = $.parseJSON(data);
- if(typeof data.message == 'string') notifyMessage(data.message);
+ if(typeof data.message == 'string') notifyMessage(data);
}
}
});
diff --git a/module/doc/view/browse.html.php b/module/doc/view/browse.html.php
index 58abda25b9..681f0cc1ea 100644
--- a/module/doc/view/browse.html.php
+++ b/module/doc/view/browse.html.php
@@ -53,7 +53,7 @@ var browseType = '';
" . $lang->delete, 'hiddenwin');?>
- " . $this->lang->doc->create, '', "class='btn btn-primary'");?>
+ " . $this->lang->doc->create, '', "class='btn btn-primary'");?>
@@ -68,7 +68,7 @@ var browseType = '';
doc->noDoc;?>
youCould;?>
- createLink('doc', 'create', "libID={$libID}"), " " . $lang->doc->create, '', "class='btn btn-info'");?>
+ createLink('doc', 'create', "libID={$libID}&moduleID=$moduleID"), " " . $lang->doc->create, '', "class='btn btn-info'");?>
doc->noEditedDoc;?>
diff --git a/module/doc/view/browsebygrid.html.php b/module/doc/view/browsebygrid.html.php
index 2a076d874b..b7332ebc0e 100644
--- a/module/doc/view/browsebygrid.html.php
+++ b/module/doc/view/browsebygrid.html.php
@@ -25,7 +25,7 @@
" . $lang->delete, 'hiddenwin');?>
- " . $this->lang->doc->create, '', "class='btn btn-primary'");?>
+ " . $this->lang->doc->create, '', "class='btn btn-primary'");?>
@@ -41,7 +41,7 @@
doc->noDoc;?>
youCould;?>
- createLink('doc', 'create', "libID={$libID}"), " " . $lang->doc->create, '', "class='btn btn-info'");?>
+ createLink('doc', 'create', "libID={$libID}&moduleID=$moduleID"), " " . $lang->doc->create, '', "class='btn btn-info'");?>
doc->noEditedDoc;?>
diff --git a/module/mail/view/edit.html.php b/module/mail/view/edit.html.php
index 79dedb972e..71ed1f15fc 100755
--- a/module/mail/view/edit.html.php
+++ b/module/mail/view/edit.html.php
@@ -92,12 +92,12 @@
- |
+ |
+
mail->turnon and $mailExist) echo html::linkButton($lang->mail->test, inlink('test'));
- echo html::linkButton($lang->mail->reset, inlink('reset'));
- if(common::hasPriv('mail', 'browse') and !empty($config->mail->async) and !empty($config->global->cron)) echo html::linkButton($lang->mail->browse, inlink('browse'));
+ if($config->mail->turnon and $mailExist) echo html::a(inlink('test'), $lang->mail->test, '', "class='btn btn-wide'");
+ echo html::a(inlink('reset'), $lang->mail->reset, '', "class='btn btn-wide'");
+ if(common::hasPriv('mail', 'browse') and !empty($config->mail->async) and !empty($config->global->cron)) echo html::a(inlink('browse'), $lang->mail->browse, '', "class='btn btn-wide'");
?>
|
diff --git a/module/message/control.php b/module/message/control.php
index c214f35193..9b36897266 100644
--- a/module/message/control.php
+++ b/module/message/control.php
@@ -86,11 +86,13 @@ class message extends control
$this->dao->update(TABLE_NOTIFY)->set('status')->eq('sended')->set('sendTime')->eq(helper::now())->where('id')->in($idList)->exec();
foreach($todos as $todo) $messages .= $todo->data . $newline;
- if($windowBlur) $messages = strip_tags($messages);
if($windowBlur)
{
- echo json_encode(array('message' => $messages));
+ preg_match_all("/ $messages, 'url' => $link));
}
else
{
diff --git a/module/misc/control.php b/module/misc/control.php
index 5fcff88926..1ade939165 100644
--- a/module/misc/control.php
+++ b/module/misc/control.php
@@ -88,109 +88,253 @@ class misc extends control
* Download zentao client.
*
* @access public
+ * @param string $action
+ * @param string $os
+ * @param string $version
* @return void
*/
- public function downloadClient($os = '', $confirm = 'no', $send = 'no')
+ public function downloadClient($action = 'check', $os = '', $version = '')
{
- if($_POST) die(js::locate($this->createLink('misc', 'downloadClient', "os={$this->post->os}&confirm=yes"), 'parent'));
-
- if($send == 'yes')
+ if($_POST)
{
- $clientDir = $this->app->getBasePath() . 'tmp/cache/client/tmp/';
- if(!is_dir($clientDir)) mkdir($clientDir, 0755, true);
+ $version = $this->post->version;
+ $os = $this->post->os;
- /* write login info into config file. */
- $defaultUser = new stdclass();
- $defaultUser->server = common::getSysURL();
- $defaultUser->account = $this->app->user->account;
+ die(js::locate($this->createLink('misc', 'downloadClient', "action=getPackage&os=$os"), 'parent'));
+ }
- $loginInfo = new stdclass();
- $loginInfo->ui = $defaultUser;
- $loginInfo = json_encode($loginInfo);
+ if($action == 'check')
+ {
+ $error = false;
+ $errorInfo = '';
- $loginFile = $clientDir . 'config.json';
- file_put_contents($loginFile, $loginInfo);
+ $cacheDir = $this->app->getBasePath() . 'tmp/cache/';
+ if(!is_dir($cacheDir))
+ {
+ $result = mkdir($cacheDir, 0755, true);
+ if($result == false)
+ {
+ $error = true;
+ $errorInfo = sprintf($this->lang->misc->client->errorInfo->dirNotExist, $cacheDir, $cacheDir);
+ }
+ }
+
+ if(!is_writable($cacheDir))
+ {
+ $error = true;
+ $errorInfo = sprintf($this->lang->misc->client->errorInfo->dirNotWritable, $cacheDir, $cacheDir);
+ }
+
+ $this->view->error = $error;
+ $this->view->errorInfo = $errorInfo;
+
+ if(!$error) die(js::locate($this->createLink('misc', 'downloadClient', "action=selectPackage")));
+ }
+
+ if($action == 'selectPackage')
+ {
+ $os = 'windows64';
+ $agentOS = helper::getOS();
+ if(strpos($agentOS, 'Windows') !== false) $os = 'windows64';
+ if(strpos($agentOS, 'Linux') !== false) $os = 'linux64';
+ if(strpos($agentOS, 'Mac') !== false) $os = 'mac';
+
+ $this->view->os = $os;
+ }
+
+ if($action == 'getPackage')
+ {
+ $this->view->os = $os;
+ $this->view->account = $this->app->user->account;
+ }
+
+ if($action == 'clearTmpPackage')
+ {
+ $account = $this->app->user->account;
+ $tmpDir = $this->app->getBasePath() . 'tmp/cache/client/' . "$account/";
+
+ if(is_dir($tmpDir))
+ {
+ $zfile = $this->app->loadClass('zfile');
+ $zfile->removeDir($tmpDir);
+ }
+
+ die(js::closeModal('parent.parent', 'this'));
+ }
+
+ if($action == 'downloadPackage')
+ {
+ $account = $this->app->user->account;
+ $clientDir = $this->app->getBasePath() . 'tmp/cache/client/' . "$account/";
- define('PCLZIP_TEMPORARY_DIR', $clientDir);
- $this->app->loadClass('pclzip', true);
$clientFile = $clientDir . 'zentaoClient.zip';
- $archive = new pclzip($clientFile);
-
- if($os == 'mac')
+ $zipContent = file_get_contents($clientFile);
+ if(is_dir($clientDir))
{
- $result = $archive->add($loginFile, PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_OPT_ADD_PATH, 'xuanxuan.app/Contents/Resouces');
+ $zfile = $this->app->loadClass('zfile');
+ $zfile->removeDir($clientDir);
}
- else
- {
- $result = $archive->add($loginFile, PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_OPT_ADD_PATH, 'resources/build-in');
- }
-
- if($result == 0) die("Error : " . $archive->errorInfo(true));
-
- unlink($clientDir);
$this->fetch('file', 'sendDownHeader', array('fileName' => 'client.zip', 'zip', $zipContent));
}
- $this->view->os = $os;
- $this->view->confirm = $confirm;
+ $this->view->action = $action;
$this->display();
}
- public function ajaxGetClient($os)
+ /**
+ * Ajax get client package.
+ *
+ * @param string $os
+ * @param string $version
+ * @access public
+ * @return void
+ */
+ public function ajaxGetClientPackage($os = '', $version = '')
{
set_time_limit (0);
+ session_write_close();
+
+ $response = array();
+ $response['result'] = 'success';
+ $response['message'] = '';
$clientDir = $this->app->getBasePath() . 'tmp/cache/client/';
if(!is_dir($clientDir)) mkdir($clientDir, 0755, true);
+ $account = $this->app->user->account;
+ $tmpDir = $clientDir . "/$account/";
+ if(!is_dir($tmpDir)) mkdir($tmpDir, 0755, true);
+
if($os == 'windows64') $clientName = "xuanxuan.win64.zip";
if($os == 'windows32') $clientName = "xuanxuan.win32.zip";
if($os == 'linux64') $clientName = "xuanxuan.linux.x64.zip";
if($os == 'linux32') $clientName = "xuanxuan.linux.ia32.zip";
if($os == 'mac') $clientName = "xuanxuan.mac.zip";
- $tmpDir = $clientDir . '/tmp/';
- if(!is_dir($tmpDir)) mkdir($tmpDir, 0755, true);
-
+ $needCache = false;
$packageFile = $clientDir . $clientName;
if(!file_exists($packageFile))
{
- $handle = "http://dl.pts.com/xuanxuan/xuanxuan.win64.zip";
+ $url = "http://dl.pts.com/xuanxuan/";
+ $xxFile = $url . $clientName;
+ $needCache = true;
}
else
{
- $handle = $packageFile;
+ $xxFile = $packageFile;
}
- $client = $tmpDir . 'zentaoClient.zip';
-
- $clientHd = fopen($handle, "rb");
- if($clientHd)
+ $clientFile = $tmpDir . 'zentaoClient.zip';
+ if($xxHd = fopen($xxFile, "rb"))
{
- $newf = fopen($client, "wb");
- if($newf)
+ if($clientHd = fopen($clientFile, "wb"))
{
- while(!feof($clientHd))
+ while(!feof($xxHd))
{
- fwrite($newf, fread($clientHd, 1024 * 8 ), 1024 * 8 );
+ $result = fwrite($clientHd, fread($xxHd, 1024 * 8 ), 1024 * 8 );
+ if($result == false)
+ {
+ $response['result'] = 'fail';
+ $response['message'] = sprintf($this->lang->misc->client->errorInfo->manualOpt, $xxFile);
+ $this->send($response);
+ }
}
}
+ else
+ {
+ $response['result'] = 'fail';
+ $response['message'] = sprintf($this->lang->misc->client->errorInfo->manualOpt, $xxFile);
+ $this->send($response);
+ }
+ fclose($xxHd);
+ fclose($clientHd);
+ }
+ else
+ {
+ $response['result'] = 'fail';
+ $response['message'] = sprintf($this->lang->misc->client->errorInfo->manualOpt, $xxFile);
+ $this->send($response);
}
- if ($clientHd) fclose($clientHd);
- if ($newf) fclose($newf);
-
- $response = array();
- $response['result'] = 'success';
+ if($needCache) file_put_contents($packageFile, file_get_contents($clientFile));
$this->send($response);
}
- public function ajaxGetDownProgress($os = '')
+ /**
+ * Ajax set client config to client package.
+ *
+ * @param string $os
+ * @param string $version
+ * @access public
+ * @return void
+ */
+ public function ajaxSetClientConfig($os = '', $version = '')
{
+ $response['result'] = 'success';
+
+ $account = $this->app->user->account;
+ $clientDir = $this->app->getBasePath() . 'tmp/cache/client/' . "$account/";
+ if(!is_dir($clientDir)) mkdir($clientDir, 0755, true);
+
+ /* write login info into config file. */
+ $defaultUser = new stdclass();
+ $defaultUser->server = common::getSysURL();
+ $defaultUser->account = $this->app->user->account;
+
+ $loginInfo = new stdclass();
+ $loginInfo->ui = $defaultUser;
+ $loginInfo = json_encode($loginInfo);
+
+ $loginFile = $clientDir . 'config.json';
+ file_put_contents($loginFile, $loginInfo);
+
+ define('PCLZIP_TEMPORARY_DIR', $clientDir);
+ $this->app->loadClass('pclzip', true);
+ $clientFile = $clientDir . 'zentaoClient.zip';
+ $archive = new pclzip($clientFile);
+
+ if($os == 'mac')
+ {
+ $result = $archive->add($loginFile, PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_OPT_ADD_PATH, 'xuanxuan.app/Contents/Resouces');
+ }
+ else
+ {
+ $result = $archive->add($loginFile, PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_OPT_ADD_PATH, 'resources/build-in');
+ }
+
+ if($result == 0)
+ {
+ $response['result'] = 'fail';
+ $response['message'] = $archive->errorInfo(true);
+ $this->send($response);
+ }
+
+ $this->send($response);
+ }
+
+ /**
+ * Ajax get client package size.
+ *
+ * @access public
+ * @return void
+ */
+ public function ajaxGetPackageSize()
+ {
+ $account = $this->app->user->account;
+ $packageFile = $this->app->getBasePath() . 'tmp/cache/client/' . $account . '/zentaoClient.zip';
+
+ $size = 0;
+ if(file_exists($packageFile))
+ {
+ $size = filesize($packageFile);
+ $size = $size ? round($size / 1048576, 2) : 0;
+ }
+
$response = array();
- $response['result'] = 'unfinished';
+ $response['result'] = 'success';
+ $response['size'] = $size;
$this->send($response);
}
diff --git a/module/misc/lang/en.php b/module/misc/lang/en.php
index 8b8b5fa375..ad5e460340 100644
--- a/module/misc/lang/en.php
+++ b/module/misc/lang/en.php
@@ -16,7 +16,12 @@ $lang->misc->api = 'https://api.zentao.net';
$lang->misc->enApi = 'http://api.zentao.pm';
$lang->misc->client = new stdclass();
-$lang->misc->client->download = 'Download';
+$lang->misc->client->version = 'Select Version';
+$lang->misc->client->os = 'Select OS';
+$lang->misc->client->download = 'Download';
+$lang->misc->client->downloading = 'Downloading:';
+$lang->misc->client->downloaded = 'Downloaded successful!';
+$lang->misc->client->setConfig = 'Set config successful!';
$lang->misc->client->osList['windows64'] = 'Windows 64';
$lang->misc->client->osList['windows32'] = 'Windows 32';
@@ -24,6 +29,15 @@ $lang->misc->client->osList['linux64'] = 'Linux 64';
$lang->misc->client->osList['linux32'] = 'Linux 32';
$lang->misc->client->osList['mac'] = 'Mac';
+$lang->misc->client->versionList['2.1.1'] = '2.1.1';
+
+$lang->misc->client->errorInfo = new stdclass();
+$lang->misc->client->errorInfo->downloadError = 'Failed to download package!';
+$lang->misc->client->errorInfo->configError = 'Failed to set config info!';
+$lang->misc->client->errorInfo->manualOpt = 'Please get client package from %s .';
+$lang->misc->client->errorInfo->dirNotExist = 'The dir %s is not exist, please make it.';
+$lang->misc->client->errorInfo->dirNotWritable = 'The dir %s is not writable.
Please exec:sudo chmod 777 %s under linux os.';
+
$lang->misc->zentao = new stdclass();
$lang->misc->zentao->version = 'Version %s';
$lang->misc->zentao->labels['about'] = 'About';
diff --git a/module/misc/lang/zh-cn.php b/module/misc/lang/zh-cn.php
index 24eb26bd7c..f7adfb4b09 100644
--- a/module/misc/lang/zh-cn.php
+++ b/module/misc/lang/zh-cn.php
@@ -16,7 +16,12 @@ $lang->misc->api = 'https://api.zentao.net';
$lang->misc->enApi = 'http://api.zentao.pm';
$lang->misc->client = new stdclass();
-$lang->misc->client->download = '下载';
+$lang->misc->client->version = '选择版本';
+$lang->misc->client->os = '操作系统';
+$lang->misc->client->download = '下载';
+$lang->misc->client->downloading = '正在获取安装包:';
+$lang->misc->client->downloaded = '成功获取安装包';
+$lang->misc->client->setConfig = '成功设置配置信息';
$lang->misc->client->osList['windows64'] = 'Windows 64位';
$lang->misc->client->osList['windows32'] = 'Windows 32位';
@@ -24,6 +29,15 @@ $lang->misc->client->osList['linux64'] = 'Linux 64位';
$lang->misc->client->osList['linux32'] = 'Linux 32位';
$lang->misc->client->osList['mac'] = 'Mac版';
+$lang->misc->client->versionList['2.1.1'] = '2.1.1';
+
+$lang->misc->client->errorInfo = new stdclass();
+$lang->misc->client->errorInfo->downloadError = '获取安装包失败';
+$lang->misc->client->errorInfo->configError = '配置用户信息失败';
+$lang->misc->client->errorInfo->manualOpt = '请从 %s 手动获取安装包。';
+$lang->misc->client->errorInfo->dirNotExist = '客户端下载存储路径 %s 不存在,请创建该目录。';
+$lang->misc->client->errorInfo->dirNotWritable = '客户端下载存储路径 %s 不可写
linux下面请执行命令:sudo chmod 777 %s来修正';
+
$lang->misc->zentao = new stdclass();
$lang->misc->zentao->version = '版本%s';
$lang->misc->zentao->labels['about'] = '关于禅道';
diff --git a/module/misc/view/downloadclient.html.php b/module/misc/view/downloadclient.html.php
index 8f0dda4e65..2f5c5517ab 100644
--- a/module/misc/view/downloadclient.html.php
+++ b/module/misc/view/downloadclient.html.php
@@ -1,68 +1,111 @@
-
-
-
downloadClient;?>
+
+
+
+
+
+
createLink('misc', 'downloadClient', "action=check"), $lang->refresh, '', "class='btn btn-primary btn-wide'");?>
-
-
-
+
+
+
+
+
-
+
+
+ - misc->client->downloading;?>0M
+ - misc->client->downloaded;?>
+ - misc->client->setConfig;?>
+ - misc->client->errorInfo->configError;?>
+ - misc->client->errorInfo->downloadError;?>
+
+
+
createLink('misc', 'downloadClient', "action=clearTmpPackage"), $lang->confirm, '', "class='btn btn-primary btn-wide'");?>