Some new features
[openemr.git] / templates / documents / general_list.html
blob020a2e5cb0cf3a2cc60c24b953e7ff625a285e96
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|jquery-ui|jquery-ui-lightness'}
14 <link rel="stylesheet" href="{$GLOBALS.assets_static_relative}/dropzone/dist/dropzone.css">
15 {literal}
16 <style type="text/css">
17 .warn_diagnostic {
18 margin: 10 auto 10 auto;
19 color: rgb(255, 0, 0);
20 font-size: 1.5em;
22 .ui-autocomplete {
23 position: absolute;
24 top: 0;
25 left: 0;
26 min-width:200px;
27 cursor: default;
29 .ui-menu-item{
30 min-width:200px;
32 .fixed-height{
33 min-width:200px;
34 padding: 1px;
35 max-height: 35%;
36 overflow: auto;
38 </style>
39 {/literal}
40 <script type="text/javascript" src="{$GLOBALS.webroot}/library/js/DocumentTreeMenu.js"></script>
41 <script type="text/javascript" src="{$GLOBALS.assets_static_relative}/dropzone/dist/dropzone.js"></script>
43 <script type="text/javascript">
44 function callTemplateModule() {literal}{{/literal}
45 top.restoreSession();
46 let tele = document.getElementById("template_filename");
47 let tname = encodeURIComponent(tele.options[tele.selectedIndex].value);
48 let callUrl = '{$GLOBALS.webroot}/portal/patient/onsitedocuments?pid={$patient_id|attr}&catid={$category_id|attr}&is_module=true&new=' + tname;
49 location.assign(callUrl);
50 {literal}}{/literal}
51 // dropzone javascript asset translation(s)
52 Dropzone.prototype.defaultOptions.dictDefaultMessage = {xlj t='Drop files here to upload'};
53 </script>
54 <title>{xlt t='Documents'}</title>
55 </head>
56 <!-- ViSolve - Call expandAll function on loading of the page if global value 'expand_document' is set -->
57 {if $GLOBALS.expand_document_tree}
58 <body class="body_top" onload="javascript:objTreeMenu_1.expandAll();return false;">
59 {else}
60 <body class="body_top">
61 {/if}
62 <div class="container-fluid">
63 <div class="row">
64 <div class="col-sm-12">
65 <div class="title">
66 <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 fa-2x small' aria-hidden='true'></i></a></h2>
67 </div>
68 </div>
69 </div>
70 <div class="row">
71 <div class="col-sm-3">
72 <div id="documents_list">
73 <fieldset>
74 <legend>{xlt t='Documents List'}</legend>
75 <div style="padding: 0 10px">
76 <div class="ui-widget"style="float:right;">
77 <button id='pid' class="pBtn" type="button" style="float:right;">0</button>
78 <input id="selectPatient" type="text" placeholder="{$place_hld|attr}">
79 </div>
80 <a id="list_collapse" href="#" onclick="javascript:objTreeMenu_1.collapseAll();return false;">&nbsp;({xlt t='Collapse all'})</a>
81 {$tree_html}
82 </div>
83 </div>
84 </fieldset>
85 </div>
87 <div class="col-sm-9">
88 <div id="documents_actions">
90 <fieldset>
92 <legend>{xlt t='Document Uploader/Viewer'}</legend>
93 <div style="padding: 0 10px">
94 {if $message}
95 <div class='text' style="margin-bottom:-10px; margin-top:-8px; padding:10px;"><i>{$message|text}</i></div><br>
96 {/if}
97 {if $messages}
98 <div class='text' style="margin-bottom:-10px; margin-top:-8px; padding:10px;"><i>{$messages|text}</i></div><br>
99 {/if}
100 {$activity}
101 </div>
102 </fieldset>
104 </div>
105 </div>
106 </div>
107 </div><!--end of container div-->
108 <script type="text/javascript">
109 var curpid = {$cur_pid|js_escape};
110 var newVersion= {$is_new|js_escape};
111 var demoPid = {$demo_pid|js_escape};
112 var inUseMsg = {$used_msg|js_escape};
113 {literal}
114 if(curpid == demoPid && !newVersion){
115 $(".ui-widget").hide();
117 else{
118 $("#pid").text(curpid);
120 $(function() {
121 $( "#selectPatient" ).autocomplete({
122 source: "{/literal}{$GLOBALS.webroot}/library/ajax/document_helpers.php?csrf_token_form=" + {$CSRF_TOKEN_FORM|js_url}{literal},
123 focus: function(event, sel) {
124 event.preventDefault();
126 select: function(event, sel) {
127 event.preventDefault();
128 if (sel.item.value == '00' && ! sel.item.label.match({/literal}{xlj t="Reset"}{literal})){
129 alert(inUseMsg);
130 return false;
132 $(this).val(sel.item.label);
133 location.href = "{/literal}{$GLOBALS.webroot}{literal}/controller.php?document&list&patient_id=" + encodeURIComponent(sel.item.value) + "&patient_name=" + encodeURIComponent(sel.item.label);
134 $("#pid").text(sel.item.value);
136 minLength: 3
137 }).autocomplete("widget").addClass("fixed-height");
139 $(".pBtn").click(function(event) {
140 var $input = $("#selectPatient");
141 $input.val('*');
142 $input.autocomplete('search'," ");
143 $input.val('');
145 $("#list_collapse").detach().appendTo("#objTreeMenu_1_node_1 nobr");
147 // functions to view and pop out documents as needed.
149 $(function () {
150 $("img[id^='icon_objTreeMenu_']").tooltip({
151 items: $("img[src*='file3.png']"),
152 content: {/literal}{xlj t="Double Click on this icon to pop up document in a new viewer."}{literal}
155 $("img[id^='icon_objTreeMenu_']").on('dblclick', function (e) {
156 let popsrc = $(this).next("a").attr('href') || '';
157 let diview = $(this).next("a").text();
158 let dflg = false;
159 if (!popsrc.includes('&view&')) {
160 return false;
161 } else if (diview.toLowerCase().includes('.dcm') || diview.toLowerCase().includes('.zip')) {
162 popsrc = "{/literal}{$GLOBALS.webroot}{literal}/library/dicom_frame.php?web_path=" + encodeURIComponent(popsrc);
163 dflg = true;
165 popsrc = popsrc.replace('&view&', '&retrieve&') + 'as_file=false';
166 let poContentModal = function () {
167 let wname = '_' + Math.random().toString(36).substr(2, 6);
168 let opt = "menubar=no,location=no,resizable=yes,scrollbars=yes,status=no";
169 window.open(popsrc, wname, opt);
172 let btnText = {/literal}{xlj t="Full Screen"}{literal};
173 let btnClose = {/literal}{xlj t="Close"}{literal};
174 let size = 'modal-xl';
175 let sizeHeight = 'full';
176 if (dflg) {
177 size = 'modal-md';
179 dlgopen(popsrc, 'popdoc', size, 600, '', '', {
180 buttons: [
181 {text: btnText, close: true, style: 'primary btn-xs', click: poContentModal},
182 {text: btnClose, close: true, style: 'default btn-xs'}
184 sizeHeight: sizeHeight,
185 allowResize: true,
186 allowDrag: true,
187 dialogId: '',
188 type: 'iframe'
190 return false;
194 $(function(){{/literal}
195 {datetimepickerSupport}
196 {literal}});{/literal}
198 </script>
199 </body>
200 </html>