Example #1
0
\Locale::setDefault($SESSION->lang);
$l10n->setLanguage($SESSION->lang);
//============================================================================================
// Model
//============================================================================================
$follow = new \Ventus\Specialist\FollowUps($dbo);
//============================================================================================
// Load the content
//============================================================================================
if (!isset($_GET['page'])) {
    $render = true;
    if ($_GET['for'] === "employee") {
        $followups = $follow->listFollowUpsEmployee($SESSION->user_id);
    }
    foreach ($followups as $key => $f) {
        $recipients = $follow->listFollowUpRecipients($f['follow_up_id']);
        $recipient_string = "";
        foreach ($recipients as $r) {
            $recipient_string .= $r['first_name'] . ' ' . $r['last_name'] . ', ';
        }
        $followups[$key]['recipients'] = $recipient_string;
    }
    $emps = \Ventus\Utilities\Functions::listEmployees(SERVICE_ID_ACCESS);
    $l10n->addResource(FS_SPECIALIST . '/l10n/follow-ups.json');
    $viewFile = '../specialist/views/follow-ups.php';
} elseif ($_GET['page'] === "add") {
    $follow->addFollowUp($_POST, $_POST['message'], $_POST['to_emp_class'], $_POST['to_emp_val'], "employee");
    $loggers['audit']->info("Follow-up added");
} elseif ($_GET['page'] === "switch") {
    $follow->switchStatus($SESSION->user_id, $_POST['follow_up_id'], $_POST['completion_status']);
    $loggers['audit']->info("Follow-up {$_POST['follow_up_id']} completion status changed to {$_POST['completion_status']}");