当前位置: 首页>>代码示例>>PHP>>正文


PHP Notification::update方法代码示例

本文整理汇总了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();
        }
    }
}
开发者ID:gaforeror,项目名称:glpi,代码行数:31,代码来源:notification.form.php

示例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();
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:notification.php

示例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;
    }
开发者ID:JulioNavarro,项目名称:Affiliates-For-All,代码行数:34,代码来源:Notification.php

示例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.'));
开发者ID:korusdipl,项目名称:eventum,代码行数:31,代码来源:notification.php

示例5: set_notification_read

 public function set_notification_read($notification_id)
 {
     $notification = new Notification($notification_id);
     $notification->set_read('TRUE');
     $notification->update();
     return $this;
 }
开发者ID:119155012,项目名称:kals,代码行数:7,代码来源:User.php

示例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)){
开发者ID:nanoprime,项目名称:sureinvoice,代码行数:31,代码来源:notification.php

示例7: read

 public function read(Notification $notification)
 {
     $notification->readed = 1;
     return $notification->update();
 }
开发者ID:jhmachado,项目名称:tools,代码行数:5,代码来源:NotificationTrait.php

示例8: markNotificationRead

 public function markNotificationRead(Notification $notification)
 {
     $notification->isRead(1);
     $notification->update();
 }
开发者ID:rosemalejohn,项目名称:dnsc-hris,代码行数:5,代码来源:NotificationController.php


注:本文中的Notification::update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。