本文整理汇总了PHP中Reminder::isDebug方法的典型用法代码示例。如果您正苦于以下问题:PHP Reminder::isDebug方法的具体用法?PHP Reminder::isDebug怎么用?PHP Reminder::isDebug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reminder
的用法示例。
在下文中一共展示了Reminder::isDebug方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: perform
/**
* Method used to perform a specific action to an issue.
*
* @access public
* @param integer $issue_id The issue ID
* @param array $reminder The reminder details
* @param array $action The action details
* @return boolean
*/
function perform($issue_id, $reminder, $action)
{
$type = '';
// - see which action type we're talking about here...
$action_type = Reminder_Action::getActionType($action['rma_rmt_id']);
// - do we also need to alert the group leader about this?
$group_leader_usr_id = 0;
if ($action['rma_alert_group_leader']) {
if (Reminder::isDebug()) {
echo " - Processing Group Leader notification\n";
}
$group_id = Issue::getGroupID($issue_id);
// check if there's even a group associated with this issue
if (empty($group_id)) {
if (Reminder::isDebug()) {
echo " - No group associated with issue {$issue_id}\n";
}
} else {
$group_details = Group::getDetails($group_id);
if (!empty($group_details['grp_manager_usr_id'])) {
$group_leader_usr_id = $group_details['grp_manager_usr_id'];
}
}
}
if (Reminder::isDebug()) {
echo " - Performing action '{$action_type}' for issue #{$issue_id}\n";
}
switch ($action_type) {
case 'email_assignee':
$type = 'email';
$assignees = Issue::getAssignedUserIDs($issue_id);
$to = array();
foreach ($assignees as $assignee) {
$to[] = User::getFromHeader($assignee);
}
// add the group leader to the recipient list, if needed
if (!empty($group_leader_usr_id)) {
$leader_email = User::getFromHeader($group_leader_usr_id);
if (!empty($leader_email) && !in_array($leader_email, $to)) {
$to[] = $leader_email;
}
}
break;
case 'email_list':
$type = 'email';
$list = Reminder_Action::getUserList($action['rma_id']);
$to = array();
foreach ($list as $key => $value) {
// add the recipient to the list if it's a simple email address
if (Validation::isEmail($key)) {
$to[] = $key;
} else {
$to[] = User::getFromHeader($key);
}
}
// add the group leader to the recipient list, if needed
if (!empty($group_leader_usr_id)) {
$leader_email = User::getFromHeader($group_leader_usr_id);
if (!empty($leader_email) && !in_array($leader_email, $to)) {
$to[] = $leader_email;
}
}
break;
case 'sms_assignee':
$type = 'sms';
$assignees = Issue::getAssignedUserIDs($issue_id);
$to = array();
foreach ($assignees as $assignee) {
if (User::isClockedIn($assignee)) {
$sms_email = User::getSMS($assignee);
if (!empty($sms_email)) {
$to[] = $sms_email;
}
}
}
// add the group leader to the recipient list, if needed
if (!empty($group_leader_usr_id) && User::isClockedIn($group_leader_usr_id)) {
$leader_sms_email = User::getSMS($group_leader_usr_id);
if (!empty($leader_sms_email) && !in_array($leader_sms_email, $to)) {
$to[] = $leader_sms_email;
}
}
break;
case 'sms_list':
$type = 'sms';
$list = Reminder_Action::getUserList($action['rma_id']);
$to = array();
foreach ($list as $key => $value) {
// add the recipient to the list if it's a simple email address
if (Validation::isEmail($key)) {
$to[] = $key;
//.........这里部分代码省略.........
示例2: foreach
}
$triggered_issues[] = $issue;
}
}
if (count($issues) > 0) {
foreach ($issues as $issue) {
if (Reminder::isDebug()) {
echo " - Processing issue '" . $issue . "'\n";
}
// only perform one action per issue id
if (in_array($issue, $triggered_issues)) {
if (Reminder::isDebug()) {
echo " - Ignoring issue '" . $issue . "' because it was found in the list of already triggered issues\n";
}
continue;
}
$triggered_issues[] = $issue;
if (Reminder::isDebug()) {
echo " - Triggered Action '" . $action['rma_title'] . "' for issue #" . $issue . "\n";
}
Reminder_Action::perform($issue, $reminder, $action);
}
} else {
if (Reminder::isDebug()) {
echo " - No triggered issues for action '" . $action['rma_title'] . "'\n";
}
}
}
}
// release the lock
Lock::release('check_reminders');
示例3: perform
/**
* Method used to perform a specific action to an issue.
*
* @param integer $issue_id The issue ID
* @param array $reminder The reminder details
* @param array $action The action details
* @return boolean
*/
public static function perform($issue_id, $reminder, $action)
{
$type = '';
// - see which action type we're talking about here...
$action_type = self::getActionType($action['rma_rmt_id']);
// - do we also need to alert the group leader about this?
$group_leader_usr_id = 0;
if ($action['rma_alert_group_leader']) {
if (Reminder::isDebug()) {
echo ' - ' . ev_gettext('Processing Group Leader notification') . "\n";
}
$group_id = Issue::getGroupID($issue_id);
// check if there's even a group associated with this issue
if (empty($group_id)) {
if (Reminder::isDebug()) {
echo ' - ' . ev_gettext('No group associated with issue %1$s', $issue_id) . "\n";
}
} else {
$group_details = Group::getDetails($group_id);
if (!empty($group_details['grp_manager_usr_id'])) {
$group_leader_usr_id = $group_details['grp_manager_usr_id'];
}
}
}
if (Reminder::isDebug()) {
echo ' - ' . ev_gettext('Performing action %1$s for issue # %2$s', $action_type, $issue_id) . "\n";
}
switch ($action_type) {
case 'email_assignee':
$type = 'email';
$assignees = Issue::getAssignedUserIDs($issue_id);
$to = array();
foreach ($assignees as $assignee) {
$to[] = User::getFromHeader($assignee);
}
// add the group leader to the recipient list, if needed
if (!empty($group_leader_usr_id)) {
$leader_email = User::getFromHeader($group_leader_usr_id);
if (!empty($leader_email) && !in_array($leader_email, $to)) {
$to[] = $leader_email;
}
}
break;
case 'email_list':
$type = 'email';
$list = self::getUserList($action['rma_id']);
$to = array();
foreach ($list as $key => $value) {
// add the recipient to the list if it's a simple email address
if (Validation::isEmail($key)) {
$to[] = $key;
} else {
$to[] = User::getFromHeader($key);
}
}
// add the group leader to the recipient list, if needed
if (!empty($group_leader_usr_id)) {
$leader_email = User::getFromHeader($group_leader_usr_id);
if (!empty($leader_email) && !in_array($leader_email, $to)) {
$to[] = $leader_email;
}
}
break;
case 'sms_assignee':
$type = 'sms';
$assignees = Issue::getAssignedUserIDs($issue_id);
$to = array();
foreach ($assignees as $assignee) {
if (User::isClockedIn($assignee)) {
$sms_email = User::getSMS($assignee);
if (!empty($sms_email)) {
$to[] = $sms_email;
}
}
}
// add the group leader to the recipient list, if needed
if (!empty($group_leader_usr_id) && User::isClockedIn($group_leader_usr_id)) {
$leader_sms_email = User::getSMS($group_leader_usr_id);
if (!empty($leader_sms_email) && !in_array($leader_sms_email, $to)) {
$to[] = $leader_sms_email;
}
}
break;
case 'sms_list':
$type = 'sms';
$list = self::getUserList($action['rma_id']);
$to = array();
foreach ($list as $key => $value) {
// add the recipient to the list if it's a simple email address
if (Validation::isEmail($key)) {
$to[] = $key;
} else {
//.........这里部分代码省略.........