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|select2'}
14 <link rel=
"stylesheet" href=
"{$GLOBALS.assets_static_relative}/dropzone/dist/dropzone.css">
17 height:
35px!important;
18 border-radius:
4px
0 0 4px!important;
21 margin:
10 auto
10 auto;
22 color: rgb(
255,
0,
0);
32 <script src=
"{$GLOBALS.webroot}/library/js/DocumentTreeMenu.js"></script>
33 <script src=
"{$GLOBALS.assets_static_relative}/dropzone/dist/dropzone.js"></script>
36 function callTemplateModule() {
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
);
44 <title>{xlt t='Documents'}
</title>
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;">
52 <div class=
"container-fluid mt-3">
54 <div class=
"col-sm-12">
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>
61 <div class=
"col-sm-3">
62 <div id=
"documents_list">
64 <legend>{xlt t='Documents List'}
</legend>
66 <div class=
"form-inline float-right" id=
"patientSearch">
67 <select id=
"selectPatient" class=
"form-control" type=
"text" data-placeholder=
"{$place_hld|attr}">
70 <button id='pid'
type=
"button" class='float-right btn btn-primary pBtn'
>×</button>
72 <a id=
"list_collapse" href=
"#" onclick=
"javascript:objTreeMenu_1.collapseAll();return false;"> ({xlt t='Collapse all'})
</a>
78 <div class=
"col-sm-9">
79 <div id=
"documents_actions">
81 <legend>{xlt t='Document Uploader/Viewer'}
</legend>
82 <div style=
"padding: 0 10px">
84 <div class='text'
style=
"margin-bottom:-10px; margin-top:-8px; padding:10px;"><i>{$message|text}
</i></div><br />
86 {if !empty($messages)}
87 <div class='text'
style=
"margin-bottom:-10px; margin-top:-8px; padding:10px;"><i>{$messages|text}
</i></div><br />
89 {if !empty($activity)}{$activity}{/if}
95 </div><!--end of container div-->
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();
106 $("#pid").text(curpid
);
109 $("#selectPatient").select2({
111 url
: "{$GLOBALS.webroot}/library/ajax/document_helpers.php",
113 data: function(params
) {
116 csrf_token_form
: {$CSRF_TOKEN_FORM
|js_escape
},
120 processResults: function(data
) {
122 results
: $.map(data
, function(item
, index
) {
135 minimumInputLength
: 3
138 $('#selectPatient').on('select2:select', function (e
) {
140 if (e
.params
.data
.value
== '00' && ! e
.params
.data
.label
.match({xlj t
="Reset"})){
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");
154 $("#list_collapse").detach().appendTo("#objTreeMenu_1_node_1 nobr");
156 // functions to view and pop out documents as needed.
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();
168 if (!popsrc
.includes('&view&')) {
170 } else if (diview
.toLowerCase().includes('.dcm') || diview
.toLowerCase().includes('.zip')) {
171 popsrc
= "{$GLOBALS.webroot}/library/dicom_frame.php?web_path=" + popsrc
;
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, '', '', {
186 { text
: btnText
, close
: true, style
: 'primary btn-sm', click
: poContentModal
},
187 { text
: btnClose
, close
: true, style
: 'secondary btn-sm' }
199 {datetimepickerSupport
}