diff --git a/xuanxuan/module/message/ext/config/xuanxuan.php b/xuanxuan/module/message/ext/config/xuanxuan.php new file mode 100644 index 0000000000..ba81cc8e28 --- /dev/null +++ b/xuanxuan/module/message/ext/config/xuanxuan.php @@ -0,0 +1,3 @@ +message->available['xuanxuan'] = $config->message->objectTypes; +$config->message->setting['xuanxuan']['setting'] = $config->message->available['xuanxuan']; diff --git a/xuanxuan/module/message/ext/lang/en/xuanxuan.php b/xuanxuan/module/message/ext/lang/en/xuanxuan.php new file mode 100644 index 0000000000..bf45e30825 --- /dev/null +++ b/xuanxuan/module/message/ext/lang/en/xuanxuan.php @@ -0,0 +1,2 @@ +message->typeList['xuanxuan'] = 'Xuanxuan'; diff --git a/xuanxuan/module/message/ext/lang/zh-cn/xuanxuan.php b/xuanxuan/module/message/ext/lang/zh-cn/xuanxuan.php new file mode 100644 index 0000000000..d5daca9d76 --- /dev/null +++ b/xuanxuan/module/message/ext/lang/zh-cn/xuanxuan.php @@ -0,0 +1,2 @@ +message->typeList['xuanxuan'] = '喧喧'; diff --git a/xuanxuan/module/message/ext/model/class/xuanxuan.class.php b/xuanxuan/module/message/ext/model/class/xuanxuan.class.php new file mode 100644 index 0000000000..a92ecae9a1 --- /dev/null +++ b/xuanxuan/module/message/ext/model/class/xuanxuan.class.php @@ -0,0 +1,29 @@ +config->message->setting; + if(is_string($messageSetting)) $messageSetting = json_decode($messageSetting, true); + if(isset($messageSetting['xuanxuan'])) + { + $actions = $messageSetting['xuanxuan']['setting']; + if(isset($actions[$objectType]) and in_array($actionType, $actions[$objectType])) + { + $this->loadModel('action'); + $object = $this->dao->select('*')->from($this->config->objectTables[$objectType])->where('id')->eq($objectID)->fetch(); + $field = $this->config->action->objectNameFields[$objectType]; + $title = $this->app->user->realname . $this->lang->action->label->$actionType . $this->lang->action->objectTypes[$objectType]; + $text = $title . ' ' . "[#{$objectID}::{$object->$field}]"; + $url = common::getSysURL() . helper::createLink($objectType, 'view', "id=$objectID"); + + $target = ''; + if(!empty($object->assignedTo)) $target .= $object->assignedTo; + if(!empty($object->mailto)) $target .= ",{$object->mailto}"; + $target = trim($target, ','); + + if($target) $this->loadModel('chat')->createNotify($target, $text, '', $text, 'text', $url); + } + } + } +} diff --git a/xuanxuan/module/message/ext/model/hook/send.xuanxuan.php b/xuanxuan/module/message/ext/model/hook/send.xuanxuan.php new file mode 100644 index 0000000000..f4daeaa410 --- /dev/null +++ b/xuanxuan/module/message/ext/model/hook/send.xuanxuan.php @@ -0,0 +1,2 @@ +loadExtension('xuanxuan')->send($objectType, $objectID, $actionType, $actionID);