Various changes and fixes (#7424)
[openemr.git] / interface / patient_file / void_dialog.php
blob80a968aa1076aa738a908198061ab9ee0dbbc805
1 <?php
2 /* Copyright (C) 2016-2021 Rod Roark <rod@sunsetsystems.com>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 */
10 require_once('../globals.php');
11 require_once("$srcdir/options.inc.php");
13 use OpenEMR\Common\Acl\AclMain;
14 use OpenEMR\Core\Header;
16 <!DOCTYPE html>
17 <html>
18 <head>
19 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
20 <?php Header::setupHeader(['common', 'datetime-picker', 'opener']); ?>
22 <title><?php echo xlt('Void Dialog'); ?></title>
24 <script>
26 function DoSubmit() {
27 var f = document.forms[0];
28 if (opener.closed || !opener.voidwrap) {
29 alert(<?php echo xlj('The destination form was closed; I cannot act on your selection.'); ?>);
31 else if (f.form_reason.selectedIndex == 0) {
32 alert(<?php echo xlj('Please specify Void Reason.'); ?>);
33 return false;
35 else if (f.form_notes.value.trim() == '') {
36 alert(<?php echo xlj('Please specify Void Notes.'); ?>);
37 return false;
39 else {
40 opener.voidwrap(f.form_reason.value, f.form_notes.value);
42 window.close();
43 return false;
46 </script>
48 </head>
50 <body>
52 <div class="container-fluid">
54 <form method='post'>
56 <center>
58 <table border='0'>
60 <tr>
61 <td valign='top' nowrap><b><?php echo xlt('Void Reason'); ?>:</b></td>
62 <td>
63 <?php
64 generate_form_field(
65 array(
66 'data_type' => 1,
67 'field_id' => 'reason',
68 'list_id' => 'void_reasons',
69 'empty_title' => 'Select Reason'
74 </td>
75 </tr>
77 <tr>
78 <td valign='top' nowrap><b><?php echo xlt('Void Notes'); ?>:</b></td>
79 <td>
80 <input type='text' size='40' name='form_notes' maxlength='80' value='' style='width:100%' />
81 </td>
82 </tr>
84 </table>
86 <?php
87 echo "<p>\n";
88 echo "<input type='button' value='" . xla('Submit') . "' onclick='DoSubmit()' />&nbsp;\n";
89 echo "<input type='button' value='" . xla('Cancel') . "' onclick='window.close()' />\n";
90 echo "</p>\n";
93 </center>
95 </form>
96 </div>
97 </body>
98 </html>