Skip to content

Commit

Permalink
display correct name when 'choices' group name is changed (openemr#7671)
Browse files Browse the repository at this point in the history
* display correct name when 'choices' group name is changed

* correct styling errors

* correct use of translation functions

* hand group name to twig and display full message from the twig. added new xlLayoutLabel function
  • Loading branch information
ruthkonyn authored Aug 24, 2024
1 parent aea767b commit aa8f92c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/Common/Twig/TwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,12 @@ function ($string) {
return oeFormatShortDate($string);
}
),
new TwigFilter(
'xlLayoutLabel',
function ($string) {
return xl_layout_label($string);
}
),
new TwigFilter(
'xlListLabel',
function ($string) {
Expand Down
8 changes: 8 additions & 0 deletions src/Patient/Cards/PortalCard.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion templates/patient/partials/portal.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The Patient Portal card for the Medical Record Dashboard
{% if isPortalAllowed == false %}
<div class="alert alert-warning" role="alert">
<p class="font-weight-bold">{{ "Portal Access"|xlt }}</p>
<p> {{ "Allow Patient Portal in Demographics Choices."|xlt }} </p>
<p> {{ "Allow Patient Portal in Demographic"|xlt }} {{ allowpp|xlLayoutLabel|text }} </p>
</div>
{% elseif isContactEmail == false and isEnforceSigninEmailPortal == true %}
<div class="alert alert-warning" role="alert">
Expand Down

0 comments on commit aa8f92c

Please sign in to comment.