This commit is contained in:
Yagami
2018-12-20 16:49:41 +08:00
13 changed files with 89 additions and 65 deletions
+1 -1
View File
@@ -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);
}
+13 -13
View File
@@ -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();
+1 -1
View File
@@ -13,7 +13,7 @@
<small class='muted'><?php echo $lang->designedByAIUX;?></small> &nbsp;
<a href='<?php echo $lang->website;?>' target='_blank'><i class='icon-zentao'></i> <?php echo $lang->zentaoPMS . $config->version;?></a> &nbsp;
<?php echo $lang->proVersion;?>
<?php commonModel::printClientLink();?>
<?php if(isset($config->xxserver->installed) and $config->xuanxuan->turnon) commonModel::printClientLink();?>
</div>
</div>
</footer>
+15 -18
View File
@@ -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)
+5 -7
View File
@@ -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!';
+5 -7
View File
@@ -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 = '获取安装包失败';
+1 -1
View File
@@ -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';
+2 -2
View File
@@ -29,8 +29,8 @@ $lang->tutorial->requiredTip = '【%s】is required.';
$lang->tutorial->congratulateTask = 'Congratulations! You have finished【<span class="task-name-current"></span>】!';
$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();
@@ -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;
}
}
+1 -1
View File
@@ -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;
+22 -9
View File
@@ -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;
@@ -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.';
@@ -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 = '没有设置发送方信息';