@@ 393-421 (lines=29) @@ | ||
390 | break; |
|
391 | ||
392 | // Reminder is dedicated to records submitters. |
|
393 | case REMINDER_FLAG_AUTHOR: |
|
394 | ||
395 | $rs = dal_query('reminders/alista.sql', $reminder['state_id']); |
|
396 | ||
397 | while (($row = $rs->fetch())) |
|
398 | { |
|
399 | $records = dal_query('reminders/rlista.sql', $reminder['state_id'], $row['account_id']); |
|
400 | ||
401 | if ($records->rows == 0) |
|
402 | { |
|
403 | debug_write_log(DEBUG_NOTICE, '[reminder_send] Reminder is empty and will not be sent.'); |
|
404 | } |
|
405 | else |
|
406 | { |
|
407 | $message = reminder_message($records, $row['locale']); |
|
408 | ||
409 | if (EMAIL_NOTIFICATIONS_ENABLED) |
|
410 | { |
|
411 | debug_write_log(DEBUG_NOTICE, '[reminder_send] Sending email.'); |
|
412 | sendmail($account['fullname'], $account['email'], $row['email'], $reminder['subject_text'], $message); |
|
413 | } |
|
414 | else |
|
415 | { |
|
416 | debug_write_log(DEBUG_NOTICE, '[reminder_send] Email notifications are disabled.'); |
|
417 | } |
|
418 | } |
|
419 | } |
|
420 | ||
421 | break; |
|
422 | ||
423 | // Reminder is dedicated to current records assignees. |
|
424 | case REMINDER_FLAG_RESPONSIBLE: |
|
@@ 424-452 (lines=29) @@ | ||
421 | break; |
|
422 | ||
423 | // Reminder is dedicated to current records assignees. |
|
424 | case REMINDER_FLAG_RESPONSIBLE: |
|
425 | ||
426 | $rs = dal_query('reminders/alistr.sql', $reminder['state_id']); |
|
427 | ||
428 | while (($row = $rs->fetch())) |
|
429 | { |
|
430 | $records = dal_query('reminders/rlistr.sql', $reminder['state_id'], $row['account_id']); |
|
431 | ||
432 | if ($records->rows == 0) |
|
433 | { |
|
434 | debug_write_log(DEBUG_NOTICE, '[reminder_send] Reminder is empty and will not be sent.'); |
|
435 | } |
|
436 | else |
|
437 | { |
|
438 | $message = reminder_message($records, $row['locale']); |
|
439 | ||
440 | if (EMAIL_NOTIFICATIONS_ENABLED) |
|
441 | { |
|
442 | debug_write_log(DEBUG_NOTICE, '[reminder_send] Sending email.'); |
|
443 | sendmail($account['fullname'], $account['email'], $row['email'], $reminder['subject_text'], $message); |
|
444 | } |
|
445 | else |
|
446 | { |
|
447 | debug_write_log(DEBUG_NOTICE, '[reminder_send] Email notifications are disabled.'); |
|
448 | } |
|
449 | } |
|
450 | } |
|
451 | ||
452 | break; |
|
453 | ||
454 | default: |
|
455 |