/** * Method used to update the details of a specific reminder action. * * @access public * @return integer 1 if the update worked, -1 or -2 otherwise */ function update() { global $HTTP_POST_VARS; $stmt = "UPDATE\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "reminder_action\n SET\n rma_last_updated_date='" . Date_API::getCurrentDateGMT() . "',\n rma_rank='" . Misc::escapeInteger($HTTP_POST_VARS['rank']) . "',\n rma_title='" . Misc::escapeString($HTTP_POST_VARS['title']) . "',\n rma_rmt_id=" . Misc::escapeInteger($HTTP_POST_VARS['type']) . ",\n rma_alert_irc=" . Misc::escapeInteger($HTTP_POST_VARS['alert_irc']) . ",\n rma_alert_group_leader=" . Misc::escapeInteger($HTTP_POST_VARS['alert_group_leader']) . ",\n rma_boilerplate='" . Misc::escapeString($HTTP_POST_VARS['boilerplate']) . "'\n WHERE\n rma_id=" . Misc::escapeInteger($HTTP_POST_VARS['id']); $res = $GLOBALS["db_api"]->dbh->query($stmt); if (PEAR::isError($res)) { Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); return -1; } else { // remove any user list associated with this reminder action Reminder_Action::clearActionUserList($HTTP_POST_VARS['id']); // add the user list back in, if appropriate if (Reminder_Action::isUserList($HTTP_POST_VARS['type'])) { Reminder_Action::associateUserList($HTTP_POST_VARS['id'], $HTTP_POST_VARS['user_list']); } return 1; } }