Skip to content

Commit

Permalink
Portal fixups (openemr#7103) (openemr#7112)
Browse files Browse the repository at this point in the history
* Portal fixups
- for windows fix file path
- php 8.2 warning

* - remove extraneous characters from html

Co-authored-by: Jerry Padgett <[email protected]>
  • Loading branch information
stephenwaite and sjpadgett authored Dec 15, 2023
1 parent 7a952f0 commit 86680b6
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 25 deletions.
3 changes: 1 addition & 2 deletions portal/patient/templates/OnsiteActivityViewListView.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

if (!AclMain::aclCheckCore('patientportal', 'portal')) {
die(xlt("Unauthorized"));
exit;
}

$this->display('_FormsHeader.tpl.php');
Expand All @@ -37,7 +36,7 @@
<div class="container mt-5">

<h3>
<i class="icon-th-list"></i><?php echo xlt('Onsite Patient Activities')?>
<i class="icon-th-list"></i><?php echo xlt('Onsite Patient Activities'); ?>
<span id="loader" class="loader progress progress-striped active"><span class="progress-bar"></span></span>
<div class="col-sm-3 col-md-3 float-right">
<form class="navbar-form" role="search">
Expand Down
2 changes: 1 addition & 1 deletion portal/patient/templates/_FormsHeader.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
Header::setupHeader(['datetime-picker', 'moment']);
}
?>
?>

<script src="<?php echo $GLOBALS['web_root']; ?>/portal/patient/scripts/libs/LAB.min.js"></script>
<script>
$LAB.script("<?php echo $GLOBALS['assets_static_relative']; ?>/underscore/underscore-min.js").wait()
Expand Down
40 changes: 19 additions & 21 deletions portal/portal_payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
$cryptoGen = new CryptoGen();

$appsql = new ApplicationTable();
$pid = isset($_REQUEST['pid']) ? $_REQUEST['pid'] : $pid;
$pid = $_REQUEST['hidden_patient_code'] > 0 ? $_REQUEST['hidden_patient_code'] : $pid;
$pid = $_REQUEST['pid'] ?? $pid;
$pid = ($_REQUEST['hidden_patient_code'] ?? null) > 0 ? $_REQUEST['hidden_patient_code'] : $pid;
$recid = isset($_REQUEST['recid']) ? (int) $_REQUEST['recid'] : 0;
$adminUser = '';
$portalPatient = '';
Expand All @@ -63,7 +63,7 @@
"LEFT JOIN patient_access_onsite pao ON pao.pid = patient_data.pid " .
"WHERE patient_data.pid = ? AND pao.portal_pwd_status = 1";
$portalPatient = sqlQueryNoLog($query, $pid);
if ($_SESSION['authUserID']) {
if ($_SESSION['authUserID'] ?? '') {
$query = "SELECT users.username as recip_id, users.authorized as dash, CONCAT(users.fname,' ',users.lname) as username " .
"FROM users WHERE id = ?";
$adminUser = sqlQueryNoLog($query, $_SESSION['authUserID']);
Expand Down Expand Up @@ -180,7 +180,7 @@ function calcTaxes($row, $amount)
$alertmsg = ''; // anything here pops up in an alert box

// If the Save button was clicked...
if ($_POST['form_save']) {
if ($_POST['form_save'] ?? '') {
$form_pid = $_POST['form_pid'];
$form_method = trim($_POST['form_method']);
$form_source = trim($_POST['form_source']);
Expand Down Expand Up @@ -389,8 +389,8 @@ function calcTaxes($row, $amount)
}//if ($_POST['form_upay'])
}//if ($_POST['form_save'])

if ($_POST['form_save'] || $_REQUEST['receipt']) {
if ($_REQUEST['receipt']) {
if (($_POST['form_save'] ?? null) || ($_REQUEST['receipt'] ?? null)) {
if (($_REQUEST['receipt'] ?? null)) {
$form_pid = $_GET['patient'];
$timestamp = decorateString('....-..-.. ..:..:..', $_GET['time']);
}
Expand Down Expand Up @@ -1098,17 +1098,15 @@ function getAuth() {
);
}

if ($brow['code_type'] === 'COPAY') {
// $encs[$key]['payments'] -= $brow['fee'];
} else {
if ($brow['code_type'] !== 'COPAY') {
$encs[$key]['charges'] += $brow['fee'];
// Add taxes.
$sql_array = array();
$query = "SELECT taxrates FROM codes WHERE " . "code_type = ? AND " . "code = ? AND ";
array_push($sql_array, $code_types[$brow['code_type']]['id'], $brow['code']);
if ($brow['modifier']) {
array_push($sql_array, $code_types[$brow['code_type']]['id'] ?? '', $brow['code'] ?? '');
if ($brow['modifier'] ?? '') {
$query .= "modifier = ?";
array_push($sql_array, $brow['modifier']);
$sql_array[] = $brow['modifier'] ?? '';
} else {
$query .= "(modifier IS NULL OR modifier = '')";
}
Expand Down Expand Up @@ -1239,26 +1237,26 @@ function getAuth() {
}
?>
<div class="card-body">
<span class="font-weight-bold"><?php echo xlt('Card Name'); ?>: </span><span id="cn"><?php echo text($ccdata["cc_type"]) ?></span><br />
<span class="font-weight-bold"><?php echo xlt('Name on Card'); ?>: </span><span id="nc"><?php echo text($ccdata["cardHolderName"]) ?></span>
<span class="font-weight-bold"><?php echo xlt('Card Holder Zip'); ?>: </span><span id="czip"><?php echo text($ccdata["zip"]) ?></span><br />
<span class="font-weight-bold"><?php echo xlt('Card Name'); ?>: </span><span id="cn"><?php echo text($ccdata["cc_type"] ?? '') ?></span><br />
<span class="font-weight-bold"><?php echo xlt('Name on Card'); ?>: </span><span id="nc"><?php echo text($ccdata["cardHolderName"] ?? '') ?></span>
<span class="font-weight-bold"><?php echo xlt('Card Holder Zip'); ?>: </span><span id="czip"><?php echo text($ccdata["zip"] ?? '') ?></span><br />
<span class="font-weight-bold"><?php echo xlt('Card Number'); ?>: </span><span id="ccn">
<?php
if (isset($_SESSION['authUserID']) || isset($ccdata["transId"])) {
echo text($ccdata["cardNumber"]) . "</span><br />";
} else {
} elseif (strlen($ccdata["cardNumber"] ?? '') > 4) {
echo "********** " . text(substr($ccdata["cardNumber"], -4)) . "</span><br />";
}
?>
<?php
if (!isset($ccdata["transId"])) { ?>
<span class="font-weight-bold"><?php echo xlt('Exp Date'); ?>: </span><span id="ed"><?php echo text($ccdata["month"]) . "/" . text($ccdata["year"]) ?></span>
<span class="font-weight-bold"><?php echo xlt('CVV'); ?>: </span><span id="cvvpin"><?php echo text($ccdata["cardCode"]) ?></span><br />
<span class="font-weight-bold"><?php echo xlt('Exp Date'); ?>: </span><span id="ed"><?php echo text($ccdata["month"] ?? '') . "/" . text($ccdata["year"] ?? '') ?></span>
<span class="font-weight-bold"><?php echo xlt('CVV'); ?>: </span><span id="cvvpin"><?php echo text($ccdata["cardCode"] ?? '') ?></span><br />
<?php } else { ?>
<span class="font-weight-bold"><?php echo xlt('Transaction Id'); ?>: </span><span id="ed"><?php echo text($ccdata["transId"]) . "/" . text($ccdata["year"]) ?></span>
<span class="font-weight-bold"><?php echo xlt('Authorization'); ?>: </span><span id="cvvpin"><?php echo text($ccdata["authCode"]) ?></span><br />
<span class="font-weight-bold"><?php echo xlt('Transaction Id'); ?>: </span><span id="ed"><?php echo text($ccdata["transId"] ?? '') . "/" . text($ccdata["year"]) ?></span>
<span class="font-weight-bold"><?php echo xlt('Authorization'); ?>: </span><span id="cvvpin"><?php echo text($ccdata["authCode"] ?? '') ?></span><br />
<?php } ?>
<span class="font-weight-bold"><?php echo xlt('Charge Total'); ?>: </span><span id="ct"><?php echo text($invdata["form_paytotal"]) ?></span><br />
<span class="font-weight-bold"><?php echo xlt('Charge Total'); ?>: </span><span id="ct"><?php echo text($invdata["form_paytotal"] ?? '') ?></span><br />
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion portal/verify_session.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@
}

$ignoreAuth_onsite_portal = true; // ignore the standard authentication for a regular OpenEMR user
require_once(dirname(__file__) . './../interface/globals.php');
require_once(__DIR__ . '/../interface/globals.php');

0 comments on commit 86680b6

Please sign in to comment.