2 [-*****************************************************************************-]
3 [-* Copyright (C)
2005-
2006 Rod Roark
<rod@sunsetsystems.com
> and others *-]
5 [-* This program is free software; you can redistribute it and/or *-]
6 [-* modify it under the terms of the GNU General Public License *-]
7 [-* as published by the Free Software Foundation; either version
2 *-]
8 [-* of the License, or (at your option) any later version. *-]
9 [-*****************************************************************************-]
10 [-config_load
file=
"default.conf"-]
11 [-*Load the Language Definitions*-]
12 [-config_load
file=
"lang.$USER_LANG"-]
13 [-include
file=
"$TPL_NAME/views/header.html"-]
15 [-*Values used in setting timeslot and event heights*-]
17 /* if you change these be sure to change their matching values in
18 * the CSS for the calendar, found in interface/themes/ajax_calendar.css
20 $timeslotHeightVal=
20;
21 $
timeslotHeightUnit=
"px";
24 <script language='JavaScript'
>
26 var mypcc
= '[-php-] echo $GLOBALS['phone_country_code
'] [-/php-]';
28 // This is called from the event editor popup.
29 function refreshme() {
31 document
.forms
[0].submit();
34 function newEvt(startampm
, starttimeh
, starttimem
, eventdate
, providerid
, catid
) {
35 dlgopen('add_edit_event.php?startampm=' + startampm
+
36 '&starttimeh=' + starttimeh
+ '&starttimem=' + starttimem
+
37 '&date=' + eventdate
+ '&userid=' + providerid
+ '&catid=' + catid
,
41 function oldEvt(eventdate
, eventid
, pccattype
) {
42 dlgopen('add_edit_event.php?date='+eventdate
+'&eid=' + eventid
+'&prov=' + pccattype
, '_blank', 575, 375);
48 if ($GLOBALS
['concurrent_layout'])
51 echo
" top.RTop.location = '../../patient_file/summary/demographics.php' " .
52 "+ '?set_pid=' + pid;\n";
55 echo
" top.location = '../../patient_file/patient_file.php' " .
56 "+ '?set_pid=' + pid + '&pid=' + pid;\n";
61 function GoToToday(theForm
){
62 var todays_date
= new Date();
63 var theMonth
= todays_date
.getMonth() + 1;
64 theMonth
= theMonth
< 10 ? "0" + theMonth
: theMonth
;
65 theForm
.jumpdate
.value
= todays_date
.getFullYear() + "-" + theMonth
+ "-" + todays_date
.getDate();
74 // this is my proposed setting in the globals config file so we don't
75 // need to mess with altering the pn database AND the config file
76 //pnModSetVar(__POSTCALENDAR__, 'pcFirstDayOfWeek', $GLOBALS['schedule_dow_start']);
78 // build a day-of-week (DOW) list so we may properly build the calendars later in this code
80 $tmpDOW = pnModGetVar(__POSTCALENDAR__, 'pcFirstDayOfWeek');
81 // bound check and auto-correction
82 if ($tmpDOW
<0 || $tmpDOW
>6) {
83 pnModSetVar(__POSTCALENDAR__, 'pcFirstDayOfWeek', '
0');
86 while (count($DOWlist) <
7) {
87 array_push($DOWlist, $tmpDOW);
89 if ($tmpDOW
> 6) $tmpDOW =
0;
92 // A_CATEGORY is an ordered array of associative-array categories.
93 // Keys of interest are: id, name, color, desc, event_duration.
95 // echo
"<!-- A_CATEGORY = "; print_r($this-
>_tpl_vars['A_CATEGORY']); echo
" -->\n"; // debugging
96 // echo
"<!-- A_EVENTS = "; print_r($this-
>_tpl_vars['A_EVENTS']); echo
" -->\n"; // debugging
98 $A_CATEGORY =& $this-
>_tpl_vars['A_CATEGORY'];
100 // [-if $PRINT_VIEW !=
1-]
101 // [-*Main Navigation*-]
102 // [-include
file=
"$TPL_NAME/views/global/navigation.html"-]
105 $A_EVENTS =& $this-
>_tpl_vars['A_EVENTS'];
106 $providers =& $this-
>_tpl_vars['providers'];
107 $times =& $this-
>_tpl_vars['times'];
108 $interval = $this-
>_tpl_vars['interval'];
109 $viewtype = $this-
>_tpl_vars['VIEW_TYPE'];
110 $PREV_WEEK_URL = $this-
>_tpl_vars['PREV_WEEK_URL'];
111 $NEXT_WEEK_URL = $this-
>_tpl_vars['NEXT_WEEK_URL'];
112 $PREV_DAY_URL = $this-
>_tpl_vars['PREV_DAY_URL'];
113 $NEXT_DAY_URL = $this-
>_tpl_vars['NEXT_DAY_URL'];
115 $Date = postcalendar_getDate();
116 if (!isset($y)) $y = substr($Date,
0,
4);
117 if (!isset($m)) $m = substr($Date,
4,
2);
118 if (!isset($d)) $d = substr($Date,
6,
2);
120 // echo
"<!-- There are " . count($A_EVENTS) .
" A_EVENTS days -->\n";
122 //==================================
123 //FACILITY FILTERING (CHEMED)
124 $facilities = getUserFacilities($_SESSION['authId']); // from users_facility
125 if ( $_SESSION['pc_facility'] ) {
126 $provinfo = getProviderInfo('%', true, $_SESSION['pc_facility']);
128 $provinfo = getProviderInfo();
130 //EOS FACILITY FILTERING (CHEMED)
131 //==================================
133 <div id=
"topToolbarRight"> <!-- this wraps some of the top toolbar items -->
135 <!-- stuff form element here to avoid the margin padding it introduces into the page in some browsers -->
136 <form name='theform' id='theform' action='index.php?module=PostCalendar&func=view&tplview=default&pc_category=&pc_topic=' method='post' onsubmit='return top.restoreSession()'
>
137 <input type=
"hidden" name=
"jumpdate" id=
"jumpdate" value=
"">
138 <input type=
"hidden" name=
"viewtype" id=
"viewtype" value=
"[-php-]echo $viewtype;[-/php-]">
140 echo
" <a href='#' value='" .xl (
"Add").
"' onclick='newEvt(1, 9, 00, $Date, 0, 0)' class='css_button'/><span>".xl(
"Add").
"</span></a>\n";
141 echo
" <a href='#' value='" . xl (
"Search") .
142 "' onclick='top.restoreSession();location=\"index.php?module=PostCalendar&func=search\
"' class='css_button'/><span>".xl(
"Search").
"</span></a>\n";
148 <a href='#' name='bnsubmit' value='[-php-]echo xl ("Today
")[-/php-]' onClick='GoToToday(theform);' class='css_button'/><span>[-php-] echo xl("Today
")[-/php-]</span></a>
149 <a href='[-php-]echo $PREV_MONTH_URL[-/php-]' onclick='top.restoreSession()'>
150 <img id="prevmonth
" src="[-$TPL_IMAGE_PATH-]/leftbtn.gif
" border="0" title="[-php-]echo xl(
"Previous Month")[-/php-]
" alt="[-php-]echo xl (
"Previous Month")[-/php-]
" style="padding-top:
5px
"/></a>
151 <a href='[-php-]echo $NEXT_MONTH_URL[-/php-]' onclick='top.restoreSession()'>
152 <img id="nextmonth
" src="[-$TPL_IMAGE_PATH-]/rightbtn.gif
" border="0" title="[-php-]echo xl(
"Next Month")[-/php-]
" alt="[-php-]echo xl (
"Next Month")[-/php-]
" /></a>
155 echo xl(date('F', strtotime($Date))) . " " . date('Y', strtotime($Date));
159 <div id="viewPicker
">
161 echo " <a href='#' type='button' id='printview' title='
" .xl ("Print View
"). "' class='css_button'
/><span>".xl("Print
")."</span></a>\n
";
162 echo " <a href='#' type='button' value='
" .xl ("Refresh
"). "' onclick='javascript:refreshme()' class='css_button'
/><span>".xl("Refresh
")."</span></a>\n
";
163 echo " <a href='#' type='button' id='dayview' title='
" .htmlspecialchars( xl('Day View'), ENT_QUOTES). "' class='css_button'
/><span>".htmlspecialchars( xl('Day'), ENT_QUOTES)."</span></a>\n
";
164 echo " <a href='#' type='button' id='weekview' title='
" .htmlspecialchars( xl('Week View'), ENT_QUOTES). "' class='css_button'
/><span>".htmlspecialchars( xl('Week'), ENT_QUOTES)."</span></a>\n
";
165 echo " <a href='#' type='button' id='monthview' title='
" .htmlspecialchars( xl('Month View'), ENT_QUOTES). "' class='css_button'
/><span>".htmlspecialchars( xl('Month'), ENT_QUOTES)."</span></a>\n
";
168 </div> <!-- end topToolbarRight -->
170 <div id="bottomLeft
">
171 <div id="datePicker
">
172 <table border="0" cellpadding="0" cellspacing="0">
175 // caldate depends on what the user has clicked
176 $caldate = strtotime($Date);
177 $cMonth = date("m
", $caldate);
178 $cYear = date("Y
", $caldate);
179 $cDay = date("d
", $caldate);
181 // compute the previous month date
182 // stay on the same day if possible
184 $pMonth = $cMonth - 1;
186 if ($pMonth < 1) { $pMonth = 12; $pYear = $cYear - 1; }
187 while (! checkdate($pMonth, $pDay, $pYear)) { $pDay = $pDay - 1; }
188 $prevMonth = sprintf("%d%
02d%
02d
",$pYear,$pMonth,$pDay);
190 // compute the next month
191 // stay on the same day if possible
193 $nMonth = $cMonth + 1;
195 if ($nMonth > 12) { $nMonth = 1; $nYear = $cYear + 1; }
196 while (! checkdate($nMonth, $nDay, $nYear)) { $nDay = $nDay - 1; }
197 $nextMonth = sprintf("%d%
02d%
02d
",$nYear,$nMonth,$nDay);
199 <td class="tdDOW-small tdDatePicker tdNav
" id="[-php-]echo $prevMonth[-/php-]
" title="[-php-]echo xl(date(
"F", strtotime($prevMonth)));[-/php-]
"><</td>
200 <td colspan="5" class="tdMonthName-small
">
202 echo xl(date('F', $caldate));
205 <td class="tdDOW-small tdDatePicker tdNav
" id="[-php-]echo $nextMonth[-/php-]
" title="[-php-]echo xl(date(
"F", strtotime($nextMonth)));[-/php-]
">></td>
208 foreach ($DOWlist as $dow) {
209 echo "<td class='tdDOW-small'
>".$this->_tpl_vars['A_SHORT_DAY_NAMES'][$dow]."</td>";
214 $atmp = array_keys($A_EVENTS);
216 foreach ($atmp as $currdate) {
217 $currdate = strtotime($currdate);
218 if (date('w', $currdate) == $DOWlist[0]) {
225 $tdClass = "tdMonthDay-small
";
226 if (date('m', $currdate) != $month) {
227 $tdClass = "tdOtherMonthDay-small
";
229 if ((date('w', $currdate) == 0) || (date('w', $currdate) == 6)) {
230 $tdClass = "tdWeekend-small
";
233 if (date('Ymd',$currdate) == $Date) {
234 // $Date is defined near the top of this file
235 // and is equal to whatever date the user has clicked
236 $tdClass .= " currentDate
";
239 // add a class so that jQuery can grab these days for the 'click' event
240 $tdClass .= " tdDatePicker
";
244 $td .= "class=\
"".$tdClass.
"\" ";
245 //$td .= "id=\
"".date(
"Ymd", $currdate).
"\" ";
246 $td .= "id=\
"".date(
"Ymd", $currdate).
"\" ";
247 $td .= "title=\
"" . xl('Go to') .
" ".date('F', $currdate).
"\" ";
248 $td .= "> ".date('d', $currdate)."</td>\n
";
252 if (date('w', $currdate) == $DOWlist[6]) echo "</tr>\n
";
257 <div id="bigCalHeader
">
260 <div id="providerPicker
">
261 [-php-] xl('Providers','e'); [-/php-]
264 // ==============================
265 // FACILITY FILTERING (lemonsoftware)
266 // $facilities = getFacilities();
267 if ($_SESSION['authorizeduser'] == 1) {
268 $facilities = getFacilities();
270 $facilities = getUserFacilities($_SESSION['authId']); // from users_facility
271 if (count($facilities) == 1)
272 $_SESSION['pc_facility'] = key($facilities);
274 if (count($facilities) > 1) {
275 echo " <select name='pc_facility' id='pc_facility' class='view1'
>\n
";
276 if ( !$_SESSION['pc_facility'] ) $selected = "selected='selected'
";
277 // echo " <option value='
0' $selected
>" .xl('All Facilities'). "</option>\n
";
278 if (!$GLOBALS['restrict_user_facility']) echo " <option value='
0' $selected
>" . xl('All Facilities') . "</option>\n
";
280 foreach ($facilities as $fa) {
281 $selected = ( $_SESSION['pc_facility'] == $fa['id']) ? "selected='selected'
" : "" ;
282 echo " <option style=background-color:
".htmlspecialchars($fa['color'],ENT_QUOTES)." value='
" .htmlspecialchars($fa['id'],ENT_QUOTES). "' $selected
>" .htmlspecialchars($fa['name'],ENT_QUOTES). "</option>\n
";
287 // ==============================
289 echo " <select multiple size='
5' name='pc_username[]' id='pc_username' class='view2'
>\n
";
290 echo " <option value='__PC_ALL__'
>" .xl ("All Users
"). "</option>\n
";
291 foreach ($provinfo as $doc) {
292 $username = $doc['username'];
293 echo " <option value='$username'
";
294 foreach ($providers as $provider)
295 if ($provider['username'] == $username) echo " selected
";
296 echo ">" . htmlspecialchars($doc['lname'],ENT_QUOTES) . ",
" . htmlspecialchars($doc['fname'],ENT_QUOTES) . "</option>\n
";
303 if($_SESSION['pc_facility'] == 0){
305 <div id="facilityColor
">
308 foreach ($facilities as $f){
309 echo " <tr><td><div class='view1' style=background-color:
".$f['color'].";font-weight:bold
>".htmlspecialchars($f['name'],ENT_QUOTES)."</div></td></tr>";
319 [-assign var="dayname
" value=$DATE|date_format:"%w
"-]
320 [-assign var="day
" value=$DATE|date_format:"%d
"|string_format:"%
1d
"-]
321 [-assign var="month
" value=$DATE|date_format:"%m
"|string_format:"%
1d
"-]
322 [-assign var="year
" value=$DATE|date_format:"%Y
"|string_format:"%
4d
"-]
323 </div> <!-- end bottomLeft -->
328 foreach ($A_EVENTS as $date => $events) {
330 foreach ($events as $oneE) {
334 echo "<hr width=
100%
>";
339 // This loops once for each provider to be displayed.
341 foreach ($providers as $provider) {
342 $providerid = $provider['id'];
346 echo " <td colspan='
7' class='providerheader'
>";
347 echo htmlspecialchars($provider['fname'],ENT_QUOTES)." ".htmlspecialchars($provider['lname'],ENT_QUOTES);
351 // output date headers
353 $defaultDate = ""; // used when creating link for a 'new' event
354 $in_cat_id = 0; // used when creating link for a 'new' event
356 foreach ($A_EVENTS as $date => $events) {
357 if ($defaultDate == "") $defaultDate = date("Ymd
", strtotime($date));
358 echo "<td align='center' class='month_dateheader'
>";
359 echo xl(date("D
", strtotime($date)));
361 if ($dowCount++ == 6) { break; }
366 // output a TD with an inner containing DIV positioned 'relative'
368 foreach ($A_EVENTS as $date => $events) {
369 $eventdate = substr($date, 0, 4) . substr($date, 5, 2) . substr($date, 8, 2);
371 $gotoURL = pnModURL(__POSTCALENDAR__,'user','view',
372 array('tplview'=>$template_view,
374 'Date'=> date("Ymd
", strtotime($date)),
375 'pc_username'=>$pc_username,
376 'pc_category'=>$category,
377 'pc_topic'=>$topic));
379 if (date("w
", strtotime($date)) == $DOWlist[0]) { echo "<tr>"; }
380 echo "<td class='schedule'
>";
382 echo "<div class='calendar_day'
>\n
";
384 echo "<div class='month_daylink'
>";
385 echo "<a href='
".$gotoURL."' alt='Go to
".date("d M Y
",strtotime($date))."' title='
" . xl('Go to') . " " .date("d M Y
", strtotime($date))."'
>";
386 echo date("d
", strtotime($date))."</a></div>";
388 if (count($events) == 0) { echo " "; }
389 //=======================================================================================
390 //=======================================================================================
391 foreach ($events as $event) {
392 // skip events for other providers
393 // yeah, we've got that sort of overhead here... it ain't perfect
394 if ($providerid != $event['aid']) { continue; }
396 // Omit IN and OUT events to reduce clutter in this month view
397 if (($event['catid'] == 2) || ($event['catid'] == 3)) { continue; }
399 // specially handle all-day events
400 if ($event['alldayevent'] == 1) {
401 $tmpTime = $times[0];
402 if (strlen($tmpTime['hour']) < 2) { $tmpTime['hour'] = "0".$tmpTime['hour']; }
403 if (strlen($tmpTime['minute']) < 2) { $tmpTime['minute'] = "0".$tmpTime['minute']; }
404 $event['startTime'] = $tmpTime['hour'].":
".$tmpTime['minute'].":
00";
405 $event['duration'] = ($calEndMin - $calStartMin) * 60; // measured in seconds
408 // figure the start time and minutes (from midnight)
409 $starth = substr($event['startTime'], 0, 2);
410 $startm = substr($event['startTime'], 3, 2);
411 $eStartMin = $starth * 60 + $startm;
412 $startDateTime = strtotime($date." ".$event['startTime']);
414 // determine the class for the event DIV based on the event category
415 $evtClass = "event_appointment
";
416 switch ($event['catid']) {
417 case 1: // NO-SHOW appt
418 $evtClass = "event_noshow
";
421 $evtClass = "event_in
";
423 case 3: // OUT of office
424 $evtClass = "event_out
";
429 $evtClass = "event_reserved
";
431 default: // some appointment
432 $evtClass = "event_appointment
";
436 // now, output the event DIV
438 $eventid = $event['eid'];
439 $eventtype = sqlQuery("SELECT pc_cattype FROM openemr_postcalendar_categories as oc LEFT OUTER JOIN openemr_postcalendar_events as oe ON oe.pc_catid=oc.pc_catid WHERE oe.pc_eid='
".$eventid."'
");
441 if($eventtype['pc_cattype']==1)
443 $patientid = $event['pid'];
444 $commapos = strpos($event['patient_name'], ",
");
445 $lname = substr($event['patient_name'], 0, $commapos);
446 $fname = substr($event['patient_name'], $commapos + 2);
447 $patient_dob = $event['patient_dob'];
448 $patient_age = $event['patient_age'];
449 $catid = $event['catid'];
450 $comment = addslashes($event['hometext']);
451 $catname = $event['catname'];
452 $title = "Age $patient_age ($patient_dob)
";
454 // format the time specially
455 $displayTime = date("g
", $startDateTime);
456 if (date("i
", $startDateTime) == "00") {
457 $displayTime .= (date("a
", $startDateTime));
460 $displayTime .= (date(":ia
", $startDateTime));
463 if ($comment && $GLOBALS['calendar_appt_style'] < 4) $title .= " " . $comment;
465 // the divTitle is what appears when the user hovers the mouse over the DIV
466 $divTitle = dateformat (strtotime($date),true);
467 $result = sqlStatement("SELECT name,id,color FROM facility WHERE id=(SELECT pc_facility FROM openemr_postcalendar_events WHERE
pc_eid=
".$eventid.")
");
468 $row = sqlFetchArray($result);
469 $color=$event["catcolor
"];
470 if($GLOBALS['event_color']==2)
471 $color=$row['color'];
472 $divTitle .= "\n
" .htmlspecialchars($row['name'],ENT_QUOTES);
474 if ($catid == 4 || $catid == 8 || $catid == 11) {
475 if ($catid == 4) $catname = xl("VACATION
");
476 else if ($catid == 8) $catname = xl("LUNCH
");
477 else if ($catid == 11) $catname = xl("RESERVED
");
480 if ($comment) $atitle .= " $comment
";
481 $divTitle .= "\n[
".$atitle ."]
";
482 $content .= $displayTime;
483 $content .= " ".$catname;
486 // some sort of patient appointment
487 $divTitle .= "\r\n[
".$catname.' '.htmlspecialchars($comment, ENT_QUOTES) ."]
".htmlspecialchars($fname,ENT_QUOTES)." ".htmlspecialchars($lname,ENT_QUOTES);
488 $content .= $displayTime;
490 // include patient name and link to their details
491 $link_title = htmlspecialchars($fname,ENT_QUOTES)." ".htmlspecialchars($lname,ENT_QUOTES). " \n
";
492 $link_title .= xl('Age') . ":
".$patient_age."\n
" . xl('DOB') . ":
".$patient_dob.htmlspecialchars($comment, ENT_QUOTES)."\n
";
493 $link_title .= "(
" . xl('Click to view') . ")
";
494 $content .= "<a href='javascript:goPid($patientid)' title='$link_title'
>";
495 $content .= "<img src='$TPL_IMAGE_PATH/user-green.gif' border='
0' title='$link_title' alt='View Patient'
/>";
496 if ($catid == 1) $content .= "<strike>";
497 $content .= htmlspecialchars($lname);
498 if ($GLOBALS['calendar_appt_style'] != 1) {
499 $content .= ",
" . htmlspecialchars($fname);
500 if ($event['title'] && $GLOBALS['calendar_appt_style'] >= 3) {
501 $content .= "(
" . $event['title'];
502 if ($event['hometext'] && $GLOBALS['calendar_appt_style'] >= 4)
503 $content .= ":
<font color='green'
>" . htmlspecialchars(trim($event['hometext'])) . "</font>";
507 if ($catid == 1) $content .= "</strike>";
511 // no patient id, just output the category name
512 $content .= " ".$catname;
515 $divTitle .= "\n(
" . xl('double click to edit') . ")
";
516 if($_SESSION['pc_facility'] == 0){
517 echo "<div class='
".$evtClass." month_event' style='background-color:
".$color.
518 "' title='
".$divTitle."'
".
519 " id='
".$eventdate."-
".$eventid."-
".$pccattype."'
".
524 elseif($_SESSION['pc_facility'] == $row['id']){
525 echo "<div class='
".$evtClass." month_event' style='background-color:
".$event["catcolor
"].
526 "' title='
".$divTitle."'
".
527 " id='
".$eventdate."-
".$eventid."-
".$pccattype."'
".
533 echo "<div class='
".$evtClass." month_event' style='background-color:#DDDDDD
".
534 "' title='
".$divTitle."'
".
535 " id='
".$eventdate."-
".$eventid."-
".$pccattype."'
".
537 echo "<span style='color:red;text-align:center;'
>".$displayTime." ".htmlspecialchars($row['name'],ENT_QUOTES)."</span>";
541 //=======================================================================================
542 //=======================================================================================
545 if (date("w
", strtotime($date)) == $DOWlist[6]) { echo "</tr>"; }
553 // [-include file="$TPL_NAME/views/global/footer.html
"-]
554 // [-include file="$TPL_NAME/views/footer.html
"-]
557 </div> <!-- end bigCal DIV -->
558 </div> <!-- end bottom DIV -->
561 <script language='JavaScript'>
563 $(document).ready(function(){
564 $("#pc_username
").change(function() { ChangeProviders(this); });
565 $("#pc_facility
").change(function() { ChangeProviders(this); });
566 $("#dayview
").click(function() { ChangeView(this); });
567 $("#weekview
").click(function() { ChangeView(this); });
568 //$("#monthview
").click(function() { ChangeView(this); });
569 //$("#yearview
").click(function() { ChangeView(this); });
570 $(".tdDatePicker
").click(function() { ChangeDate(this); });
571 $("#datePicker
.tdNav
").mouseover(function() { $(this).toggleClass("tdDatePickerHighlight
"); });
572 $("#datePicker
.tdNav
").mouseout(function() { $(this).toggleClass("tdDatePickerHighlight
"); });
573 $("#printview
").click(function() { PrintView(this); });
574 $(".month_event
").dblclick(function() { EditEvent(this); });
575 $(".month_event
").mouseover(function() { $(this).toggleClass("event_highlight
"); });
576 $(".month_event
").mouseout(function() { $(this).toggleClass("event_highlight
"); });
579 /* edit an existing event */
580 var EditEvent = function(eObj) {
581 //alert ('editing '+eObj.id);
582 // split the object ID into date and event ID
584 var parts = new Array();
585 parts = objID.split("-");
586 // call the oldEvt function to bring up the event editor
587 oldEvt(parts[0], parts[1], parts[2]);
591 /* pop up a window to print the current view
593 var PrintView = function (eventObject) {
594 printURL = "[-php
-]echo
pnModURL(__POSTCALENDAR__
,'user','view',
595 array('tplview'=>$template_view
,
596 'viewtype'=>$viewtype
,
599 'pc_username'=>$pc_username
,
600 'pc_category'=>$category
,
601 'pc_topic'=>$topic
));[-/php
-]";
602 window.open(printURL,'printwindow','width=740,height=480,toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,copyhistory=no,resizable=yes');
606 /* change the current date based upon what the user clicked in
609 var ChangeDate = function(eObj) {
610 baseURL = "[-php
-]echo
pnModURL(__POSTCALENDAR__
,'user','view',
611 array('tplview'=>$template_view
,
612 'viewtype'=>$viewtype
,
613 'Date'=> '~REPLACEME~',
614 'pc_username'=>$pc_username
,
615 'pc_category'=>$category
,
616 'pc_topic'=>$topic
));[-/php
-]";
617 newURL = baseURL.replace(/~REPLACEME~/, eObj.id);
618 document.location.href=newURL;
621 /* change the provider(s)
623 var ChangeProviders = function (eventObject) {
624 $('#theform').submit();
627 /* change the calendar view
629 var ChangeView = function (eventObject) {
630 if (eventObject.id == "dayview
") {
631 $("#viewtype
").val('day');
633 else if (eventObject.id == "weekview
") {
634 $("#viewtype
").val('week');
636 else if (eventObject.id == "monthview
") {
637 $("#viewtype
").val('month');
639 else if (eventObject.id == "yearview
") {
640 $("#viewtype
").val('year');
642 $('#theform').submit();