diff --git a/framework/base/router.class.php b/framework/base/router.class.php index 6298796383..611531ac57 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -825,7 +825,7 @@ class baseRouter session_start(); $this->sessionID = session_id(); - if(isset($_GET[$this->config->sessionVar]) and $this->sessionID != $_GET[$this->config->sessionVar]) helper::restartSession($_GET[$this->config->sessionVar]); + if(isset($_GET[$this->config->sessionVar])) helper::restartSession($_GET[$this->config->sessionVar]); define('SESSION_STARTED', true); } diff --git a/module/common/lang/en.php b/module/common/lang/en.php index 7340e83d7c..8070e348ba 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -270,38 +270,38 @@ $lang->qa->menu = new stdclass(); $lang->qa->menu->bug = array('link' => 'Bug|bug|browse|productID=%s'); $lang->qa->menu->testcase = array('link' => 'Case|testcase|browse|productID=%s'); -$lang->qa->menu->testtask = array('link' => 'Test Task|testtask|browse|productID=%s'); +$lang->qa->menu->testtask = array('link' => 'Test|testtask|browse|productID=%s'); $lang->qa->menu->testsuite = array('link' => 'Suite|testsuite|browse|productID=%s'); $lang->qa->menu->report = array('link' => 'Report|testreport|browse|productID=%s'); -$lang->qa->menu->caselib = array('link' => 'Library|testsuite|library'); +$lang->qa->menu->caselib = array('link' => 'Case Library|testsuite|library'); $lang->bug = new stdclass(); $lang->bug->menu = new stdclass(); $lang->bug->menu->bug = array('link' => 'Bug|bug|browse|productID=%s', 'alias' => 'view,create,batchcreate,edit,resolve,close,activate,report,batchedit,batchactivate,confirmbug,assignto', 'subModule' => 'tree'); $lang->bug->menu->testcase = array('link' => 'Case|testcase|browse|productID=%s'); -$lang->bug->menu->testtask = array('link' => 'Test Task|testtask|browse|productID=%s'); +$lang->bug->menu->testtask = array('link' => 'Test|testtask|browse|productID=%s'); $lang->bug->menu->testsuite = array('link' => 'Suite|testsuite|browse|productID=%s'); $lang->bug->menu->report = array('link' => 'Report|testreport|browse|productID=%s'); -$lang->bug->menu->caselib = array('link' => 'Library|testsuite|library'); +$lang->bug->menu->caselib = array('link' => 'Case Library|testsuite|library'); $lang->testcase = new stdclass(); $lang->testcase->menu = new stdclass(); $lang->testcase->menu->bug = array('link' => 'Bug|bug|browse|productID=%s'); $lang->testcase->menu->testcase = array('link' => 'Case|testcase|browse|productID=%s', 'alias' => 'view,create,batchcreate,edit,batchedit,showimport,groupcase,importfromlib', 'subModule' => 'tree'); -$lang->testcase->menu->testtask = array('link' => 'Test Task|testtask|browse|productID=%s'); +$lang->testcase->menu->testtask = array('link' => 'Test|testtask|browse|productID=%s'); $lang->testcase->menu->testsuite = array('link' => 'Suite|testsuite|browse|productID=%s'); $lang->testcase->menu->report = array('link' => 'Report|testreport|browse|productID=%s'); -$lang->testcase->menu->caselib = array('link' => 'Library|testsuite|library'); +$lang->testcase->menu->caselib = array('link' => 'Case Library|testsuite|library'); $lang->testtask = new stdclass(); $lang->testtask->menu = new stdclass(); $lang->testtask->menu->bug = array('link' => 'Bug|bug|browse|productID=%s'); $lang->testtask->menu->testcase = array('link' => 'Case|testcase|browse|productID=%s'); -$lang->testtask->menu->testtask = array('link' => 'Test Task|testtask|browse|productID=%s', 'alias' => 'view,create,edit,linkcase,cases,start,close,batchrun,groupcase,report'); +$lang->testtask->menu->testtask = array('link' => 'Test|testtask|browse|productID=%s', 'alias' => 'view,create,edit,linkcase,cases,start,close,batchrun,groupcase,report'); $lang->testtask->menu->testsuite = array('link' => 'Suite|testsuite|browse|productID=%s'); $lang->testtask->menu->report = array('link' => 'Report|testreport|browse|productID=%s'); -$lang->testtask->menu->caselib = array('link' => 'Library|testsuite|library'); +$lang->testtask->menu->caselib = array('link' => 'Case Library|testsuite|library'); $lang->testsuite = new stdclass(); $lang->testsuite->menu = new stdclass(); @@ -310,13 +310,13 @@ $lang->testsuite->menu->testcase = array('link' => 'Case|testcase|browse|produc $lang->testsuite->menu->testtask = array('link' => 'Test Task|testtask|browse|productID=%s'); $lang->testsuite->menu->testsuite = array('link' => 'Suite|testsuite|browse|productID=%s', 'alias' => 'view,create,edit,linkcase'); $lang->testsuite->menu->report = array('link' => 'Report|testreport|browse|productID=%s'); -$lang->testsuite->menu->caselib = array('link' => 'Library|testsuite|library'); +$lang->testsuite->menu->caselib = array('link' => 'Case Library|testsuite|library'); $lang->testreport = new stdclass(); $lang->testreport->menu = new stdclass(); $lang->testreport->menu->bug = array('link' => 'Bug|bug|browse|productID=%s'); $lang->testreport->menu->testcase = array('link' => 'Case|testcase|browse|productID=%s'); -$lang->testreport->menu->testtask = array('link' => 'Test Task|testtask|browse|productID=%s'); +$lang->testreport->menu->testtask = array('link' => 'Test|testtask|browse|productID=%s'); $lang->testreport->menu->testsuite = array('link' => 'Suite|testsuite|browse|productID=%s'); $lang->testreport->menu->report = array('link' => 'Report|testreport|browse|productID=%s', 'alias' => 'view,create,edit'); $lang->testreport->menu->caselib = array('link' => 'Library|testsuite|library'); @@ -325,10 +325,10 @@ $lang->caselib = new stdclass(); $lang->caselib->menu = new stdclass(); $lang->caselib->menu->bug = array('link' => 'Bug|bug|browse|'); $lang->caselib->menu->testcase = array('link' => 'Case|testcase|browse|'); -$lang->caselib->menu->testtask = array('link' => 'Test Task|testtask|browse|'); +$lang->caselib->menu->testtask = array('link' => 'Test|testtask|browse|'); $lang->caselib->menu->testsuite = array('link' => 'Suite|testsuite|browse|'); $lang->caselib->menu->report = array('link' => 'Report|testreport|browse|'); -$lang->caselib->menu->caselib = array('link' => 'Library|testsuite|library', 'alias' => 'createlib,createcase,libview,edit,batchcreatecase,showimport', 'subModule' => 'tree,testcase'); +$lang->caselib->menu->caselib = array('link' => 'Case Library|testsuite|library', 'alias' => 'createlib,createcase,libview,edit,batchcreatecase,showimport', 'subModule' => 'tree,testcase'); /* Doc menu settings. */ $lang->doc = new stdclass(); @@ -397,7 +397,7 @@ $lang->admin->subMenu->data->backup = array('link' => 'Backup|backup|index', 'su $lang->admin->subMenu->data->trash = 'Recycle|action|trash'; $lang->admin->subMenu->system = new stdclass(); -$lang->admin->subMenu->system->cron = array('link' => 'Timed task|cron|index', 'subModule' => 'cron'); +$lang->admin->subMenu->system->cron = array('link' => 'Cron|cron|index', 'subModule' => 'cron'); $lang->convert = new stdclass(); $lang->upgrade = new stdclass(); diff --git a/module/common/view/footer.html.php b/module/common/view/footer.html.php index 410772b229..d26562a5fc 100755 --- a/module/common/view/footer.html.php +++ b/module/common/view/footer.html.php @@ -13,7 +13,7 @@ designedByAIUX;?>   zentaoPMS . $config->version;?>   proVersion;?> - + xxserver->installed) and $config->xuanxuan->turnon) commonModel::printClientLink();?> diff --git a/module/misc/control.php b/module/misc/control.php index 987b76783c..62c608b968 100644 --- a/module/misc/control.php +++ b/module/misc/control.php @@ -131,9 +131,9 @@ class misc extends control if($action == 'selectPackage') { - $os = 'windows64'; + $os = 'win64'; $agentOS = helper::getOS(); - if(strpos($agentOS, 'Windows') !== false) $os = 'windows64'; + if(strpos($agentOS, 'Windows') !== false) $os = 'win64'; if(strpos($agentOS, 'Linux') !== false) $os = 'linux64'; if(strpos($agentOS, 'Mac') !== false) $os = 'mac'; @@ -199,23 +199,21 @@ class misc extends control $clientDir = $this->app->getBasePath() . 'tmp/cache/client/'; if(!is_dir($clientDir)) mkdir($clientDir, 0755, true); + $version = $this->config->xuanxuan->version; + $packageDir = $clientDir . "/$version/"; + if(!is_dir($packageDir)) mkdir($packageDir, 0755, true); + $account = $this->app->user->account; $tmpDir = $clientDir . "/$account/"; if(!is_dir($tmpDir)) mkdir($tmpDir, 0755, true); - if($os == 'windows64') $clientName = "zentaoclient.win64.zip"; - if($os == 'windows32') $clientName = "zentaoclient.win32.zip"; - if($os == 'linux64') $clientName = "zentaoclient.linux.x64.zip"; - if($os == 'linux32') $clientName = "zentaoclient.linux.ia32.zip"; - if($os == 'mac') $clientName = "zentaoclient.mac.zip"; - $needCache = false; - $version = $this->config->xuanxuan->version; - $packageFile = $clientDir . $clientName; + $clientName = "zentaoclient." . $os . ".zip"; + $packageFile = $packageDir . $clientName; if(!file_exists($packageFile)) { $url = "http://dl.cnezsoft.com/zentaoclient/$version/"; - $xxFile = $url . $clientName; + $xxFile = $url . $clientName . "?t=" . rand(); $needCache = true; } else @@ -276,12 +274,11 @@ class misc extends control 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->ui = new stdclass(); + $loginInfo->ui->defaultUser = new stdclass(); + $loginInfo->ui->defaultUser->server = common::getSysURL();; + $loginInfo->ui->defaultUser->account = $this->app->user->account; $loginInfo = json_encode($loginInfo); $loginFile = $clientDir . 'config.json'; @@ -294,11 +291,11 @@ class misc extends control if($os == 'mac') { - $result = $archive->add($loginFile, PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_OPT_ADD_PATH, 'xuanxuan.app/Contents/Resouces'); + $result = $archive->add($loginFile, PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_OPT_ADD_PATH, 'zentaoclient/xuanxuan.app/Contents/Resouces'); } else { - $result = $archive->add($loginFile, PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_OPT_ADD_PATH, 'resources/build-in'); + $result = $archive->add($loginFile, PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_OPT_ADD_PATH, 'zentaoclient/resources/build-in'); } if($result == 0) diff --git a/module/misc/lang/en.php b/module/misc/lang/en.php index 3124219929..db68829d98 100644 --- a/module/misc/lang/en.php +++ b/module/misc/lang/en.php @@ -24,13 +24,11 @@ $lang->misc->client->downloaded = 'Downloaded successful!'; $lang->misc->client->setting = 'Setting config info.'; $lang->misc->client->setted = 'Set config info successful!'; -$lang->misc->client->osList['windows64'] = 'Windows 64'; -$lang->misc->client->osList['windows32'] = 'Windows 32'; -$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->osList['win64'] = 'Windows 64'; +$lang->misc->client->osList['win32'] = 'Windows 32'; +$lang->misc->client->osList['linux64'] = 'Linux 64'; +$lang->misc->client->osList['linux32'] = 'Linux 32'; +$lang->misc->client->osList['mac'] = 'Mac'; $lang->misc->client->errorInfo = new stdclass(); $lang->misc->client->errorInfo->downloadError = 'Failed to download package!'; diff --git a/module/misc/lang/zh-cn.php b/module/misc/lang/zh-cn.php index 14100a02ec..a504bc9599 100644 --- a/module/misc/lang/zh-cn.php +++ b/module/misc/lang/zh-cn.php @@ -24,13 +24,11 @@ $lang->misc->client->downloaded = '成功获取安装包'; $lang->misc->client->setting = '正在设置配置信息'; $lang->misc->client->setted = '成功设置配置信息'; -$lang->misc->client->osList['windows64'] = 'Windows 64位'; -$lang->misc->client->osList['windows32'] = 'Windows 32位'; -$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->osList['win64'] = 'Windows 64位'; +$lang->misc->client->osList['win32'] = 'Windows 32位'; +$lang->misc->client->osList['linux64'] = 'Linux 64位'; +$lang->misc->client->osList['linux32'] = 'Linux 32位'; +$lang->misc->client->osList['mac'] = 'Mac版'; $lang->misc->client->errorInfo = new stdclass(); $lang->misc->client->errorInfo->downloadError = '获取安装包失败'; diff --git a/module/task/lang/en.php b/module/task/lang/en.php index f8a12037ee..8092c0df0c 100644 --- a/module/task/lang/en.php +++ b/module/task/lang/en.php @@ -120,7 +120,7 @@ $lang->task->noAssigned = 'Unassigned'; $lang->task->noFinished = 'Unfinished'; $lang->task->noClosed = 'Unclosed'; $lang->task->yesterdayFinished = 'Finished Yesterday'; -$lang->task->allTasks = 'All Tasks'; +$lang->task->allTasks = 'Task'; $lang->task->statusList[''] = ''; $lang->task->statusList['wait'] = 'Wait'; diff --git a/module/tutorial/lang/en.php b/module/tutorial/lang/en.php index 6ed32c64ef..3806ad875d 100644 --- a/module/tutorial/lang/en.php +++ b/module/tutorial/lang/en.php @@ -29,8 +29,8 @@ $lang->tutorial->requiredTip = '【%s】is required.'; $lang->tutorial->congratulateTask = 'Congratulations! You have finished【】!'; $lang->tutorial->serverErrorTip = 'Error!'; $lang->tutorial->ajaxSetError = 'Finished task must be defined. If you want to reset the Task, please set its value as null.'; -$lang->tutorial->novice = "For a quick start, let's go through a smart (2 min) Tutorial?"; -$lang->tutorial->dataNotSave = "Data generated in the Tutorial will not be saved!"; +$lang->tutorial->novice = "For a quick start, let's go through a two-minute Tutorial."; +$lang->tutorial->dataNotSave = "Data generated in this Tutorial will not be saved!"; $lang->tutorial->tasks = array(); diff --git a/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php b/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php index 1422d76ecb..6e4cdee8fd 100644 --- a/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php +++ b/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php @@ -66,12 +66,21 @@ class xuanxuanChat extends chatModel $entries = array(); $baseURL = commonModel::getSysURL(); + $this->loadModel('user'); + $user = $this->dao->select('*')->from(TABLE_USER)->where('id')->eq($userID)->fetch(); + $user->admin = strpos($this->app->company->admins, ",{$user->account},") !== false; + $user->rights = $this->user->authorize($user->account); + $user->groups = $this->user->getGroups($user->account); + + $this->session->set('user', $user); + $this->app->user = $this->session->user; + $actions = new stdclass(); - $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"); - $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"); - $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"); - $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"); - $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=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"); $urls = array(); foreach($this->config->chat->cards as $moduleName => $methods) @@ -103,6 +112,7 @@ class xuanxuanChat extends chatModel $data->data['entryUrl'] = trim($baseURL . $this->config->webRoot, '/'); $entries[] = $data; + unset($_SESSION['user']); return $entries; } } diff --git a/xuanxuan/module/entry/ext/control/visit.php b/xuanxuan/module/entry/ext/control/visit.php index 457d124e38..16be2d2127 100644 --- a/xuanxuan/module/entry/ext/control/visit.php +++ b/xuanxuan/module/entry/ext/control/visit.php @@ -14,7 +14,7 @@ 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('index', 'index', '', 'xhtml')); + if(empty($referer)) $referer = common::getSysURL() . 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/control/notify.php b/xuanxuan/module/message/ext/control/notify.php index ed56d88dcc..43b104d522 100644 --- a/xuanxuan/module/message/ext/control/notify.php +++ b/xuanxuan/module/message/ext/control/notify.php @@ -8,17 +8,30 @@ class myMessage extends message $response['result'] = true; $response['message'] = ''; - $userList = empty($this->post->userList) ? '' : $this->post->userList; - $title = empty($this->post->title) ? '' : $this->post->title; - $subtitle = empty($this->post->subtitle) ? '' : $this->post->subtitle; - $content = empty($this->post->content) ? '' : $this->post->content; - $contentType = empty($this->post->contentType) ? 'text' : $this->post->contentType; - $url = empty($this->post->url) ? '' : $this->post->url; - $actions = empty($this->post->actions) ? array() : $this->post->actions; - $sender = empty($this->post->sender) ? 0 : $this->post->sender; + if(empty($_POST['userList'])) + { + $response['result'] = false; + $response['message'] = $this->lang->message->error->noUserList; + die(json_encode($response)); + } + + if(empty($_POST['sender'])) + { + $response['result'] = false; + $response['message'] = $this->lang->message->error->noSender; + die(json_encode($response)); + } + + $userList = empty($_POST['userList']) ? '' : $this->post->userList; + $title = empty($_POST['title']) ? '' : $this->post->title; + $subtitle = empty($_POST['subtitle']) ? '' : $this->post->subtitle; + $content = empty($_POST['content']) ? '' : $this->post->content; + $contentType = empty($_POST['contentType']) ? 'text' : $this->post->contentType; + $url = empty($_POST['url']) ? '' : $this->post->url; + $actions = empty($_POST['actions']) ? array() : $this->post->actions; + $sender = empty($_POST['sender']) ? 0 : $this->post->sender; $result = $this->loadModel('chat')->createNotify($userList, $title, $subtitle, $content, $contentType, $url, $actions, $sender); - if(!$result) { $response['result'] = false; diff --git a/xuanxuan/module/message/ext/lang/en/xuanxuan.php b/xuanxuan/module/message/ext/lang/en/xuanxuan.php index 2cc831d314..5f17d9ff8d 100644 --- a/xuanxuan/module/message/ext/lang/en/xuanxuan.php +++ b/xuanxuan/module/message/ext/lang/en/xuanxuan.php @@ -2,3 +2,7 @@ $lang->message->typeList['xuanxuan'] = 'Xuanxuan'; $lang->message->sender = 'ZentaoPMS'; + +if(!isset($lang->message->error)) $lang->message->error = new stdclass(); +$lang->message->error->noUserList = 'Not set user id list.'; +$lang->message->error->noSender = 'Not set sender information.'; diff --git a/xuanxuan/module/message/ext/lang/zh-cn/xuanxuan.php b/xuanxuan/module/message/ext/lang/zh-cn/xuanxuan.php index abff61c208..4176c92aa4 100644 --- a/xuanxuan/module/message/ext/lang/zh-cn/xuanxuan.php +++ b/xuanxuan/module/message/ext/lang/zh-cn/xuanxuan.php @@ -2,3 +2,7 @@ $lang->message->typeList['xuanxuan'] = '喧喧'; $lang->message->sender = '禅道项目管理'; + +if(!isset($lang->message->error)) $lang->message->error = new stdclass(); +$lang->message->error->noUserList = '没有设置消息发送用户列表'; +$lang->message->error->noSender = '没有设置发送方信息';