From cada6c243b72b67a2e9f7dbeb99c0f4384f8c728 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 11 Jan 2019 15:57:01 +0800 Subject: [PATCH 1/7] * adjust for showDeleted custom. --- module/custom/control.php | 2 +- module/project/model.php | 1 + module/task/model.php | 2 +- module/user/model.php | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/module/custom/control.php b/module/custom/control.php index 059ef2d5ec..2d494bf029 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -75,7 +75,7 @@ class custom extends control } if($module == 'user' and $field == 'deleted') { - $this->loadModel('user'); + $this->app->loadConfig('user'); $this->view->showDeleted = isset($this->config->user->showDeleted) ? $this->config->user->showDeleted : '0'; } diff --git a/module/project/model.php b/module/project/model.php index c541d70df7..67c0b7a743 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1686,6 +1686,7 @@ class projectModel extends model public function getTeamMemberPairs($projectID, $params = '') { if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getTeamMembersPairs(); + $this->app->loadConfig('user'); $users = $this->dao->select('t1.account, t2.realname')->from(TABLE_TEAM)->alias('t1') ->leftJoin(TABLE_USER)->alias('t2')->on('t1.account = t2.account') ->where('t1.root')->eq((int)$projectID) diff --git a/module/task/model.php b/module/task/model.php index ab18f58b34..a94af1c135 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1428,7 +1428,7 @@ class taskModel extends model if($task->parent > 0) $task->parentName = $this->dao->findById($task->parent)->from(TABLE_TASK)->fetch('name'); $task->team = $this->dao->select('*')->from(TABLE_TEAM)->where('root')->eq($taskID)->andWhere('type')->eq('task')->orderBy('order')->fetchAll('account'); - foreach($children as $child) $child->team = isset($teams[$child->id]) ? $teams[$child->id] : array(); + foreach($children as $child) $child->team = array(); $task = $this->loadModel('file')->replaceImgURL($task, 'desc'); if($setImgSize) $task->desc = $this->file->setImgSize($task->desc); diff --git a/module/user/model.php b/module/user/model.php index 26ebdc716e..458b8aedd2 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -87,6 +87,7 @@ class userModel extends model $orderBy = strpos($params, 'first') !== false ? 'roleOrder DESC, account' : 'account'; /* Get raw records. */ + $this->app->loadConfig('user'); $users = $this->dao->select($fields)->from(TABLE_USER) ->where('1') ->beginIF(strpos($params, 'nodeleted') !== false or empty($this->config->user->showDeleted))->andWhere('deleted')->eq('0')->fi() From ee4766e6990ec491e7ef1a6658a4dda5ef2059a5 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 15 Jan 2019 10:03:38 +0800 Subject: [PATCH 2/7] * Adjust for copy story desc when batch create task. --- module/task/js/batchcreate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/task/js/batchcreate.js b/module/task/js/batchcreate.js index 906da94e8a..4111017729 100755 --- a/module/task/js/batchcreate.js +++ b/module/task/js/batchcreate.js @@ -63,7 +63,7 @@ function copyStoryTitle(num) $('#name\\[' + num + '\\]').val(storyTitle); $('#estimate\\[' + num + '\\]').val($('#storyEstimate' + num).val()); - $('#desc\\[' + num + '\\]').val(($('#storyDesc' + num).val()).replace(/<[^>]+>/g,'')); + $('#desc\\[' + num + '\\]').val(($('#storyDesc' + num).val()).replace(/<[^>]+>/g,'').replace(/(\n)+\n/g, "\n").replace(/^\n/g, '')); var storyPri = $('#storyPri' + num).val(); if(storyPri == 0) $('#pri' + num ).val('3'); From 7418523c136857a2b01857e86903e3af3d8d4170 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 15 Jan 2019 10:20:54 +0800 Subject: [PATCH 3/7] * adjust code. --- module/common/model.php | 2 +- module/tree/model.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/common/model.php b/module/common/model.php index 39d6b1bb35..b93cb7b4ea 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -1491,7 +1491,7 @@ EOD; */ public function checkIP($ipWhiteList = '') { - $ip = $this->server->remote_addr; + $ip = helper::getRemoteIp(); if(!$ipWhiteList) $ipWhiteList = $this->config->ipWhiteList; diff --git a/module/tree/model.php b/module/tree/model.php index b382ea1169..a78b4652ce 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -34,7 +34,7 @@ class treeModel extends model * @access public * @return void */ - public function buildMenuQuery($rootID, $type, $startModule, $branch = 0) + public function buildMenuQuery($rootID, $type, $startModule = 0, $branch = 0) { /* Set the start module. */ $startModulePath = ''; From 29659ce40f364ff94c00aa4c5ac851df44b497bd Mon Sep 17 00:00:00 2001 From: Yagami Date: Tue, 15 Jan 2019 14:24:48 +0800 Subject: [PATCH 4/7] * Delete chat/downloadxxd.php. --- .../module/chat/ext/control/downloadxxd.php | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 xuanxuan/module/chat/ext/control/downloadxxd.php diff --git a/xuanxuan/module/chat/ext/control/downloadxxd.php b/xuanxuan/module/chat/ext/control/downloadxxd.php deleted file mode 100644 index e984cc0cfa..0000000000 --- a/xuanxuan/module/chat/ext/control/downloadxxd.php +++ /dev/null @@ -1,17 +0,0 @@ -get(); - $result = $this->loadModel('setting')->setItems('system.common.xxd', $setting); - $this->chat->downloadXXD($setting); - } - - if(!isset($this->config->xxd)) $this->config->xxd = new stdclass(); - $this->view->title = $this->lang->chat->downloadXXD; - $this->display(); - } -} From 4b33485a7fed7013f01807e450942ba0993f4ad2 Mon Sep 17 00:00:00 2001 From: Yagami Date: Wed, 16 Jan 2019 15:05:00 +0800 Subject: [PATCH 5/7] * Change xuanxuan lang file. --- xuanxuan/module/chat/ext/lang/en/xuanxuan.php | 10 +++++----- xuanxuan/module/chat/ext/lang/zh-cn/xuanxuan.php | 7 +++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/xuanxuan/module/chat/ext/lang/en/xuanxuan.php b/xuanxuan/module/chat/ext/lang/en/xuanxuan.php index 1e56490a24..c115071f16 100644 --- a/xuanxuan/module/chat/ext/lang/en/xuanxuan.php +++ b/xuanxuan/module/chat/ext/lang/en/xuanxuan.php @@ -1,7 +1,7 @@ chat->common = 'Xuanxuan'; $lang->chat->turnon = 'On'; -$lang->chat->downloadXXD = 'Download XXD'; +$lang->chat->help = 'Help'; $lang->chat->settings = 'Settings'; $lang->chat->turnonList = array(); @@ -10,7 +10,7 @@ $lang->chat->turnonList[0] = 'Off'; $lang->chat->status = 'Status'; $lang->chat->xxdServer = 'Zentao Server'; -$lang->chat->downloadXXD = 'Download XXD'; +$lang->chat->downloadXXD = 'Download Xuanxuan Server'; $lang->chat->listenIP = 'Listen IP'; $lang->chat->chatPort = 'Chat Port'; $lang->chat->uploadFileSize = 'File Size'; @@ -31,9 +31,9 @@ $lang->chat->statusList[0] = 'Disable'; $lang->chat->httpsOptions[1] = 'Enable'; $lang->chat->httpsOptions[0] = 'Disable'; -$lang->chat->xxdServerTip = 'XXD server address contains protocol and host and port,such as http://192.168.1.35 or http://pms.zentao.com. that can not be 127.0.0.1.'; -$lang->chat->xxdServerEmpty = 'XXD server address is empty.'; -$lang->chat->xxdServerError = 'XXD server address can not be 127.0.0.1.'; +$lang->chat->xxdServerTip = 'Zentao server address contains protocol and host and port,such as http://192.168.1.35 or http://pms.zentao.com. that can not be 127.0.0.1.'; +$lang->chat->xxdServerEmpty = 'Zentao server address is empty.'; +$lang->chat->xxdServerError = 'Zentao server address can not be 127.0.0.1.'; $lang->chat->xxdSchemeError = 'Server address should started with http:// or https://.'; $lang->chat->xxdPortError = 'Server address should contain valid port and the default is 11443.'; $lang->chat->xxClientConfirm = 'Click to download new zentao client!'; diff --git a/xuanxuan/module/chat/ext/lang/zh-cn/xuanxuan.php b/xuanxuan/module/chat/ext/lang/zh-cn/xuanxuan.php index f41c3c890a..a7f2ade892 100644 --- a/xuanxuan/module/chat/ext/lang/zh-cn/xuanxuan.php +++ b/xuanxuan/module/chat/ext/lang/zh-cn/xuanxuan.php @@ -1,7 +1,6 @@ chat->common = '客户端'; $lang->chat->turnon = '是否打开'; -$lang->chat->downloadXXD = '下载XXD服务端'; $lang->chat->help = '使用说明'; $lang->chat->settings = '服务器设置'; @@ -29,9 +28,9 @@ $lang->chat->createTodo = '创建待办'; $lang->chat->statusList[1] = '启用'; $lang->chat->statusList[0] = '不启用'; -$lang->chat->xxdServerTip = 'XXD服务器地址为完整的协议+地址+端口,示例:http://192.168.1.35 或 http://pms.zentao.com ,不能使用127.0.0.1。'; -$lang->chat->xxdServerEmpty = 'XXD服务器地址为空。'; -$lang->chat->xxdServerError = 'XXD服务器地址不能为 127.0.0.1。'; +$lang->chat->xxdServerTip = '禅道服务器地址为完整的协议+地址+端口,示例:http://192.168.1.35 或 http://pms.zentao.com ,不能使用127.0.0.1。'; +$lang->chat->xxdServerEmpty = '禅道服务器地址为空。'; +$lang->chat->xxdServerError = '禅道服务器地址不能为 127.0.0.1。'; $lang->chat->xxdSchemeError = '服务器地址应该以http://或https://开头。'; $lang->chat->xxdPortError = '服务器地址应该包含有效的端口号,默认为11443。'; $lang->chat->zentaoClient = '新增禅道客户端!'; From cd3422f865a83dac858cf9556829e26a9acaf6ea Mon Sep 17 00:00:00 2001 From: chenfeiCF Date: Wed, 16 Jan 2019 16:50:41 +0800 Subject: [PATCH 6/7] * Modified Makefile. --- Makefile | 105 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 56 insertions(+), 49 deletions(-) diff --git a/Makefile b/Makefile index a2fe4b3397..fbd5159d48 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ clean: rm -fr api* rm -fr build/linux/lampp rm -fr lampp -pms: +common: mkdir zentaopms cp -fr bin zentaopms/ cp -fr config zentaopms/ && rm -fr zentaopms/config/my.php @@ -39,44 +39,43 @@ pms: find zentaopms -name tests |xargs rm -fr # notify.zip. mkdir zentaopms/www/data/notify/ +zentaoxx: #xuanxuan - mkdir -p buildxx/config/ext - mkdir -p buildxx/lib - mkdir -p buildxx/module - mkdir -p buildxx/framework - mkdir -p buildxx/db - mkdir -p buildxx/www - mkdir -p buildxx/module/common/ext/model/ + mkdir -p zentaoxx/config/ext + mkdir -p zentaoxx/lib + mkdir -p zentaoxx/module + mkdir -p zentaoxx/framework + mkdir -p zentaoxx/db + mkdir -p zentaoxx/www + mkdir -p zentaoxx/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/*.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/config/* buildxx/config/ - cp -r xuanxuan/module/* buildxx/module/ - cp -r xuanxuan/www/* buildxx/www/ - sed -i 's/site,//' buildxx/module/chat/model.php - sed -i 's/admin, g/g/' buildxx/module/chat/model.php - sed -i '/password = md5/d' buildxx/module/chat/control.php - sed -i '/getSignedTime/d' buildxx/module/chat/control.php - sed -i 's/tree/dept/' buildxx/module/chat/control.php - sed -i "s/, 'sys'//" buildxx/module/chat/control.php - sed -i 's/system.sys/system/' buildxx/module/chat/control.php - sed -i 's/&app=sys//' buildxx/module/chat/control.php - sed -i 's/file->createdBy/file->addedBy/' buildxx/module/chat/control.php - sed -i 's/file->createdDate/file->addedDate/' buildxx/module/chat/control.php - sed -i 's/im_/zt_im_/' buildxx/db/*.sql - sed -i 's/sys_user/zt_user/' buildxx/db/*.sql - sed -i 's/sys_file/zt_file/' buildxx/db/*.sql - sed -i '/sys_entry/d' buildxx/db/*.sql - zip -rqm -9 xuanxuan.zentao.$(VERSION).zip buildxx/* - rm -rf buildxx/ - unzip xuanxuan.zentao.*.zip -d zentaoxx - cp zentaoxx/buildxx/* zentaopms/ -r - cat zentaoxx/buildxx/db/xuanxuan.sql >> zentaopms/db/zentao.sql + cp ranzhi/config/ext/xuanxuan.php zentaoxx/config/ext/ + cp -r ranzhi/lib/phpaes zentaoxx/lib/ + cp -r ranzhi/framework/xuanxuan.class.php zentaoxx/framework/ + cp -r ranzhi/db/*.sql zentaoxx/db/ + cp -r ranzhi/app/sys/chat zentaoxx/module/ + cp -r ranzhi/app/sys/common/ext/model/hook zentaoxx/module/common/ext/model/ + cp -r ranzhi/app/sys/action zentaoxx/module/ + cp -r xuanxuan/config/* zentaoxx/config/ + cp -r xuanxuan/module/* zentaoxx/module/ + cp -r xuanxuan/www/* zentaoxx/www/ + sed -i 's/site,//' zentaoxx/module/chat/model.php + sed -i 's/admin, g/g/' zentaoxx/module/chat/model.php + sed -i '/password = md5/d' zentaoxx/module/chat/control.php + sed -i '/getSignedTime/d' zentaoxx/module/chat/control.php + sed -i 's/tree/dept/' zentaoxx/module/chat/control.php + sed -i "s/, 'sys'//" zentaoxx/module/chat/control.php + sed -i 's/system.sys/system/' zentaoxx/module/chat/control.php + sed -i 's/&app=sys//' zentaoxx/module/chat/control.php + sed -i 's/file->createdBy/file->addedBy/' zentaoxx/module/chat/control.php + sed -i 's/file->createdDate/file->addedDate/' zentaoxx/module/chat/control.php + sed -i 's/im_/zt_im_/' zentaoxx/db/*.sql + sed -i 's/sys_user/zt_user/' zentaoxx/db/*.sql + sed -i 's/sys_file/zt_file/' zentaoxx/db/*.sql + sed -i '/sys_entry/d' zentaoxx/db/*.sql + zip -rqm -9 zentaoxx.$(VERSION).zip zentaoxx/* + rm -rf ranzhi zentaoxx +package: # change mode. chmod -R 777 zentaopms/tmp/ chmod -R 777 zentaopms/www/data @@ -88,8 +87,27 @@ pms: for module in `ls zentaopms/module/`; do if [ ! -d "zentaopms/module/$$module/ext" ]; then mkdir zentaopms/module/$$module/ext; fi done find zentaopms/ -name ext |xargs chmod -R 777 tools/cn2tw.php +pms: + make common + make zentaoxx + unzip zentaoxx.*.zip + cp zentaoxx/* zentaopms/ -r + cat zentaoxx/db/xuanxuan.sql >> zentaopms/db/zentao.sql + make package zip -rq -9 ZenTaoPMS.$(VERSION).zip zentaopms - rm -fr zentaopms ranzhi buildxx zentaoxx xuanxuan.zentao.*.zip + rm -fr zentaopms zentaoxx zentaoxx.*.zip +en: + make common + cd zentaopms/; grep -rl 'zentao.net'|xargs sed -i 's/zentao.net/zentao.pm/g'; + cd zentaopms/; grep -rl 'http://www.zentao.pm'|xargs sed -i 's/http:\/\/www.zentao.pm/https:\/\/www.zentao.pm/g'; + cd zentaopms/config/; echo >> config.php; echo '$$config->isINT = true;' >> config.php + make package + zip -r -9 ZenTaoPMS.$(VERSION).int.zip zentaopms + rm -fr zentaopms + echo $(VERSION).int > VERSION + make deb + make rpm + echo $(VERSION) > VERSION deb: mkdir buildroot cp -r build/debian/DEBIAN buildroot @@ -117,17 +135,6 @@ rpm: rpmbuild -ba ~/rpmbuild/SPECS/zentaopms.spec cp ~/rpmbuild/RPMS/noarch/zentaopms-${VERSION}-1.noarch.rpm ./ rm -rf ~/rpmbuild -en: - unzip ZenTaoPMS.${VERSION}.zip - cd zentaopms/; grep -rl 'zentao.net'|xargs sed -i 's/zentao.net/zentao.pm/g'; - cd zentaopms/; grep -rl 'http://www.zentao.pm'|xargs sed -i 's/http:\/\/www.zentao.pm/https:\/\/www.zentao.pm/g'; - cd zentaopms/config/; echo >> config.php; echo '$$config->isINT = true;' >> config.php - zip -r -9 ZenTaoPMS.$(VERSION).int.zip zentaopms - rm -fr zentaopms - echo $(VERSION).int > VERSION - make deb - make rpm - echo $(VERSION) > VERSION patchphpdoc: sudo cp misc/doc/phpdoc/*.tpl /usr/share/php/data/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/phphtmllib/templates/ phpdoc: From 2b2fb9840f3e66750825cdeb172523a0d8c7e7cb Mon Sep 17 00:00:00 2001 From: Yagami Date: Wed, 16 Jan 2019 16:52:18 +0800 Subject: [PATCH 7/7] * Fix chat lang. --- xuanxuan/module/chat/ext/lang/en/xuanxuan.php | 40 +++++++++++++------ 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/xuanxuan/module/chat/ext/lang/en/xuanxuan.php b/xuanxuan/module/chat/ext/lang/en/xuanxuan.php index c115071f16..e4675a6808 100644 --- a/xuanxuan/module/chat/ext/lang/en/xuanxuan.php +++ b/xuanxuan/module/chat/ext/lang/en/xuanxuan.php @@ -1,7 +1,8 @@ chat->common = 'Xuanxuan'; $lang->chat->turnon = 'On'; -$lang->chat->help = 'Help'; +$lang->chat->downloadXXD = 'Download XXD'; +$lang->chat->help = 'Help'; $lang->chat->settings = 'Settings'; $lang->chat->turnonList = array(); @@ -10,7 +11,7 @@ $lang->chat->turnonList[0] = 'Off'; $lang->chat->status = 'Status'; $lang->chat->xxdServer = 'Zentao Server'; -$lang->chat->downloadXXD = 'Download Xuanxuan Server'; +$lang->chat->downloadXXD = 'Download XXD'; $lang->chat->listenIP = 'Listen IP'; $lang->chat->chatPort = 'Chat Port'; $lang->chat->uploadFileSize = 'File Size'; @@ -28,14 +29,12 @@ $lang->chat->createTodo = 'Create Todo'; $lang->chat->statusList[1] = 'Enable'; $lang->chat->statusList[0] = 'Disable'; -$lang->chat->httpsOptions[1] = 'Enable'; -$lang->chat->httpsOptions[0] = 'Disable'; - -$lang->chat->xxdServerTip = 'Zentao server address contains protocol and host and port,such as http://192.168.1.35 or http://pms.zentao.com. that can not be 127.0.0.1.'; -$lang->chat->xxdServerEmpty = 'Zentao server address is empty.'; -$lang->chat->xxdServerError = 'Zentao server address can not be 127.0.0.1.'; +$lang->chat->xxdServerTip = 'XXD server address contains protocol and host and port,such as http://192.168.1.35 or http://pms.zentao.com. that can not be 127.0.0.1.'; +$lang->chat->xxdServerEmpty = 'XXD server address is empty.'; +$lang->chat->xxdServerError = 'XXD server address can not be 127.0.0.1.'; $lang->chat->xxdSchemeError = 'Server address should started with http:// or https://.'; $lang->chat->xxdPortError = 'Server address should contain valid port and the default is 11443.'; +$lang->chat->zentaoClient = 'ZenTao Client is added!'; $lang->chat->xxClientConfirm = 'Click to download new zentao client!'; $lang->chat->xxServerConfirm = 'Click to download new zentao client server!'; $lang->chat->info = "ZenTao client is powered by Xuan, a secure and open source Instant Messenger by Nature Easy Soft. It is a self-hosted and cross-platform tool with numerous plug-ins and robust features. In Xuan, you can code your own plug-ins. Click HERE for more."; @@ -47,12 +46,27 @@ $lang->chat->xxd->chatPort = 'Chat Port'; $lang->chat->xxd->commonPort = 'Common Port'; $lang->chat->xxd->isHttps = 'Ishttps'; $lang->chat->xxd->uploadFileSize = 'File Size'; +$lang->chat->xxd->maxOnlineUser = 'Max. Online'; $lang->chat->xxd->sslcrt = 'SSL Crt'; $lang->chat->xxd->sslkey = 'SSL Key'; -$lang->chat->xxd->max = 'Max'; +$lang->chat->xxd->max = 'Max.'; -$lang->chat->osList['win_i386'] = 'Windows 32位'; -$lang->chat->osList['win_x86_64'] = 'Windows 64位'; -$lang->chat->osList['linux_i386'] = 'Linux 32位'; -$lang->chat->osList['linux_x86_64'] = 'Linux 64位'; +$lang->chat->httpsOptions[1] = 'On'; +$lang->chat->httpsOptions[0] = 'Off'; + +$lang->chat->placeholder = new stdclass(); +$lang->chat->placeholder->xxd = new stdclass(); +$lang->chat->placeholder->xxd->ip = 'Listen the IP of the server. Enter 0.0.0.0 if it is not set.'; +$lang->chat->placeholder->xxd->chatPort = 'Port for communications with the client.'; +$lang->chat->placeholder->xxd->commonPort = 'Common port for client user login authentication and file upload/download.'; +$lang->chat->placeholder->xxd->isHttps = 'Use HTTPS'; +$lang->chat->placeholder->xxd->uploadFileSize = 'File size for the uploaded.'; +$lang->chat->placeholder->xxd->maxOnlineUser = 'Maximum number of users online.'; +$lang->chat->placeholder->xxd->sslcrt = 'Copy and paste certificate here.'; +$lang->chat->placeholder->xxd->sslkey = 'Copy and paste key here.'; + +$lang->chat->osList['win_i386'] = 'Windows 32-bit'; +$lang->chat->osList['win_x86_64'] = 'Windows 64-bit'; +$lang->chat->osList['linux_i386'] = 'Linux 32-bit'; +$lang->chat->osList['linux_x86_64'] = 'Linux 64-bit'; $lang->chat->osList['darwin_x86_64'] = 'macOS';