本文整理汇总了PHP中Notification::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Notification::update方法的具体用法?PHP Notification::update怎么用?PHP Notification::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Notification
的用法示例。
在下文中一共展示了Notification::update方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Notification
*/
include '../inc/includes.php';
Session::checkRight("notification", 'r');
if (!isset($_GET["id"])) {
$_GET["id"] = "";
}
$notification = new Notification();
if (isset($_POST["add"])) {
$notification->check(-1, 'w', $_POST);
$newID = $notification->add($_POST);
Event::log($newID, "notifications", 4, "notification", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"]));
Html::redirect($_SERVER['PHP_SELF'] . "?id={$newID}");
} else {
if (isset($_POST["delete"])) {
$notification->check($_POST["id"], 'd');
$notification->delete($_POST);
Event::log($_POST["id"], "notifications", 4, "notification", sprintf(__('%s purges an item'), $_SESSION["glpiname"]));
$notification->redirectToList();
} else {
if (isset($_POST["update"])) {
$notification->check($_POST["id"], 'w');
$notification->update($_POST);
Event::log($_POST["id"], "notifications", 4, "notification", sprintf(__('%s updates an item'), $_SESSION["glpiname"]));
Html::back();
} else {
Html::header(Notification::getTypeName(2), $_SERVER['PHP_SELF'], "config", "mailing", "notification");
$notification->showForm($_GET["id"]);
Html::footer();
}
}
}
示例2: array
$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();
示例3: register
public static function register()
{
global $https, $store_home;
$trigger = new Notification();
Database::register_trigger($trigger);
$dir = dirname($_SERVER['PHP_SELF']);
if ($dir != '/') {
$dir .= '/';
}
$protocol = $https ? 'https' : 'http';
$url = "{$protocol}://{$_SERVER['HTTP_HOST']}{$dir}";
Notification::$insert = <<<end
Your affiliate account has been credited with a new order. The details are as
follows:
end;
Notification::$update = <<<end
An order in your affiliate account has been changed. The details are as
follows:
end;
Notification::$signoff = <<<end
You are receiving this message because you signed up to be an affiliate of
{$store_home} .
If you no longer wish to receive these emails, you can turn them off by
visiting {$url} and clicking ‘Your Account’.
This will take you to a page where you can set your email preferences.
If you have any questions, please feel free to contact us at any time.
However, this email was sent from an address which is not monitored, so a reply
will not reach us.
Thank you for being a member of our affiliate programme.
end;
}
示例4: array
// format default actions properly
$default = Notification::getDefaultActions();
// first setup defaults
$res = array('updated' => 0, 'closed' => 0, 'files' => 0, 'emails' => 0);
foreach ($default as $action) {
$res[$action] = 1;
}
$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.'));
示例5: set_notification_read
public function set_notification_read($notification_id)
{
$notification = new Notification($notification_id);
$notification->set_read('TRUE');
$notification->update();
return $this;
}
示例6: if
}
}
}else if($_REQUEST['mode'] == 'edit'){
$title = "Edit Notification";
if(empty($_REQUEST['id'])){
$error_msg .= "Error: No ID specified!\n";
}else{
if(!$notification->get($_REQUEST['id'])){
$error_msg .= "Error retrieving notification information!\n";
debug_message($notification->getLastError());
}
}
if($_POST['save']){
$notification->updateFromAssocArray($_POST);
if($notification->update()){
if(!empty($_POST['new_address'])){
if($notification->addAddress($_POST['new_address']) === FALSE){
$error_msg .= "Error adding new address to notification!";
debug_message($notification->getLastError());
}
}
if(!empty($_POST['new_macro_name'])){
if($notification->addMacro($_POST['new_macro_name'], $_POST['new_macro_description']) === FALSE){
$error_msg .= "Error adding new macro to notification!";
debug_message($notification->getLastError());
}
}
if(empty($error_msg)){
示例7: read
public function read(Notification $notification)
{
$notification->readed = 1;
return $notification->update();
}
示例8: markNotificationRead
public function markNotificationRead(Notification $notification)
{
$notification->isRead(1);
$notification->update();
}