diff --git a/src/Common/Twig/TwigExtension.php b/src/Common/Twig/TwigExtension.php index fd9b30bdcd0..46027375430 100644 --- a/src/Common/Twig/TwigExtension.php +++ b/src/Common/Twig/TwigExtension.php @@ -326,6 +326,12 @@ function ($string) { return oeFormatShortDate($string); } ), + new TwigFilter( + 'xlLayoutLabel', + function ($string) { + return xl_layout_label($string); + } + ), new TwigFilter( 'xlListLabel', function ($string) { diff --git a/src/Patient/Cards/PortalCard.php b/src/Patient/Cards/PortalCard.php index 6bd5d2dc775..ecffaa52ebd 100644 --- a/src/Patient/Cards/PortalCard.php +++ b/src/Patient/Cards/PortalCard.php @@ -64,10 +64,17 @@ private function renderCard() $this->opts['templateVariables']['appendedInjection'] = $dispatchResult->getAppendedInjection(); } + // used in twigs private function setOpts() { global $GLOBALS; global $pid; + // RM get name for 'choices' group, i.e. group 4 in 'layout_gropu_properties' table in db + $sql = "SELECT grp_title FROM layout_group_properties WHERE grp_group_id = 4 AND grp_form_id = 'DEM'"; + $res = sqlStatement($sql); + $nrow = sqlFetchArray($res); + $groupName = ($nrow['grp_title'] !== '' ? $nrow['grp_title'] : 'Choices'); + $this->opts = [ 'acl' => ['patients', 'demo'], 'initiallyCollapsed' => (getUserSetting(self::CARD_ID . '_expand') == 0), @@ -78,6 +85,7 @@ private function setOpts() 'identifier' => self::CARD_ID, 'title' => xl('Patient Portal') . ' / ' . xl('API Access'), 'templateVariables' => [ + 'allowpp' => $groupName, 'isPortalEnabled' => isPortalEnabled(), 'isPortalSiteAddressValid' => isPortalSiteAddressValid(), 'isPortalAllowed' => isPortalAllowed($pid), diff --git a/templates/patient/partials/portal.html.twig b/templates/patient/partials/portal.html.twig index fc144edea97..563bb31a15a 100644 --- a/templates/patient/partials/portal.html.twig +++ b/templates/patient/partials/portal.html.twig @@ -33,7 +33,7 @@ The Patient Portal card for the Medical Record Dashboard {% if isPortalAllowed == false %} {% elseif isContactEmail == false and isEnforceSigninEmailPortal == true %}