XSS remediation
[openemr.git] / templates / prescription / general_list.html
blob68dc2cca72a5a87300ba35b20bd54d374e8e55bd
1 <html>
2 <head>
3 {php}html_header_show();{/php}
4 <link rel="stylesheet" href="{php}echo $GLOBALS['css_header']; {/php}" type="text/css">
5 <script type="text/javascript" src="{php} echo $GLOBALS['assets_static_relative']; {/php}/jquery-min-1-2-2/index.js"></script>
7 {literal}
8 <style type="text/css" title="mystyles" media="all">
9 .inactive {
10 color:#777777;
12 </style>
14 <script language="javascript">
16 function changeLinkHref(id,addValue,value) {
17 var myRegExp = new RegExp(":" + value + ":");
18 if (addValue){ //add value to href
19 document.getElementById(id).href += ':' + value + ':';
21 else { //remove value from href
22 document.getElementById(id).href = document.getElementById(id).href.replace(myRegExp,'');
26 function changeLinkHref_All(id,addValue,value) {
27 var myRegExp = new RegExp(":" + value + ":");
28 if (addValue){ //add value to href
29 document.getElementById(id).href += ':' + value + ':';
31 else { //remove value from href
32 document.getElementById(id).href = document.getElementById(id).href.replace(myRegExp,'');
33 // TajEmo Work By CB 2012/06/14 02:17:16 PM remove the target change
34 //document.getElementById(id).target = '';
38 function Check(chk) {
39 var len=chk.length;
40 if (len==undefined) {chk.checked=true;}
41 else {
42 for (pr = 0; pr < chk.length; pr++){
43 if($(chk[pr]).parents("tr.inactive").length==0)
45 chk[pr].checked=true;
46 changeLinkHref_All('multiprint',true,chk[pr].value);
47 changeLinkHref_All('multiprintcss',true, chk[pr].value);
48 changeLinkHref_All('multiprintToFax',true, chk[pr].value);
54 function Uncheck(chk) {
55 var len=chk.length;
56 if (len==undefined) {chk.checked=false;}
57 else {
58 for (pr = 0; pr < chk.length; pr++){
59 chk[pr].checked=false;
60 changeLinkHref_All('multiprint',false,chk[pr].value);
61 changeLinkHref_All('multiprintcss',false, chk[pr].value);
62 changeLinkHref_All('multiprintToFax',false, chk[pr].value);
67 var CheckForChecks = function(chk) {
68 // Checks for any checked boxes, if none are found than an alert is raised and the link is killed
69 if (Checking(chk) == false) { return false; }
70 return top.restoreSession();
73 function Checking(chk) {
74 var len=chk.length;
75 var foundone=false;
77 if (len==undefined) {
78 if (chk.checked == true){
79 foundone=true;
82 else {
83 for (pr = 0; pr < chk.length; pr++){
84 if (chk[pr].checked == true) {
85 foundone=true;
89 if (foundone) {
90 return true;
91 } else {
92 alert("{/literal}{xl t='Please select at least one prescription!'}{literal}");
93 return false;
97 $(document).ready(function(){
98 $(":checkbox:checked").each(function () {
99 changeLinkHref('multiprint',this.checked, this.value);
100 changeLinkHref('multiprintcss',this.checked, this.value);
101 changeLinkHref('multiprintToFax',this.checked, this.value);
105 </script>
107 {/literal}
108 </head>
109 <body class="body_top">
111 {if $prescriptions}
112 <span class="title"><b>{xl t='List'}</b></span>
114 <div id="prescription_list">
116 <form name="presc">
118 <div id="print_links">
119 <table width="100%">
120 <tr>
121 <td align="left">
122 <table>
123 <tr>
124 <td>
125 <a id="multiprint" href="{$CONTROLLER}prescription&multiprint&id={$printm}" onclick="top.restoreSession()" class="css_button"><span>{xl t='Download'} ({xl t='PDF'})</span></a>
126 </td>
127 <td>
128 <!-- TajEmo work by CB 2012/06/14 02:16:32 PM target="_script" opens better -->
129 <a target="_script" id="multiprintcss" href="{$CONTROLLER}prescription&multiprintcss&id={$printm}" onclick="top.restoreSession()" class="css_button"><span>{xl t='View Printable Version'} ({xl t='HTML'})</span></a>
130 </td>
131 <td style="border-style:none;">
132 <a id="multiprintToFax" href="{$CONTROLLER}prescription&multiprintfax&id={$printm}" onclick="top.restoreSession()" class="css_button"><span>{xl t='Download'} ({xl t='Fax'})</span></a>
133 </td>
134 {if $CAMOS_FORM == true}
135 <td>
136 <a id="four_panel_rx" href="{$WEBROOT}/interface/forms/CAMOS/rx_print.php?sigline=plain" onclick="top.restoreSession()" class="css_button"><span>{xl t='View Four Panel'}</span></a>
137 </td>
138 {/if}
139 </tr>
140 </table>
141 </td>
142 <td align="right">
143 <table>
144 <tr>
145 <td>
146 <a href="#" class="small" onClick="Check(document.presc.check_list);"><span>{xl t='Check All'}</span></a> |
147 <a href="#" class="small" onClick="Uncheck(document.presc.check_list);"><span>{xl t='Clear All'}</span></a>
148 </td>
149 </tr>
150 </table>
151 </td>
152 </tr>
153 </table>
154 </div>
157 <table width="100%" class="showborder_head" cellspacing="0px" cellpadding="2px">
158 <tr>
159 <!-- TajEmo Changes 2012/06/14 02:01:43 PM by CB added Heading for checkbox column -->
160 <th width="8px">&nbsp;</th>
161 <th width="8px">&nbsp;</th>
162 <th width="180px">{xl t='Drug'}</th>
163 <th>{xl t='Code'}</th>
164 <th>{xl t='Created'}<br />{xl t='Changed'}</th>
165 <th>{xl t='Dosage'}</th>
166 <th>{xl t='Qty'}.</th>
167 <th>{xl t='Unit'}</th>
168 <th>{xl t='Provider'}</th>
169 </tr>
171 {foreach from=$prescriptions item=prescription}
172 <!-- TajEmo Changes 2012/06/14 02:03:17 PM by CB added cursor:pointer for easier user understanding -->
173 <tr style="cursor:pointer" id="{$prescription->id}" class="showborder onescript {if $prescription->active <= 0} inactive{/if}" title="{xl t='Click to view/edit'}">
174 <td align="center">
175 <input class="check_list" id="check_list" type="checkbox" value="{$prescription->id}" {if $prescription->encounter == $prescription->get_encounter() && $prescription->active > 0}checked="checked" {/if}onclick="changeLinkHref('multiprint',this.checked, this.value);changeLinkHref('multiprintcss',this.checked, this.value);changeLinkHref('multiprintToFax',this.checked, this.value)" title="{xl t='Select for printing'}">
176 </td>
177 {if $prescription->erx_source==0}
178 <td class="editscript" id="{$prescription->id}">
179 <a class='editscript css_button_small' id='{$prescription->id}' href="controller.php?prescription&edit&id={$prescription->id}" style="margin-top:-2px"><span>{xl t='Edit'}</span></a>
180 <!-- TajEmo Changes 2012/06/14 02:02:22 PM by CB commented out, to avoid duplicate display of drug name
181 {if $prescription->active > 0}<b>{/if}{$prescription->drug}{if $prescription->active > 0}</b>{/if}&nbsp;
182 -->
183 </td>
184 <td class="editscript" id="{$prescription->id}">
185 {if $prescription->active > 0}<b>{/if}{$prescription->drug|escape:"html"}{if $prescription->active > 0}</b>{/if}&nbsp;
186 <br />{$prescription->note|escape:"html"}
187 </td>
188 {else}
189 <td>&nbsp;</td>
190 <td id="{$prescription->id}">
191 {if $prescription->active > 0}<b>{/if}{$prescription->drug|escape:"html"}{if $prescription->active > 0}</b>{/if}&nbsp;
192 <br />{$prescription->note|escape:"html"}
193 </td>
194 {/if}
195 <td id="{$prescription->id}">
196 {$prescription->rxnorm_drugcode|escape:"html"}&nbsp;
197 </td>
198 <td id="{$prescription->id}">
199 {$prescription->date_added}<br />
200 {$prescription->date_modified}&nbsp;
201 </td>
202 <td id="{$prescription->id}">
203 {$prescription->get_dosage_display()|escape:"html"} &nbsp;
204 </td>
205 {if $prescription->erx_source==0}
206 <td class="editscript" id="{$prescription->id}">
207 {$prescription->quantity|escape:"html"} &nbsp;
208 </td>
209 {else}
210 <td id="{$prescription->id}">
211 {$prescription->quantity|escape:"html"} &nbsp;
212 </td>
213 {/if}
214 <td id="{$prescription->id}">
215 {$prescription->get_size()|escape:"html"} {$prescription->get_unit_display()}&nbsp;
216 </td>
217 <td id="{$prescription->id}">
218 {$prescription->provider->get_name_display()}&nbsp;
219 </td>
220 </tr>
221 {/foreach}
222 </table>
224 </form>
225 </div>
227 {else}
228 <div class="text" style="margin-top:10px">{xl t='There are currently no prescriptions'}.</div>
229 {/if}
231 </body>
232 {literal}
233 <script language='JavaScript'>
235 $(document).ready(function(){
236 $("#multiprint").click(function() { return CheckForChecks(document.presc.check_list); });
237 $("#multiprintcss").click(function() { return CheckForChecks(document.presc.check_list); });
238 $("#multiprintToFax").click(function() { return CheckForChecks(document.presc.check_list); });
239 $(".editscript").click(function() { ShowScript(this); });
240 $(".onescript").mouseover(function() { $(this).children().toggleClass("highlight"); });
241 $(".onescript").mouseout(function() { $(this).children().toggleClass("highlight"); });
244 var ShowScript = function(eObj) {
245 top.restoreSession();
246 objID = eObj.id;
247 document.location.href="{/literal}{$WEB_ROOT}{literal}/controller.php?prescription&edit&id="+objID;
248 return true;
251 </script>
252 {/literal}
253 </html>