bug: fix typo in 837I script (#7469)
[openemr.git] / templates / documents / general_list.html
blobd3eeb286cf9d3527587d49db5d588542c31a6b19
1 {**
2 * general document list
4 * @package OpenEMR
5 * @link http://www.open-emr.org
6 * @author Brady Miller <brady.g.miller@gmail.com>
7 * @author Jerry Padgett <sjpadgett@gmail.com>
8 * @copyright Copyright (c) 2017-2018 Brady Miller <brady.g.miller@gmail.com>
9 * @copyright Copyright (c) 2019-2024 Jerry Padgett <sjpadgett@gmail.com>
10 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
12 <html>
13 <head>
15 {headerTemplate assets='datetime-picker|select2'}
16 <link rel="stylesheet" href="{$GLOBALS.assets_static_relative}/dropzone/dist/dropzone.css">
17 <style>
18 .select2-selection {
19 height: 35px!important;
20 border-radius: 4px 0 0 4px!important;
22 .warn_diagnostic {
23 margin: 10px auto 10px auto;
24 color: rgb(255, 0, 0);
25 font-size: 1.5rem;
27 .fixed-height {
28 min-width: 200px;
29 padding: 1px;
30 max-height: 35%;
31 overflow: auto;
33 </style>
34 <script src="{$GLOBALS.webroot}/library/js/DocumentTreeMenu.js"></script>
35 <script src="{$GLOBALS.assets_static_relative}/dropzone/dist/dropzone.js"></script>
37 <script>
38 function callTemplateModule(patient_id, cuser, templateName, id, edit) {
39 top.restoreSession();
40 let callUrl = '{$GLOBALS.webroot}/portal/patient/onsitedocuments?is_module=1' +
41 '&catid=' + {$category_id|js_url} +
42 '&pid=' + encodeURIComponent(patient_id) +
43 '&cuser=' + encodeURIComponent(cuser) +
44 '&recid=' + encodeURIComponent(id) +
45 '&edit=' + encodeURIComponent(edit) +
46 '&new=' + encodeURIComponent(templateName)
47 location.assign(callUrl);
49 </script>
50 <title>{xlt t='Documents'}</title>
51 </head>
52 <!-- ViSolve - Call expandAll function on loading of the page if global value 'expand_document' is set -->
53 {if $GLOBALS.expand_document_tree}
54 <body onload="javascript:objTreeMenu_1.expandAll();return false;">
55 {else}
56 <body>
57 {/if}
58 <div class="container-fluid mt-3">
59 <div class="row">
60 <div class="col-sm-12">
61 <div class="title">
62 <h2>{xlt t='Documents'} <a href='interface/patient_file/summary/demographics.php' onclick='top.restoreSession()' title="{xla t='Go Back'}" ><i id='advanced-tooltip' class='fa fa-solid fa-backward fa-sm' aria-hidden='true'></i></a></h2>
63 </div>
64 </div>
65 </div>
66 <div class="row">
67 <div class="col-sm-3">
68 <div id="documents_list">
69 <fieldset>
70 <legend>{xlt t='Documents List'}</legend>
71 <div class="pl-3">
72 <div class="form-inline float-right" id="patientSearch">
73 <select id="selectPatient" class="form-control" type="text" data-placeholder="{$place_hld|attr}">
74 <option></option>
75 </select>
76 <button id='pid' type="button" class='float-right btn btn-primary pBtn'>&times;</button>
77 </div>
78 <a id="list_collapse" href="#" onclick="javascript:objTreeMenu_1.collapseAll();return false;">&nbsp;({xlt t='Collapse all'})</a>
79 {$tree_html}
80 </div>
81 </fieldset>
82 </div>
83 </div>
84 <div class="col-sm-9">
85 <div id="documents_actions">
86 <fieldset>
87 <legend>{xlt t='Document Uploader/Viewer'}</legend>
88 <div style="padding: 0 10px">
89 {if !empty($message)}
90 <div class='text' style="margin-bottom:-10px; margin-top:-8px; padding:10px;"><i>{$message|text}</i></div><br />
91 {/if}
92 {if !empty($messages)}
93 <div class='text' style="margin-bottom:-10px; margin-top:-8px; padding:10px;"><i>{$messages|text}</i></div><br />
94 {/if}
95 {if !empty($activity)}{$activity}{/if}
96 </div>
97 </fieldset>
98 </div>
99 </div>
100 </div>
101 </div><!--end of container div-->
102 <script>
103 var curpid = {$cur_pid|js_escape};
104 var newVersion= {$is_new|js_escape};
105 var demoPid = {$demo_pid|js_escape};
106 var inUseMsg = {$used_msg|js_escape};
108 if(curpid == demoPid && !newVersion){
109 $("#patientSearch").hide();
111 else{
112 $("#pid").text(curpid);
114 $(function () {
115 $("#selectPatient").select2({
116 ajax: {
117 url: "{$GLOBALS.webroot}/library/ajax/document_helpers.php",
118 dataType: 'json',
119 data: function(params) {
120 return {
122 csrf_token_form: {$CSRF_TOKEN_FORM|js_escape},
123 term: params.term
126 processResults: function(data) {
127 return {
128 results: $.map(data, function(item, index) {
129 return {
130 text: item.label,
131 id: index,
132 value: item.value,
133 label: item.label
137 return x;
139 cache: true
141 minimumInputLength: 3
144 $('#selectPatient').on('select2:select', function (e) {
145 e.preventDefault();
146 if (e.params.data.value == '00' && ! e.params.data.label.match({xlj t="Reset"})){
147 alert(inUseMsg);
148 return false;
150 $(this).val(e.params.data.label);
151 location.href = "{$GLOBALS.webroot}/controller.php?document&list&patient_id=" + encodeURIComponent(e.params.data.value) + "&patient_name=" + encodeURIComponent(e.params.data.label);
152 $("#pid").text(e.params.data.value);
155 $(".pBtn").click(function(event) {
156 var $input = $("#selectPatient");
157 $input.val('');
160 $("#list_collapse").detach().appendTo("#objTreeMenu_1_node_1 nobr");
162 // functions to view and pop out documents as needed.
163 $(function () {
164 $("img[id^='icon_objTreeMenu_']").tooltip({
165 items: $("img[src*='file3.png']"),
166 content: {xlj t="Double Click on this icon to pop up document in a new viewer."}
169 $("img[id^='icon_objTreeMenu_']").on('dblclick', function (e) {
170 let popsrc = $(this).next("a").attr('href') || '';
171 let diview = $(this).next("a").text();
172 let dflg = false;
173 if (!popsrc.includes('&view&')) {
174 return false;
175 } else if (diview.toLowerCase().includes('.dcm') || diview.toLowerCase().includes('.zip')) {
176 popsrc = "{$GLOBALS.webroot}/library/dicom_frame.php?web_path=" + popsrc;
177 dflg = true;
179 popsrc = popsrc.replace('&view&', '&retrieve&') + 'as_file=false';
180 let poContentModal = function () {
181 let wname = '_' + Math.random().toString(36).substr(2, 6);
182 let opt = "menubar=no,location=no,resizable=yes,scrollbars=yes,status=no";
183 window.open(popsrc, wname, opt);
186 let btnText = {xlj t="Full Screen"};
187 let btnClose = {xlj t="Close"};
188 let size = 'modal-xl';
189 dlgopen(popsrc, 'popdoc', size, 700, '', '', {
190 buttons: [
191 { text: btnText, close: true, style: 'primary btn-sm', click: poContentModal },
192 { text: btnClose, close: true, style: 'secondary btn-sm' }
194 allowResize: true,
195 allowDrag: true,
196 dialogId: '',
197 type: 'iframe'
199 return false;
203 $(function () {
204 {datetimepickerSupport}
207 </script>
208 </body>
209 </html>