diff --git a/library/globals.inc.php b/library/globals.inc.php index 8b8d9f91c0f..417cb37a59c 100644 --- a/library/globals.inc.php +++ b/library/globals.inc.php @@ -1194,6 +1194,26 @@ ), + // Portal Tab + // + 'Portal' => array( + + 'portal_onsite_enable' => array( + xl('Enable Onsite Patient Portal'), + 'bool', // data type + '0', + xl('Enable Onsite Patient Portal.') + ), + + 'portal_onsite_address' => array( + xl('Onsite Patient Portal Site Address'), + 'text', // data type + 'https://your_web_site.com/openemr/patients', + xl('Website link for the Onsite Patient Portal.') + ), + + ), + // Connectors Tab // 'Connectors' => array( @@ -1226,20 +1246,6 @@ xl('Https link for the OpenEMR Support LLC Lab Exchange Service.') ), - 'portal_onsite_enable' => array( - xl('Enable Onsite Patient Portal'), - 'bool', // data type - '0', - xl('Enable Onsite Patient Portal.') - ), - - 'portal_onsite_address' => array( - xl('Onsite Patient Portal Site Address'), - 'text', // data type - 'https://your_web_site.com/openemr/patients', - xl('Website link for the Onsite Patient Portal.') - ), - 'erx_enable' => array( xl('Enable NewCrop eRx Service'), 'bool', // data type diff --git a/patients/get_patient_info.php b/patients/get_patient_info.php index 28a18a105ab..74261dc0629 100644 --- a/patients/get_patient_info.php +++ b/patients/get_patient_info.php @@ -46,8 +46,21 @@ $ignoreAuth = 1; // - //Authentication + //Authentication (and language setting) require_once('../interface/globals.php'); + + // set the language + if (!empty($_POST['languageChoice'])) { + $_SESSION['language_choice'] = $_POST['languageChoice']; + } + else if (empty($_SESSION['language_choice'])) { + // just in case both are empty, then use english + $_SESSION['language_choice'] = 1; + } + else { + // keep the current session language token + } + $authorizedPortal=false; //flag $sql = "SELECT * FROM `patient_access_onsite` WHERE `portal_username` = ? AND `portal_pwd` = ?"; diff --git a/patients/index.php b/patients/index.php index 97b92acdf1c..3adee17aa89 100644 --- a/patients/index.php +++ b/patients/index.php @@ -31,7 +31,61 @@ // security measure -- will check on next page. $_SESSION['itsme'] = 1; - // + // + + // + // Deal with language selection + // + // collect default language id (skip this if this is a password update) + if (!(isset($_SESSION['password_update']))) { + $res2 = sqlStatement("select * from lang_languages where lang_description = ?", array($GLOBALS['language_default']) ); + for ($iter = 0;$row = sqlFetchArray($res2);$iter++) { + $result2[$iter] = $row; + } + if (count($result2) == 1) { + $defaultLangID = $result2[0]{"lang_id"}; + $defaultLangName = $result2[0]{"lang_description"}; + } + else { + //default to english if any problems + $defaultLangID = 1; + $defaultLangName = "English"; + } + // set session variable to default so login information appears in default language + $_SESSION['language_choice'] = $defaultLangID; + // collect languages if showing language menu + if ($GLOBALS['language_menu_login']) { + // sorting order of language titles depends on language translation options. + $mainLangID = empty($_SESSION['language_choice']) ? '1' : $_SESSION['language_choice']; + if ($mainLangID == '1' && !empty($GLOBALS['skip_english_translation'])) { + $sql = "SELECT * FROM lang_languages ORDER BY lang_description, lang_id"; + $res3=SqlStatement($sql); + } + else { + // Use and sort by the translated language name. + $sql = "SELECT ll.lang_id, " . + "IF(LENGTH(ld.definition),ld.definition,ll.lang_description) AS trans_lang_description, " . + "ll.lang_description " . + "FROM lang_languages AS ll " . + "LEFT JOIN lang_constants AS lc ON lc.constant_name = ll.lang_description " . + "LEFT JOIN lang_definitions AS ld ON ld.cons_id = lc.cons_id AND " . + "ld.lang_id = ? " . + "ORDER BY IF(LENGTH(ld.definition),ld.definition,ll.lang_description), ll.lang_id"; + $res3=SqlStatement($sql, array($mainLangID) ); + } + for ($iter = 0;$row = sqlFetchArray($res3);$iter++) { + $result3[$iter] = $row; + } + if (count($result3) == 1) { + //default to english if only return one language + $hiddenLanguageField = "\n"; + } + } + else { + $hiddenLanguageField = "\n"; + } + } + ?> @@ -179,10 +233,38 @@ function validate_new_pass() { + + + + + + + + + + +
+