From 26ef93cf5e7d881edd5a683d11ded2674dfab3c7 Mon Sep 17 00:00:00 2001 From: Jerry Padgett Date: Mon, 2 Sep 2024 09:22:35 -0400 Subject: [PATCH] Auto-create encounter reason flag and some forgotten fixes. (#7681) * Auto-create encounter reason flag and some forgotten fixes. remove purifier global property new global in Calender to prevent using appointmnet comment as new visit reason. refactor encounter report twig to have visit reason on it's own line instead of header. * oops! new config global for appointment comment * revert cron job for sms/email reminders to correct script * add jsGlobals from main.php to portal for issue #7688 * set default portal appointment category duration to 15 minutes for categories where a duration is not set. Otherwise calendar timeslot appears as a line. * Add past appointments view limit max appointments to 10 refactor limit reached message to a card * spelling * Normalize category path/title to an acceptable category class name get_patient_documents --- .../newpatient/templates/report.html.twig | 8 +- .../library/rc_sms_notification.php | 253 +++++++++--------- library/encounter_events.inc.php | 3 + library/globals.inc.php | 7 + portal/add_edit_event_user.php | 4 +- portal/get_patient_documents.php | 7 +- portal/home.php | 48 +++- src/Services/AppointmentService.php | 6 +- .../DocumentTemplateRender.php | 1 - templates/portal/appointment-item.html.twig | 2 + templates/portal/home.html.twig | 7 + .../partial/cards/_appointment_card.html.twig | 42 ++- 12 files changed, 246 insertions(+), 142 deletions(-) diff --git a/interface/forms/newpatient/templates/report.html.twig b/interface/forms/newpatient/templates/report.html.twig index ac17bb1b071..3e1c4b48321 100644 --- a/interface/forms/newpatient/templates/report.html.twig +++ b/interface/forms/newpatient/templates/report.html.twig @@ -1,13 +1,15 @@
{% for e in encounters %} {% set _reason = (e.reason) ? " - " ~ e.reason|text|nl2br : "" %} -

{{ e.category|text }}{{ _reason }}

-
{{ e.provider|text }} ({{ e.facility|text }})
+

{{ e.category|text }}

+ {{ "Reason For Visit"|xlt }}{{ _reason }} +
{{ e.provider|text }} ({{ e.facility|text }})
{% if e.posCode %} {{ "POS Code"|xlt }} - {{ e.posCode|text }} {% endif %} {% if e.referringProvider %} -
{{ "Referring Provider"|xlt }} - {{ e.referringProvider|text }} +
{{ "Referring Provider"|xlt }} - {{ e.referringProvider|text }} {% endif %} + {% endfor %}
diff --git a/interface/modules/custom_modules/oe-module-faxsms/library/rc_sms_notification.php b/interface/modules/custom_modules/oe-module-faxsms/library/rc_sms_notification.php index 1e44eeedef3..c17eb0e7172 100644 --- a/interface/modules/custom_modules/oe-module-faxsms/library/rc_sms_notification.php +++ b/interface/modules/custom_modules/oe-module-faxsms/library/rc_sms_notification.php @@ -115,142 +115,144 @@ $db_sms_msg['sms_gateway_type'] = "SMS"; $db_sms_msg['message'] = $MESSAGE; ?> - - - - <?php echo xlt("SMS Notification") ?> - - + + + + <?php echo xlt("Notifications") ?> + + + - +
-
-

-

-
- " . xlt('Total of') . ": " . count($db_patient ?? []) . " " . xlt('Reminders Found') . " " . ($bTestRun ? xlt("and will be sending for reminders") . " " : xlt("and Sending for reminders ")) . ' ' . text($SMS_NOTIFICATION_HOUR) . ' ' . xlt("hrs from now."); +

+

+
+ " . xlt('Total of') . ": " . count($db_patient ?? []) . " " . xlt('Reminders Found') . " " . ($bTestRun ? xlt("and will be sending for reminders") . " " : xlt("and Sending for reminders ")) . ' ' . text($SMS_NOTIFICATION_HOUR) . ' ' . xlt("hrs from now."); + ob_flush(); + flush(); + // for every event found + $plast = ''; + echo "

======================== " . text($TYPE) . " | " . text(date("Y-m-d H:i:s")) . " =========================

"; + for ($p = 0; $p < count($db_patient); $p++) { ob_flush(); flush(); - // for every event found - $plast = ''; - echo "

======================== " . text($TYPE) . " | " . text(date("Y-m-d H:i:s")) . " =========================

"; - for ($p = 0; $p < count($db_patient); $p++) { - ob_flush(); - flush(); - $prow = $db_patient[$p]; - $db_sms_msg['sms_gateway_type'] = "RCSMS"; - $db_sms_msg['message'] = $MESSAGE; - - $app_date = $prow['pc_eventDate'] . " " . $prow['pc_startTime']; - $app_time = strtotime($app_date); - - $app_time_hour = round($app_time / 3600); - $curr_total_hour = round(time() / 3600); - - $remaining_app_hour = round($app_time_hour - $curr_total_hour); - $remain_hour = round($remaining_app_hour - $SMS_NOTIFICATION_HOUR); - - if ($plast != $prow['ulname']) { - echo "

" . xlt("For Provider") . ": " . text($prow['utitle']) . ' ' . text($prow['ufname']) . ' ' . text($prow['ulname']) . "

"; - $plast = $prow['ulname']; - } - $strMsg = "* " . xlt("SEND NOTIFICATION BEFORE:") . text($SMS_NOTIFICATION_HOUR) . " | " . xlt("CRONJOB RUNS EVERY:") . text($CRON_TIME) . " | " . xlt("APPOINTMENT DATE TIME") . ': ' . $app_date . " | " . xlt("APPOINTMENT REMAINING HOURS") . ": " . text($remaining_app_hour) . " | " . xlt("SEND ALERT AFTER") . ': ' . text($remain_hour) . ""; + $prow = $db_patient[$p]; + $db_sms_msg['sms_gateway_type'] = "RCSMS"; + $db_sms_msg['message'] = $MESSAGE; + + $app_date = $prow['pc_eventDate'] . " " . $prow['pc_startTime']; + $app_time = strtotime($app_date); + + $app_time_hour = round($app_time / 3600); + $curr_total_hour = round(time() / 3600); - // check in the interval - if ($remain_hour >= -($CRON_TIME) && $remain_hour <= $CRON_TIME) { - //set message - $db_sms_msg['message'] = cron_SetMessage($prow, $db_sms_msg); + $remaining_app_hour = round($app_time_hour - $curr_total_hour); + $remain_hour = round($remaining_app_hour - $SMS_NOTIFICATION_HOUR); + + if ($plast != $prow['ulname']) { + echo "

" . xlt("For Provider") . ": " . text($prow['utitle']) . ' ' . text($prow['ufname']) . ' ' . text($prow['ulname']) . "

"; + $plast = $prow['ulname']; + } + $strMsg = "* " . xlt("SEND NOTIFICATION BEFORE:") . text($SMS_NOTIFICATION_HOUR) . " | " . xlt("CRONJOB RUNS EVERY:") . text($CRON_TIME) . " | " . xlt("APPOINTMENT DATE TIME") . ': ' . $app_date . " | " . xlt("APPOINTMENT REMAINING HOURS") . ": " . text($remaining_app_hour) . " | " . xlt("SEND ALERT AFTER") . ': ' . text($remain_hour) . ""; + + // check in the interval + if ($remain_hour >= -($CRON_TIME) && $remain_hour <= $CRON_TIME) { + //set message + $db_sms_msg['message'] = cron_SetMessage($prow, $db_sms_msg); + // send sms to patient - if not in test mode + if ($TYPE == 'SMS' && $clientApp != null) { + $isValid = isValidPhone($prow['phone_cell']); // send sms to patient - if not in test mode - if ($bTestRun == 0) { - cron_InsertNotificationLogEntry($TYPE, $prow, $db_sms_msg); - if ($TYPE == 'SMS' && $clientApp != null) { - $isValid = isValidPhone($prow['phone_cell']); - if ($isValid) { - $error = $clientApp->sendSMS( - $prow['phone_cell'] ?? '', - $db_sms_msg['email_subject'] ?? '', - $db_sms_msg['message'] ?? '', - $db_sms_msg['email_sender'] ?? '' - ); - if (stripos($error, 'error') !== false) { - $strMsg .= " | " . xlt("Error:") . " " . text($error) . ""; - echo(nl2br($strMsg)); - exit; - } - } - if (!$isValid) { - $strMsg .= "\n* " . xlt("INVALID Mobile Phone#") . text('$prow["phone_cell"]') . " " . xlt("SMS NOT SENT Patient") . ":" . text($prow['fname']) . " " . text($prow['lname']) . ""; - $db_sms_msg['message'] = xlt("Error: INVALID Mobile Phone") . '# ' . text($prow['phone_cell']) . xlt("SMS NOT SENT For") . ": " . text($prow['fname']) . " " . text($prow['lname']); - if ($bTestRun == 0) { - cron_InsertNotificationLogEntry($TYPE, $prow, $db_sms_msg); - } - } else { - $strMsg .= " | " . xlt("SMS SENT SUCCESSFULLY TO") . " " . text($prow['phone_cell']) . ""; - cron_UpdateEntry($TYPE, $prow['pid'], $prow['pc_eid'], $prow['pc_recurrtype']); - } - if ((int)$prow['pc_recurrtype'] > 0) { - $row = fetchRecurrences($prow['pid']); - $strMsg .= "\n" . xlt("A Recurring") . " " . text($row[0]['pc_catname']) . " " . xlt("Event Occuring") . " " . text($row[0]['pc_recurrspec']) . ""; - } - $strMsg .= "\n" . text($db_sms_msg['message']) . "\n"; + if ($bTestRun == 0 && $isValid) { + $error = $clientApp->sendSMS( + $prow['phone_cell'] ?? '', + $db_sms_msg['email_subject'] ?? '', + $db_sms_msg['message'] ?? '', + $db_sms_msg['email_sender'] ?? '' + ); + if (stripos($error, 'error') !== false) { + $strMsg .= " | " . xlt("Error:") . " " . text($error) . " \n"; echo(nl2br($strMsg)); + continue; + } else { + cron_InsertNotificationLogEntry($TYPE, $prow, $db_sms_msg); } - if ($TYPE == 'EMAIL' && $emailApp != null) { - $isValid = $emailApp->validEmail($prow['email']); - if ($isValid) { - try { - $error = $emailApp->emailReminder( - $prow['email'] ?? '', - $db_sms_msg['message'], - ); - } catch (\PHPMailer\PHPMailer\Exception $e) { - $error = 'Error' . ' ' . $e->getMessage(); - } - if (stripos($error, 'error') !== false) { - $strMsg .= " | " . xlt("Error:") . " " . text($error) . ""; - echo(nl2br($strMsg)); - exit; - } - } - if (!$isValid) { - $strMsg .= "\n* " . xlt("INVALID Email") . text('$prow["email"]') . " " . xlt("EMAIL NOT SENT Patient") . ":" . text($prow['fname']) . " " . text($prow['lname']) . ""; - $db_sms_msg['message'] = xlt("Error: INVALID EMAIL") . '# ' . text($prow['email']) . xlt("EMAIL NOT SENT For") . ": " . text($prow['fname']) . " " . text($prow['lname']); - if ($bTestRun == 0) { - cron_InsertNotificationLogEntry($TYPE, $prow, $db_sms_msg); - } - } else { - $strMsg .= " | " . xlt("EMAILED SUCCESSFULLY TO") . " " . text($prow['email']) . ""; - cron_UpdateEntry($TYPE, $prow['pid'], $prow['pc_eid'], $prow['pc_recurrtype']); - } - if ((int)$prow['pc_recurrtype'] > 0) { - $row = fetchRecurrences($prow['pid']); - $strMsg .= "\n" . xlt("A Recurring") . " " . text($row[0]['pc_catname']) . " " . xlt("Event Occuring") . " " . text($row[0]['pc_recurrspec']) . ""; - } - $strMsg .= "\n" . text($db_sms_msg['message']) . "\n"; + } + if (!$isValid) { + $strMsg .= "\n* " . xlt("INVALID Mobile Phone#") . text('$prow["phone_cell"]') . " " . xlt("SMS NOT SENT Patient") . ":" . text($prow['fname']) . " " . text($prow['lname']) . ""; + $db_sms_msg['message'] = xlt("Error: INVALID Mobile Phone") . '# ' . text($prow['phone_cell']) . xlt("SMS NOT SENT For") . ": " . text($prow['fname']) . " " . text($prow['lname']); + if ($bTestRun == 0) { + cron_InsertNotificationLogEntry($TYPE, $prow, $db_sms_msg); + } + } else { + $strMsg .= " | " . xlt("SMS SENT SUCCESSFULLY TO") . " " . text($prow['phone_cell']) . ""; + cron_UpdateEntry($TYPE, $prow['pid'], $prow['pc_eid'], $prow['pc_recurrtype']); + } + if ((int)$prow['pc_recurrtype'] > 0) { + $row = fetchRecurrences($prow['pid']); + $strMsg .= "\n" . xlt("A Recurring") . " " . text($row[0]['pc_catname']) . " " . xlt("Event Occurring") . " " . text($row[0]['pc_recurrspec']) . ""; + } + $strMsg .= "\n" . text($db_sms_msg['message']) . "\n"; + echo(nl2br($strMsg)); + } + if ($TYPE == 'EMAIL' && $emailApp != null) { + $isValid = $emailApp->validEmail($prow['email']); + if ($bTestRun == 0 && $isValid) { + try { + $error = $emailApp->emailReminder( + $prow['email'] ?? '', + $db_sms_msg['message'], + ); + } catch (\PHPMailer\PHPMailer\Exception $e) { + $error = 'Error' . ' ' . $e->getMessage(); + } + if (stripos($error, 'error') !== false) { + $strMsg .= " | " . xlt("Error:") . " " . text($error) . "\n"; echo(nl2br($strMsg)); + continue; + } else { + cron_InsertNotificationLogEntry($TYPE, $prow, $db_sms_msg); + } + } + if (!$isValid) { + $strMsg .= "\n* " . xlt("INVALID Email") . text('$prow["email"]') . " " . xlt("EMAIL NOT SENT Patient") . ":" . text($prow['fname']) . " " . text($prow['lname']) . ""; + $db_sms_msg['message'] = xlt("Error: INVALID EMAIL") . '# ' . text($prow['email']) . xlt("EMAIL NOT SENT For") . ": " . text($prow['fname']) . " " . text($prow['lname']); + if ($bTestRun == 0) { + cron_InsertNotificationLogEntry($TYPE, $prow, $db_sms_msg); } + } else { + $strMsg .= " | " . xlt("EMAILED SUCCESSFULLY TO") . " " . text($prow['email']) . ""; + cron_UpdateEntry($TYPE, $prow['pid'], $prow['pc_eid'], $prow['pc_recurrtype']); } + if ((int)$prow['pc_recurrtype'] > 0) { + $row = fetchRecurrences($prow['pid']); + $strMsg .= "\n" . xlt("A Recurring") . " " . text($row[0]['pc_catname']) . " " . xlt("Event Occurring") . " " . text($row[0]['pc_recurrspec']) . ""; + } + $strMsg .= "\n" . text($db_sms_msg['message']) . "\n"; + echo(nl2br($strMsg)); } } - unset($clientApp); - unset($emailApp); - echo "

" . xlt("Done!") . "

"; - ?> -
- - -

" . xlt("Done!") . "

"; + ?> + + + +'' AND e.pc_sendalertsms != 'YES' AND e.pc_apptstatus != 'x')"; + if ($TYPE == 'EMAIL') { + $where = " AND (p.hipaa_allowemail='YES' AND p.email<>'' AND e.pc_sendalertemail != 'YES' AND e.pc_apptstatus != 'x')"; + } $adj_date = date("h") + $SMS_NOTIFICATION_HOUR; $check_date = date("Y-m-d", mktime($adj_date, 0, 0, date("m"), date("d"), date("Y"))); $patient_array = fetchEvents($check_date, $check_date, $where, 'u.lname,pc_startTime,p.lname'); diff --git a/library/encounter_events.inc.php b/library/encounter_events.inc.php index 91a63090a0a..b4c06194bfb 100644 --- a/library/encounter_events.inc.php +++ b/library/encounter_events.inc.php @@ -78,6 +78,9 @@ function todaysEncounterCheck($patient_id, $enc_date = '', $reason = '', $fac_id $dos = $enc_date ? $enc_date : $today; $visit_reason = $reason ? $reason : xl('Please indicate visit reason'); + if (!empty($GLOBALS['auto_create_prevent_reason'] ?? 0)) { + $visit_reason = 'Please indicate visit reason'; + } $tmprow = sqlQuery("SELECT username, facility, facility_id FROM users WHERE id = ?", array($_SESSION["authUserID"])); $username = $tmprow['username']; $facility = $tmprow['facility']; diff --git a/library/globals.inc.php b/library/globals.inc.php index 64721494245..156f80445e7 100644 --- a/library/globals.inc.php +++ b/library/globals.inc.php @@ -1897,6 +1897,13 @@ function gblTimeZones() xl('The appointment status changes and encounter creations are managed through the Patient Tracker.') ), + 'auto_create_prevent_reason' => array( + xl('Prevent Appointment Comment as Visit Reason'), + 'bool', // data type + '0', // default + xl('Check this if you do not want to allow the appointments comment as the visit reason when auto-creating new encounter for appointment.') + ), + 'allow_early_check_in' => array( xl('Allow Early Check In'), 'bool', // data type diff --git a/portal/add_edit_event_user.php b/portal/add_edit_event_user.php index 63a09c30f36..d4cfb830545 100644 --- a/portal/add_edit_event_user.php +++ b/portal/add_edit_event_user.php @@ -761,7 +761,7 @@ function change_provider() { var f = document.forms.namedItem("theaddform"); // use today's date but reset everything else when changing providers so we can - // search on availability. + // search on availability. jsGlobals['date_display_format'] f.form_date.value = window.top.oeFormatters.I18NDateFormat(new Date()); f.form_hour.value = ''; f.form_minute.value = ''; @@ -804,7 +804,7 @@ function set_category() { if (s.selectedIndex >= 0) { var catid = s.options[s.selectedIndex].value; f.form_title.value = s.options[s.selectedIndex].text; - f.form_duration.value = durations[catid]; + f.form_duration.value = durations[catid] || '15'; set_display(); } } diff --git a/portal/get_patient_documents.php b/portal/get_patient_documents.php index f7eca081574..386560d0a64 100644 --- a/portal/get_patient_documents.php +++ b/portal/get_patient_documents.php @@ -125,20 +125,21 @@ function validateForm(event) { } else { $normalizedTitle = $title; } + $normalizedCategory = preg_replace('/[^a-zA-Z0-9]/', '', $title); ?>
- - + +
- + diff --git a/portal/home.php b/portal/home.php index 7deaa2415a3..c269aeb08a6 100644 --- a/portal/home.php +++ b/portal/home.php @@ -71,10 +71,11 @@ $isEasyPro = $GLOBALS['easipro_enable'] && !empty($GLOBALS['easipro_server']) && !empty($GLOBALS['easipro_name']); $current_date2 = date('Y-m-d'); -$apptLimit = 30; +$apptLimit = 10; $appts = fetchNextXAppts($current_date2, $pid, $apptLimit); +$past_appts = fetchXPastAppts($pid, 10); -$appointments = array(); +$appointments = $past_appointments = array(); if ($appts) { $stringCM = '(' . xl('Comments field entry present') . ')'; $stringR = '(' . xl('Recurring appointment') . ')'; @@ -113,7 +114,44 @@ $appointments[] = $filteredEvent->getAppointment() ?? $formattedRecord; } } +if ($past_appts) { + $stringCM = '(' . xl('Comments field entry present') . ')'; + $stringR = '(' . xl('Recurring appointment') . ')'; + $pastCount = 0; + foreach ($past_appts as $row) { + $status_title = getListItemTitle('apptstat', $row['pc_apptstatus']); + $pastCount++; + $dayname = xl(date('l', strtotime($row['pc_eventDate']))); + $dispampm = 'am'; + $disphour = (int)substr($row['pc_startTime'], 0, 2); + $dispmin = substr($row['pc_startTime'], 3, 2); + if ($disphour >= 12) { + $dispampm = 'pm'; + if ($disphour > 12) { + $disphour -= 12; + } + } + + if ($row['pc_hometext'] != '') { + $etitle = xl('Comments') . ': ' . $row['pc_hometext'] . "\r\n"; + } else { + $etitle = ''; + } + $formattedRecord = [ + 'appointmentDate' => $dayname . ', ' . oeFormatShortDate($row['pc_eventDate']) . ' ' . $disphour . ':' . $dispmin . ' ' . $dispampm, + 'appointmentType' => xl('Type') . ': ' . $row['pc_catname'], + 'provider' => xl('Provider') . ': ' . $row['ufname'] . ' ' . $row['ulname'], + 'status' => xl('Status') . ': ' . $status_title, + 'mode' => (int)$row['pc_recurrtype'] > 0 ? 'recurring' : $row['pc_recurrtype'], + 'icon_type' => (int)$row['pc_recurrtype'] > 0, + 'etitle' => $etitle, + 'pc_eid' => $row['pc_eid'], + ]; + $filteredEvent = $GLOBALS['kernel']->getEventDispatcher()->dispatch(new AppointmentFilterEvent($row, $formattedRecord), AppointmentFilterEvent::EVENT_NAME); + $past_appointments[] = $filteredEvent->getAppointment() ?? $formattedRecord; + } +} $current_theme = sqlQuery("SELECT `setting_value` FROM `patient_settings` WHERE setting_patient = ? AND `setting_label` = ?", array($pid, 'portal_theme'))['setting_value'] ?? ''; function collectStyles(): array { @@ -301,9 +339,11 @@ function buildNav($newcnt, $pid, $result): array 'csrfUtils' => CsrfUtils::collectCsrfToken(), 'isEasyPro' => $isEasyPro, 'appointments' => $appointments, + 'pastAppointments' => $past_appointments, 'appts' => $appts, 'appointmentLimit' => $apptLimit, 'appointmentCount' => $count ?? null, + 'pastAppointmentCount' => $pastCount ?? null, 'displayLimitLabel' => xl('Display limit reached'), 'site_id' => $_SESSION['site_id'] ?? ($_GET['site'] ?? 'default'), // one way or another, we will have a site_id. 'portal_timeout' => $GLOBALS['portal_timeout'] ?? 1800, // timeout is in seconds @@ -313,6 +353,10 @@ function buildNav($newcnt, $pid, $result): array 'ccdaOk' => $ccdaOk, 'allow_custom_report' => $GLOBALS['allow_custom_report'] ?? '0', 'immunRecords' => $immunRecords, + 'languageDirection' => $_SESSION['language_direction'] ?? 'ltr', + 'dateDisplayFormat' => $GLOBALS['date_display_format'], + 'timezone' => $GLOBALS['gbl_time_zone'] ?? '', + 'assetVersion' => $GLOBALS['v_js_includes'], 'eventNames' => [ 'sectionRenderPost' => RenderEvent::EVENT_SECTION_RENDER_POST, 'scriptsRenderPre' => RenderEvent::EVENT_SCRIPTS_RENDER_PRE, diff --git a/src/Services/AppointmentService.php b/src/Services/AppointmentService.php index 81ea8db4bcf..0fae93b8ff2 100644 --- a/src/Services/AppointmentService.php +++ b/src/Services/AppointmentService.php @@ -615,6 +615,10 @@ public function createEncounterForAppointment($eid) [$appointment['pc_facility']] ); + $visit_reason = $appointment['pc_hometext'] ?? xl('Please indicate visit reason'); + if (!empty($GLOBALS['auto_create_prevent_reason'] ?? 0)) { + $visit_reason = 'Please indicate visit reason'; + } $data = [ 'pc_catid' => $appointment['pc_catid'] // TODO: where would we get this information if it wasn't defaulted to ambulatory? Should this be a globals setting? @@ -623,7 +627,7 @@ public function createEncounterForAppointment($eid) ,'puuid' => $patientUuid ,'pid' => $appointment['pid'] ,'provider_id' => $user['id'] - ,'reason' => $appointment['pc_hometext'] ?? xl('Please indicate visit reason') + ,'reason' => $visit_reason ,'facility_id' => $appointment['pc_facility'] ,'billing_facility' => $appointment['pc_billing_location'] ,'pos_code' => $pos_code diff --git a/src/Services/DocumentTemplates/DocumentTemplateRender.php b/src/Services/DocumentTemplates/DocumentTemplateRender.php index aef99452000..abbec7f2c2e 100644 --- a/src/Services/DocumentTemplates/DocumentTemplateRender.php +++ b/src/Services/DocumentTemplates/DocumentTemplateRender.php @@ -121,7 +121,6 @@ public function doRender($template_id, $template_content = null, $json_data = nu } $config->set('Cache.SerializerPath', $purifyTempFile); $config->set('Core.Encoding', 'UTF-8'); - $config->set('CSS.AllowedProperties', '*'); $purify = new HTMLPurifier($config); $edata = $purify->purify($template); // Purify escapes URIs. diff --git a/templates/portal/appointment-item.html.twig b/templates/portal/appointment-item.html.twig index a5e13d18197..be671ba7304 100644 --- a/templates/portal/appointment-item.html.twig +++ b/templates/portal/appointment-item.html.twig @@ -1,8 +1,10 @@
+ {% if past == false %} + {% endif %}

diff --git a/templates/portal/home.html.twig b/templates/portal/home.html.twig index 6590c2ddd9b..dfc007bd21a 100644 --- a/templates/portal/home.html.twig +++ b/templates/portal/home.html.twig @@ -54,6 +54,13 @@ tab_mode = true, isPortal = 1; + var jsLanguageDirection = {{ languageDirection | js_escape }}; + var jsGlobals = { + languageDirection: jsLanguageDirection, + date_display_format: {{ dateDisplayFormat | js_escape }}, + timezone: {{ timezone | js_escape }}, + assetVersion: {{ assetVersion | js_escape }} + }; function restoreSession() { return true; } diff --git a/templates/portal/partial/cards/_appointment_card.html.twig b/templates/portal/partial/cards/_appointment_card.html.twig index 25d6676955c..43028e7cd39 100644 --- a/templates/portal/partial/cards/_appointment_card.html.twig +++ b/templates/portal/partial/cards/_appointment_card.html.twig @@ -50,19 +50,23 @@ dialog.ajax(params); } -

+
-

{{ 'Appointments' | xlt }}

+

{{ 'Future Appointments' | xlt }}

{% if appointments|length > 0 %} {% for appt in appointments %} - {% include 'portal/appointment-item.html.twig' with {appt: appt} %} + {% include 'portal/appointment-item.html.twig' with {appt: appt, past: false} %} {% endfor %} {% if appointmentLimit == appointmentCount %} -

{{ 'Display limit reached' | xlt }} -
- {{ 'More appointments may exist' | xlt }}

+
+
+
{{ 'Display limit reached' | xlt }} +
+ {{ 'More upcoming appointments may exist' | xlt }}
+
+
{% endif %} {% else %}
@@ -70,8 +74,32 @@
{% endif %}
- +
+

{{ 'Past Appointments' | xlt }}

+
+ {% if pastAppointments|length > 0 %} + {% for appt in pastAppointments %} + {% include 'portal/appointment-item.html.twig' with {appt: appt, past: true} %} + {% endfor %} + + {% if appointmentLimit == pastAppointmentCount %} +
+
+
{{ 'Display limit reached' | xlt }} +
+ {{ 'More past appointments may exist' | xlt }}
+
+
+ {% endif %} + {% else %} +
+
{{ 'No Past Appointments' | xlt }}
+
+ {% endif %} +
+