Fix #5 for MU2 item a8.
[openemr.git] / interface / super / rules / controllers / alerts / view / list_actmgr.php
blob930838e9c63f47e4d89d44c9330fac314842d95c
1 <?php
2 /**
3 * Script to configure the Rules.
5 * Copyright (C) 2015 Brady Miller <brady@sparmy.com>
7 * LICENSE: This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 3
10 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
18 * @package OpenEMR
19 * @author Ensoftek
20 * @author Brady Miller <brady@sparmy.com>
21 * @link http://www.open-emr.org
24 require_once(dirname(__FILE__)."/../../../../../../library/acl.inc");
25 global $phpgacl_location;
26 require_once("$phpgacl_location/gacl_api.class.php");
29 <table class="header">
30 <tr>
31 <td class="title"><?php echo out( xl('Clinical Decision Rules Alert Manager') ); ?></td>
33 </tr>
34 <tr>
35 <td>
36 <a href="javascript:document.cdralertmgr.submit();" class="css_button" onclick="top.restoreSession()"><span><?php echo out( xl('Save') ); ?></span></a><a href="javascript:document.cdralertmgr.reset();" class="css_button" onclick="top.restoreSession()"><span><?php echo out( xl('Reset') ); ?></span></a>
37 </td>
38 </tr>
39 </table>
41 &nbsp;
43 <form name="cdralertmgr" method="post" action="index.php?action=alerts!submitactmgr" onsubmit="return top.restoreSession()">
44 <table cellpadding="1" cellspacing="0" class="showborder">
45 <tr class="showborder_head">
46 <th width="250px"><?php echo out( xl('Title') ); ?></th>
47 <th width="40px">&nbsp;</th>
48 <th width="10px"><?php echo out( xl('Active Alert') ); ?></th>
49 <th width="40px">&nbsp;</th>
50 <th width="10px"><?php echo out( xl('Passive Alert') ); ?></th>
51 <th width="40px">&nbsp;</th>
52 <th width="10px"><?php echo out( xl('Patient Reminder') ); ?></th>
53 <th width="40px">&nbsp;</th>
54 <th width="100px"><?php echo out( xl('Access Control') ); ?> <span title='<?php echo out( xl('User is required to have this access control for Active Alerts and Passive Alerts') ); ?>'>?</span></th>
55 <th></th>
56 </tr>
57 <?php $index = -1; ?>
58 <?php foreach($viewBean->rules as $rule) {?>
59 <?php $index++; ?>
60 <tr height="22">
61 <td><?php echo out( xl($rule->get_rule()) );?></td>
62 <td>&nbsp;</td>
63 <?php if ($rule->active_alert_flag() == "1"){ ?>
64 <td><input type="checkbox" name="active[<?php echo $index ?>]" checked="yes"></td>
65 <?php }else {?>
66 <td><input type="checkbox" name="active[<?php echo $index ?>]" ></td>
67 <?php } ?>
68 <td>&nbsp;</td>
69 <?php if ($rule->passive_alert_flag() == "1"){ ?>
70 <td><input type="checkbox" name="passive[<?php echo $index ?>]]" checked="yes"></td>
71 <?php }else {?>
72 <td><input type="checkbox" name="passive[<?php echo $index ?>]]"></td>
73 <?php } ?>
74 <td>&nbsp;</td>
75 <?php if ($rule->patient_reminder_flag() == "1"){ ?>
76 <td><input type="checkbox" name="reminder[<?php echo $index ?>]]" checked="yes"></td>
77 <?php }else {?>
78 <td><input type="checkbox" name="reminder[<?php echo $index ?>]]"></td>
79 <?php } ?>
80 <td>&nbsp;</td>
81 <td>
82 <?php //Place the ACO selector here
83 $gacl_temp = new gacl_api();
84 $list_aco_objects = $gacl_temp->get_objects(NULL, 0, 'ACO');
85 foreach ($list_aco_objects as $key => $value) {
86 asort($list_aco_objects[$key]);
88 echo "<select name='access_control[" . $index . "]'>";
89 foreach ($list_aco_objects as $section => $array_acos) {
90 $aco_section_data = $gacl_temp->get_section_data($section, 'ACO');
91 $aco_section_title = $aco_section_data[3];
92 foreach ($array_acos as $aco) {
93 $aco_id = $gacl_temp->get_object_id($section, $aco,'ACO');
94 $aco_data = $gacl_temp->get_object_data($aco_id, 'ACO');
95 $aco_title = $aco_data[0][3];
96 $select = '';
97 if ($rule->access_control() == $section.":".$aco) {
98 $select = 'selected';
100 echo "<option value='" . attr($section) . ":" . attr($aco) . "' " . $select . ">" . xlt($aco_section_title) . ": " . xlt($aco_title) . "</option>";
103 echo "</select>";
105 </td>
106 <td><input style="display:none" name="id[<?php echo $index ?>]]" value=<?php echo out($rule->get_id()); ?> /></td>
107 </tr>
108 <?php }?>
109 </table>
110 </form>