2 // This program is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU General Public License
4 // as published by the Free Software Foundation; either version 2
5 // of the License, or (at your option) any later version.
8 $sanitize_all_escapes=true;
11 //STOP FAKE REGISTER GLOBALS
12 $fake_register_globals=false;
15 require_once("../../globals.php");
16 require_once("$srcdir/pnotes.inc");
17 require_once("$srcdir/acl.inc");
18 require_once("$srcdir/patient.inc");
19 require_once("$srcdir/options.inc.php");
20 require_once("$srcdir/classes/Document.class.php");
21 require_once("$srcdir/formatting.inc.php");
23 // form parameter docid can be passed to restrict the display to a document.
24 $docid = empty($_REQUEST['docid']) ?
0 : 0 +
$_REQUEST['docid'];
27 <div id
='pnotes' style
='margin-top:3px; margin-left:10px; margin-right:10px'>
31 //display all of the notes for the day, as well as others that are active from previous dates, up to a certain number, $N
39 $thisauth = acl_check('patients', 'notes');
41 $tmp = getPatientData($pid, "squad");
42 if ($tmp['squad'] && ! acl_check('squads', $tmp['squad']))
46 echo "<p>(" . htmlspecialchars(xl('Notes not authorized'),ENT_NOQUOTES
) . ")</p>\n";
53 //retrieve all active notes
54 $result = getPnotesByDate("", 1, "id,date,body,user,title,assigned_to",
55 $pid, "$N", 0, '', $docid);
57 if ($result != null) {
58 $notes_count = 0;//number of notes so far displayed
59 foreach ($result as $iter) {
62 $body = $iter['body'];
63 if (preg_match('/^\d\d\d\d-\d\d-\d\d \d\d\:\d\d /', $body)) {
64 $body = nl2br(htmlspecialchars(oeFormatPatientNote($body),ENT_NOQUOTES
));
66 $body = htmlspecialchars(oeFormatSDFT(strtotime($iter['date'])) . date(' H:i', strtotime($iter['date'])) .
67 ' (' . $iter['user'] . ') ',ENT_NOQUOTES
) .
68 nl2br(htmlspecialchars(oeFormatPatientNote($body),ENT_NOQUOTES
));
71 echo " <tr class='text' id='".htmlspecialchars($iter['id'],ENT_QUOTES
)."' style='border-bottom:1px dashed' >\n";
73 // Modified 6/2009 by BM to incorporate the patient notes into the list_options listings
74 echo " <td valign='top' class='text'><b>";
75 echo generate_display_field(array('data_type'=>'1','list_id'=>'note_type'), $iter['title']);
78 echo " <td valign='top' class='text'>$body</td>\n";
88 if ( $has_note < 1 ) { ?
>
90 <?php
echo htmlspecialchars(xl( "There are no notes on file for this patient."),ENT_NOQUOTES
);
92 echo htmlspecialchars(xl("To add notes, please click "),ENT_NOQUOTES
);
93 echo "<a href='pnotes_full.php'>";
94 echo htmlspecialchars(xl("here"),ENT_NOQUOTES
);
101 <?php
echo htmlspecialchars(xl('Displaying the following number of most recent notes:'),ENT_NOQUOTES
); ?
>
102 <b
><?php
echo $N;?
></b
><br
>
103 <a href
='pnotes_full.php'><?php
echo htmlspecialchars(xl('Click here to view them all.'),ENT_NOQUOTES
); ?
></a
>
113 </div
> <!-- end pnotes
-->
115 <script language
="javascript">
116 // jQuery stuff to make the page a little easier to use
118 $
(document
).ready(function(){
119 $
(".noterow").mouseover(function() { $
(this
).toggleClass("highlight"); });
120 $
(".noterow").mouseout(function() { $
(this
).toggleClass("highlight"); });