4 * Patient Portal QuickStart
7 * @link http://www.open-emr.org
8 * @author Jerry Padgett <sjpadgett@gmail.com>
9 * @copyright Copyright (c) 2023 Jerry Padgett <sjpadgett@gmail.com>
10 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
13 require_once("verify_session.php");
15 $title = xlt("My Quickstarts");
17 $current_theme = sqlQuery("SELECT `setting_value` FROM `patient_settings` WHERE setting_patient = ? AND `setting_label` = ?", array($pid, 'portal_theme'))['setting_value'] ??
'';
19 use OpenEMR\Common\Csrf\CsrfUtils
;
20 use OpenEMR\Core\Header
;
24 <!-- Language grabbed by PDF
var that has the correct format
!-->
25 <html lang
="<?php echo $GLOBALS['pdf_language']; ?>">
27 <title
><?php
echo($title); ?
></title
>
28 <meta name
="description" content
="Patient Portal" />
29 <meta name
="author" content
="Dashboard | sjpadgett@gmail.com" />
31 Header
::setupHeader(['no_main-theme', 'portal-theme', 'datetime-picker']);
32 echo "<script>var cpid='" . attr($cpid ??
$pid) . "';var cuser='" . attr($cuser ??
'portal-user') . "';var webRoot='" . $GLOBALS['web_root'] . "';</script>";
34 <link href
="<?php echo $GLOBALS['web_root']; ?>/portal/sign/css/signer_modal.css?v=<?php echo $GLOBALS['v_js_includes']; ?>" rel
="stylesheet">
35 <script src
="<?php echo $GLOBALS['web_root']; ?>/portal/sign/assets/signature_pad.umd.js?v=<?php echo $GLOBALS['v_js_includes']; ?>"></script
>
36 <script src
="<?php echo $GLOBALS['web_root']; ?>/portal/sign/assets/signer_api.js?v=<?php echo $GLOBALS['v_js_includes']; ?>"></script
>
40 let ele
= parent
.document
.getElementById('topNav');
41 if ($
(parent
.document
.getElementById('topNav')).is('.collapse:not(.show)')) {
42 ele
.classList
.toggle('collapse');
44 // ensure top level shows in quickstart
45 $
(parent
.document
.getElementById('topNav')).removeClass("d-none");
46 $
("#my_theme").on('change', function (e
) {
47 let sel
= $
("#my_theme :selected").val();
48 persistPatientSetting(cpid
, 'portal_theme', sel
);
49 $
(parent
.document
.getElementById('homeRefresh')).click();
53 function persistPatientSetting(pid
, label
, setting
) {
54 fetch('lib/persist.php', {
57 'Content-Type': 'application/json'
61 'csrf_token_form': <?php
echo js_escape(CsrfUtils
::collectCsrfToken()); ?
>,
62 'setting_patient': pid
,
63 'setting_label': label
,
64 'setting_value': setting
72 <div
class="modal fade" id
="formdialog" tabindex
="-1" role
="dialog" aria
-hidden
="true">
73 <div
class="modal-dialog bg-light">
74 <div
class="modal-content">
75 <div
class="modal-header">
76 <h4
class="modal-title"><?php
echo xlt('About Portal Dashboard') ?
></h4
>
77 <button type
="button" class="close" data
-dismiss
="modal">×
;</button
>
79 <div
class="modal-body">
81 <span
><?php
echo xlt('Please see forum or wiki'); ?
>
82 <a href
="<?php echo attr('https://community.open-emr.org/'); ?>" target
="_blank"><?php
echo xlt("Visit Forum"); ?
></a
>
86 <div
class="modal-footer">
87 <button id
="okButton" data
-dismiss
="modal" class="btn btn-secondary"><?php
echo xlt('Close...') ?
></button
>
92 <div
class="container-xl p-3">
93 <div
class="jumbotron jumbotron-fluid text-center p-1">
94 <h3
><?php
echo xlt('My Quick Starts') ?
><i
class="fa fa-user text-danger ml-2" style
="font-size: 3rem;"></i
></h3
>
96 <button
class="btn btn-sm btn-secondary" data
-toggle
="modal" data
-target
="#formdialog"><?php
echo xlt('Tell me more') ?
></button
>
99 <div
class='jumbotron jumbotron-fluid p-4'>
100 <div
class="row" id
="inject_card">
102 <div
class="card d-flex mr-1 mb-1">
103 <div
class="card-body">
104 <h4
class="card-title"><i
class="fa fa-file-text mr-1"></i
><?php
echo xlt('My Documents') ?
></h4
>
105 <a
class="btn btn-success" href
="<?php echo $GLOBALS['web_root']; ?>/portal/patient/onsitedocuments?pid=<?php echo attr_url($pid); ?>"><?php
echo xlt('Manage Documents') ?
></a
>
109 <div
class="card d-flex mr-1 mb-1">
110 <div
class="card-body">
111 <h4
><i
class="card-title fa fa-signature mr-1"></i
><?php
echo xlt('Signature') ?
></h4
>
112 <a data
-type
="patient-signature" class="btn btn-primary" href
="#openSignModal" data
-toggle
="modal" data
-backdrop
="true" data
-target
="#openSignModal"><?php
echo xlt('Manage Signature'); ?
></a
>
116 <div
class="card d-flex mr-1 mb-1">
117 <div
class="card-body row">
118 <h4
class="card-title"><i
class="fa fa-link mr-1"></i
><?php
echo xlt('Settings') ?
></h4
>
119 <div
class="col-12 form-group">
121 <div
class="input-group">
122 <label
class="m-0" for='my_theme'><?php
echo xlt('Current Theme') ?
></label
>
123 <select
class='form-control ml-2' id
='my_theme'>
125 $theme_dir = "$webserver_root/public/themes";
127 $patternStyle = 'style_';
128 $dh = opendir($theme_dir);
131 $styleArray = array();
132 while (false !== ($tfname = readdir($dh))) {
133 $patternStyle = 'style_';
135 $tfname == 'style_blue.css' ||
136 $tfname == 'style_pdf.css' ||
137 !preg_match("/^" . $patternStyle . ".*\.css$/", $tfname)
141 $styleDisplayName = str_replace("_", " ", substr($tfname, 6));
142 $styleDisplayName = ucfirst(str_replace(".css", "", $styleDisplayName));
143 $styleArray[$tfname] = $styleDisplayName;
146 // Generate style selector
147 foreach ($styleArray as $styleKey => $styleValue) {
148 echo "<option value='" . attr($styleKey) . "'";
149 if ($styleKey == $current_theme) {
153 echo text($styleValue);
160 <div
class="input-group-append">
161 <a
class="btn btn-primary" href
="./home.php" target
="_parent"><?php
echo xlt('Apply') ?
></a
>
166 <div
class="form-group form-check">
167 <input type
="checkbox" class="form-check-input" id
="exampleCheck1">
168 <label
class="form-check-label" for="exampleCheck1"><?php
echo xlt('Auto Save Documents') . " (Coming soon)" ?
></label
>