Documents Module: minor bug fixes for sha-1 validation and encyption/decryption code.
[openemr.git] / templates / documents / general_view.html
blobc3a1f9b3d89a9997299ece7af4e7bf6cc516a6bc
1 <head>
2 <style type="text/css">@import url(library/dynarch_calendar.css);</style>
3 <script type="text/javascript" src="library/dialog.js"></script>
4 <script type="text/javascript" src="library/textformat.js"></script>
5 <script type="text/javascript" src="library/dynarch_calendar.js"></script>
6 {php} include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); {/php}
7 <script type="text/javascript" src="library/dynarch_calendar_setup.js"></script>
8 <script language="JavaScript">
9 var mypcc = '{php} echo $GLOBALS['phone_country_code'] {/php}';
11 // Process click on Delete link.
12 function deleteme(docid) {literal}{{/literal}
13 dlgopen('interface/patient_file/deleter.php?document=' + docid, '_blank', 500, 450);
14 return false;
15 {literal}}{/literal}
17 // Called by the deleter.php window on a successful delete.
18 function imdeleted() {literal}{{/literal}
19 top.restoreSession();
20 window.location.href='{$REFRESH_ACTION}';
21 {literal}}{/literal}
23 // Called to show patient notes related to this document in the "other" frame.
24 function showpnotes(docid) {literal}{{/literal}
25 {php} if ($GLOBALS['concurrent_layout']) { {/php}
26 var othername = (window.name == 'RTop') ? 'RBot' : 'RTop';
27 parent.left_nav.forceDual();
28 parent.left_nav.setRadio(othername, 'pno');
29 parent.left_nav.loadFrame('pno1', othername, 'patient_file/summary/pnotes.php?docid=' + docid);
30 {php} } {/php}
31 return false;
32 {literal}}{/literal}
34 function submitNonEmpty( e ) {literal}{{/literal}
35 if ( e.elements['passphrase'].value.length == 0 ) {literal}{{/literal}
36 alert( "{xl t='You must enter a pass phrase to encrypt the document'}" );
37 {literal}}{/literal} else {literal}{{/literal}
38 e.submit();
39 {literal}}{/literal}
40 {literal}}{/literal}
42 </script>
44 </head>
47 <table valign="top">
48 <tr>
49 <td>
50 <a class="css_button" href="{$web_path}" onclick="top.restoreSession()"><span>{xl t='Download'}</span></a>
51 <a class="css_button" href='' onclick='return showpnotes({$file->get_id()})'><span>{xl t='Show Notes'}</span></a>
52 {$delete_string}
53 </td>
54 </tr>
55 <tr>
56 <td valign="top">
57 {if !$hide_encryption}
58 <div class="text">
59 <form method="post" name="document_encrypt" action="{$web_path}" onsubmit="return top.restoreSession()">
60 <div>
61 <div style="float:left">
62 <b>{xl t='Encryption'}</b>&nbsp;
63 </div>
64 <div style="float:none">
65 <a href="javascript:;" onclick="submitNonEmpty( document.forms['document_encrypt'] );">(<span>{xl t='download encrypted file'})</span></a>
66 </div>
67 </div>
68 <div>
69 {xl t='Pass Phrase'}:
70 <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=''/>
71 <input type="hidden" name="encrypted" value="true"></input>
72 </div>
73 </form>
74 </div>
75 <br/>
76 {/if}
77 <div class="text">
78 <form method="post" name="document_validate" action="{$VALIDATE_ACTION}" onsubmit="return top.restoreSession()">
79 <div>
80 <div style="float:left">
81 <b>{xl t='Sha-1 Hash'}:</b>&nbsp;
82 <i>{$file->get_hash()}</i>&nbsp;
83 </div>
84 <div style="float:none">
85 <a href="javascript:;" onclick="document.forms['document_validate'].submit();">(<span>{xl t='validate'})</span></a>
86 </div>
87 </div>
88 </form>
89 </div>
90 <br/>
91 <div class="text">
92 <form method="post" name="document_update" action="{$UPDATE_ACTION}" onsubmit="return top.restoreSession()">
93 <div>
94 <div style="float:left">
95 <b>{xl t='Update'}</b>&nbsp;
96 </div>
97 <div style="float:none">
98 <a href="javascript:;" onclick="document.forms['document_update'].submit();">(<span>{xl t='submit'})</span></a>
99 </div>
100 </div>
101 <div>
102 {xl t='Rename'}:
103 <input type='text' size='20' name='docname' id='docname' value='{$file->get_url_web()}'/>
104 </div>
105 <div>
106 {xl t='Date'}:
107 <input type='text' size='10' name='docdate' id='docdate'
108 value='{$DOCDATE}' title='{xl t='yyyy-mm-dd document date'}'
109 onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' />
110 <img src='interface/pic/show_calendar.gif' id='img_docdate' align='absbottom'
111 width='24' height='22' border='0' alt='[?]' style='cursor:pointer'
112 title='{xl t='Click here to choose a date'}' />
113 <select name="issue_id">{$ISSUES_LIST}</select>
114 </div>
115 </form>
116 </div>
118 <br/>
120 <div class="text">
121 <form method="post" name="document_move" action="{$MOVE_ACTION}" onsubmit="return top.restoreSession()">
122 <div>
123 <div style="float:left">
124 <b>{xl t='Move'}</b>&nbsp;
125 </div>
126 <div style="float:none">
127 <a href="javascript:;" onclick="document.forms['document_move'].submit();">(<span>{xl t='submit'})</span></a>
128 </div>
129 </div>
131 <div>
132 <select name="new_category_id">{$tree_html_listbox}</select>&nbsp;
133 {xl t='Move to Patient'} # <input type="text" name="new_patient_id" size="4" />
134 <a href="javascript:{literal}{}{/literal}"
135 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');">
136 <img src="images/stock_search-16.png" border="0" /></a>
137 <input type="hidden" name="new_patient_name" value="" />
138 </div>
139 </form>
140 </div>
142 <br/>
144 <form name="notes" method="post" action="{$NOTE_ACTION}" onsubmit="return top.restoreSession()">
145 <div class="text">
146 <div>
147 <div style="float:left">
148 <b>{xl t='Notes'}</b>&nbsp;
149 </div>
150 <div style="float:none">
151 <a href="javascript:;" onclick="document.forms['notes'].submit();">(<span>{xl t='add'}</span>)</a>
152 </div>
153 <div>
154 <textarea cols="53" rows="4" wrap="virtual" name="note"></textarea><br>
155 <input type="hidden" name="process" value="{$PROCESS}" />
156 <input type="hidden" name="foreign_id" value="{$file->get_id()}" />
158 {if $notes}
159 <div style="margin-top:7px">
160 {foreach name=note_loop from=$notes item=note}
161 <div>
162 {xl t='Note'} #{$note->get_id()}
163 {xl t='Date:'} {$note->get_date()}
164 {$note->get_note()}
165 </div>
166 {/foreach}
167 {/if}
168 </div>
169 </div>
170 </div>
171 </form>
173 </td>
174 </tr>
175 <tr>
176 <td>
177 <div class="text"><b>{xl t='Content'}</b></div>
178 {if $file->get_mimetype() eq "image/tiff"}
179 <embed frameborder="0" type="{$file->get_mimetype()}" src="{$web_path}as_file=false"></embed>
180 {elseif $file->get_mimetype() eq "image/png" or
181 $file->get_mimetype() eq "image/jpg" or
182 $file->get_mimetype() eq "image/jpeg" or
183 $file->get_mimetype() eq "image/gif" or
184 $file->get_mimetype() eq "application/pdf" }
185 <iframe frameborder="0" type="{$file->get_mimetype()}" src="{$web_path}as_file=false"></iframe>
186 {else}
187 <iframe frameborder="0" type="{$file->get_mimetype()}" src="{$web_path}as_file=true"></iframe>
188 {/if}
189 </td>
190 </tr>
191 </table>
192 <script language='JavaScript'>
193 Calendar.setup({literal}{{/literal}inputField:"docdate", ifFormat:"%Y-%m-%d", button:"img_docdate"{literal}}{/literal});
194 </script>