diff --git a/Makefile b/Makefile
index 2ff831e294..49c3731579 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/xuanxuan/module/admin/ext/control/xuanxuan.php b/xuanxuan/module/admin/ext/control/xuanxuan.php
new file mode 100644
index 0000000000..088b0c2658
--- /dev/null
+++ b/xuanxuan/module/admin/ext/control/xuanxuan.php
@@ -0,0 +1,32 @@
+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();
+ }
+}
diff --git a/xuanxuan/module/admin/ext/js/xuanxuan/xuanxuan.js b/xuanxuan/module/admin/ext/js/xuanxuan/xuanxuan.js
new file mode 100644
index 0000000000..7416f44f03
--- /dev/null
+++ b/xuanxuan/module/admin/ext/js/xuanxuan/xuanxuan.js
@@ -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;
+}
diff --git a/xuanxuan/module/admin/ext/view/xuanxuan.html.php b/xuanxuan/module/admin/ext/view/xuanxuan.html.php
new file mode 100644
index 0000000000..c37d01ce93
--- /dev/null
+++ b/xuanxuan/module/admin/ext/view/xuanxuan.html.php
@@ -0,0 +1,51 @@
+
+ * @package setting
+ * @version $Id$
+ * @link http://www.ranzhico.com
+ */
+?>
+
+
+
+
+
+
+
chat->settings;?>
+
+
+
+
+
+
diff --git a/xuanxuan/module/chat/ext/control/extensions.php b/xuanxuan/module/chat/ext/control/extensions.php
new file mode 100644
index 0000000000..8ec231b152
--- /dev/null
+++ b/xuanxuan/module/chat/ext/control/extensions.php
@@ -0,0 +1,11 @@
+output->result = 'success';
+ $this->output->data = array();
+ $this->output->users = array($userID);
+ die($this->app->encrypt($this->output));
+ }
+}
diff --git a/xuanxuan/module/chat/ext/lang/en/xuanxuan.php b/xuanxuan/module/chat/ext/lang/en/xuanxuan.php
new file mode 100644
index 0000000000..e68afb4913
--- /dev/null
+++ b/xuanxuan/module/chat/ext/lang/en/xuanxuan.php
@@ -0,0 +1,11 @@
+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';
diff --git a/xuanxuan/module/chat/ext/lang/zh-cn/xuanxuan.php b/xuanxuan/module/chat/ext/lang/zh-cn/xuanxuan.php
new file mode 100644
index 0000000000..5c28992e74
--- /dev/null
+++ b/xuanxuan/module/chat/ext/lang/zh-cn/xuanxuan.php
@@ -0,0 +1,11 @@
+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] = '否';
diff --git a/xuanxuan/module/chat/ext/lang/zh-tw/xuanxuan.php b/xuanxuan/module/chat/ext/lang/zh-tw/xuanxuan.php
new file mode 100644
index 0000000000..182a73f176
--- /dev/null
+++ b/xuanxuan/module/chat/ext/lang/zh-tw/xuanxuan.php
@@ -0,0 +1,2 @@
+chat->common = '喧喧';
diff --git a/xuanxuan/module/common/ext/lang/en/xuanxuan.php b/xuanxuan/module/common/ext/lang/en/xuanxuan.php
new file mode 100644
index 0000000000..e94f51dba0
--- /dev/null
+++ b/xuanxuan/module/common/ext/lang/en/xuanxuan.php
@@ -0,0 +1,9 @@
+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';
diff --git a/xuanxuan/module/common/ext/lang/zh-cn/xuanxuan.php b/xuanxuan/module/common/ext/lang/zh-cn/xuanxuan.php
new file mode 100644
index 0000000000..9d70f7cf5c
--- /dev/null
+++ b/xuanxuan/module/common/ext/lang/zh-cn/xuanxuan.php
@@ -0,0 +1,9 @@
+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';
diff --git a/xuanxuan/module/common/ext/lang/zh-tw/xuanxuan.php b/xuanxuan/module/common/ext/lang/zh-tw/xuanxuan.php
new file mode 100644
index 0000000000..924951419f
--- /dev/null
+++ b/xuanxuan/module/common/ext/lang/zh-tw/xuanxuan.php
@@ -0,0 +1,9 @@
+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';
diff --git a/xuanxuan/module/common/ext/model/hook/loadConfigFromDB.xuanxuan.php b/xuanxuan/module/common/ext/model/hook/loadConfigFromDB.xuanxuan.php
new file mode 100644
index 0000000000..947029f21b
--- /dev/null
+++ b/xuanxuan/module/common/ext/model/hook/loadConfigFromDB.xuanxuan.php
@@ -0,0 +1,3 @@
+loadModel('setting')->getItem('owner=system&module=xuanxuan&key=key');
+if(empty($sn)) $this->setting->setItem('system.xuanxuan..key', $this->setting->computeSN());
diff --git a/xuanxuan/module/common/ext/model/xuanxuan.php b/xuanxuan/module/common/ext/model/xuanxuan.php
new file mode 100644
index 0000000000..0807095a41
--- /dev/null
+++ b/xuanxuan/module/common/ext/model/xuanxuan.php
@@ -0,0 +1,6 @@
+config->system->xuanxuan)) $this->app->mergeConfig($this->config->system->xuanxuan, 'xuanxuan');
+}
diff --git a/xuanxuan/module/dept/ext/model/getlistbytype.php b/xuanxuan/module/dept/ext/model/getlistbytype.php
new file mode 100644
index 0000000000..f4c39e1c23
--- /dev/null
+++ b/xuanxuan/module/dept/ext/model/getlistbytype.php
@@ -0,0 +1,13 @@
+dao->select('*')->from(TABLE_DEPT)->orderBy($orderBy)->fetchAll('id');
+}
diff --git a/xuanxuan/module/dev/ext/config/xuanxuan.php b/xuanxuan/module/dev/ext/config/xuanxuan.php
new file mode 100644
index 0000000000..c1ce9de599
--- /dev/null
+++ b/xuanxuan/module/dev/ext/config/xuanxuan.php
@@ -0,0 +1,6 @@
+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';
diff --git a/xuanxuan/module/dev/ext/lang/en/xuanxuan.php b/xuanxuan/module/dev/ext/lang/en/xuanxuan.php
new file mode 100644
index 0000000000..f66285e311
--- /dev/null
+++ b/xuanxuan/module/dev/ext/lang/en/xuanxuan.php
@@ -0,0 +1,5 @@
+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';
diff --git a/xuanxuan/module/dev/ext/lang/zh-cn/xuanxuan.php b/xuanxuan/module/dev/ext/lang/zh-cn/xuanxuan.php
new file mode 100644
index 0000000000..f374358360
--- /dev/null
+++ b/xuanxuan/module/dev/ext/lang/zh-cn/xuanxuan.php
@@ -0,0 +1,5 @@
+dev->tableList['im_chat'] = '喧喧列表';
+$lang->dev->tableList['im_message'] = '喧喧消息';
+$lang->dev->tableList['im_chatuser'] = '喧喧用户';
+$lang->dev->tableList['im_messagestatus'] = '喧喧消息状态';
diff --git a/xuanxuan/module/dev/ext/lang/zh-tw/xuanxuan.php b/xuanxuan/module/dev/ext/lang/zh-tw/xuanxuan.php
new file mode 100644
index 0000000000..fb9ec9ed3e
--- /dev/null
+++ b/xuanxuan/module/dev/ext/lang/zh-tw/xuanxuan.php
@@ -0,0 +1,5 @@
+dev->tableList['im_chat'] = '喧喧列表';
+$lang->dev->tableList['im_message'] = '喧喧消息';
+$lang->dev->tableList['im_chatuser'] = '喧喧用戶';
+$lang->dev->tableList['im_messagestatus'] = '喧喧消息狀態';
diff --git a/xuanxuan/www/upgradexuanxuan.php b/xuanxuan/www/upgradexuanxuan.php
new file mode 100644
index 0000000000..007d588641
--- /dev/null
+++ b/xuanxuan/www/upgradexuanxuan.php
@@ -0,0 +1,27 @@
+loadCommon();
+$common->loadModel('chat')->upgrade();
+
+/* Flush the buffer. */
+echo helper::removeUTF8Bom(ob_get_clean());
diff --git a/xuanxuan/www/xuanxuan.php b/xuanxuan/www/xuanxuan.php
new file mode 100644
index 0000000000..f2302b17f7
--- /dev/null
+++ b/xuanxuan/www/xuanxuan.php
@@ -0,0 +1,29 @@
+loadCommon();
+$app->parseRequest();
+$app->loadModule();
+
+/* Flush the buffer. */
+echo helper::removeUTF8Bom(ob_get_clean());