security fix in master branch
[openemr.git] / templates / documents / general_view.html
blobff73e03466dbaedf28a4e1f1d6bef9ff722161c6
1 {**
2 * general document view
4 * @package OpenEMR
5 * @link http://www.open-emr.org
6 * @author Brady Miller <brady.g.miller@gmail.com>
7 * @copyright Copyright (c) 2017 Brady Miller <brady.g.miller@gmail.com>
8 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
9 *}
11 <script language="JavaScript">
13 // Process click on Delete link.
14 function deleteme(docid) {literal}{{/literal}
15 dlgopen('interface/patient_file/deleter.php?document=' + docid, '_blank', 500, 450);
16 return false;
17 {literal}}{/literal}
19 // Called by the deleter.php window on a successful delete.
20 function imdeleted() {literal}{{/literal}
21 top.restoreSession();
22 window.location.href='{$REFRESH_ACTION}';
23 {literal}}{/literal}
25 // Called to show patient notes related to this document in the "other" frame.
26 function showpnotes(docid) {literal}{{/literal}
27 var othername = (window.name == 'RTop') ? 'RBot' : 'RTop';
28 parent.left_nav.forceDual();
29 parent.left_nav.loadFrame('pno1', othername, 'patient_file/summary/pnotes.php?docid=' + docid);
30 return false;
31 {literal}}{/literal}
33 function submitNonEmpty( e ) {literal}{{/literal}
34 if ( e.elements['passphrase'].value.length == 0 ) {literal}{{/literal}
35 alert( "{xl t='You must enter a pass phrase to encrypt the document'}" );
36 {literal}}{/literal} else {literal}{{/literal}
37 e.submit();
38 {literal}}{/literal}
39 {literal}}{/literal}
41 // For tagging it encounter
42 function tagUpdate() {literal}{{/literal}
43 var f = document.forms['document_tag'];
44 if (f.encounter_check.checked) {literal}{{/literal}
45 if(f.visit_category_id.value==0) {literal}{{/literal}
46 alert(" {xl t='Please select visit category'}" );
47 return false;
48 {literal}}{/literal}
49 {literal}}{/literal} else if (f.encounter_id.value == 0 ) {literal}{{/literal}
50 alert(" {xl t='Please select encounter'}");
51 return false;
52 {literal}}{/literal}
53 //top.restoreSession();
54 document.forms['document_tag'].submit();
55 {literal}}{/literal}
57 // For new or existing encounter
58 function set_checkbox() {literal}{{/literal}
59 var f = document.forms['document_tag'];
60 if (f.encounter_check.checked) {literal}{{/literal}
61 f.encounter_id.disabled = true;
62 f.visit_category_id.disabled = false;
63 $('.hide_clear').attr('href','javascript:void(0);');
64 {literal}}{/literal} else {literal}{{/literal}
65 f.encounter_id.disabled = false;
66 f.visit_category_id.disabled = true;
67 f.visit_category_id.value = 0;
68 $('.hide_clear').attr('href','{$clear_encounter_tag}');
69 {literal}}{/literal}
70 {literal}}{/literal}
72 // For tagging it with image procedure
73 function ImgProcedure() {literal}{{/literal}
74 var f = document.forms['img_procedure_tag'];
75 if(f.image_procedure_id.value == 0 ) {literal}{{/literal}
76 alert("{xl t='Please select image procedure'}");
77 return false;
78 {literal}}{/literal}
79 f.procedure_code.value = f.image_procedure_id.options[f.image_procedure_id.selectedIndex].getAttribute('data-code');
80 document.forms['img_procedure_tag'].submit();
81 {literal}}{/literal}
82 // Process click on Import link.
83 function import_ccr(docid) {literal}{
84 top.restoreSession();
85 $.ajax({
86 url: "library/ajax/ccr_import_ajax.php",
87 type: "POST",
88 dataType: "html",
89 data:
91 ccr_ajax : "yes",
92 document_id : docid,
94 success: function(data){
95 alert(data);
96 top.restoreSession();
97 document.location.reload();
99 error:function(){
100 alert("failure");
103 }{/literal}
104 </script>
106 <table valign="top" width="100%">
107 <tr>
108 <td>
109 <div style="margin-bottom: 6px;padding-bottom: 6px;border-bottom:3px solid gray;">
110 <h4>{$file->get_url_web()}
111 <div class="btn-group btn-toggle">
112 <button class="btn btn-xs btn-default properties">{xl t='Properties'}</button>
113 <button class="btn btn-xs btn-primary active">{xl t='Contents'}</button>
114 </div>
115 <span style="float:right;">
116 <a class="css_button" href="{$web_path}" title="{xl t='Original file'}" onclick="top.restoreSession()"><span>{xl t='Download'}</span></a>
117 <a class="css_button" href='' onclick='return showpnotes({$file->get_id()})'><span>{xl t='Show Notes'}</span></a>
118 {$delete_string}
119 {if $file->get_ccr_type($file->get_id()) eq "CCR" and ($file->get_mimetype($file->get_id()) eq "application/xml" or $file->get_mimetype($file->get_id()) eq "text/xml") and
120 $file->get_imported($file->get_id()) eq 0 }
121 <a class="css_button" href='javascript:' onclick='return import_ccr({$file->get_id()})'><span>{xl t='Import'}</span></a>
122 {/if}
123 </span>
124 </h4>
125 </div>
126 </td>
127 </tr>
128 <tr id="DocProperties" style="display:none;">
129 <td valign="top">
130 {if !$hide_encryption}
131 <div class="text">
132 <form method="post" name="document_encrypt" action="{$web_path}" onsubmit="return top.restoreSession()">
133 <div>
134 <div style="float:left">
135 <b>{xl t='Encryption'}</b>&nbsp;
136 </div>
137 <div style="float:none">
138 <a href="javascript:;" onclick="submitNonEmpty( document.forms['document_encrypt'] );">(<span>{xl t='download encrypted file'})</span></a>
139 </div>
140 </div>
141 <div>
142 {xl t='Pass Phrase'}:
143 <input title="{xl t='Supports TripleDES encryption/decryption only.'} {xl t='Leaving the pass phrase blank will not encrypt the document'}" type='text' size='20' name='passphrase' id='passphrase' value=''/>
144 <input type="hidden" name="encrypted" value="true"></input>
145 </div>
146 </form>
147 </div>
148 <br/>
149 {/if}
150 <div class="text">
151 <form method="post" name="document_validate" action="{$VALIDATE_ACTION}" onsubmit="return top.restoreSession()">
152 <div>
153 <div style="float:left">
154 <b>{xl t='Sha-1 Hash'}:</b>&nbsp;
155 <i>{$file->get_hash()}</i>&nbsp;
156 </div>
157 <div style="float:none">
158 <a href="javascript:;" onclick="document.forms['document_validate'].submit();">(<span>{xl t='validate'})</span></a>
159 </div>
160 </div>
161 </form>
162 </div>
163 <br/>
164 <div class="text">
165 <form method="post" name="document_update" action="{$UPDATE_ACTION}" onsubmit="return top.restoreSession()">
166 <div>
167 <div style="float:left">
168 <b>{xl t='Update'}</b>&nbsp;
169 </div>
170 <div style="float:none">
171 <a href="javascript:;" onclick="document.forms['document_update'].submit();">(<span>{xl t='submit'})</span></a>
172 </div>
173 </div>
174 <div>
175 {xl t='Rename'}:
176 <input type='text' size='20' name='docname' id='docname' value='{$file->get_url_web()|escape:'html'}'/>
177 </div>
178 <div>
179 {xl t='Date'}:
180 <input type='text' size='10' class='datepicker' name='docdate' id='docdate'
181 value='{$DOCDATE}' title='{xl t='yyyy-mm-dd document date'}' />
182 <select name="issue_id">{$ISSUES_LIST}</select>
183 </div>
184 </form>
185 </div>
187 <br/>
189 <div class="text">
190 <form method="post" name="document_move" action="{$MOVE_ACTION}" onsubmit="return top.restoreSession()">
191 <div>
192 <div style="float:left">
193 <b>{xl t='Move'}</b>&nbsp;
194 </div>
195 <div style="float:none">
196 <a href="javascript:;" onclick="document.forms['document_move'].submit();">(<span>{xl t='submit'})</span></a>
197 </div>
198 </div>
200 <div>
201 <select name="new_category_id">{$tree_html_listbox}</select>&nbsp;
202 {xl t='Move to Patient'} # <input type="text" name="new_patient_id" size="4" />
203 <a href="javascript:{literal}{}{/literal}"
204 onclick="top.restoreSession();var URL='controller.php?patient_finder&find&form_id={"document_move['new_patient_id']"|escape:"url"}&form_name={"document_move['new_patient_name']"|escape:"url"}'; window.open(URL, 'document_move', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=450,height=400,left=425,top=250');">
205 <img src="images/stock_search-16.png" border="0" /></a>
206 <input type="hidden" name="new_patient_name" value="" />
207 </div>
208 </form>
209 </div>
211 <br/>
213 <div class="text">
214 <form method="post" name="document_tag" id="document_tag" action="{$TAG_ACTION}" onsubmit="return top.restoreSession()">
216 <div >
217 <div style="float:left">
218 <b>{xl t='Tag to Encounter'}</b>&nbsp;
219 </div>
221 <div style="float:none">
222 <a href="javascript:;" onclick="tagUpdate();">(<span>{xl t='submit'})</span></a>
223 </div>
224 </div>
226 <div>
227 <select id="encounter_id" name="encounter_id" >{$ENC_LIST}</select>&nbsp;
228 <a href="{$clear_encounter_tag}" class="hide_clear">(<span>{xl t='clear'})</span></a>&nbsp;&nbsp;
229 <input type="checkbox" name="encounter_check" id="encounter_check" onclick='set_checkbox(this)'/> <label for="encounter_check"><b>{xl t='Create Encounter'}</b></label>&nbsp;&nbsp;
230 {xl t='Visit Category'} : &nbsp;<select id="visit_category_id" name="visit_category_id" disabled>{$VISIT_CATEGORY_LIST}</select>&nbsp;
232 </div>
233 </form>
234 </div>
235 <br/>
236 <div class="text">
237 <form method="post" name="img_procedure_tag" id="img_procedure_tag" action="{$IMG_PROCEDURE_TAG_ACTION}" onsubmit="return top.restoreSession()">
238 <input type='hidden' name='procedure_code' value=''>
239 <div>
240 <div style="float:left">
241 <b>{xl t='Tag to Image Procedure'}</b>&nbsp;
242 </div>
243 <div style="float:none">
244 <a href="javascript:;" onclick="ImgProcedure();">(<span>{xl t='submit'})</span></a>
245 </div>
246 </div>
247 <div>
248 <select id="image_procedure_id" name="image_procedure_id">{$IMAGE_PROCEDURE_LIST}</select>&nbsp;
249 <a href="{$clear_procedure_tag}">(<span>{xl t='clear'})</span></a>
250 </div>
251 </form>
252 </div>
254 <br/>
256 <form name="notes" method="post" action="{$NOTE_ACTION}" onsubmit="return top.restoreSession()">
257 <div class="text">
258 <div>
259 <div style="float:left">
260 <b>{xl t='Notes'}</b>&nbsp;
261 </div>
262 <div style="float:none">
263 <a href="javascript:;" onclick="document.notes.identifier.value='no';document.forms['notes'].submit();">(<span>{xl t='add'}</span>)</a>
264 &nbsp;&nbsp;&nbsp;<b>{xl t='Email'}</b>&nbsp;
265 <input type="text" size="25" name="provide_email" id="provide_email" />
266 <input type="hidden" name="identifier" id="identifier" />
267 <a href="javascript:;" onclick="javascript:document.notes.identifier.value='yes';document.forms['notes'].submit();">
268 (<span>{xl t='Send'}</span>)
269 </a>
270 </div>
271 <div>
273 </div>
274 <div style="float:none">
276 </div>
277 <div>
278 <textarea cols="53" rows="8" wrap="virtual" name="note" style="width:100%"></textarea><br>
279 <input type="hidden" name="process" value="{$PROCESS}" />
280 <input type="hidden" name="foreign_id" value="{$file->get_id()}" />
282 {if $notes}
283 <div style="margin-top:7px">
284 {foreach name=note_loop from=$notes item=note}
285 <div>
286 {xl t='Note'} #{$note->get_id()}
287 {xl t='Date:'} {$note->get_date()}
288 {$note->get_note()}
289 {if $note->get_owner()}
290 &nbsp;-{user_info id=$note->get_owner()}
291 {/if}
292 </div>
293 {/foreach}
294 {/if}
295 </div>
296 </div>
297 </div>
298 </form>
299 <h4>{xl t='Contents'}</h4>
300 </td>
301 </tr>
302 <tr id="DocContents">
303 <td>
304 {if $file->get_mimetype() eq "image/tiff"}
305 <embed frameborder="0" type="{$file->get_mimetype()}" src="{$web_path}as_file=false"></embed>
306 {elseif $file->get_mimetype() eq "image/png" or
307 $file->get_mimetype() eq "image/jpg" or
308 $file->get_mimetype() eq "image/jpeg" or
309 $file->get_mimetype() eq "image/gif" or
310 $file->get_mimetype() eq "application/pdf" }
311 <iframe frameborder="0" type="{$file->get_mimetype()}" src="{$web_path}as_file=false"></iframe>
312 {elseif $file->get_ccr_type($file->get_id()) ne "CCR" and
313 $file->get_ccr_type($file->get_id()) ne "CCD"}
314 <iframe frameborder="0" type="{$file->get_mimetype()}" src="{$web_path}as_file=true"></iframe>
315 {/if}
316 </td>
317 </tr>
318 </table>
319 <script language='JavaScript'>
320 {literal}
321 $('.btn-toggle').click(function() {
322 $(this).find('.btn').toggleClass('active');
324 if ($(this).find('.btn-primary').length >0) {
325 $(this).find('.btn').toggleClass('btn-primary');
328 $(this).find('.btn').toggleClass('btn-default');
329 var show_prop = ($(this).find('.properties.active').length > 0 ? 'block':'none');
330 $("#DocProperties").css('display', show_prop);
332 {/literal}
333 </script>