Fix the size of the calendar add/edit popup to fit the fields displayed
[openemr.git] / interface / main / calendar / modules / PostCalendar / pntemplates / default / user / submit_no_nav.html
blob90ec1a287d9481d1956263c720f5efedc6afb437
1 [-*Smarty*-]
2 <!-- main navigation -->
3 [-*Load the Language Definitions*-]
4 [-config_load file="lang.$USER_LANG"-]
5 [-include file="$TPL_NAME/views/header.html"-]
6 [-*Main Navigation*-]
7 [-literal-]
8 <SCRIPT LANGUAGE="JavaScript">
10 function popUp(location) {
11 day = new Date();
12 id = "findfirstpopup";
14 var provid = document.find_first.event_userid.options[document.find_first.event_userid.selectedIndex].value;
15 var patient_id = document.find_first.event_pid.options[document.find_first.event_pid.selectedIndex].value;
16 var title = document.find_first.event_subject.value;
17 var category = document.find_first.event_category.options[document.find_first.event_category.selectedIndex].value;
18 var duration_m = document.find_first.event_dur_minutes.options[document.find_first.event_dur_minutes.selectedIndex].value;
19 var duration_h = document.find_first.event_dur_hours.options[document.find_first.event_dur_hours.selectedIndex].value;
20 var s_day = document.find_first.event_startday.options[document.find_first.event_startday.selectedIndex].value;
21 var s_month = document.find_first.event_startmonth.options[document.find_first.event_startmonth.selectedIndex].value;
22 var s_year = document.find_first.event_startyear.options[document.find_first.event_startyear.selectedIndex].value;
23 var s_hour = document.find_first.event_starttimeh.options[document.find_first.event_starttimeh.selectedIndex].value;
24 var s_min = document.find_first.event_starttimem.options[document.find_first.event_starttimem.selectedIndex].value;
25 var s_ampm = document.find_first.event_startampm.options[document.find_first.event_startampm.selectedIndex].value;
28 location = location + '&provider_id=' + provid;
29 location = location + '&patient_id=' + patient_id;
32 if (title != "undefined") {
33 location = location + '&event_subject=' + title;
35 if (category != "undefined") {
36 location = location + '&event_category=' + category;
38 if (duration_m != "undefined") {
40 location = location + '&event_dur_minutes=' + duration_m;
44 if (duration_h != "undefined") {
45 location = location + '&event_dur_hours=' + duration_h;
48 if (s_day != "undefined") {
49 location = location + '&event_startday=' + s_day;
51 if (s_month != "undefined") {
52 location = location + '&event_startmonth=' + s_month;
54 if (s_year != "undefined") {
55 location = location + '&event_startyear=' + s_year;
57 if (s_hour != "undefined") {
58 location = location + '&event_starttimeh=' + s_hour;
60 if (s_min != "undefined") {
62 location = location + '&event_starttimem=' + s_min;
64 if (s_ampm != "undefined") {
65 location = location + '&event_startampm=' + s_ampm;
69 top.restoreSession();
70 eval("page" + id + " = window.open(location, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=350,height=400,left = 825,top = 400');");
74 function reloadForm(select) {
75 var provid = select.options[select.selectedIndex].value;
76 var title = document.find_first.event_subject.value;
77 var category = document.find_first.event_category.options[document.find_first.event_category.selectedIndex].value;
78 var duration_m = document.find_first.event_dur_minutes.options[document.find_first.event_dur_minutes.selectedIndex].value;
79 var duration_h = document.find_first.event_dur_hours.options[document.find_first.event_dur_hours.selectedIndex].value;
80 var s_day = document.find_first.event_startday.options[document.find_first.event_startday.selectedIndex].value;
81 var s_month = document.find_first.event_startmonth.options[document.find_first.event_startmonth.selectedIndex].value;
82 var s_year = document.find_first.event_startyear.options[document.find_first.event_startyear.selectedIndex].value;
83 var s_hour = document.find_first.event_starttimeh.options[document.find_first.event_starttimeh.selectedIndex].value;
84 var s_min = document.find_first.event_starttimem.options[document.find_first.event_starttimem.selectedIndex].value;
85 var s_ampm = document.find_first.event_startampm.options[document.find_first.event_startampm.selectedIndex].value;
86 var location = 'find_patient.php?[-/literal-][-$qstring-][-literal-]';
88 location = location + '&provider_id=' + provid;
90 if (title != "undefined") {
91 location = location + '&event_subject=' + title;
93 if (category != "undefined") {
94 location = location + '&event_category=' + category;
96 if (duration_m != "undefined") {
97 location = location + '&event_dur_minutes=' + duration_m;
99 if (duration_h != "undefined") {
100 alter("here is durationh". duration_h);
101 location = location + '&event_dur_hours=' + duration_h;
104 if (s_day != "undefined") {
105 location = location + '&event_startday=' + s_day;
107 if (s_month != "undefined") {
108 location = location + '&event_startmonth=' + s_month;
110 if (s_year != "undefined") {
111 location = location + '&event_startyear=' + s_year;
113 if (s_hour != "undefined") {
114 location = location + '&event_starttimeh=' + s_hour;
116 if (s_min != "undefined") {
118 location = location + '&event_starttimem=' + s_min;
120 if (s_ampm != "undefined") {
121 location = location + '&event_startampm=' + s_ampm;
123 top.restoreSession();
124 window.location.href=location;
128 function populateOffice(select) {
129 var EventCats = new Array();
130 [-/literal-][-foreach item=cat from=$category-][-literal-]
132 EventCats["value[-/literal-][-$cat.id-][-literal-]"] = new Array();
134 EventCats["value[-/literal-][-$cat.id-][-literal-]"]["name"]="[-/literal-][-$cat.name-][-literal-]";
135 EventCats["value[-/literal-][-$cat.id-][-literal-]"]["duration"]="[-/literal-][-$cat.event_duration-][-literal-]";
136 EventCats["value[-/literal-][-$cat.id-][-literal-]"]["repeat"]="[-/literal-][-$cat.event_repeat-][-literal-]";
137 EventCats["value[-/literal-][-$cat.id-][-literal-]"]["repeat_freq"]="[-/literal-][-$cat.event_repeat_freq-][-literal-]";
138 EventCats["value[-/literal-][-$cat.id-][-literal-]"]["repeat_freq_type"]="[-/literal-][-$cat.event_repeat_freq_type-][-literal-]";
139 EventCats["value[-/literal-][-$cat.id-][-literal-]"]["repeat_on_num"]="[-/literal-][-$cat.event_repeat_on_num-][-literal-]";
140 EventCats["value[-/literal-][-$cat.id-][-literal-]"]["repeat_on_day"]="[-/literal-][-$cat.event_repeat_on_day-][-literal-]";
141 EventCats["value[-/literal-][-$cat.id-][-literal-]"]["repeat_on_freq"]="[-/literal-][-$cat.event_repeat_on_freq-][-literal-]";
142 EventCats["value[-/literal-][-$cat.id-][-literal-]"]["recurrspec"]="[-/literal-][-$cat.event_recurrspec-][-literal-]";
143 EventCats["value[-/literal-][-$cat.id-][-literal-]"]["durationh"]="[-/literal-][-$cat.event_durationh-][-literal-]";
144 EventCats["value[-/literal-][-$cat.id-][-literal-]"]["durationm"]="[-/literal-][-$cat.event_durationm-][-literal-]";
145 EventCats["value[-/literal-][-$cat.id-][-literal-]"]["end_date_flag"]="[-/literal-][-$cat.end_date_flag-][-literal-]";
146 EventCats["value[-/literal-][-$cat.id-][-literal-]"]["end_date_type"]="[-/literal-][-$cat.end_date_type-][-literal-]";
147 EventCats["value[-/literal-][-$cat.id-][-literal-]"]["end_date_freq"]="[-/literal-][-$cat.end_date_freq-][-literal-]";
148 EventCats["value[-/literal-][-$cat.id-][-literal-]"]["all_day"]="[-/literal-][-$cat.end_all_day-][-literal-]";
151 [-/literal-][-/foreach-][-literal-]
154 var that = select.value;
155 var cat = "value";
156 cat += select.value;
157 document.find_first.event_subject.value = EventCats.eval(cat).name;
160 var found_dur_min = 0;
162 document.find_first.event_repeat_on_freq = EventCats.eval(cat).repeat_on_freq;
163 for(var i=0;i < document.find_first.event_dur_minutes.length;i++){
164 if(document.find_first.event_dur_minutes.options[i].value == EventCats.eval(cat).durationm){
165 found_dur_min = 1;
166 document.find_first.event_dur_minutes.options[i].selected =true;
170 if(found_dur_min != 1){
171 document.find_first.event_dur_minutes.options[document.find_first.event_dur_minutes.options.length++]= new Option(EventCats.eval(cat).durationm,EventCats.eval(cat).durationm,false,true);
175 for(var i=0;i < document.find_first.event_allday.length;i++){
177 if(document.find_first.event_allday[i].value == EventCats.eval(cat).all_day){
179 document.find_first.event_allday[i].checked =true;
183 for(var i=0;i < document.find_first.event_repeat.length;i++){
184 if(document.find_first.event_repeat[i].value == EventCats.eval(cat).repeat){
186 document.find_first.event_repeat[i].checked =true;
190 for(var i=0;i < document.find_first.event_endtype.length;i++){
191 if(document.find_first.event_endtype[i].value == EventCats.eval(cat).end_date_type){
193 document.find_first.event_endtype[i].checked =true;
197 document.find_first.event_repeat_freq_type.value = EventCats.eval(cat).repeat_freq_type;
199 document.find_first.event_repeat_on_num.value = EventCats.eval(cat).repeat_on_num;
201 document.find_first.event_repeat_on_day.value = EventCats.eval(cat).repeat_on_day;
203 for(var i=0;i < document.find_first.event_dur_hours.length;i++){
204 if(document.find_first.event_dur_hours.options[i].value == EventCats.eval(cat).durationh){
206 document.find_first.event_dur_hours.options[i].selected =true;
210 date = new Date();
211 date.setDate(document.find_first.event_startday.options[document.find_first.event_startday.selectedIndex].value);
212 date.setMonth(document.find_first.event_startmonth.options[document.find_first.event_startmonth.selectedIndex].value -1 );
213 date.setFullYear(document.find_first.event_startyear.options[document.find_first.event_startyear.selectedIndex].value);
215 if(EventCats.eval(cat).end_date_flag > 0)
217 var num = parseInt(EventCats.eval(cat).end_date_freq);
218 switch(EventCats.eval(cat).end_date_type)
220 case '0':
221 case '4':
222 date.setDate(date.getDate() + num);
223 break;
224 case '1':
225 date.setDate(date.getDate() + (num * 7));
226 break;
227 case '2':
228 date.setMonth(date.getMonth() + num);
229 break;
230 case '3':
231 date.setFullYear(date.getFullYear() + num);
232 break;
234 document.find_first.event_endday = date.getDate();
235 document.find_first.event_endmonth = (date.getMonth() +1);
236 document.find_first.event_endyear = date.getFullYear();
239 [-/literal-]
240 [-literal-]
244 </script>
245 [-/literal-]
246 [-if $double_book eq 1-]
247 [-assign var=disable value="disabled"-]
248 [-/if-]
250 <form name="find_first" action="find_patient.php?no_nav=1" method="post" enctype="application/x-www-form-urlencoded" onsubmit="return top.restoreSession()">
251 <table width="100%" border="0" cellpadding="2" cellspacing="0" >
252 <!-- EVENT INFO ROWS -->
253 <tr>
254 <td valign="top">
256 [-$EventTitle-] <span style="font-size:8pt;">[-$Required-]</span><br />
257 <input type="text" name="[-$InputEventTitle-]" value="[-$ValueEventTitle-]" [-$disable-]/><br />
258 [-if $disable-]
259 <input type="hidden" name="[-$InputEventTitle-]" value="[-$ValueEventTitle-]"/>
260 [-/if-]
261 [-$DateTimeTitle-] <span style="font-size:8pt;">[-$Required-]</span><br />
262 [-$SelectDateTime-]<br /><br />
263 [-if $disable-]
264 <input type="hidden" name="event_startday" value="[-$event_startday-]">
265 [-/if-]
266 [-if $disable-]
267 <input type="hidden" name="event_startmonth" value="[-$event_startmonth-]">
268 [-/if-]
269 [-if $disable-]
270 <input type="hidden" name="event_startyear" value="[-$event_startyear-]">
271 [-/if-]
272 <input type="hidden" name="event_sharing" value="1"><!-- default of 1 is ahring type "public" -->
275 </td>
276 <td>&nbsp;</td>
277 <td align="left" valign="top">
278 <table cellpadding="0" cellspacing="0">
279 <tr><td>Provider</td>
280 <td>
281 [-strip-]
282 <select name="event_userid" onChange="reloadForm(this);" [-$disable-]>
283 <option value="">Unassigned</option>
284 [-foreach item=provider from=$user-]
285 <option value="[-$provider.id-]"
286 [-if $ProviderID eq $provider.id-]
287 selected
288 [-/if-]
289 >[-$provider.lname-], [-$provider.fname-]</option>
290 [-/foreach-]
292 </select>
293 [-/strip-]
294 [-if $disable-]
295 <input type="hidden" name="event_userid" value="[-$ProviderID-]">
296 [-/if-]
297 </td>
298 </tr>
299 <tr>
300 <td>Patient</td>
301 <td>
302 [-strip-]
303 <select name="event_pid" [-$disable-]>
304 [-if count($PatientList) > 1-]
305 <option value="">None Specified</option>
306 [-/if-]
307 [-foreach item=patient from=$PatientList-]
308 <option value="[-$patient.pid-]">[-$patient.lname-], [-$patient.fname-]</option>
309 [-/foreach-]
310 [-if count($PatientList) < 2-]
311 <option value="">None Specified</option>
312 [-/if-]
313 </select>
314 [-/strip-]
315 [-if $disable-]
316 <input type="hidden" name="event_pid" value="[-$patient.pid-]">
317 [-/if-]
318 </td></tr>
319 <tr>
320 <td valign="top">
321 <table><tr>
322 <td>Category&nbsp;</td>
323 <tr><td>Time &nbsp;</td></td></tr>
325 <tr><td>[-$TimedDurationTitle-]&nbsp;</td>
326 </tr></table>
327 </td>
328 <td>
329 [-strip-]
330 <select name="[-$InputEventCategory-]" onChange="populateOffice(this);" [-$disable-]>
331 [-foreach item=category from=$categories-]
332 <option value="[-$category.value-]" [-$category.selected-]>[-$category.name-]</option>
333 [-/foreach-]
334 </select>
335 [-/strip-]
336 [-if $disable-]
337 <input type="hidden" name="[-$InputEventCategory-]" value="[-$hidden_event_category-]">
338 [-/if-]
339 <br />
340 [-$SelectTimedHours-] [-$SelectTimedMinutes-] [-$SelectTimedAMPM-]
341 [-if $disable-]
342 <input type="hidden" name="event_starttimeh" value="[-$event_starttimeh-]">
343 [-/if-]
344 [-if $disable-]
345 <input type="hidden" name="event_starttimem" value="[-$event_starttimem-]">
346 [-/if-]
347 [-if $disable-]
348 <input type="hidden" name="event_startampm" value="[-$event_startampm-]">
349 [-/if-]
350 <br />
353 [-strip-]
354 <!--<select name="[-$InputTimedDurationHours-]">
355 [-foreach item=time from=$TimedDurationHours-]
356 <option value="[-$time.value-]" [-$time.selected-]>[-$time.name-]</option>
357 [-/foreach-]
358 </select> -->
359 [-if $disable-]
360 <input type="hidden" name="[-$InputTimedDurationHours-]" value="[-$event_dur_hours-]" />
361 [-/if-]
362 <select name="[-$InputTimedDurationHours-]" [-$disable-]>
363 [-foreach item=timeh from=$TimedDurationHours-]
364 <option value="[-$timeh.value-]" [-$timeh.selected-]>[-$timeh.name-]</option>
365 [-/foreach-]
366 </select>:
367 <select name="[-$InputTimedDurationMinutes-]" [-$disable-]>
368 [-foreach item=time from=$TimedDurationMinutes-]
369 <option value="[-$time.value-]" [-$time.selected-]>[-$time.name-]</option>
370 [-/foreach-]
371 </select>
372 [-/strip-]
373 [-if $disable-]
374 <input type="hidden" name="[-$InputTimedDurationMinutes-]" value="[-$event_dur_minutes-]">
375 [-/if-]
377 </td></tr>
378 [-if $displayTopics eq 1-]
379 <tr><td>[-$EventTopicTitle-]</td>
380 <td>
381 [-strip-]
382 <select name="[-$InputEventTopic-]" [-$disable-]>
383 [-foreach item=topic from=$topics-]
384 <option value="[-$topic.value-]" [-$topic.selected-]>[-$topic.name-]</option>
385 [-/foreach-]
386 </select>
387 [-/strip-]
388 [-if $disable-]
389 <input type="hidden" name="[-$InputEventTopic-]" value="[-$topic.value-]">
390 [-/if-]
391 </td></tr>
392 [-/if-]
395 </table>
396 </td>
398 </tr>
399 <tr>
400 <td colspan="3" align="center">
401 [-php-]
403 $plussevend = strtotime("+7 days");
405 $eday = date("d",$plussevend);
406 $emonth = date("m",$plussevend);
407 $eyear = date("Y",$plussevend);
408 $this->assign("endd",$eday);
409 $this->assign("endm",$emonth);
410 $this->assign("endy",$eyear);
411 [-/php-]
412 [-if $double_book ne 1-]
413 <A HREF="javascript:popUp('index.php?no_nav=1&module=PostCalendar&func=search&submit=Find%20First')" style="font-size:10pt;font-family:san-serif;">First Available Appointment</A>
414 [-/if-]
415 &nbsp;[-$FormSubmit-]
417 </td>
418 </tr>
420 </table>
421 [-if $ValueEventDesc -]
422 <input type="hidden" name="[-$InputEventDesc-]" value="[-$ValueEventDesc-]" />
423 [-else-]
424 <input type="hidden" name="[-$InputEventDesc-]" value="no description" />
425 [-/if-]
426 <input type="hidden" name="[-$InputTimed-]" value="[-$ValueTimed-]" />
427 <!-- EVENT INFO ROWS -->
428 <!-- baggage from regular size submit form -->
429 <input type="hidden" name="[-$InputNoRepeat-]" value="[-$ValueNoRepeat-]" [-$SelectedNoRepeat-] />
430 <input type="hidden" name="[-$InputRepeatOnFreq-]" value="[-$InputRepeatOnFreqVal-]" size="4" />
431 <input type="hidden" name="event_repeat_freq_type" value="[-$InputRepeatOnFreqVal-]" size="4" />
432 <input type="hidden" name="event_repeat_on_num" value="[-$InputRepeatOnFreqVal-]" size="4" />
433 <input type="hidden" name="event_repeat_on_day" value="[-$InputRepeatOnFreqVal-]" size="4" />
434 <input type="hidden" name="[-$InputEndOn-]" value="[-$ValueEndOn-]" [-$SelectedEndOn-] />
435 <input type="hidden" name="event_endmonth" id="event_endmonth" value="01">
436 <input type="hidden" name="event_endday" id="event_day" value="01">
437 <input type="hidden" name="event_endyear" id="event_day" value="1994">
438 <input type="hidden" name="[-$InputNoEnd-]" value="[-$ValueNoEnd-]" [-$SelectedNoEnd-] />
439 <input type="hidden" name="double_book" value="[-$double_book-]"/>
440 <!-- REPEATING ROWS -->
441 <input type="hidden" name="pc_html_or_text" value="text" selected>
442 [-*$EventHTMLorText*-]
445 [-$FormHidden-]
448 </form>
449 [-include file="$TPL_NAME/views/footer.html"-]