* Add zentao extension for xuanxuan and modified Makefile.

This commit is contained in:
chenfeiCF
2018-12-05 10:43:17 +08:00
parent a05b7d4d4e
commit efdce81b19
20 changed files with 296 additions and 10 deletions
+35 -10
View File
@@ -40,15 +40,40 @@ pms:
# notify.zip.
mkdir zentaopms/www/data/notify/
#xuanxuan
mkdir xuanxuan
cd xuanxuan; svn export https://github.com/easysoft/xuanxuan.git/branches/master/ranzhi/
cd xuanxuan; svn export https://github.com/easysoft/xuanxuan.git/branches/master/zentao/
mkdir xuanxuan/xxb
cd xuanxuan/xxb; svn export https://github.com/easysoft/xuanxuan.git/branches/master/xxb/VERSION
cd xuanxuan/zentao; make
unzip xuanxuan/zentao/xuanxuan.zentao.*.zip -d zentaoxx
cp zentaoxx/build/* zentaopms/ -r
cat zentaoxx/build/db/xuanxuan.sql >> zentaopms/db/zentao.sql
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
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/xuanxuan.sql buildxx/db/
cp -r ranzhi/app/sys/chat buildxx/module/
cp -r ranzhi/app/sys/action buildxx/module/
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/xuanxuan.sql
sed -i 's/sys_user/zt_user/' buildxx/db/xuanxuan.sql
sed -i 's/sys_file/zt_file/' buildxx/db/xuanxuan.sql
sed -i '/sys_entry/d' buildxx/db/xuanxuan.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
# change mode.
chmod -R 777 zentaopms/tmp/
chmod -R 777 zentaopms/www/data
@@ -60,7 +85,7 @@ 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
zip -rq -9 ZenTaoPMS.$(VERSION).zip zentaopms
rm -fr zentaopms xuanxuan zentaoxx
rm -fr zentaopms ranzhi buildxx zentaoxx xuanxuan.zentao.*.zip
deb:
mkdir buildroot
cp -r build/debian/DEBIAN buildroot
@@ -0,0 +1,32 @@
<?php
class admin extends control
{
/**
* Configuration of xuanxuan.
*
* @access public
* @return void
*/
public function xuanxuan()
{
$this->app->loadLang('chat');
if($_POST)
{
if(strlen($this->post->key) != 32 or !validater::checkREG($this->post->key, '|^[A-Za-z0-9]+$|')) $this->send(array('result' => 'fail', 'message' => array('key' => $this->lang->chat->errorKey)));
$data = new stdclass();
$data->turnon = $this->post->turnon;
$data->key = $this->post->key;
if($data) $this->loadModel('setting')->setItems('system.xuanxuan', $data);
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
$locate = inlink('xuanxuan');
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locate));
}
$this->view->position[] = $this->lang->chat->settings;
$this->view->title = $this->lang->chat->settings;
$this->view->turnon = isset($this->config->xuanxuan->turnon) ? $this->config->xuanxuan->turnon : 1;
$this->display();
}
}
@@ -0,0 +1,17 @@
/**
* create key for an entry.
*
* @access public
* @return void
*/
function createKey()
{
var chars = '0123456789abcdefghiklmnopqrstuvwxyz'.split('');
var key = '';
for(var i = 0; i < 32; i ++)
{
key += chars[Math.floor(Math.random() * chars.length)];
}
$('#key').val(key);
return false;
}
@@ -0,0 +1,51 @@
<?php
/**
* The configure xuanxuan view file of setting module of RanZhi.
*
* @copyright Copyright 2009-2017 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Gang Liu <liugang@cnezsoft.com>
* @package setting
* @version $Id$
* @link http://www.ranzhico.com
*/
?>
<?php include '../../../common/view/header.html.php';?>
<div id="mainMenu" class="clearfix">
<div class="btn-toolbar pull-left"><?php common::printAdminSubMenu('sso');?></div>
</div>
<div id='mainContent' class='main-content'>
<div class='center-block'>
<div class='main-header'>
<div class='heading'>
<h4><?php echo $lang->chat->settings;?></h4>
</div>
</div>
<form id='dataform' method='post' class='form-ajax'>
<table class='table table-form w-p40'>
<tr>
<th class='w-80px'><?php echo $lang->chat->version;?></th>
<td><?php echo $config->xuanxuan->version;?></td>
<td></td>
<td></td>
</tr>
<tr>
<th class='w-80px'><?php echo $lang->chat->turnon;?></th>
<td><?php echo html::radio('turnon', $lang->chat->turnonList, $turnon);?></td>
<td></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->chat->key;?></th>
<td colspan='2'><?php echo html::input('key', $config->xuanxuan->key, "class='form-control'");?></td>
<td><?php echo html::a('javascript:void(0)', $lang->chat->createKey, "", 'onclick="createKey()"');?></td>
</tr>
<tr>
<th></th>
<td colspan='3'><?php echo html::submitButton();?></td>
</tr>
</table>
</form>
</div>
</div>
<?php include '../../../common/view/footer.html.php';?>
@@ -0,0 +1,11 @@
<?php
class chat extends control
{
public function extensions($userID = 0)
{
$this->output->result = 'success';
$this->output->data = array();
$this->output->users = array($userID);
die($this->app->encrypt($this->output));
}
}
@@ -0,0 +1,11 @@
<?php
$lang->chat->common = 'Xuanxuan';
$lang->chat->settings = 'Xuanxuan';
$lang->chat->createKey = 'Create Key';
$lang->chat->turnon = 'On';
$lang->chat->key = 'Key';
$lang->chat->version = 'Version';
$lang->chat->turnonList = array();
$lang->chat->turnonList[1] = 'On';
$lang->chat->turnonList[0] = 'Off';
@@ -0,0 +1,11 @@
<?php
$lang->chat->common = '喧喧';
$lang->chat->settings = '喧喧集成';
$lang->chat->createKey = '重新生成密钥';
$lang->chat->turnon = '是否打开';
$lang->chat->key = '密钥';
$lang->chat->version = '版本';
$lang->chat->turnonList = array();
$lang->chat->turnonList[1] = '是';
$lang->chat->turnonList[0] = '否';
@@ -0,0 +1,2 @@
<?php
$lang->chat->common = '喧喧';
@@ -0,0 +1,9 @@
<?php
$lang->xuanxuan = new stdclass();
$lang->admin->menu->sso['link'] = 'Integrate|admin|xuanxuan';
if(!isset($lang->admin->menu->sso['alias'])) $lang->admin->menu->sso['alias'] = '';
$lang->admin->menu->sso['alias'] .= ',sso';
$lang->admin->subMenu->sso->xuanxuan = 'Xuanxuan|admin|xuanxuan';
$lang->admin->subMenuOrder->sso[4] = 'xuanxuan';
@@ -0,0 +1,9 @@
<?php
$lang->xuanxuan = new stdclass();
$lang->admin->menu->sso['link'] = '集成|admin|xuanxuan';
if(!isset($lang->admin->menu->sso['alias'])) $lang->admin->menu->sso['alias'] = '';
$lang->admin->menu->sso['alias'] .= ',sso';
$lang->admin->subMenu->sso->xuanxuan = '喧喧集成|admin|xuanxuan';
$lang->admin->subMenuOrder->sso[4] = 'xuanxuan';
@@ -0,0 +1,9 @@
<?php
$lang->xuanxuan = new stdclass();
$lang->admin->menu->sso['link'] = '整合|admin|xuanxuan';
if(!isset($lang->admin->menu->sso['alias'])) $lang->admin->menu->sso['alias'] = '';
$lang->admin->menu->sso['alias'] .= ',sso';
$lang->admin->subMenu->sso->xuanxuan = '喧喧整合|admin|xuanxuan';
$lang->admin->subMenuOrder->sso[4] = 'xuanxuan';
@@ -0,0 +1,3 @@
<?php
$sn = $this->loadModel('setting')->getItem('owner=system&module=xuanxuan&key=key');
if(empty($sn)) $this->setting->setItem('system.xuanxuan..key', $this->setting->computeSN());
@@ -0,0 +1,6 @@
<?php
public function loadConfigFromDB()
{
parent::loadConfigFromDB();
if(isset($this->config->system->xuanxuan)) $this->app->mergeConfig($this->config->system->xuanxuan, 'xuanxuan');
}
@@ -0,0 +1,13 @@
<?php
/**
* Get list of one type.
*
* @param string $type
* @param string $orderBy
* @access public
* @return array
*/
public function getListByType($type = 'article', $orderBy = 'id_asc')
{
return $this->dao->select('*')->from(TABLE_DEPT)->orderBy($orderBy)->fetchAll('id');
}
@@ -0,0 +1,6 @@
<?php
$config->dev->group['chat'] = 'api';
$config->dev->group['im_chat'] = 'api';
$config->dev->group['im_message'] = 'api';
$config->dev->group['im_chatuser'] = 'api';
$config->dev->group['im_messagestatus'] = 'api';
@@ -0,0 +1,5 @@
<?php
$lang->dev->tableList['im_chat'] = 'Chat List';
$lang->dev->tableList['im_message'] = 'Chat Message';
$lang->dev->tableList['im_chatuser'] = 'Chat User';
$lang->dev->tableList['im_messagestatus'] = 'Chat Status';
@@ -0,0 +1,5 @@
<?php
$lang->dev->tableList['im_chat'] = '喧喧列表';
$lang->dev->tableList['im_message'] = '喧喧消息';
$lang->dev->tableList['im_chatuser'] = '喧喧用户';
$lang->dev->tableList['im_messagestatus'] = '喧喧消息状态';
@@ -0,0 +1,5 @@
<?php
$lang->dev->tableList['im_chat'] = '喧喧列表';
$lang->dev->tableList['im_message'] = '喧喧消息';
$lang->dev->tableList['im_chatuser'] = '喧喧用戶';
$lang->dev->tableList['im_messagestatus'] = '喧喧消息狀態';
+27
View File
@@ -0,0 +1,27 @@
<?php
/* Set the error reporting. */
error_reporting(E_ALL);
/* Start output buffer. */
ob_start();
/* Define the run mode as front. */
define('RUN_MODE', 'upgrade');
/* Load the framework. */
include '../framework/xuanxuan.class.php';
include '../framework/control.class.php';
include '../framework/model.class.php';
include '../framework/helper.class.php';
/* Log the time and define the run mode. */
$startTime = getTime();
/* Run the app. */
$appName = 'sys';
$app = xuanxuan::createApp($appName, dirname(dirname(__FILE__)), 'xuanxuan');
$common = $app->loadCommon();
$common->loadModel('chat')->upgrade();
/* Flush the buffer. */
echo helper::removeUTF8Bom(ob_get_clean());
+29
View File
@@ -0,0 +1,29 @@
<?php
/* Set the error reporting. */
error_reporting(E_ALL);
/* Start output buffer. */
ob_start();
/* Define the run mode as front. */
define('RUN_MODE', 'xuanxuan');
/* Load the framework. */
include '../framework/xuanxuan.class.php';
include '../framework/control.class.php';
include '../framework/model.class.php';
include '../framework/helper.class.php';
/* Log the time and define the run mode. */
$startTime = getTime();
/* Run the app. */
$appName = '';
$app = xuanxuan::createApp($appName, dirname(dirname(__FILE__)), 'xuanxuan');
$app->loadCommon();
$app->parseRequest();
$app->loadModule();
/* Flush the buffer. */
echo helper::removeUTF8Bom(ob_get_clean());