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