/** * Before Delete, remove LikeCount (Cache) of target object. * Remove activity */ protected function beforeDelete() { $this->flushCache(); Notification::remove('Comment', $this->id); return parent::beforeDelete(); }
$tpl->setTemplate("notification.tpl.html"); Auth::checkAuthentication(APP_COOKIE, 'index.php?err=5', true); $usr_id = Auth::getUserID(); $prj_id = Auth::getCurrentProject(); $issue_id = @$HTTP_POST_VARS["issue_id"] ? $HTTP_POST_VARS["issue_id"] : $HTTP_GET_VARS["iss_id"]; $tpl->assign("issue_id", $issue_id); // format default actions properly $default = Notification::getDefaultActions(); $res = array(); foreach ($default as $action) { $res[$action] = 1; } $tpl->assign("default_actions", $res); if (@$HTTP_POST_VARS["cat"] == "insert") { $res = Notification::subscribeEmail($usr_id, $issue_id, $HTTP_POST_VARS['email'], $HTTP_POST_VARS['actions']); $tpl->assign("insert_result", $res); } elseif (@$HTTP_GET_VARS["cat"] == "edit") { $res = Notification::getDetails($HTTP_GET_VARS["id"]); $tpl->assign("info", $res); } elseif (@$HTTP_POST_VARS["cat"] == "update") { $res = Notification::update($HTTP_POST_VARS["id"]); $tpl->assign("update_result", $res); } elseif (@$HTTP_POST_VARS["cat"] == "delete") { $res = Notification::remove($HTTP_POST_VARS["items"]); $tpl->assign("delete_result", $res); } $tpl->assign("list", Notification::getSubscriberListing($issue_id)); $t = Project::getAddressBook($prj_id, $issue_id); $tpl->assign("assoc_users", $t); $tpl->assign("allowed_emails", Project::getAddressBookEmails($prj_id, $issue_id)); $tpl->displayTemplate();
/** * Before Delete, remove LikeCount (Cache) of target object. * Remove activity */ protected function beforeDelete() { Yii::app()->cache->delete('likes_' . $this->object_model . "_" . $this->object_id); // Delete Activity // Currently we need to delete this manually, because the activity object is NOT bound to the Like // Instead is it bound to the Like Target (This should changed) $activity = Activity::model()->findByAttributes(array('type' => 'Interest', 'module' => 'like', 'object_model' => $this->object_model, 'object_id' => $this->object_id, 'created_by' => $this->created_by)); if ($activity) { $activity->delete(); } Notification::remove('Interest', $this->id); return parent::beforeDelete(); }
$tpl->assign('default_actions', $res); $cat = isset($_POST['cat']) ? (string) $_POST['cat'] : (isset($_GET['cat']) ? (string) $_GET['cat'] : null); if ($cat == 'insert') { $res = Notification::subscribeEmail($usr_id, $issue_id, $_POST['email'], $_POST['actions']); if ($res == 1) { Misc::setMessage(ev_gettext('Thank you, the email has been subscribed to the issue.')); } } elseif ($cat == 'update') { $res = Notification::update($issue_id, $_POST['id'], $_POST['email']); if ($res == 1) { Misc::setMessage(ev_gettext('Thank you, the notification entry was updated successfully.')); } elseif ($res == -1) { Misc::setMessage(ev_gettext('An error occurred while trying to update the notification entry.'), Misc::MSG_ERROR); } elseif ($res == -2) { Misc::setMessage(ev_gettext('Error: the given email address is not allowed to be added to the notification list.'), Misc::MSG_ERROR); } Auth::redirect(APP_RELATIVE_URL . 'notification.php?iss_id=' . $issue_id); } elseif ($cat == 'edit') { $res = Notification::getDetails($_GET['id']); $tpl->assign('info', $res); } elseif ($cat == 'delete') { $res = Notification::remove($_POST['items']); if ($res == 1) { Misc::setMessage(ev_gettext('Thank you, the items have been deleted.')); } } $tpl->assign('list', Notification::getSubscriberListing($issue_id)); $t = Project::getAddressBook($prj_id, $issue_id); $tpl->assign('assoc_users', $t); $tpl->assign('allowed_emails', Project::getAddressBookEmails($prj_id, $issue_id)); $tpl->displayTemplate();
/** * Before Delete, remove LikeCount (Cache) of target object. * Remove activity */ protected function beforeDelete() { Notification::remove('Post', $this->id); return parent::beforeDelete(); }
/** * Cleanup AlbumImage */ public function beforeDelete() { $cover = $this->cover; if ($cover != null) { $cover->delete(); } foreach ($this->getImages() as $image) { $image->delete(); } /** * Remove notifications. */ Notification::remove('Album', $this->id); return parent::beforeDelete(); }
function ajax_remove_notification() { RoutingEngine::setPage("runnDAILY User Remove Notification", "PV__300"); if (!isset($_POST["id"])) { return false; } $id = $_POST["id"]; Notification::remove($id); RoutingEngine::getInstance()->persistUserData(); RoutingEngine::returnAjax(true); }
/** * Method used to remove all subscriptions associated with a given * set of issues. * * @access public * @param array $ids The list of issues * @return boolean */ function removeByIssues($ids) { $items = @implode(", ", Misc::escapeInteger($ids)); $stmt = "SELECT\r\n sub_id\r\n FROM\r\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "subscription\r\n WHERE\r\n sub_iss_id IN ({$items})"; $res = $GLOBALS["db_api"]->dbh->getCol($stmt); if (PEAR::isError($res)) { Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); return false; } else { Notification::remove($res); return true; } }