Example #1
0
	function addMacro($name, $description){
		$this->id = intval($this->id);
		if($this->id <= 0){
			$this->error = "Notification::addMacro(): Invalid notification id!";
			return FALSE;
		}

		$nm = new NotificationMacro();
		$nm->notification_id = $this->id;
		$nm->name = $name;
		$nm->description = $description;
		$result = $nm->add();
		if($result === FALSE){
			$this->error = "Notification::addMacro(): Error adding address: ".$nm->getLastError();
			return FALSE;
		}

		return TRUE;
	}
Example #2
0
	}
}else if($_REQUEST['mode'] == 'delete_address'){
	$title = "Delete Email Address";

	$na = new NotificationAddress();
	if($na->delete($_REQUEST['address_id'])){
		header("Location: ".getCurrentURL(null, false)."?mode=edit&id=".$_REQUEST['id']."\r\n");
		exit();
	}else{
		$error_msg .= "Error deleting email address!\n";
		debug_message($na->getLastError());
	}
}else if($_REQUEST['mode'] == 'delete_macro'){
	$title = "Delete Notification Macro";

	$nm = new NotificationMacro();
	if($nm->delete($_REQUEST['macro_id'])){
		header("Location: ".getCurrentURL(null, false)."?mode=edit&id=".$_REQUEST['id']."\r\n");
		exit();
	}else{
		$error_msg .= "Error deleting macro!\n";
		debug_message($nm->getLastError());
	}
}else{
	$title = "Invalid Mode";
	$error_msg .= "Error: Invalid mode!\n";
}

?>
<? require('header.php'); ?>
<form action="<?php