Skip to content

Commit

Permalink
Support for optional logging of print actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsetsystems committed Oct 4, 2015
1 parent dd253ae commit 9c4a08c
Show file tree
Hide file tree
Showing 66 changed files with 465 additions and 110 deletions.
2 changes: 1 addition & 1 deletion controllers/C_Prescription.class.php
Expand Up @@ -485,7 +485,7 @@ function multiprintcss_footer() {

function multiprintcss_postfooter() {
echo("<script language='JavaScript'>\n");
echo("window.print();\n");
echo("opener.top.printLogPrint(window);\n");
echo("</script>\n");
echo("</body>\n");
echo("</html>\n");
Expand Down
9 changes: 7 additions & 2 deletions interface/billing/indigent_patients_report.php
@@ -1,5 +1,5 @@
<?php
// Copyright (C) 2005-2010 Rod Roark <rod@sunsetsystems.com>
// Copyright (C) 2005-2015 Rod Roark <rod@sunsetsystems.com>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
Expand Down Expand Up @@ -63,6 +63,11 @@ function bucks($amount) {

<script language="JavaScript">

$(document).ready(function() {
var win = top.printLogSetup ? top : opener.top;
win.printLogSetup(document.getElementById('printbutton'));
});

</script>

</head>
Expand Down Expand Up @@ -122,7 +127,7 @@ function bucks($amount) {
</a>

<?php if ($_POST['form_refresh']) { ?>
<a href='#' class='css_button' onclick='window.print()'>
<a href='#' class='css_button' id='printbutton'>
<span>
<?php xl('Print','e'); ?>
</span>
Expand Down
10 changes: 8 additions & 2 deletions interface/billing/sl_receipts_report.php
Expand Up @@ -105,8 +105,15 @@ function bucks($amount) {
}
</style>

<script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="<?php echo $GLOBALS['webroot']; ?>/library/dialog.js"></script>
<script language="JavaScript">

$(document).ready(function() {
var win = top.printLogSetup ? top : opener.top;
win.printLogSetup(document.getElementById('printbutton'));
});

// This is for callback by the find-code popup.
// Erases the current entry
// The target element is set by the find-code popup
Expand Down Expand Up @@ -256,7 +263,7 @@ function sel_diagnosis() {
</a>

<?php if ($_POST['form_refresh']) { ?>
<a href='#' class='css_button' onclick='window.print()'>
<a href='#' class='css_button' id='printbutton'>
<span>
<?php xl('Print','e'); ?>
</span>
Expand Down Expand Up @@ -766,7 +773,6 @@ function sel_diagnosis() {
<script type="text/javascript" src="<?php echo $GLOBALS['webroot']; ?>/library/dynarch_calendar.js"></script>
<?php require_once($GLOBALS['srcdir'].'/dynarch_calendar_en.inc.php'); ?>
<script type="text/javascript" src="<?php echo $GLOBALS['webroot']; ?>/library/dynarch_calendar_setup.js"></script>
<script type="text/javascript" src="<?php echo $GLOBALS['webroot']; ?>/library/js/jquery.1.3.2.js"></script>

<script language="Javascript">
Calendar.setup({inputField:"form_from_date", ifFormat:"%Y-%m-%d", button:"img_from_date"});
Expand Down
3 changes: 2 additions & 1 deletion interface/drugs/dispense_drug.php
Expand Up @@ -237,7 +237,8 @@ function send_email($subject, $body) {
</table>
</center>
<script language="JavaScript">
window.print();
var win = top.printLogPrint ? top : opener.top;
win.printLogPrint(window);
</script>
</body>
</html>
Expand Down
3 changes: 2 additions & 1 deletion interface/forms/CAMOS/notegen.php
Expand Up @@ -228,7 +228,8 @@
}
?>
<script language='JavaScript'>
window.print();
var win = top.printLogPrint ? top : opener.top;
win.printLogPrint(window);
</script>
</div>
</body>
Expand Down
3 changes: 2 additions & 1 deletion interface/forms/CAMOS/rx_print.php
Expand Up @@ -353,7 +353,8 @@ function bottomHeaderRx() {
print "</div>";
?>
<script language='JavaScript'>
window.print();
var win = top.printLogPrint ? top : opener.top;
win.printLogPrint(window);
</script>
</div>
</body>
Expand Down
3 changes: 2 additions & 1 deletion interface/forms/LBF/printable.php
Expand Up @@ -201,7 +201,8 @@ function end_group() {

<!-- This should really be in the onload handler but that seems to be unreliable and can crash Firefox 3. -->
<script language='JavaScript'>
window.print();
var win = top.printLogPrint ? top : opener.top;
win.printLogPrint(window);
</script>

</body>
Expand Down
15 changes: 12 additions & 3 deletions interface/forms/aftercare_plan/new.php
Expand Up @@ -49,6 +49,15 @@
<script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/textformat.js"></script>
<script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/dialog.js"></script>
<link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">

<script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery-1.9.1.min.js"></script>
<script language="JavaScript">
$(document).ready(function() {
var win = top.printLogSetup ? top : opener.top;
win.printLogSetup(document.getElementById('printbutton'));
});
</script>

</head>
<body class="body_top">
<p><span class="forms-title"><?php echo xlt('AfterCare Planning'); ?></span></p>
Expand Down Expand Up @@ -176,9 +185,9 @@
</tr>
<tr>
<td></td>
<td><input type='submit' value='<?php echo xlt('Save');?>' class="button-css">&nbsp;
<input type='button' value="Print" onclick="window.print()" class="button-css">&nbsp;
<input type='button' class="button-css" value='<?php echo xlt('Cancel');?>'
<td><input type='submit' value='<?php echo xla('Save'); ?>' class='button-css' />&nbsp;
<input type='button' value='<?php echo xla('Print'); ?>' id='printbutton' class='button-css' />&nbsp;
<input type='button' class='button-css' value='<?php echo xla('Cancel'); ?>'
onclick="top.restoreSession();location='<?php echo "$rootdir/patient_file/encounter/$returnurl" ?>'" /></td>
</tr>
</table>
Expand Down
4 changes: 2 additions & 2 deletions interface/forms/note/print.php
Expand Up @@ -63,8 +63,8 @@
// jQuery stuff to make the page a little easier to use

$(document).ready(function(){
window.print();
window.close();
var win = top.printLogPrint ? top : opener.top;
if (win.printLogPrint(window)) window.close();
});

</script>
Expand Down
13 changes: 11 additions & 2 deletions interface/forms/transfer_summary/new.php
Expand Up @@ -47,6 +47,15 @@
<script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/textformat.js"></script>
<script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/dialog.js"></script>
<link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">

<script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery-1.9.1.min.js"></script>
<script language="JavaScript">
$(document).ready(function() {
var win = top.printLogSetup ? top : opener.top;
win.printLogSetup(document.getElementById('printbutton'));
});
</script>

</head>

<body class="body_top">
Expand Down Expand Up @@ -142,8 +151,8 @@
<tr>
<td></td>
<td><input type='submit' value='<?php echo xlt('Save');?>' class="button-css">&nbsp;
<input type='button' value="Print" onclick="window.print()" class="button-css">&nbsp;
<input type='button' class="button-css" value='<?php echo xlt('Cancel');?>'
<input type='button' value='<?php echo xla('Print'); ?>' id='printbutton' />&nbsp;
<input type='button' class="button-css" value='<?php echo xla('Cancel'); ?>'
onclick="top.restoreSession();location='<?php echo "$rootdir/patient_file/encounter/$returnurl" ?>'" />

</td>
Expand Down
18 changes: 12 additions & 6 deletions interface/forms/treatment_plan/new.php
Expand Up @@ -34,7 +34,6 @@
$formid = 0 + (isset($_GET['id']) ? $_GET['id'] : '');
$obj = $formid ? formFetch("form_treatment_plan", $formid) : array();


// Get the providers list.
$ures = sqlStatement("SELECT id, username, fname, lname FROM users WHERE " .
"authorized != 0 AND active = 1 ORDER BY lname, fname");
Expand All @@ -50,6 +49,15 @@
<script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/textformat.js"></script>
<script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/dialog.js"></script>
<link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">

<script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery-1.9.1.min.js"></script>
<script language="JavaScript">
$(document).ready(function() {
var win = top.printLogSetup ? top : opener.top;
win.printLogSetup(document.getElementById('printbutton'));
});
</script>

</head>
<body class="body_top">
<p><span class="forms-title"><?php echo xlt('Treatment Planning'); ?></span></p>
Expand Down Expand Up @@ -86,10 +94,7 @@
</td>
</tr>
<tr>



<td align="left" class="forms"><?php echo xlt('Client Number'); ?>:</td>
<td align="left" class="forms"><?php echo xlt('Client Number'); ?>:</td>
<td class="forms">
<label class="forms-data" > <?php if (is_numeric($pid)) {

Expand Down Expand Up @@ -186,7 +191,8 @@
<tr>
<td></td>
<td><input type='submit' value='<?php echo xlt('Save');?>' class="button-css">&nbsp;
<input type='button' value="Print" onclick="window.print()" class="button-css">&nbsp;
<input type='button' value='<?php echo xla('Print'); ?>' id='printbutton' />&nbsp;

<input type='button' class="button-css" value='<?php echo xlt('Cancel');?>'
onclick="top.restoreSession();location='<?php echo "$rootdir/patient_file/encounter/$returnurl" ?>'" /></td>
</tr>
Expand Down
9 changes: 5 additions & 4 deletions interface/forms/vitals/growthchart/chart.php
Expand Up @@ -307,10 +307,11 @@ function changeStyle(css_title) {
}
}
}
function pagePrint(title) {
changeStyle(title);
window.print();
}
function pagePrint(title) {
changeStyle(title);
var win = top.printLogPrint ? top : opener.top;
win.printLogPrint(window);
}
</SCRIPT>
<title><?php xl('Growth Chart','e'); ?></title>
</head>
Expand Down
2 changes: 1 addition & 1 deletion interface/logview/logview.php
Expand Up @@ -330,7 +330,7 @@ function setpatient(pid, lname, fname, dob) {
<TD class="text"><?php echo $iter["groupname"]?></TD>
<TD class="text"><?php echo $iter["patient_id"]?></TD>
<TD class="text"><?php echo $iter["success"]?></TD>
<TD class="text"><?php echo preg_replace('/^select/i','Query',$trans_comments); //Convert select term to Query for MU2 requirements ?></TD>
<TD class="text"><?php echo text(preg_replace('/^select/i','Query',$trans_comments)); //Convert select term to Query for MU2 requirements ?></TD>
<?php if($check_sum) { ?>
<TD class="text"><?php echo $iter["checksum"]?></TD>
<?php } ?>
Expand Down
Expand Up @@ -545,7 +545,8 @@
<script type="text/javascript" src="../../../library/js/jquery-1.2.2.min.js"></script>
<script>
$(document).ready(function(){
window.print();
var win = top.printLogPrint ? top : opener.top;
win.printLogPrint(window);
window.close();
});
</script>
Expand Down
Expand Up @@ -696,7 +696,8 @@
<script type="text/javascript" src="[-php-] echo $GLOBALS['webroot'] [-/php-]/library/js/jquery-1.2.2.min.js"></script>
<script>
$(document).ready(function(){
window.print();
var win = top.printLogPrint ? top : opener.top;
win.printLogPrint(window);
window.close();
});
</script>
Expand Down
Expand Up @@ -419,7 +419,8 @@

<script language='JavaScript'>
$(document).ready(function(){
window.print();
var win = top.printLogPrint ? top : opener.top;
win.printLogPrint(window);
window.close();
});
</script>
Expand Down
Expand Up @@ -518,7 +518,8 @@

<script language='JavaScript'>
$(document).ready(function(){
window.print();
var win = top.printLogPrint ? top : opener.top;
win.printLogPrint(window);
window.close();
});
</script>
Expand Down
Expand Up @@ -704,7 +704,8 @@
<script type="text/javascript" src="../../../library/js/jquery-1.2.2.min.js"></script>
<script>
$(document).ready(function(){
window.print();
var win = top.printLogPrint ? top : opener.top;
win.printLogPrint(window);
window.close();
});
</script>
Expand Down
Expand Up @@ -607,7 +607,8 @@
else if ($("#bigCal").height() > 1200) {
$("#weekcal *").css("font-size", "80%");
}
window.print();
var win = top.printLogPrint ? top : opener.top;
win.printLogPrint(window);
window.close();
});
</script>
Expand Down
4 changes: 2 additions & 2 deletions interface/main/finder/patient_select.php
Expand Up @@ -507,7 +507,8 @@ function submitList(offset) {
$(".oneresult").click(function() { SelectPatient(this); });
// $(".event").dblclick(function() { EditEvent(this); });
<?php if($print_patients) { ?>
window.print();
var win = top.printLogPrint ? top : opener.top;
win.printLogPrint(window);
<?php } ?>
});

Expand Down Expand Up @@ -537,4 +538,3 @@ function submitList(offset) {

</body>
</html>

1 change: 1 addition & 0 deletions interface/main/main_screen.php
Expand Up @@ -111,6 +111,7 @@
<title>
<?php echo text($openemr_name) ?>
</title>
<script type="text/javascript" src="../../library/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="../../library/topdialog.js"></script>

<script language='JavaScript'>
Expand Down
Expand Up @@ -44,7 +44,9 @@ $(document).ready(function(){
$('#printbutton').click(function(){
$('.header_wrap').hide();
$('#printtable').hide();
window.print();
// Can't test this so avoiding printLogSetup(). --Rod
var win = top.printLogPrint ? top : opener.top;
win.printLogPrint(window);
$('.header_wrap').show();
});

Expand Down
11 changes: 10 additions & 1 deletion interface/orders/pending_followup.php
Expand Up @@ -79,6 +79,15 @@ function thisLineItem($row, $codetype, $code) {
<head>
<?php html_header_show();?>
<title><?php xl('Pending Followup from Results','e') ?></title>

<script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery-1.9.1.min.js"></script>
<script language="JavaScript">
$(document).ready(function() {
var win = top.printLogSetup ? top : opener.top;
win.printLogSetup(document.getElementById('printbutton'));
});
</script>

</head>

<body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>
Expand Down Expand Up @@ -124,7 +133,7 @@ function thisLineItem($row, $codetype, $code) {
&nbsp;
<input type='submit' name='form_csvexport' value="<?php xl('Export to CSV','e') ?>">
&nbsp;
<input type='button' value='<?php xl('Print','e'); ?>' onclick='window.print()' />
<input type='button' value='<?php echo xla('Print'); ?>' id='printbutton' />
</td>
</tr>

Expand Down
13 changes: 12 additions & 1 deletion interface/orders/pending_orders.php
Expand Up @@ -75,6 +75,17 @@ function thisLineItem($row) {
<head>
<?php html_header_show();?>
<title><?php xl('Pending Orders','e') ?></title>

<script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery-1.9.1.min.js"></script>
<script language="JavaScript">

$(document).ready(function() {
var win = top.printLogSetup ? top : opener.top;
win.printLogSetup(document.getElementById('printbutton'));
});

</script>

</head>

<body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>
Expand Down Expand Up @@ -106,7 +117,7 @@ function thisLineItem($row) {
&nbsp;
<input type='submit' name='form_csvexport' value="<?php xl('Export to CSV','e') ?>">
&nbsp;
<input type='button' value='<?php xl('Print','e'); ?>' onclick='window.print()' />
<input type='button' value='<?php echo xla('Print'); ?>' id='printbutton' />
</td>
</tr>

Expand Down

0 comments on commit 9c4a08c

Please sign in to comment.