Document module improvements, take 3.
[openemr.git] / templates / prescription / general_list.html
blob948574090dd2180fc1fd0000dde243b9278bd889
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="{$WEBROOT}/library/js/jquery-1.2.2.min.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='Print'} ({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='Print'} ({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='Print'} ({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='Print 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='Created'}<br />{xl t='Changed'}</th>
164 <th>{xl t='Dosage'}</th>
165 <th>{xl t='Qty'}.</th>
166 <th>{xl t='Unit'}</th>
167 <th>{xl t='Provider'}</th>
168 </tr>
170 {foreach from=$prescriptions item=prescription}
171 <!-- TajEmo Changes 2012/06/14 02:03:17 PM by CB added cursor:pointer for easier user understanding -->
172 <tr style="cursor:pointer" id="{$prescription->id}" class="showborder onescript {if $prescription->active <= 0} inactive{/if}" title="{xl t='Click to view/edit'}">
173 <td align="center">
174 <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'}">
175 </td>
176 {if $prescription->erx_source==0}
177 <td class="editscript" id="{$prescription->id}">
178 <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>
179 <!-- TajEmo Changes 2012/06/14 02:02:22 PM by CB commented out, to avoid duplicate display of drug name
180 {if $prescription->active > 0}<b>{/if}{$prescription->drug}{if $prescription->active > 0}</b>{/if}&nbsp;
181 -->
182 </td>
183 <td class="editscript" id="{$prescription->id}">
184 {if $prescription->active > 0}<b>{/if}{$prescription->drug}{if $prescription->active > 0}</b>{/if}&nbsp;
185 </td>
186 {else}
187 <td id="{$prescription->id}">
188 {if $prescription->active > 0}<b>{/if}{$prescription->drug}{if $prescription->active > 0}</b>{/if}&nbsp;
189 </td>
190 {/if}
191 <td id="{$prescription->id}">
192 {$prescription->date_added}<br />
193 {$prescription->date_modified}&nbsp;
194 </td>
195 <td id="{$prescription->id}">
196 {$prescription->get_dosage_display()} &nbsp;
197 </td>
198 {if $prescription->erx_source==0}
199 <td class="editscript" id="{$prescription->id}">
200 {$prescription->quantity} &nbsp;
201 </td>
202 {else}
203 <td id="{$prescription->id}">
204 {$prescription->quantity} &nbsp;
205 </td>
206 {/if}
207 <td id="{$prescription->id}">
208 {$prescription->get_size()} {$prescription->get_unit_display()}&nbsp;
209 </td>
210 <td id="{$prescription->id}">
211 {$prescription->provider->get_name_display()}&nbsp;
212 </td>
213 </tr>
214 {/foreach}
215 </table>
217 </form>
218 </div>
220 {else}
221 <div class="text" style="margin-top:10px">{xl t='There are currently no prescriptions'}.</div>
222 {/if}
224 </body>
225 {literal}
226 <script language='JavaScript'>
228 $(document).ready(function(){
229 $("#multiprint").click(function() { return CheckForChecks(document.presc.check_list); });
230 $("#multiprintcss").click(function() { return CheckForChecks(document.presc.check_list); });
231 $("#multiprintToFax").click(function() { return CheckForChecks(document.presc.check_list); });
232 $(".editscript").click(function() { ShowScript(this); });
233 $(".onescript").mouseover(function() { $(this).children().toggleClass("highlight"); });
234 $(".onescript").mouseout(function() { $(this).children().toggleClass("highlight"); });
237 var ShowScript = function(eObj) {
238 top.restoreSession();
239 objID = eObj.id;
240 document.location.href="{/literal}{$WEB_ROOT}{literal}/controller.php?prescription&edit&id="+objID;
241 return true;
244 </script>
245 {/literal}
246 </html>