本文整理汇总了PHP中Reminder::addCustomerAssociation方法的典型用法代码示例。如果您正苦于以下问题:PHP Reminder::addCustomerAssociation方法的具体用法?PHP Reminder::addCustomerAssociation怎么用?PHP Reminder::addCustomerAssociation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reminder
的用法示例。
在下文中一共展示了Reminder::addCustomerAssociation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
/**
* Method used to update the details of a specific reminder.
*
* @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_level\n SET\n rem_last_updated_date='" . Date_API::getCurrentDateGMT() . "',\n rem_rank=" . Misc::escapeInteger($HTTP_POST_VARS['rank']) . ",\n rem_title='" . Misc::escapeString($HTTP_POST_VARS['title']) . "',\n rem_prj_id=" . Misc::escapeInteger($HTTP_POST_VARS['project']) . ",\n rem_skip_weekend=" . Misc::escapeInteger($HTTP_POST_VARS['skip_weekend']) . "\n WHERE\n rem_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 {
Reminder::removeAllAssociations($HTTP_POST_VARS['id']);
// map the reminder requirements now
if (@$HTTP_POST_VARS['reminder_type'] == 'support_level' && count($HTTP_POST_VARS['support_levels']) > 0) {
for ($i = 0; $i < count($HTTP_POST_VARS['support_levels']); $i++) {
Reminder::addSupportLevelAssociation($HTTP_POST_VARS['id'], $HTTP_POST_VARS['support_levels'][$i]);
}
} elseif (@$HTTP_POST_VARS['reminder_type'] == 'issue' && count($HTTP_POST_VARS['issues']) > 0) {
for ($i = 0; $i < count($HTTP_POST_VARS['issues']); $i++) {
Reminder::addIssueAssociation($HTTP_POST_VARS['id'], $HTTP_POST_VARS['issues'][$i]);
}
} elseif (@$HTTP_POST_VARS['reminder_type'] == 'customer' && count($HTTP_POST_VARS['customers']) > 0) {
for ($i = 0; $i < count($HTTP_POST_VARS['customers']); $i++) {
Reminder::addCustomerAssociation($HTTP_POST_VARS['id'], $HTTP_POST_VARS['customers'][$i]);
}
} elseif (@$HTTP_POST_VARS['reminder_type'] == 'all_issues') {
Reminder::associateAllIssues($HTTP_POST_VARS['id']);
}
if (@$HTTP_POST_VARS['check_priority'] == 'yes' && count($HTTP_POST_VARS['priorities']) > 0) {
for ($i = 0; $i < count($HTTP_POST_VARS['priorities']); $i++) {
Reminder::addPriorityAssociation($HTTP_POST_VARS['id'], $HTTP_POST_VARS['priorities'][$i]);
}
}
return 1;
}
}