* Perfect the notify api.
This commit is contained in:
@@ -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 = '没有设置发送方信息';
|
||||
|
||||
Reference in New Issue
Block a user