Skip to content

Commit

Permalink
Merge branch 'rel-702' of https://github.com/openemr/openemr into rel…
Browse files Browse the repository at this point in the history
…-702

* 'rel-702' of https://github.com/openemr/openemr:
  Jp port 702_3 (openemr#7840)
  • Loading branch information
sjpadgett committed Nov 22, 2024
2 parents c272321 + 015732f commit 7b4d656
Show file tree
Hide file tree
Showing 29 changed files with 468 additions and 275 deletions.
17 changes: 15 additions & 2 deletions controllers/C_Document.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1103,9 +1103,10 @@ public function list_action($patient_id = "")
$treeMenu_listbox = new HTML_TreeMenu_Listbox($menu, array('linkTarget' => '_self'));
$this->assign("tree_html", $treeMenu->toHTML());

$is_new_referer = !empty($_GET['referer_flag']) ? 1 : 0;
$is_new = isset($_GET['patient_name']) ? 1 : false;
$place_hld = isset($_GET['patient_name']) ? filter_input(INPUT_GET, 'patient_name') : xl("Patient search or select.");
$cur_pid = isset($_GET['patient_id']) ? filter_input(INPUT_GET, 'patient_id') : '';
$place_hld = isset($_GET['patient_name']) ? filter_input(INPUT_GET, 'patient_name') : false;
$cur_pid = isset($_GET['patient_id']) ? filter_input(INPUT_GET, 'patient_id') : $patient_id;
$used_msg = xl('Current patient unavailable here. Use Patient Documents');
if ($cur_pid == '00') {
if (!AclMain::aclCheckCore('patients', 'docs', '', ['write', 'addonly'])) {
Expand All @@ -1115,6 +1116,16 @@ public function list_action($patient_id = "")
$cur_pid = '0';
$is_new = 1;
}
if ((int)$cur_pid == 0) {
$place_hld = xl('New Document Uploads.');
}
if (!$place_hld) {
if ((int)$cur_pid > 0) {
$query = "select fname, lname from patient_data WHERE pid = ?";
$name = sqlQuery($query, [$cur_pid]);
$place_hld = $name['fname'] . ' ' . $name['lname'];
}
}
if (!AclMain::aclCheckCore('patients', 'docs')) {
echo (new TwigContainer(null, $GLOBALS['kernel']))->getTwig()->render('core/unauthorized.html.twig', ['pageTitle' => xl("Documents")]);
exit;
Expand All @@ -1124,6 +1135,8 @@ public function list_action($patient_id = "")
$this->assign('cur_pid', $cur_pid);
$this->assign('used_msg', $used_msg);
$this->assign('demo_pid', ($_SESSION['pid'] ?? null));
$this->assign('is_new_referer', $is_new_referer);
$this->assign('new_title', xlt("New Documents"));

return $this->fetch($GLOBALS['template_dir'] . "documents/" . $this->template_mod . "_list.html");
}
Expand Down
6 changes: 4 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
// Set the site ID if required. This must be done before any database
// access is attempted.

$site_id = '';

if (!empty($_GET['site'])) {
$site_id = $_GET['site'];
} elseif (is_dir("sites/" . $_SERVER['HTTP_HOST'] ?? '')) {
$site_id = $_SERVER['HTTP_HOST'] ?? '';
} elseif (is_dir("sites/" . ($_SERVER['HTTP_HOST'] ?? 'default'))) {
$site_id = ($_SERVER['HTTP_HOST'] ?? 'default');
} else {
$site_id = 'default';
}
Expand Down
120 changes: 56 additions & 64 deletions interface/main/onotes/office_comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,75 +23,67 @@
exit;
}

//display all of the notes for the day, as well as others that are active from previous dates, up to a certain number, $N
$N = 10;

//display all the notes for the day, as well as others that are active from previous dates, up to a certain number, $N
$N = 8;
$oNoteService = new ONoteService();
?>

<!DOCTYPE html>
<html>
<head>

<?php Header::setupHeader(); ?>

<title><?php echo xlt('Office Notes'); ?></title>
<?php Header::setupHeader(); ?>
</head>
<body class="body_top">

<div id="officenotes_list">
<a href="office_comments_full.php" onclick='top.restoreSession()'>
<font class="title"><?php echo xlt('Office Notes'); ?></font>
<font class="more"><?php echo text($tmore);?></font></a>

<br />

<table border=0 width=100%>

<?php

$notes = $oNoteService->getNotes(1, 0, ($N + 1));

//retrieve all active notes
if (!empty($notes)) {
$notes_count = 0;//number of notes so far displayed
foreach ($notes as $note) {
if ($notes_count >= $N) {
//we have more active notes to print, but we've reached our display maximum (defined at top of this file)
$notice = '';
$notice .= '<div class="alert alert-info">';
$notice .= ' <a href=\'office_comments_full.php?active=-1\' onclick=\'top.restoreSession()\'>' . xlt("Some office notes were not displayed. Click here to view all.") . '</a>';
$notice .= '</div>';
print $notice;
break;
}

$date = (new DateTime($note['date']))->format('Y-m-d');

$todaysDate = new DateTime();
if ($todaysDate->format('Y-m-d') == $date) {
$date_string = xl("Today") . ", " . oeFormatShortDate($date);
} else {
$date_string = oeFormatShortDate($date);
}

$card = '';
$card .= '<div class="card panel-default">';
$card .= ' <div class="card-heading">';
$card .= ' <h3 class="card-title">' . text($date_string) . ' <strong>(' . text($note['user']) . ')</strong></h3>';
$card .= ' </div>';
$card .= ' <div class="card-body">';
$card .= nl2br(text($note['body']));
$card .= ' </div>';
$card .= '</div>';

print $card;

$notes_count++;
}
}
?>

</table>
</div>

<div id="officenotes_list" class="container">
<div class="row my-3">
<div class="col-12">
<a class="my-3" href="office_comments_full.php" onclick='top.restoreSession()'>
<span class="h2"><?php echo xlt('Office Notes'); ?></span>
<span class="text"><?php echo text($tmore); ?></span>
</a>
</div>
</div>
<table class="table table-hover table-striped">
<?php
$notes = $oNoteService->getNotes(1, 0, ($N + 1));
//retrieve all active notes
if (!empty($notes)) {
$notes_count = 0;//number of notes so far displayed
foreach ($notes as $note) {
if ($notes_count >= $N) {
//we have more active notes to print, but we've reached our display maximum (defined at top of this file)
$notice = '';
$notice .= '<div class="alert alert-info">';
$notice .= ' <a href=\'office_comments_full.php?active=-1\' onclick=\'top.restoreSession()\'>' . xlt("Some office notes were not displayed. Click here to view all.") . '</a>';
$notice .= '</div>';
print $notice;
break;
}

$date = (new DateTime($note['date']))->format('Y-m-d H:i:s');
$todaysDate = new DateTime();
if ($todaysDate->format('Y-m-d') == $date) {
$date_string = xl("Today") . ", " . oeFormatDateTime($date);
} else {
$date_string = oeFormatDateTime($date);
}
$card = '';
$card .= '<div class="card panel-default">';
$card .= ' <div class="card-heading bg-dark text-light">';
$card .= ' <h6 class="card-title m-0 mt-1 pb-1">' . text($date_string) . ' <strong>(' . text($note['user']) . ')</strong></h6>';
$card .= ' </div>';
$card .= ' <div class="card-body p-2">';
$card .= nl2br(text($note['body']));
$card .= ' </div>';
$card .= '</div>';

print $card;

$notes_count++;
}
}
?>
</table>
</div>
</body>
</html>
Loading

0 comments on commit 7b4d656

Please sign in to comment.