示例#1
0
 public static function sendCloudMail($to, $subject, $message, $from = "*****@*****.**")
 {
     $param = array("to" => $to, "subject" => $subject, "html" => $message, "from" => $from);
     $rs = CloudApi::getInstance()->fetch("Api/Mail/Send", $param, "post");
     if (substr($rs, 0, 5) !== "error") {
         $res = json_decode($rs, true);
         if ($res["ret"] == 0) {
             return true;
         }
     }
     return false;
 }
示例#2
0
 public function sendEmail($data, $hasContent = false)
 {
     if (empty($data["email"])) {
         return false;
     }
     $s["uid"] = intval($data["uid"]);
     $s["node"] = StringUtil::filterCleanHtml($data["node"]);
     $s["email"] = StringUtil::filterCleanHtml($data["email"]);
     $s["module"] = StringUtil::filterCleanHtml($data["module"]);
     $s["issend"] = $s["sendtime"] = 0;
     $s["title"] = StringUtil::filterCleanHtml($data["title"]);
     $baseUrl = Ibos::app()->setting->get("siteurl");
     $fullName = Ibos::app()->setting->get("setting/unit/fullname");
     $user = User::model()->fetchByUid($s["uid"]);
     $named = $user["realname"] . ($user["gender"] == 1 ? " 先生" : " 女士");
     $body = html_entity_decode($data["body"]);
     if ($hasContent) {
         //$bodystr = "        <tr>\r\n\t\t\t<td colspan=\"2\">\r\n\t\t\t\t<div style=\"width:493px; padding:25px; margin:0 auto; background:#FFF; border:1px solid #ededed\">\r\n\t\t\t\t\t$body\r\n\t\t\t\t</div>\r\n\t\t\t</td>\r\n\t\t</tr>   ";
         $bodystr = '
     <tr>
         <td colspan="2">
             <div style="width:493px; padding:25px; margin:0 auto; background:#FFF; border:1px solid #ededed">
                 $body
             </div>
         </td>
     </tr>   ';
     } else {
         $bodystr = "";
     }
     $s["body"] = "<!DOCTYPE HTML>\r\n<html lang=\"en-US\">\r\n<head>\r\n\t<meta charset=\"UTF-8\">\r\n\t<title>邮件提醒</title>\r\n</head>\r\n<body>\r\n\t<style type=\"text/css\">\r\n\t\ta{ text-decoration:none; }\r\n\t\ta:hover{ text-decoration:underline; }\r\n\t</style>\r\n\t<table style=\"width:598px; border:1px solid #e8e8e8;  background:#fcfcfc; margin:0 auto;\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n\t\t<tr>\r\n\t\t\t<!-- 公司名称 -->\r\n\t\t\t<td style=\"width:425px; height:49px; line-height:49px; overflow:hidden; background:#1180c6; font-size:18px; font-weight:bold; color:#FFF; font-family:'Microsoft YaHei';\">&#12288;{$fullName}</td>\r\n\t\t\t<td style=\"width:173px; height:49px; line-height:49px; overflow:hidden; background:#1180c6; font-size:12px; color:#FFF\">IBOS云服务中心·邮件提醒</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" style=\"width:598px; height:30px; overflow:hidden;\">&nbsp;</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<!-- 收件人姓名 -->\r\n\t\t\t<td colspan=\"2\" style=\"width:548px; height:40px; line-height:40px; overflow:hidden;font-size:16px; font-family:'b8bf53';\"><div style=\"width:543px; margin:0 auto; font-size:16px;\">HELLO!{$named}:</div></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" style=\"width:598px; height:80px; overflow:hidden; \">\r\n\t\t\t\t<div style=\"width:543px; margin:0 auto;\">\r\n\t\t\t\t\t<!-- 通知标题 -->\r\n\t\t\t\t\t<p align=\"center\" style=\"width:493px; margin:0 auto; font-size:14px; line-height:20px; font-family:'b8bf53';color:#50545f;\">{$s["title"]}</p>\r\n\t\t\t\t</div>\r\n\t\t\t</td>\r\n\t\t</tr>\r\n        {$bodystr}\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" style=\"width:598px; height:50px; overflow:hidden;\">&nbsp;</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" style=\"width:598px; height:40px; overflow:hidden;\">\r\n\t\t\t\t<!-- 登录按钮 -->\r\n\t\t\t\t<div style=\"width:380px; height:40px; line-height:40px; background:#1180c6; margin:0 auto; color:#fff; text-align:center\">\r\n                    <a href=\"{$baseUrl}{$data["url"]}\" target=\"_blank\" style=\" color:#fff;font-size:16px;\">现在就登录 IBOS协同办公平台,处理相关事宜!</a>\r\n                </div>\r\n\t\t\t</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" style=\"width:598px; height:40px; overflow:hidden;\">&nbsp;</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<!-- 提示 -->\r\n\t\t\t<td colspan=\"2\" align=\"center\" style=\"width:598px; height:80px; overflow:hidden; font-size:12px;\">\r\n                <span style=\"color:#1180c6\">■&nbsp;</span>您可以在<span style=\"color:#1180c6\">&#12288;\r\n                    <a style=\"color:#1180c6;\" href=\"{$baseUrl}?r=user/home/index\">个人中心</a>&#12288;->&#12288;\r\n                    <a style=\"color:#1180c6;\" href=\"{$baseUrl}?r=user/home/personal\">个人资料</a>&#12288;->&#12288;\r\n                    <a style=\"color:#1180c6;\" href=\"{$baseUrl}?r=user/home/personal&op=remind\">提醒设置</a>&#12288;\r\n                 </span>中管理来自IBOS协同办公平台的邮件提醒\r\n            </td>\r\n\t\t</tr>\r\n\t</table>\r\n\t<table style=\"width:600px; margin:0 auto;\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n\t\t<tr>\r\n\t\t\t<td style=\"width:600px; height:30px; font-size:12px; font-family:'b8bf53';color:#50545f;\">\r\n                <div style=\"line-height:30px; padding-top:5px;\">2014 ©  IBOS协同办公平台</div>\r\n            </td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<!-- 其他链接 -->\r\n\t\t\t<td style=\"width:600px; height:30px; font-size:12px; font-family:'b8bf53';color:#50545f; line-height:30px;\">\r\n                <a href=\"http://www.ibos.com.cn\" style=\"color:#50545f;\" target=\"_blank\">开发者平台</a>&#12288;/&#12288;\r\n                <a href=\"http://bbs.ibos.com.cn\" style=\"color:#50545f;\" target=\"_blank\">问答社区</a>&#12288;/&#12288;\r\n                <a href=\"http://www.ibos.com.cn/wiki\" style=\"color:#50545f;\" target=\"_blank\">文档中心</a>&#12288;&#12288;客户支持: 400-838-1185&#12288;&#12288;&#12288;support@ibos.com.cn\r\n            </td>\r\n\t\t</tr>\r\n\t</table>\r\n</body>\r\n</html>";
     $s["ctime"] = time();
     if (CloudApi::getInstance()->isOpen() && CloudApi::getInstance()->exists("mail_send")) {
         MailUtil::sendCloudMail($s["email"], $s["title"], $s["body"]);
     } else {
         MailUtil::sendMail($s["email"], $s["title"], $s["body"]);
     }
     return $this->add($s, true);
 }
示例#3
0
文件: index.php 项目: AxelPanda/ibos
                        <button id="createconf" class="btn">创建会议</button>
                    </div>
                </div>
            </div>
            <script>
                $('#createconf').on('click', function() {
                    var phone = $('#confnumbers').val();
                    var arr = phone.split(';'), member = [];
                    $.each(arr, function(i, n) {
                        if (n !== '' && (U.regex(n, 'mobile') || U.regex(n, 'tel'))) {
                            member.push(n);
                        }
                    });
                    if (member.length > 1) {
                        var url = '<?php 
    echo CloudApi::getInstance()->build('Api/Ivr/Confirmconf');
    ?>
';
                        Ui.openFrame(url + '&member=' + encodeURI(member.join(';')), {width: '830px', height: '560px', title: '语音会议'}
                        );
                    } else {
                        Ui.tip('会议成员必须大于1个', 'error')
                    }
                })
            </script>
        <?php 
}
?>
    </div>
</div>
<div id="in_operate" class="in-operate">
示例#4
0
 public static function appPush($toUid, $message)
 {
     is_array($toUid) && ($toUid = implode(",", $toUid));
     if (!empty($toUid)) {
         $message = str_replace(" ", "", StringUtil::filterCleanHtml($message));
         CloudApi::getInstance()->fetch("Api/Push/Notify", array("uid" => $toUid, "msg" => $message));
     }
 }
示例#5
0
 public function actionToken()
 {
     $devtoken = EnvUtil::getRequest("devtoken");
     $platform = EnvUtil::getRequest("platform");
     $uniqueid = EnvUtil::getRequest("uniqueid");
     $param = array("uid" => Ibos::app()->user->uid, "devtoken" => $devtoken, "platform" => $platform, "uniqueid" => $uniqueid);
     $rs = CloudApi::getInstance()->fetch("Api/push/token", $param, "post");
     if (substr($rs, 0, 5) !== "error") {
         $this->ajaxReturn(array("isSucess" => true), "JSONP");
     }
     $this->ajaxReturn(array("isSucess" => false), "JSONP");
 }
示例#6
0
文件: dept.php 项目: AxelPanda/ibos
<script>
    Ibos.app.setPageParam({
        "deptid": "<?php 
echo intval(EnvUtil::getRequest("deptid"));
?>
"
    });

    <?php 
if (CloudApi::getInstance()->exists("call_land")) {
    ?>
	        $('#call_land').on('click', function() {
            var phone = $('#care_mobile').html();
            if (phone !== '' && U.regex(phone, 'mobile')) {
                var url = '<?php 
    echo CloudApi::getInstance()->build("Api/Comm/Call");
    ?>
';
                Ui.openFrame(url + '&call=' + phone, {width: '830px', height: '560px', title: '在线呼叫'});
            } else {
                Ui.tip('手机号码格式错误', 'error')
            }
        })
	<?php 
}
?>
</script>
<script src="<?php 
echo $assetUrl;
?>
/js/contactList.js?<?php 
示例#7
0
 protected function getRemind()
 {
     $user = $this->getUser();
     $user["remindsetting"] = !empty($user["remindsetting"]) ? unserialize($user["remindsetting"]) : array();
     $nodeList = Notify::model()->getNodeList();
     $apiOpen = CloudApi::getInstance()->isOpen();
     foreach ($nodeList as $id => &$node) {
         $node["moduleName"] = Module::model()->fetchNameByModule($node["module"]);
         $node["appdisabled"] = !$apiOpen ? 1 : 0;
         $node["maildisabled"] = $user["validationemail"] == 0 || !$node["sendemail"] ? 1 : 0;
         $node["smsdisabled"] = $user["validationmobile"] == 0 || !$node["sendsms"] ? 1 : 0;
         if (empty($user["remindsetting"])) {
             $node["emailcheck"] = $node["smscheck"] = $node["appcheck"] = 1;
         } elseif (isset($user["remindsetting"][$id])) {
             $node["appcheck"] = isset($user["remindsetting"][$id]["app"]) ? $user["remindsetting"][$id]["app"] : 0;
             $node["emailcheck"] = isset($user["remindsetting"][$id]["email"]) ? $user["remindsetting"][$id]["email"] : 0;
             $node["smscheck"] = isset($user["remindsetting"][$id]["sms"]) ? $user["remindsetting"][$id]["sms"] : 0;
         } else {
             $node["emailcheck"] = $node["smscheck"] = $node["appcheck"] = 0;
         }
     }
     return array("nodeList" => $nodeList);
 }