* Fallback version of the xuanxuan folder.

This commit is contained in:
hufangzhou
2021-12-06 20:09:06 +08:00
parent 3d1d34e383
commit 88eac3a1da
20 changed files with 27 additions and 123 deletions
+1 -1
View File
@@ -653,7 +653,7 @@ CREATE TABLE IF NOT EXISTS `zt_kanbanlane` (
`name` varchar(255) NOT NULL DEFAULT '',
`color` char(30) NOT NULL,
`order` smallint(6) NOT NULL DEFAULT '0',
`lastEditedDate` datetime NOT NULL,
`lastEditedTime` datetime NOT NULL,
`deleted` enum('0','1') NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
View File
View File
@@ -8,6 +8,11 @@ $lang->resource->setting->xuanxuan = 'xuanxuan';
$lang->setting->methodOrder[26] = 'xuanxuan';
$lang->resource->im = new stdclass();
$lang->resource->im->getChatUsers = 'getChatUsers';
$lang->resource->im->getChatGroups = 'getChatGroups';
$lang->resource->im->notifyMSG = 'notifyMSG';
$lang->resource->im->sendNotification = 'sendNotification';
$lang->resource->im->sendChatMessage = 'sendChatMessage';
$lang->resource->im->downloadXxdPackage = 'downloadXXD';
$lang->resource->client = new stdclass();
@@ -8,6 +8,11 @@ $lang->resource->setting->xuanxuan = 'xuanxuan';
$lang->setting->methodOrder[26] = 'xuanxuan';
$lang->resource->im = new stdclass();
$lang->resource->im->getChatUsers = 'getChatUsers';
$lang->resource->im->getChatGroups = 'getChatGroups';
$lang->resource->im->notifyMSG = 'notifyMSG';
$lang->resource->im->sendNotification = 'sendNotification';
$lang->resource->im->sendChatMessage = 'sendChatMessage';
$lang->resource->im->downloadXxdPackage = 'downloadXXD';
$lang->resource->client = new stdclass();
@@ -14,4 +14,3 @@ $config->im->cards['task']['view'] = array('width' => '700px', 'height' => '
$config->im->cards['doc']['view'] = array('width' => '700px', 'height' => '500px');
$config->im->cards['story']['view'] = array('width' => '700px', 'height' => '500px');
$config->im->cards['testcase']['view'] = array('width' => '700px', 'height' => '500px');
$config->im->cards['productplan']['view'] = array('width' => '700px', 'height' => '447px');
@@ -7,6 +7,11 @@ $lang->im->xxdServer = 'ZenTao Server';
$lang->im->downloadXXD = 'Download XXD';
$lang->im->zentaoIntegrate = 'ZenTao Integrated';
$lang->im->zentaoClient = 'ZenTao Desktop is added!';
$lang->im->getChatUsers = 'Get Chat Users';
$lang->im->getChatGroups = 'Get Chat Groups';
$lang->im->notifyMSG = 'Notification';
$lang->im->sendNotification = 'Push message to notification Center';
$lang->im->sendChatMessage = 'Push messages to the discussion group';
$lang->im->createBug = 'Create Bug';
$lang->im->createDoc = 'Create Doc';
@@ -7,6 +7,11 @@ $lang->im->xxdServer = '禅道服务器';
$lang->im->downloadXXD = '下载喧喧服务端';
$lang->im->zentaoIntegrate = '禅道集成';
$lang->im->zentaoClient = '新增禅道客户端!';
$lang->im->getChatUsers = '获取用户';
$lang->im->getChatGroups = '获取讨论组';
$lang->im->notifyMSG = '消息通知';
$lang->im->sendNotification = '向通知中心推送通知消息';
$lang->im->sendChatMessage = '向指定的讨论组推送通知消息';
$lang->im->createBug = '创建 Bug';
$lang->im->createDoc = '创建文档';
View File
@@ -1,39 +0,0 @@
<?php
include '../../control.php';
class myIndex extends index
{
/**
* The index page of whole zentao system.
*
* @param string $open
* @access public
* @return void
*/
public function index($open = '')
{
if(strpos($_SERVER['HTTP_USER_AGENT'], 'xuanxuan') != false)
{
$this->view->pageBodyClass = 'xxc-embed';
}
else
{
$this->loadModel('im');
$xuanConfig = new stdclass();
$token = $this->im->userGetAuthToken($this->app->user->id, 'zentaoweb');
$clientUrl = isset($this->config->webClientUrl) ? $this->config->webClientUrl : 'data/xuanxuan/web/';
$xuanConfig->clientUrl = $clientUrl;
$xuanConfig->server = $this->im->getServer('zentao');
$xuanConfig->account = $this->app->user->account;
$xuanConfig->authKey = $token->token;
$xuanConfig->debug = $this->config->debug;
$xuanConfig->serverTime = (int)(microtime(true) * 1000);
$xuanConfig->serverNowTime = (int)round(time() / $tokenAuthWindow);
$this->view->xuanConfig = $xuanConfig;
}
return parent::index($open);
}
}
@@ -1,73 +0,0 @@
<?php if(strpos($_SERVER['HTTP_USER_AGENT'], 'xuanxuan') != false): ?>
<style>
#menu {display: none!important;}
#appsBar,
#apps {left: 0!important;}
</style>
<script>
$('html').addClass('xxc-embed');
/** Update zentao client app menu */
function updateAppMenu()
{
const menuItems = appsMenuItems.map(function(item)
{
if (item === 'divider') return '-';
var $title = $('<div>' + item.title + '</div>');
return [item.code, ($title.find('.icon').attr('class') || '').replace('icon ', ''),$title.text().trim()];
});
window.open('xxc://extension.zentao-integrated.updateAppMenu/' + encodeURIComponent(JSON.stringify(menuItems)));
}
updateAppMenu();
$(function()
{
$(document).on('showapp', function(e, app)
{
window.open('xxc://extension.zentao-integrated.activeAppMenuItem/' + app.code);
});
});
</script>
<?php endif; ?>
<?php if(isset($xuanConfig)): ?>
<style>
#chatBtn {padding: 3px; position: relative;}
#chatBtn .icon {font-size: 24px;}
#chatNoticeBadge {position: absolute; top: -4px; right: -2px; line-height: 14px; height: 14px; width: 14px; text-align: center; display: block; font-size: 12px; border-radius: 50%; opacity: 0; transform: scale(0); transition: .2s; transition-property: transform, opacity;}
#chatNoticeBadge.show {opacity: 1; transform: scale(1);}
#xx-embed-container {bottom: 40px!important; z-index: 1010!important;}
#xx-embed-container .xx-embed-has-animation {transition-property: transform, opacity!important;}
#xx-embed-container .xx-embed {width: 280px; height: 100%;}
#xx-embed-container .xx-embed.xx-embed-collapsed {width: 280px!important; height: 100%!important; opacity: 0; pointer-events: none; transform: translateY(100%);}
</style>
<?php js::import($webRoot . 'data/xuanxuan/sdk/sdk.min.js'); ?>
<?php js::import($jsRoot . 'md5.js'); ?>
<?php js::set('xuanConfig', $xuanConfig); ?>
<script>
function showXuanClient()
{
if(!window.xuan.shown) window.xuan.show();
else window.xuan.toggleCollapse();
}
function handleXuanNoticeChange(notice)
{
$('#chatNoticeBadge').toggleClass('show', !!notice.count).text(notice.count);
}
Xuanxuan.setGlobalOptions(
{
position: 'right',
width: 280,
preload: true,
showHeader: false,
onNotice: handleXuanNoticeChange
});
var $chatBtn = $('<a href="javascript:void(0)" id="chatBtn" class="btn btn-link"><i class="text-primary icon icon-chat"></i><span class="badge bg-red" id="chatNoticeBadge"></span></a>');
$chatBtn.insertBefore('#globalSearchDiv').on('click', showXuanClient);
window.xuan = new Xuanxuan(xuanConfig);
</script>
<?php endif; ?>
@@ -1,6 +1,7 @@
<?php
$config->message->available['xuanxuan']['story'] = $config->message->objectTypes['story'];
$config->message->available['xuanxuan']['task'] = $config->message->objectTypes['task'];
$config->message->available['xuanxuan']['bug'] = $config->message->objectTypes['bug'];
$config->message->available['xuanxuan']['todo'] = $config->message->objectTypes['todo'];
$config->message->setting['xuanxuan']['setting'] = $config->message->available['xuanxuan'];
$config->message->available['xuanxuan']['story'] = $config->message->objectTypes['story'];
$config->message->available['xuanxuan']['task'] = $config->message->objectTypes['task'];
$config->message->available['xuanxuan']['bug'] = $config->message->objectTypes['bug'];
$config->message->available['xuanxuan']['todo'] = $config->message->objectTypes['todo'];
$config->message->available['xuanxuan']['release'] = $config->message->objectTypes['release'];
$config->message->setting['xuanxuan']['setting'] = $config->message->available['xuanxuan'];
View File
View File
View File
View File
File diff suppressed because one or more lines are too long
Binary file not shown.