Exemplo n.º 1
0
 public function actionList()
 {
     $uid = Ibos::app()->user->uid;
     $module = $_GET["module"];
     $list = NotifyMessage::model()->fetchAllDetailByTimeLine($uid, $module);
     NotifyMessage::model()->setReadByModule($uid, $module);
     $data = array("datas" => $list);
     $this->ajaxReturn($data, "JSONP");
 }
Exemplo n.º 2
0
 public function getUnreadCount($uid)
 {
     $userData = $this->getUserData($uid);
     $return["unread_notify"] = intval(NotifyMessage::model()->countUnreadByUid($uid));
     $return["unread_atme"] = isset($userData["unread_atme"]) ? intval($userData["unread_atme"]) : 0;
     $return["unread_comment"] = isset($userData["unread_comment"]) ? intval($userData["unread_comment"]) : 0;
     $return["unread_message"] = MessageContent::model()->countUnreadMessage($uid, array(MessageContent::ONE_ON_ONE_CHAT, MessageContent::MULTIPLAYER_CHAT));
     $return["new_folower_count"] = isset($userData["new_folower_count"]) ? intval($userData["new_folower_count"]) : 0;
     $return["unread_total"] = array_sum($return);
     return $return;
 }
Exemplo n.º 3
0
 public function sendNotify($toUid, $node, $config)
 {
     empty($config) && ($config = array());
     $nodeInfo = $this->getNode($node);
     if (!$nodeInfo) {
         return false;
     }
     !is_array($toUid) && ($toUid = explode(",", $toUid));
     $userInfo = User::model()->fetchAllByUids($toUid);
     $data["node"] = $node;
     $data["module"] = $nodeInfo["module"];
     $data["url"] = isset($config["{url}"]) ? $config["{url}"] : "";
     $data["title"] = Ibos::lang($nodeInfo["titlekey"], "", $config);
     if (empty($nodeInfo["contentkey"])) {
         $data["body"] = $data["title"];
         $hasContent = false;
     } else {
         $data["body"] = Ibos::lang($nodeInfo["contentkey"], "", $config);
         $hasContent = true;
     }
     MessageUtil::push("notify", $toUid, array("message" => $data["title"], "url" => $data["url"]));
     foreach ($userInfo as $v) {
         $data["uid"] = $v["uid"];
         !empty($nodeInfo["sendmessage"]) && NotifyMessage::model()->sendMessage($data);
         $data["email"] = $v["email"];
         $remindSetting = !empty($v["remindsetting"]) ? unserialize($v["remindsetting"]) : array();
         if (isset($remindSetting[$node]) && isset($remindSetting[$node]["app"]) && $remindSetting[$node]["app"] == 1) {
             MessageUtil::appPush($toUid, $data["title"]);
         }
         if (!empty($nodeInfo["sendemail"])) {
             if (isset($remindSetting[$node]) && isset($remindSetting[$node]["email"]) && $remindSetting[$node]["email"] == 1) {
                 NotifyEmail::model()->sendEmail($data, $hasContent);
             }
         }
         if (!empty($nodeInfo["sendsms"])) {
             if (isset($remindSetting[$node]) && isset($remindSetting[$node]["sms"]) && $remindSetting[$node]["sms"] == 1) {
                 MessageUtil::sendSms($v["mobile"], StringUtil::filterCleanHtml($data["title"]), $nodeInfo["module"], $v["uid"]);
             }
         }
     }
 }
Exemplo n.º 4
0
<?php

Nav::model()->deleteAllByAttributes(array("module" => "workflow"));
Notify::model()->deleteAllByAttributes(array("module" => "workflow"));
NotifyMessage::model()->deleteAllByAttributes(array("module" => "workflow"));
CacheUtil::set("notifyNode", null);
Node::model()->deleteAllByAttributes(array("module" => "workflow"));
NodeRelated::model()->deleteAllByAttributes(array("module" => "workflow"));
AuthItem::model()->deleteAll("name LIKE 'workflow%'");
AuthItemChild::model()->deleteAll("child LIKE 'workflow%'");
MenuCommon::model()->deleteAllByAttributes(array("module" => "workflow"));
$settingFields = "wfremindbefore,wfremindafter,sealfrom";
Setting::model()->deleteAll("FIND_IN_SET(skey,'{$settingFields}')");
Menu::model()->deleteAllByAttributes(array("m" => "workflow"));
Nav::model()->deleteAllByAttributes(array("module" => "workflow"));
Node::model()->deleteAllByAttributes(array("module" => "workflow"));
NodeRelated::model()->deleteAllByAttributes(array("module" => "workflow"));
AuthItem::model()->deleteAll("name LIKE 'workflow%'");
AuthItemChild::model()->deleteAll("child LIKE 'workflow%'");
$db = Ibos::app()->db->createCommand();
$prefix = $db->getConnection()->tablePrefix;
$tables = $db->setText("SHOW TABLES LIKE '" . str_replace("_", "\\_", $prefix . "flow_data_%") . "'")->queryAll(false);
foreach ($tables as $table) {
    $tableName = $table[0];
    !empty($tableName) && $db->dropTable($tableName);
}
Exemplo n.º 5
0
 public function actionSetIsRead()
 {
     $module = StringUtil::filterCleanHtml(EnvUtil::getRequest("module"));
     $res = NotifyMessage::model()->setReadByModule(Yii::app()->user->uid, $module);
     $this->ajaxReturn(array("IsSuccess" => !!$res));
 }
Exemplo n.º 6
0
<?php

$settingFields = "emailexternalmail,emailrecall,emailsystemremind,emailroleallocation,emaildefsize";
Setting::model()->deleteAll("FIND_IN_SET(skey,'{$settingFields}')");
Setting::model()->updateSettingValueByKey("emailtableids", "a:2:{i:0;i:0;i:1;i:1;}");
Setting::model()->updateSettingValueByKey("emailtable_info", "a:2:{i:0;a:1:{s:4:\"memo\";s:0:\"\";}i:1;a:2:{s:4:\"memo\";s:0:\"\";s:11:\"displayname\";s:12:\"默认归档\";}}");
Nav::model()->deleteAllByAttributes(array("module" => "email"));
Menu::model()->deleteAllByAttributes(array("m" => "email"));
MenuCommon::model()->deleteAllByAttributes(array("module" => "email"));
Notify::model()->deleteAllByAttributes(array("node" => "email_message"));
NotifyMessage::model()->deleteAllByAttributes(array("module" => "email"));
CacheUtil::set("notifyNode", null);
Node::model()->deleteAllByAttributes(array("module" => "email"));
NodeRelated::model()->deleteAllByAttributes(array("module" => "email"));
AuthItem::model()->deleteAll("name LIKE 'email%'");
AuthItemChild::model()->deleteAll("child LIKE 'email%'");
$db = Ibos::app()->db->createCommand();
$prefix = $db->getConnection()->tablePrefix;
$tables = $db->setText("SHOW TABLES LIKE '" . str_replace("_", "\\_", $prefix . "email_%") . "'")->queryAll(false);
foreach ($tables as $table) {
    $tableName = $table[0];
    !empty($tableName) && $db->dropTable($tableName);
}