From e826edc79a413a91084ea6080d84ad86516edd89 Mon Sep 17 00:00:00 2001 From: "JP-DEV\\sjpad" Date: Sat, 8 Feb 2020 07:48:18 -0500 Subject: [PATCH] Portal Fixes - add portal theme to gulp build - restructured patientportal-style to be compile for theme. - oe-sidebar auto height size. - clean up portal dashboard - clean up and fix dashboard patient template UI. - patient document style - secure messaging style sidebar and pagination. also increase page size to 20 messages. - ongoing dependencies update to Header class management. --- gulpfile.js | 16 +- interface/themes/oe-common/oe-sidebar.scss | 16 +- ...tal-style.css => patientportal-style.scss} | 93 ++++- portal/import_template_ui.php | 339 +++++++++--------- portal/messaging/messages.php | 43 ++- .../OnsiteActivityViewListView.tpl.php | 4 +- .../templates/OnsiteDocumentListView.tpl.php | 8 +- portal/patient/templates/ProviderHome.tpl.php | 33 +- portal/patient/templates/_FormsHeader.tpl.php | 36 +- portal/patient/templates/_Header.tpl.php | 2 +- .../patient/templates/_ProviderHeader.tpl.php | 2 +- 11 files changed, 348 insertions(+), 244 deletions(-) rename interface/themes/{patientportal-style.css => patientportal-style.scss} (96%) diff --git a/gulpfile.js b/gulpfile.js index 176d2971d37..c6d0b79a031 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -35,6 +35,7 @@ let config = { // Source file locations src: { styles: { + style_portal: 'interface/themes/patientportal-style.scss', style_uni: 'interface/themes/oe-styles/style_*.scss', style_color: 'interface/themes/colors/*.scss', directional: 'interface/themes/directional.scss' @@ -71,6 +72,19 @@ const autoGeneratedHeader = ` */ `; +// standard themes css compilation +function styles_style_portal() { + return gulp.src(config.src.styles.style_portal) + .pipe(sourcemaps.init()) + .pipe(sass().on('error', sass.logError)) + .pipe(prefix('last 1 version')) + .pipe(gap.prependText(autoGeneratedHeader)) + .pipe(gulpif(!config.dev, csso())) + .pipe(gulpif(!config.dev, sourcemaps.write())) + .pipe(gulp.dest(config.dest.themes)) + .pipe(gulpif(config.dev && config.build, gulp.dest(config.dest.themes))) + .pipe(gulpif(config.dev, reload({ stream: true }))); +} // standard themes css compilation function styles_style_uni() { return gulp.src(config.src.styles.style_uni) @@ -134,7 +148,7 @@ function rtl_style_color() { } // compile themes -const styles = gulp.parallel(styles_style_uni, styles_style_color, rtl_style_uni, rtl_style_color); +const styles = gulp.parallel(styles_style_uni, styles_style_portal, styles_style_color, rtl_style_uni, rtl_style_color); // Copies (and distills, if possible) assets from node_modules to public/assets function install(done) { diff --git a/interface/themes/oe-common/oe-sidebar.scss b/interface/themes/oe-common/oe-sidebar.scss index c3be42887c2..57602e3a139 100644 --- a/interface/themes/oe-common/oe-sidebar.scss +++ b/interface/themes/oe-common/oe-sidebar.scss @@ -5,7 +5,7 @@ * @link http://www.open-emr.org * @author Jerry Padgett * @author Tyler Wrenn - * @copyright Copyright (c) 2019 Jerry Padgett + * @copyright Copyright (c) 2020 Jerry Padgett * @copyright Copyright (c) 2020 Tyler Wrenn * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 */ @@ -37,8 +37,8 @@ /* if not a grid then main available */ main { - margin-left: 225px; - padding: 1rem 15px; + margin-left: 250px; + padding: 1rem 10px; width: 100%; } @@ -54,7 +54,7 @@ main { #nav-topbar .brand-container { /* Should match width of .nav-sidebar */ - width: 225px; + width: 250px; padding-left: 1rem; } @@ -83,8 +83,8 @@ main { .nav-sidebar { position: fixed; - height: 100%; - width: 225px; + height: unset; + width: 250px; top: 0; bottom: 0; left: 0; @@ -142,9 +142,9 @@ main { #nav-topbar .brand-container.active, .nav-sidebar.active { - width: 225px; + width: 250px; min-width: 30px; - max-width: 225px; + max-width: 250px; } .nav-sidebar.active .sidebar-content { diff --git a/interface/themes/patientportal-style.css b/interface/themes/patientportal-style.scss similarity index 96% rename from interface/themes/patientportal-style.css rename to interface/themes/patientportal-style.scss index a033363b1be..e8d2956384a 100644 --- a/interface/themes/patientportal-style.css +++ b/interface/themes/patientportal-style.scss @@ -4,15 +4,104 @@ * @package OpenEMR * @link https://www.open-emr.org * @author Jerry Padgett - * @copyright Copyright (c) 2016-2017 Jerry Padgett + * @copyright Copyright (c) 2016-2020 Jerry Padgett * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 */ -@import './../../../interface/themes/oe-common/oe-sidebar.scss'; /* Core: General style ---------------------------- */ +/* Default Colors */ +$blue: #007bff; +$indigo: #6610f2; +$purple: #6f42c1; +$pink: #e83e8c; +$red: #dc3545; +$orange: #fd7e14; +$yellow: #ffc107; +$green: #28a745; +$teal: #20c997; +$cyan: #17a2b8; +$white: #fff; +$black: #000; + +/* Default Grays */ +$gray-100: #f8f9fa; +$gray-200: #e9ecef; +$gray-300: #dee2e6; +$gray-400: #ced4da; +$gray-500: #adb5bd; +$gray-600: #868e96; +$gray-700: #495057; +$gray-800: #343a40; +$gray-900: #212529; + +/* Equivalents to bg-light/dark as well as default for gray */ +$light: $gray-100; +$dark: $gray-800; +$gray: $gray-600; + +/* Array of theme colors that can be added to */ +$theme-colors: ( + primary: $blue, + secondary: $gray-100, + success: $green, + info: $cyan, + warning: $yellow, + danger: $red, + light: $gray-100, + dark: $gray-800 +); + +/* Array of random colors that can be added to */ +$colors: ( + "blue": $blue, + "indigo": $indigo, + "purple": $purple, + "pink": $pink, + "red": $red, + "orange": $orange, + "yellow": $yellow, + "green": $green, + "teal": $teal, + "cyan": $cyan, + "white": $white, + "gray": $gray-600, + "gray-dark": $gray-800, + /* Overrides to allow regular CSS coloring */ + "black": $black, + "gray100": $gray-100, + "gray200": $gray-200, + "gray300": $gray-300, + "gray400": $gray-400, + "gray500": $gray-500, + "gray700": $gray-700, + "gray900": $gray-900 +); + +$body-bg: $white; +$body-color: $gray-900; +$font-family-sans-serif: "Lato", "Helvetica", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; +$font-size-base: 0.875rem; +$rfs-base-value: 0.875rem; +$font-family-base: $font-family-sans-serif; + +$close-color: $black; +$close-text-shadow: 0 1 0 $black; + +$enable-responsive-font-sizes: true; + +/*@import "../../public/assets/bootstrap/scss/bootstrap";*/ +@import "./../../public/assets/bootstrap/scss/vendor/rfs"; +@import "./oe-common/oe-sidebar.scss"; + +.btn-secondary { + background-color: rgba($black, .05) !important; + color: rgba($black, .87) !important; + border-color: $gray-500 !important; +} + /* Layouts */ .wrapper { min-height: 100%; diff --git a/portal/import_template_ui.php b/portal/import_template_ui.php index 41e9ab4be1c..ea9542850dd 100644 --- a/portal/import_template_ui.php +++ b/portal/import_template_ui.php @@ -6,7 +6,7 @@ * @link https://www.open-emr.org * @author Jerry Padgett * @author Brady Miller - * @copyright Copyright (c) 2016-2017 Jerry Padgett + * @copyright Copyright (c) 2016-2020 Jerry Padgett * @copyright Copyright (c) 2019 Brady Miller * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 */ @@ -17,26 +17,27 @@ $getdir = isset($_POST['sel_pt']) ? $_POST['sel_pt'] : 0; if ($getdir > 0) { - $tdir = $GLOBALS['OE_SITE_DIR'] . '/documents/onsite_portal_documents/templates/' . convert_safe_file_dir_name($getdir) . '/'; + $tdir = $GLOBALS['OE_SITE_DIR'] . '/documents/onsite_portal_documents/templates/' . convert_safe_file_dir_name($getdir) . '/'; if (!is_dir($tdir)) { if (!mkdir($tdir, 0755, true)) { die(xl('Failed to create folder')); } } } else { - $tdir = $GLOBALS['OE_SITE_DIR'] . '/documents/onsite_portal_documents/templates/'; + $tdir = $GLOBALS['OE_SITE_DIR'] . '/documents/onsite_portal_documents/templates/'; } function getAuthUsers() { $response = sqlStatement("SELECT patient_data.pid, Concat_Ws(' ', patient_data.fname, patient_data.lname) as ptname FROM patient_data WHERE allow_patient_portal = 'YES'"); - $resultpd = array (); + $resultpd = array(); while ($row = sqlFetchArray($response)) { $resultpd[] = $row; } return $resultpd; } + function getTemplateList($dir) { $retval = array(); @@ -52,17 +53,17 @@ function getTemplateList($dir) if (is_dir("$dir$entry")) { $retval[] = array( - 'pathname' => "$dir$entry", - 'name' => "$entry", - 'size' => 0, - 'lastmod' => filemtime("$dir$entry") + 'pathname' => "$dir$entry", + 'name' => "$entry", + 'size' => 0, + 'lastmod' => filemtime("$dir$entry") ); } elseif (is_readable("$dir$entry")) { $retval[] = array( - 'pathname' => "$dir$entry", - 'name' => "$entry", - 'size' => filesize("$dir$entry"), - 'lastmod' => filemtime("$dir$entry") + 'pathname' => "$dir$entry", + 'name' => "$entry", + 'size' => filesize("$dir$entry"), + 'lastmod' => filemtime("$dir$entry") ); } } @@ -70,87 +71,87 @@ function getTemplateList($dir) $d->close(); return $retval; } + ?> + - -<?php echo xlt('OpenEMR Portal'); ?> | <?php echo xlt('Import'); ?> - - - + + <?php echo xlt('Portal'); ?> | <?php echo xlt('Templates'); ?> + + + - -
-
-

-

.
.
-.

-
- -
- - - -
-
-

-
-
-
- -
"; -echo ''; -echo '
'; -$dirlist = getTemplateList($tdir); -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -foreach ($dirlist as $file) { - $t = $file['pathname']; - echo ""; - echo ''; - echo ""; - echo ""; - echo ""; -} - -echo ""; -echo "
" . xlt("Template") . " - " . xlt("Click to edit") . "" . xlt("Size") . "" . xlt("Last Modified") . "
- " . text($file['size']) . "" . text(date('r', $file['lastmod'])) . "
"; -?> - -
-