Skip to content

Commit

Permalink
Layout editor list dialog error fix (openemr#6992)
Browse files Browse the repository at this point in the history
* Layout editor list dialog error fix
- add modifier to lists search returned array

* - PHP warning.$opt_default is not defined or used anywhere I can find.

* - some readablity changes
- refactor based on orginal version

* - add BS4 styles
  • Loading branch information
sjpadgett authored and bradymiller committed Nov 9, 2023
1 parent c44026f commit b899a61
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
20 changes: 11 additions & 9 deletions interface/login/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
// If this script is called with app parameter, validate it without showing other apps.
//
// Build a list of valid entries
// Original merge v5.0.1
$emr_app = array();
$sql = "SELECT option_id, title,is_default FROM list_options WHERE list_id=? and activity=1 ORDER BY seq, option_id";
$rs = sqlStatement($sql, ['apps']);
Expand Down Expand Up @@ -83,20 +84,21 @@
if (isset($_REQUEST['app']) && $emr_app[$_REQUEST['app']]) {
$div_app = sprintf('<input type="hidden" name="appChoice" value="%s">', attr($_REQUEST['app']));
} else {
$opt_htm = '';
foreach ($emr_app as $opt_disp => $opt_value) {
$opt_htm .= sprintf(
'<option value="%s" %s>%s</option>\n',
attr($opt_disp),
($opt_disp == $opt_default ? 'selected="selected"' : ''),
($opt_disp == ($emr_app_def ?? '') ? 'selected="selected"' : ''),
text(xl_list_label($opt_disp))
);
}

$div_app = sprintf(
'
<div id="divApp" class="form-group">
<label for="appChoice" class="text-right">%s:</label>
<div>
<div id="divApp" class="form-group row">
<label for="appChoice" class="col-form-label col-sm-4">%s:</label>
<div class="col">
<select class="form-control" id="selApp" name="appChoice" size="1">%s</select>
</div>
</div>',
Expand Down Expand Up @@ -208,16 +210,16 @@ function getLanguagesList(): array

$viewArgs = [
'title' => $openemr_name,
'displayLanguage' => ($GLOBALS["language_menu_login"] && (count($languageList) != 1)) ? true : false,
'displayLanguage' => $GLOBALS["language_menu_login"] && (count($languageList) != 1),
'defaultLangID' => $defaultLanguage['id'],
'defaultLangName' => $defaultLanguage['language'],
'languageList' => $languageList,
'relogin' => $relogin,
'loginFail' => (isset($_SESSION["loginfailure"]) && $_SESSION["loginfailure"] == 1) ? true : false,
'displayFacilities' => ($GLOBALS["login_into_facility"]) ? true : false,
'loginFail' => isset($_SESSION["loginfailure"]) && $_SESSION["loginfailure"] == 1,
'displayFacilities' => (bool)$GLOBALS["login_into_facility"],
'facilityList' => $facilities,
'facilitySelected' => $facilitySelected,
'displayGoogleSignin' => (!empty($GLOBALS['google_signin_enabled']) && !empty($GLOBALS['google_signin_client_id'])) ? true : false,
'displayGoogleSignin' => !empty($GLOBALS['google_signin_enabled']) && !empty($GLOBALS['google_signin_client_id']),
'googleSigninClientID' => $GLOBALS['google_signin_client_id'],
'displaySmallLogo' => $displaySmallLogo,
'smallLogoOne' => $smallLogoOne,
Expand All @@ -226,7 +228,7 @@ function getLanguagesList(): array
'displayTagline' => $GLOBALS['show_tagline_on_login'],
'tagline' => $GLOBALS['login_tagline_text'],
'displayAck' => $GLOBALS['display_acknowledgements_on_login'],
'hasSession' => (session_name()) ? true : false,
'hasSession' => (bool)session_name(),
'cookieText' => $cookie,
'regTranslations' => $regTranslations,
'regConstants' => json_encode(['webroot' => $GLOBALS['webroot']]),
Expand Down
3 changes: 2 additions & 1 deletion interface/patient_file/encounter/find_code_dynamic_ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ function genFieldIdString($row)
$arow[] = $row['title'];
} else {
$arow[] = str_replace('|', ':', rtrim($row['code'], '|'));
$arow[] = $row['description'];
$arow[] = $row['description'] ?? "";
$arow[] = $row['modifier'] ?? "";
}
$out['aaData'][] = $arow;
}
Expand Down

0 comments on commit b899a61

Please sign in to comment.