2 * general document list
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
13 {headerTemplate assets='datetime-picker|jquery-ui|jquery-ui-lightness'}
14 <link rel=
"stylesheet" href=
"{$GLOBALS.assets_static_relative}/dropzone/dist/dropzone.css">
16 <style type=
"text/css">
18 margin: 10 auto
10 auto
;
19 color: rgb
(255, 0, 0);
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
}
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
);
51 // dropzone javascript asset translation(s)
52 Dropzone
.prototype.defaultOptions
.dictDefaultMessage
= {xlj t
='Drop files here to upload'};
54 <title>{xlt t='Documents'}
</title>
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;">
60 <body class=
"body_top">
62 <div class=
"container-fluid">
64 <div class=
"col-sm-12">
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>
71 <div class=
"col-sm-3">
72 <div id=
"documents_list">
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}">
80 <a id=
"list_collapse" href=
"#" onclick=
"javascript:objTreeMenu_1.collapseAll();return false;"> ({xlt t='Collapse all'})
</a>
87 <div class=
"col-sm-9">
88 <div id=
"documents_actions">
92 <legend>{xlt t='Document Uploader/Viewer'}
</legend>
93 <div style=
"padding: 0 10px">
95 <div class='text'
style=
"margin-bottom:-10px; margin-top:-8px; padding:10px;"><i>{$message|text}
</i></div><br>
98 <div class='text'
style=
"margin-bottom:-10px; margin-top:-8px; padding:10px;"><i>{$messages|text}
</i></div><br>
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
};
114 if(curpid
== demoPid
&& !newVersion
){
115 $(".ui-widget").hide();
118 $("#pid").text(curpid
);
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
})){
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
);
137 }).autocomplete("widget").addClass("fixed-height");
139 $(".pBtn").click(function(event
) {
140 var $input
= $("#selectPatient");
142 $input
.autocomplete('search'," ");
145 $("#list_collapse").detach().appendTo("#objTreeMenu_1_node_1 nobr");
147 // functions to view and pop out documents as needed.
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();
159 if (!popsrc
.includes('&view&')) {
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
);
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';
179 dlgopen(popsrc
, 'popdoc', size
, 600, '', '', {
181 {text
: btnText
, close
: true, style
: 'primary btn-xs', click
: poContentModal
},
182 {text
: btnClose
, close
: true, style
: 'default btn-xs'}
184 sizeHeight
: sizeHeight
,
194 $(function(){{/literal
}
195 {datetimepickerSupport
}
196 {literal
}});{/literal
}