From 46cfd4c19a95a11f08e11718d0ce969a937c35e9 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 25 Dec 2018 14:14:08 +0800 Subject: [PATCH 1/7] * adjust for xuanxuan server. --- .../module/admin/ext/control/downloadxxd.php | 11 +++++++++-- .../module/admin/ext/control/xuanxuan.php | 19 ++++++++++--------- .../module/admin/ext/view/xuanxuan.html.php | 14 ++++++++------ xuanxuan/module/chat/ext/lang/en/xuanxuan.php | 3 ++- .../module/chat/ext/lang/zh-cn/xuanxuan.php | 3 ++- .../chat/ext/model/class/xuanxuan.class.php | 8 ++++++-- xuanxuan/module/common/ext/model/xuanxuan.php | 6 ------ 7 files changed, 37 insertions(+), 27 deletions(-) delete mode 100644 xuanxuan/module/common/ext/model/xuanxuan.php diff --git a/xuanxuan/module/admin/ext/control/downloadxxd.php b/xuanxuan/module/admin/ext/control/downloadxxd.php index e2f82c9cb2..95739bf8d1 100644 --- a/xuanxuan/module/admin/ext/control/downloadxxd.php +++ b/xuanxuan/module/admin/ext/control/downloadxxd.php @@ -5,9 +5,16 @@ class admin extends control { if(in_array($type, array('config', 'package'))) { - $setting = $this->config->xuanxuan; + $this->loadModel('mail'); + $this->loadModel('chat'); + $domain = empty($this->config->mail->domain) ? commonModel::getSysURL() : $this->config->mail->domain; + if(!empty($this->config->xuanxuan->server)) $domain = $this->config->xuanxuan->server; + if(strpos($domain, '127.0.0.1') !== false) die(js::alert($this->lang->chat->xxdServerError)); + if(empty($domain)) die(js::alert($this->lang->chat->xxdServerEmpty)); + + $setting = $this->config->xuanxuan; $setting->os = $os; - $this->loadModel('chat')->downloadXXD($setting, $type); + $this->chat->downloadXXD($setting, $type); } die("Params error."); } diff --git a/xuanxuan/module/admin/ext/control/xuanxuan.php b/xuanxuan/module/admin/ext/control/xuanxuan.php index 08a64fd3e2..e7d4f7c05f 100644 --- a/xuanxuan/module/admin/ext/control/xuanxuan.php +++ b/xuanxuan/module/admin/ext/control/xuanxuan.php @@ -23,10 +23,15 @@ class admin extends control if(empty($setting->sslkey)) $errors['sslkey'] = $this->lang->chat->errorSSLKey; } + if(strpos($setting->server, '127.0.0.1') !== false) $errors[] = $this->lang->chat->xxdServerError; + if(strpos($setting->server, 'https://') !== 0 and strpos($setting->server, 'http://') !== 0) $errors[] = $this->lang->chat->xxdSchemeError; + if(empty($setting->server)) $errors[] = $this->lang->chat->xxdServerEmpty; + if($errors) $this->send(array('result' => 'fail', 'message' => $errors)); - $setting->server = ($setting->isHttps ? 'https' : 'http') . '://' . $setting->domain . ':' . $setting->commonPort; - $result = $this->loadModel('setting')->setItems('system.common.xuanxuan', $setting, 'all'); + + $result = $this->loadModel('setting')->setItems('system.common.xuanxuan', $setting); + $this->setting->setItem('system.mail.domain', $setting->server); if(!$result) $this->send(array('result' => 'fail', 'message' => dao::getError())); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('xuanxuan'))); } @@ -34,13 +39,9 @@ class admin extends control $os = 'win'; if(strpos(strtolower(PHP_OS), 'win') !== 0) $os = strtolower(PHP_OS); - $domain = $this->server->http_host; - if(!empty($this->config->xuanxuan->server)) - { - preg_match('/^(https?:\/\/)?([^\:]+)/i', $this->config->xuanxuan->server, $match); - $domain = $match[2]; - } - + $this->loadModel('mail'); + $domain = empty($this->config->mail->domain) ? commonModel::getSysURL() : $this->config->mail->domain; + if(!empty($this->config->xuanxuan->server)) $domain = $this->config->xuanxuan->server; $this->view->title = $this->lang->chat->common; $this->view->adminList = $this->loadModel('user')->getPairs('admin'); diff --git a/xuanxuan/module/admin/ext/view/xuanxuan.html.php b/xuanxuan/module/admin/ext/view/xuanxuan.html.php index 0ea81fbd52..cb5974b3cb 100644 --- a/xuanxuan/module/admin/ext/view/xuanxuan.html.php +++ b/xuanxuan/module/admin/ext/view/xuanxuan.html.php @@ -21,11 +21,12 @@

chat->settings;?>

-
+ - + + @@ -37,7 +38,8 @@ - + + @@ -58,7 +60,7 @@
chat->turnon;?>chat->turnonList, $turnon) : zget($lang->chat->turnonList, $config->xuanxuan->turnon);?>chat->turnonList, $turnon) : zget($lang->chat->turnonList, $config->xuanxuan->turnon);?>
chat->version;?>
chat->xxdServer;?>chat->xxdServerTip;?>
chat->xxd->ip;?>chat->xxd->uploadFileSize;?> -
+
chat->xxd->max;?> xuanxuan, 'uploadFileSize', 20), "class='form-control' placeholder='{$lang->chat->placeholder->xxd->uploadFileSize}' ");?> M @@ -109,8 +111,8 @@ goback, '', 'class="btn" style="min-width: 120px"');?> - chat->downloadXXD, '', "class='btn btn-primary download download-package' target='_blank'");?> - chat->downloadConfig, '', "class='btn btn-primary download'");?> + chat->downloadXXD, 'hiddenwin', "class='btn btn-primary download download-package'");?> + chat->downloadConfig, 'hiddenwin', "class='btn btn-primary download'");?> chat->changeSetting, '', "class='btn'");?> chat->help, '_blank', "class='btn'");?> diff --git a/xuanxuan/module/chat/ext/lang/en/xuanxuan.php b/xuanxuan/module/chat/ext/lang/en/xuanxuan.php index 3b6d432358..d0683f2afe 100644 --- a/xuanxuan/module/chat/ext/lang/en/xuanxuan.php +++ b/xuanxuan/module/chat/ext/lang/en/xuanxuan.php @@ -31,8 +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 https://127.0.0.1:11443'; +$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->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 ca7edea3ff..6217092182 100644 --- a/xuanxuan/module/chat/ext/lang/zh-cn/xuanxuan.php +++ b/xuanxuan/module/chat/ext/lang/zh-cn/xuanxuan.php @@ -29,8 +29,9 @@ $lang->chat->createTodo = '创建待办'; $lang->chat->statusList[1] = '启用'; $lang->chat->statusList[0] = '不启用'; -$lang->chat->xxdServerTip = 'XXD服务器地址为完整的协议+地址+端口,示例:https://127.0.0.1:11443。'; +$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->xxdSchemeError = '服务器地址应该以http://或https://开头。'; $lang->chat->xxdPortError = '服务器地址应该包含有效的端口号,默认为11443。'; $lang->chat->zentaoClient = '新增禅道客户端!'; diff --git a/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php b/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php index ae424d6541..b738e78501 100644 --- a/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php +++ b/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php @@ -4,7 +4,6 @@ class xuanxuanChat extends chatModel public function downloadXXD($setting, $type) { $data = new stdClass(); - $data->server = $setting->server; $data->uploadFileSize = $setting->uploadFileSize; $data->isHttps = $setting->isHttps; $data->sslcrt = $setting->sslcrt; @@ -13,12 +12,17 @@ class xuanxuanChat extends chatModel $data->chatPort = $setting->chatPort; $data->commonPort = $setting->commonPort; $data->maxOnlineUser = isset($setting->maxOnlineUser) ? $setting->maxOnlineUser : 0; - $data->host = commonModel::getSysURL() . getWebRoot(); $data->key = $this->config->xuanxuan->key; $data->os = $setting->os; $data->version = $this->config->xuanxuan->version; $data->downloadType = $type; + $this->loadModel('mail'); + $domain = empty($this->config->mail->domain) ? commonModel::getSysURL() : $this->config->mail->domain; + if(!empty($this->config->xuanxuan->server)) $domain = $this->config->xuanxuan->server; + $data->server = $domain; + $data->host = trim($domain, '/') . getWebRoot(); + $url = "https://www.chanzhi.org/license-downloadxxd-zentao.html"; $result = common::http($url, $data); diff --git a/xuanxuan/module/common/ext/model/xuanxuan.php b/xuanxuan/module/common/ext/model/xuanxuan.php deleted file mode 100644 index 0807095a41..0000000000 --- a/xuanxuan/module/common/ext/model/xuanxuan.php +++ /dev/null @@ -1,6 +0,0 @@ -config->system->xuanxuan)) $this->app->mergeConfig($this->config->system->xuanxuan, 'xuanxuan'); -} From b17a9b526232ee7ff4e7484a6690e27a17eeaeaf Mon Sep 17 00:00:00 2001 From: Yagami Date: Tue, 25 Dec 2018 17:15:30 +0800 Subject: [PATCH 2/7] * Fix xuanxuan priv. --- .../chat/ext/model/class/xuanxuan.class.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php b/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php index ae424d6541..facd3b6d91 100644 --- a/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php +++ b/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php @@ -71,16 +71,24 @@ class xuanxuanChat extends chatModel $user->admin = strpos($this->app->company->admins, ",{$user->account},") !== false; $user->rights = $this->user->authorize($user->account); $user->groups = $this->user->getGroups($user->account); + $user->view = $this->user->grantUserView($user->account, $user->rights['acls']); $this->session->set('user', $user); $this->app->user = $this->session->user; + $products = explode(',', $this->app->user->view->products); + $projects = explode(',', $this->app->user->view->projects); + $libids = array_keys($this->loadModel('doc')->getLibs('all')); + $productID = isset($products[0]) ? $products[0] : 1; + $projectID = isset($projects[0]) ? $projects[0] : 1; + $libID = isset($libids[0]) ? $libids[0] : 1; + $actions = new stdclass(); - if(common::hasPriv('bug', 'create')) $actions->createBug = array('title' => $this->lang->chat->createBug, 'url' => $baseURL . str_replace('/xuanxuan.php', '/index.php', helper::createLink('bug', 'create', 'product=1', 'xhtml')), 'height' => "600px", 'width' => "800px"); - if(common::hasPriv('doc', 'create')) $actions->createDoc = array('title' => $this->lang->chat->createDoc, 'url' => $baseURL . str_replace('/xuanxuan.php', '/index.php', helper::createLink('doc', 'create', 'lib=1', 'xhtml')), 'height' => "600px", 'width' => "800px"); - if(common::hasPriv('story', 'create')) $actions->createStory = array('title' => $this->lang->chat->createStory, 'url' => $baseURL . str_replace('/xuanxuan.php', '/index.php', helper::createLink('story', 'create', 'product=1', 'xhtml')), 'height' => "600px", 'width' => "800px"); - if(common::hasPriv('task', 'create')) $actions->createTask = array('title' => $this->lang->chat->createTask, 'url' => $baseURL . str_replace('/xuanxuan.php', '/index.php', helper::createLink('task', 'create', 'project=1', 'xhtml')), 'height' => "600px", 'width' => "800px"); - if(common::hasPriv('todo', 'create')) $actions->createTodo = array('title' => $this->lang->chat->createTodo, 'url' => $baseURL . str_replace('/xuanxuan.php', '/index.php', helper::createLink('todo', 'create', '', 'xhtml')), 'height' => "600px", 'width' => "800px"); + if(common::hasPriv('bug', 'create')) $actions->createBug = array('title' => $this->lang->chat->createBug, 'url' => $baseURL . str_replace('/xuanxuan.php', '/index.php', helper::createLink('bug', 'create', "product=$productID", 'xhtml')), 'height' => "600px", 'width' => "800px"); + if(common::hasPriv('doc', 'create')) $actions->createDoc = array('title' => $this->lang->chat->createDoc, 'url' => $baseURL . str_replace('/xuanxuan.php', '/index.php', helper::createLink('doc', 'create', "libID=$libID", 'xhtml')), 'height' => "600px", 'width' => "800px"); + if(common::hasPriv('story', 'create')) $actions->createStory = array('title' => $this->lang->chat->createStory, 'url' => $baseURL . str_replace('/xuanxuan.php', '/index.php', helper::createLink('story', 'create', "product=$productID", 'xhtml')), 'height' => "600px", 'width' => "800px"); + if(common::hasPriv('task', 'create')) $actions->createTask = array('title' => $this->lang->chat->createTask, 'url' => $baseURL . str_replace('/xuanxuan.php', '/index.php', helper::createLink('task', 'create', "project=$projectID", 'xhtml')), 'height' => "600px", 'width' => "800px"); + if(common::hasPriv('todo', 'create')) $actions->createTodo = array('title' => $this->lang->chat->createTodo, 'url' => $baseURL . str_replace('/xuanxuan.php', '/index.php', helper::createLink('todo', 'create', '', 'xhtml')), 'height' => "600px", 'width' => "800px"); $urls = array(); foreach($this->config->chat->cards as $moduleName => $methods) From a7996d0b51571119fd98fe5f7018f41fc2821f01 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 25 Dec 2018 17:40:42 +0800 Subject: [PATCH 3/7] * adjust for xx server. --- .../module/admin/ext/control/downloadxxd.php | 7 ++----- .../module/admin/ext/control/xuanxuan.php | 6 +----- .../chat/ext/model/class/xuanxuan.class.php | 19 +++++++++++++------ xuanxuan/module/chat/ext/model/xuanxuan.php | 5 +++++ xuanxuan/module/entry/ext/control/visit.php | 3 ++- .../ext/model/class/xuanxuan.class.php | 3 ++- 6 files changed, 25 insertions(+), 18 deletions(-) diff --git a/xuanxuan/module/admin/ext/control/downloadxxd.php b/xuanxuan/module/admin/ext/control/downloadxxd.php index 95739bf8d1..4a7ee6c908 100644 --- a/xuanxuan/module/admin/ext/control/downloadxxd.php +++ b/xuanxuan/module/admin/ext/control/downloadxxd.php @@ -5,12 +5,9 @@ class admin extends control { if(in_array($type, array('config', 'package'))) { - $this->loadModel('mail'); $this->loadModel('chat'); - $domain = empty($this->config->mail->domain) ? commonModel::getSysURL() : $this->config->mail->domain; - if(!empty($this->config->xuanxuan->server)) $domain = $this->config->xuanxuan->server; - if(strpos($domain, '127.0.0.1') !== false) die(js::alert($this->lang->chat->xxdServerError)); - if(empty($domain)) die(js::alert($this->lang->chat->xxdServerEmpty)); + $server = $this->chat->getServer(); + if(strpos($server, '127.0.0.1') !== false) die(js::alert($this->lang->chat->xxdServerError)); $setting = $this->config->xuanxuan; $setting->os = $os; diff --git a/xuanxuan/module/admin/ext/control/xuanxuan.php b/xuanxuan/module/admin/ext/control/xuanxuan.php index e7d4f7c05f..fade5a15ff 100644 --- a/xuanxuan/module/admin/ext/control/xuanxuan.php +++ b/xuanxuan/module/admin/ext/control/xuanxuan.php @@ -39,15 +39,11 @@ class admin extends control $os = 'win'; if(strpos(strtolower(PHP_OS), 'win') !== 0) $os = strtolower(PHP_OS); - $this->loadModel('mail'); - $domain = empty($this->config->mail->domain) ? commonModel::getSysURL() : $this->config->mail->domain; - if(!empty($this->config->xuanxuan->server)) $domain = $this->config->xuanxuan->server; - $this->view->title = $this->lang->chat->common; $this->view->adminList = $this->loadModel('user')->getPairs('admin'); $this->view->os = $os . '_' . php_uname('m'); $this->view->type = $type; - $this->view->domain = $domain; + $this->view->domain = $this->loadModel('chat')->getServer(); $this->view->turnon = isset($this->config->xuanxuan->turnon) ? $this->config->xuanxuan->turnon : 1; $this->view->isHttps = $this->config->xuanxuan->isHttps ? $this->config->xuanxuan->isHttps : 0; $this->display(); diff --git a/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php b/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php index b738e78501..721d2fdc45 100644 --- a/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php +++ b/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php @@ -17,11 +17,9 @@ class xuanxuanChat extends chatModel $data->version = $this->config->xuanxuan->version; $data->downloadType = $type; - $this->loadModel('mail'); - $domain = empty($this->config->mail->domain) ? commonModel::getSysURL() : $this->config->mail->domain; - if(!empty($this->config->xuanxuan->server)) $domain = $this->config->xuanxuan->server; - $data->server = $domain; - $data->host = trim($domain, '/') . getWebRoot(); + $server = $this->getServer(); + $data->server = $server; + $data->host = trim($server, '/') . getWebRoot(); $url = "https://www.chanzhi.org/license-downloadxxd-zentao.html"; $result = common::http($url, $data); @@ -68,7 +66,7 @@ class xuanxuanChat extends chatModel public function getExtensionList($userID) { $entries = array(); - $baseURL = commonModel::getSysURL(); + $baseURL = $this->getServer(); $this->loadModel('user'); $user = $this->dao->select('*')->from(TABLE_USER)->where('id')->eq($userID)->fetch(); @@ -119,4 +117,13 @@ class xuanxuanChat extends chatModel unset($_SESSION['user']); return $entries; } + + public function getServer() + { + $this->app->loadConfig('mail'); + $server = empty($this->config->mail->domain) ? commonModel::getSysURL() : $this->config->mail->domain; + if(!empty($this->config->xuanxuan->server)) $server = $this->config->xuanxuan->server; + + return $server; + } } diff --git a/xuanxuan/module/chat/ext/model/xuanxuan.php b/xuanxuan/module/chat/ext/model/xuanxuan.php index 65e0404bf7..25a659fbb1 100644 --- a/xuanxuan/module/chat/ext/model/xuanxuan.php +++ b/xuanxuan/module/chat/ext/model/xuanxuan.php @@ -13,3 +13,8 @@ public function sendDownHeader($fileName, $fileType, $content, $fileSize = 0) { return $this->loadExtension('xuanxuan')->sendDownHeader($fileName, $fileType, $content, $fileSize); } + +public function getServer() +{ + return $this->loadExtension('xuanxuan')->getServer(); +} diff --git a/xuanxuan/module/entry/ext/control/visit.php b/xuanxuan/module/entry/ext/control/visit.php index 7b0470bb08..15f93f9145 100644 --- a/xuanxuan/module/entry/ext/control/visit.php +++ b/xuanxuan/module/entry/ext/control/visit.php @@ -14,7 +14,8 @@ class entry extends control if(RUN_MODE != 'xuanxuan') die(); $referer = !empty($_GET['referer']) ? $this->get->referer : $referer; - if(empty($referer)) $referer = common::getSysURL() . str_replace('/xuanxuan.php', '/index.php', $this->createLink('my', 'index', '', 'html')); + $server = $this->loadModel('chat')->getServer(); + if(empty($referer)) $referer = $server . str_replace('/xuanxuan.php', '/index.php', $this->createLink('my', 'index', '', 'html')); $output = new stdclass(); $output->module = $this->moduleName; diff --git a/xuanxuan/module/message/ext/model/class/xuanxuan.class.php b/xuanxuan/module/message/ext/model/class/xuanxuan.class.php index 4804d6e314..acf0b7aeef 100644 --- a/xuanxuan/module/message/ext/model/class/xuanxuan.class.php +++ b/xuanxuan/module/message/ext/model/class/xuanxuan.class.php @@ -16,9 +16,10 @@ class xuanxuanMessage extends messageModel $title = $this->app->user->realname . $this->lang->action->label->$actionType . $this->lang->action->objectTypes[$objectType]; $text = $title . ' ' . "[#{$objectID}::{$object->$field}]"; + $server = $this->loadModel('chat')->getServer(); $onlybody = isset($_GET['onlybody']) ? $_GET['onlybody'] : ''; unset($_GET['onlybody']); - $url = common::getSysURL() . helper::createLink($objectType, 'view', "id=$objectID", 'html'); + $url = $server . helper::createLink($objectType, 'view', "id=$objectID", 'html'); $target = ''; if(!empty($object->assignedTo)) $target .= $object->assignedTo; From 2bd37a479ecf65976fd00bff6e0f740f1b7bd68f Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 26 Dec 2018 09:34:26 +0800 Subject: [PATCH 4/7] * fix bug for tutorial. --- .../ext/model/hook/loadConfigFromDB.xuanxuan.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xuanxuan/module/common/ext/model/hook/loadConfigFromDB.xuanxuan.php b/xuanxuan/module/common/ext/model/hook/loadConfigFromDB.xuanxuan.php index e9af2f6c81..a594607c2a 100644 --- a/xuanxuan/module/common/ext/model/hook/loadConfigFromDB.xuanxuan.php +++ b/xuanxuan/module/common/ext/model/hook/loadConfigFromDB.xuanxuan.php @@ -8,8 +8,8 @@ if(empty($xxConfig['key'])) $this->setting->setItem('system.common.xuanxuan.turnon', 1); $this->setting->setItem('system.common.xuanxuan.key', $this->setting->computeSN()); } -if(empty($xxConfig['chatPort'])) $this->setting->setItem('system.common.xuanxuan.chatPort', 11444); -if(empty($xxConfig['commonPort'])) $this->setting->setItem('system.common.xuanxuan.commonPort', 11443); -if(empty($xxConfig['ip'])) $this->setting->setItem('system.common.xuanxuan.ip', '0.0.0.0'); -if(empty($xxConfig['isHttps'])) $this->setting->setItem('system.common.xuanxuan.isHttps', 0); -if(empty($xxConfig['uploadFileSize'])) $this->setting->setItem('system.common.xuanxuan.uploadFileSize', 20); +if(!isset($xxConfig['chatPort'])) $this->setting->setItem('system.common.xuanxuan.chatPort', 11444); +if(!isset($xxConfig['commonPort'])) $this->setting->setItem('system.common.xuanxuan.commonPort', 11443); +if(!isset($xxConfig['ip'])) $this->setting->setItem('system.common.xuanxuan.ip', '0.0.0.0'); +if(!isset($xxConfig['isHttps'])) $this->setting->setItem('system.common.xuanxuan.isHttps', 0); +if(!isset($xxConfig['uploadFileSize'])) $this->setting->setItem('system.common.xuanxuan.uploadFileSize', 20); From 4554a44aae8fdf5123536c57e05fdd5dd447386b Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 26 Dec 2018 09:47:05 +0800 Subject: [PATCH 5/7] * finish task #5172. --- module/task/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/task/model.php b/module/task/model.php index fe042c3a73..3ee0345755 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -598,7 +598,7 @@ class taskModel extends model ->setIF($this->post->assignedTo != $oldTask->assignedTo, 'assignedDate', $now) - ->setIF($this->post->status == 'wait' and $this->post->left == $oldTask->left and $this->post->consumed == 0, 'left', $this->post->estimate) + ->setIF($this->post->status == 'wait' and $this->post->left == $oldTask->left and $this->post->consumed == 0 and $this->post->estimate, 'left', $this->post->estimate) ->add('lastEditedBy', $this->app->user->account) ->add('lastEditedDate', $now) From da57fc447d805056c240e3b929c6cbb35bd1f3c5 Mon Sep 17 00:00:00 2001 From: Yagami Date: Wed, 26 Dec 2018 10:30:34 +0800 Subject: [PATCH 6/7] * Finish task #5170. --- module/task/model.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/module/task/model.php b/module/task/model.php index fe042c3a73..867739533b 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -29,12 +29,16 @@ class taskModel extends model ->setDefault('project', (int)$projectID) ->setDefault('estimate, left, story', 0) ->setDefault('status', 'wait') + ->setDefault('estimate',(int)$this->post->estimate) ->setIF($this->post->estimate != false, 'left', $this->post->estimate) ->setIF($this->post->story != false, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story)) ->setDefault('estStarted', '0000-00-00') ->setDefault('deadline', '0000-00-00') ->setIF(strpos($this->config->task->create->requiredFields, 'estStarted') !== false, 'estStarted', $this->post->estStarted) ->setIF(strpos($this->config->task->create->requiredFields, 'deadline') !== false, 'deadline', $this->post->deadline) + ->setIF($this->post->estimate !== 0, 'estimate', (int)$this->post->estimate) + ->setIF($this->post->consumed !== 0, 'consumed', (int)$this->post->consumed) + ->setIF($this->post->left !== 0, 'left', (int)$this->post->left) ->setDefault('openedBy', $this->app->user->account) ->setDefault('openedDate', helper::now()) ->stripTags($this->config->task->editor->create['id'], $this->config->allowedTags) @@ -578,6 +582,9 @@ class taskModel extends model ->setDefault('story, estimate, left, consumed', 0) ->setDefault('estStarted', '0000-00-00') ->setDefault('deadline', '0000-00-00') + ->setIF($this->post->estimate !== 0, 'estimate', (int)$this->post->estimate) + ->setIF($this->post->consumed !== 0, 'consumed', (int)$this->post->consumed) + ->setIF($this->post->left !== 0, 'left', (int)$this->post->left) ->setIF($oldTask->parent == 0 && $this->post->parent == '', 'parent', 0) ->setIF(strpos($this->config->task->edit->requiredFields, 'estStarted') !== false, 'estStarted', $this->post->estStarted) ->setIF(strpos($this->config->task->edit->requiredFields, 'deadline') !== false, 'deadline', $this->post->deadline) @@ -1170,6 +1177,7 @@ class taskModel extends model } $task = fixer::input('post') + ->setIF($this->post->consumed !== 0, 'consumed', (int)$this->post->consumed) ->setDefault('left', 0) ->setDefault('assignedTo', $oldTask->openedBy) ->setDefault('assignedDate', $now) @@ -1229,6 +1237,7 @@ class taskModel extends model } if($task->finishedDate == substr($now, 0, 10)) $task->finishedDate = $now; + $task->consumed = (int)$task->consumed; $this->dao->update(TABLE_TASK)->data($task) ->autoCheck() @@ -1349,6 +1358,7 @@ class taskModel extends model $oldTask = $this->getById($taskID); $task = fixer::input('post') + ->setIF($this->post->left !== 0, 'left', (int)$this->post->left) ->setDefault('left', 0) ->setDefault('status', 'doing') ->setDefault('finishedBy, canceledBy, closedBy, closedReason', '') @@ -1359,6 +1369,12 @@ class taskModel extends model ->remove('comment') ->get(); + if(!is_numeric($task->left)) + { + dao::$errors[] = $this->lang->task->error->estimateNumber; + return false; + } + if(!empty($oldTask->team)) { $this->dao->update(TABLE_TEAM)->set('left')->eq($this->post->left) From 0063b4a86d581394dc97f629cc8bef7cdf4ac62a Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 26 Dec 2018 11:07:21 +0800 Subject: [PATCH 7/7] * update zentao-integrated. --- .../www/data/xuanxuan/zentao-integrated.zip | Bin 98170 -> 98181 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/xuanxuan/www/data/xuanxuan/zentao-integrated.zip b/xuanxuan/www/data/xuanxuan/zentao-integrated.zip index ccc89ce0c3bcde1159b4f04373cfa27d20fc1820..b2fd5461ed958044874cb61c4cc856670c411702 100644 GIT binary patch delta 3629 zcmX|^byyQz*v2;zrfhV_q#J2QcgKiPQ%8)H21icVXaPZl0eh7aq#PlsNC*<1?6oX!dz{s9e2F|7Gy zD32x<3l-#ZZ+oUA4Xmv0a46+A`f^*jPp)5N2%;k1zpAd^HBwR=@a|#x3HKyrgwV_8 zn3?E{JXJLL%qZX~R){Y%D#$91$jWF?`Sg&nlN)w0-Exd_qpI($R*P;wPL2PUp{s{u zNJ#h#>)tlM8g{l&J67k3>8#m+7*&9l?)TUb-3Ytu?){fE}(NZv#eJ_mo zKLIvm{((2T+h;lb=`llZ@*BqRwLaBky=lcLg|Yd`>@|#BvHOk*`4Ye7cz3AqE@aT(l6GwTR9qmh6VW|^~|Pi6ZrdwFYEh`JCE*qhSk+H?qg%q z$*0KezV_rQ>}T5Nh^yN7y{rb8_6V`G?lvy&32+O)MY(?>POs43$CBf+-`;X{;fsoh z#=;t|KTq`b5K+f-v{>ajimN)X+1ox)@qQW zIcyyNJx|Y_O64dlQB{|O4%uW&?0xA#r{6Z)`Vesk4HB5MR-xk@T`9Tw>O!~G#PYeq zvZ$oVu-`WmASE)^1*;$3?ZgmmUOYIFS6_8bp*F?tDHJP$&|Jz}xPW2QKhjI3p5<%w zHuhT9+zOFi&D-Gy9h_-OK|Gq{qt-jg3BhD`ctscgGm$X!?PC`sc^p)e5-iNkdHeWZ zGK<3HTmHCWW{D6b>mmvvXLq{%M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