Example #1
0
 $found = 0;
 foreach ($reminder['actions'] as $action) {
     if (Reminder::isDebug()) {
         echo "Processing Reminder Action '" . $action['rma_title'] . "'\n";
     }
     $conditions = Reminder_Condition::getList($action['rma_id']);
     if (count($conditions) == 0) {
         if (Reminder::isDebug()) {
             echo "  - Skipping Reminder because there were no reminder conditions found\n";
         }
         continue;
     }
     $issues = Reminder::getTriggeredIssues($reminder, $conditions);
     // avoid repeating reminder actions, so get the list of issues
     // that were last triggered with this reminder action ID
     $repeat_issues = Reminder_Action::getRepeatActions($issues, $action['rma_id']);
     if (count($repeat_issues) > 0) {
         // add the repeated issues to the list of already triggered
         // issues, so they get ignored for the next reminder actions
         foreach ($repeat_issues as $issue) {
             if (Reminder::isDebug()) {
                 echo "  - Adding repeated issue '" . $issue . "' to the list of already triggered issues\n";
             }
             $triggered_issues[] = $issue;
         }
     }
     if (count($issues) > 0) {
         foreach ($issues as $issue) {
             if (Reminder::isDebug()) {
                 echo "  - Processing issue '" . $issue . "'\n";
             }
 $found = 0;
 for ($y = 0; $y < count($reminders[$i]['actions']); $y++) {
     if (Reminder::isDebug()) {
         echo "Processing Reminder Action '" . $reminders[$i]['actions'][$y]['rma_title'] . "'\n";
     }
     $conditions = Reminder_Condition::getList($reminders[$i]['actions'][$y]['rma_id']);
     if (count($conditions) == 0) {
         if (Reminder::isDebug()) {
             echo "  - Skipping Reminder because there were no reminder conditions found\n";
         }
         continue;
     }
     $issues = Reminder::getTriggeredIssues($reminders[$i], $conditions);
     // avoid repeating reminder actions, so get the list of issues
     // that were last triggered with this reminder action ID
     $repeat_issues = Reminder_Action::getRepeatActions($issues, $reminders[$i]['actions'][$y]['rma_id']);
     if (count($repeat_issues) > 0) {
         // add the repeated issues to the list of already triggered
         // issues, so they get ignored for the next reminder actions
         for ($w = 0; $w < count($repeat_issues); $w++) {
             if (Reminder::isDebug()) {
                 echo "  - Adding repeated issue '" . $repeat_issues[$w] . "' to the list of already triggered issues\n";
             }
             $triggered_issues[] = $repeat_issues[$w];
         }
     }
     if (count($issues) > 0) {
         for ($z = 0; $z < count($issues); $z++) {
             if (Reminder::isDebug()) {
                 echo "  - Processing issue '" . $issues[$z] . "'\n";
             }