From: <par...@us...> - 2009-07-10 21:06:45
|
Update of /cvsroot/phpicalendar/phpicalendar/functions In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv1223/functions Modified Files: template.php Log Message: Small cleanup in draw_week() and fix bogus span icon for 24-hour events ending at midnight. Index: template.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/functions/template.php,v retrieving revision 1.123 retrieving revision 1.124 diff -C2 -d -r1.123 -r1.124 *** template.php 10 Jul 2009 20:31:22 -0000 1.123 --- template.php 10 Jul 2009 21:06:29 -0000 1.124 *************** *** 303,307 **** $row = $loop_row_begin; $day = 0; ! $replace =''; while ($day < $phpiCal_config->week_length){ $colspan = 0; --- 303,307 ---- $row = $loop_row_begin; $day = 0; ! $replace = ''; while ($day < $phpiCal_config->week_length){ $colspan = 0; *************** *** 316,321 **** $allday = $master_array[$weekarray[$day]]['-1'][$uid]; foreach ($allday_uid_dates[$uid] as $date){ - #$ev = (!isset($ev)) ? " $uid ":""; - #$replace .= $ev; $colspan += $nbrGridCols[$weekarray[$day]]; $day++; --- 316,319 ---- *************** *** 341,363 **** $weekreplace .= "$row\n"; } - /* old routine - foreach ($weekarray as $i=>$get_date) { - $replace = $loop_begin; - $colspan = 'colspan="'.$nbrGridCols[$get_date].'"'; - $replace = str_replace('{COLSPAN}', $colspan, $replace); - if (isset($master_array[$get_date]['-1']) && is_array($master_array[$get_date]['-1']) && !empty($master_array[$get_date]['-1']) ) { - foreach ($master_array[$get_date]['-1'] as $uid => $allday) { - $event_calno = $allday['calnumber']; - $event_calno = (($event_calno - 1) % $phpiCal_config->unique_colors) + 1; - $event = openevent($get_date, -1, $uid, $allday, $phpiCal_config->allday_week_lines, 11, 'psf'); - $loop_tmp = str_replace('{ALLDAY}', $event, $loop_ad); - $loop_tmp = str_replace('{CALNO}', $event_calno, $loop_tmp); - $replace .= $loop_tmp; - } - } - $replace .= $loop_end; - $weekreplace .= $replace; - } - */ $this->page = preg_replace('!<\!-- loop allday row on -->.*<\!-- loop allday row off -->!Uis', $weekreplace, $this->page); --- 339,342 ---- *************** *** 368,372 **** $weekday_loop = ''; for ($i=0; $i<$phpiCal_config->week_length; $i++) { ! $daylink = date('Ymd', $start_wt); $weekday = localizeDate($dateFormat_week_list, strtotime($daylink)); if ($daylink == $getdate) { --- 347,351 ---- $weekday_loop = ''; for ($i=0; $i<$phpiCal_config->week_length; $i++) { ! $daylink = date('Ymd', $start_wt); $weekday = localizeDate($dateFormat_week_list, strtotime($daylink)); if ($daylink == $getdate) { *************** *** 434,438 **** foreach ($weekarray as $thisday) { $this_time_arr = array(); - $dayborder = 0; if ($phpiCal_config->day_start == $cal_time && isset($master_array[$thisday]) && is_array($master_array[$thisday])) { # want to pile up all the events before day_start that end in the displayed times --- 413,416 ---- *************** *** 466,483 **** } } if (empty($event_length[$thisday])) { # no events - if ($dayborder == 0) { - $class = ' class="weekborder'.$even_row.'"'; - $dayborder++; - } else { - $class = ''; - $dayborder = 0; - } $tclass = $class; ! if ($thisday == $getdate) { ! if ($tclass) $tclass = ' class="weekborder'.$even_row.' weektoday"'; ! else $tclass = ' class="weektoday"'; ! } $drawWidth = 1; $weekdisplay .= '<td colspan="' . $nbrGridCols[$thisday] . '"' . $tclass . '> </td>'."\n"; --- 444,452 ---- } } + $class = ' class="weekborder'.$even_row.'"'; if (empty($event_length[$thisday])) { # no events $tclass = $class; ! if ($thisday == $getdate) $tclass = ' class="weekborder'.$even_row.' weektoday"'; $drawWidth = 1; $weekdisplay .= '<td colspan="' . $nbrGridCols[$thisday] . '"' . $tclass . '> </td>'."\n"; *************** *** 494,501 **** if ($ended_counter) { $tclass = $class; ! if ($thisday == $getdate) { ! if ($tclass) $tclass = ' class="weekborder'.$even_row.' weektoday"'; ! else $tclass = ' class="weektoday"'; ! } $weekdisplay .= '<td colspan="' . $ended_counter . '"' . $tclass . '> </td>'; $ended_counter = 0; --- 463,467 ---- if ($ended_counter) { $tclass = $class; ! if ($thisday == $getdate) $tclass = ' class="weekborder'.$even_row.' weektoday"'; $weekdisplay .= '<td colspan="' . $ended_counter . '"' . $tclass . '> </td>'; $ended_counter = 0; *************** *** 515,519 **** } $event_date_start = date('Ymd', $this_time_arr[$uid]['start_unixtime']); ! $event_date_end = date('Ymd', $this_time_arr[$uid]['end_unixtime']); if ($event_date_start != $event_date_end) { if ($thisday == $event_date_start) { --- 481,485 ---- } $event_date_start = date('Ymd', $this_time_arr[$uid]['start_unixtime']); ! $event_date_end = date('Ymd', $this_time_arr[$uid]['end_unixtime'] - 1); if ($event_date_start != $event_date_end) { if ($thisday == $event_date_start) { *************** *** 544,551 **** if ($ended_counter) { $tclass = $class; ! if ($thisday == $getdate) { ! if ($tclass) $tclass = ' class="weekborder'.$even_row.' weektoday"'; ! else $tclass = ' class="weektoday"'; ! } $weekdisplay .= '<td colspan="' . $ended_counter . '"' . $tclass . '> </td>'; $ended_counter = 0; --- 510,514 ---- if ($ended_counter) { $tclass = $class; ! if ($thisday == $getdate) $tclass = ' class="weekborder'.$even_row.' weektoday"'; $weekdisplay .= '<td colspan="' . $ended_counter . '"' . $tclass . '> </td>'; $ended_counter = 0; *************** *** 567,574 **** if ($emptyWidth > 0) { $tclass = $class; ! if ($thisday == $getdate) { ! if ($tclass) $tclass = ' class="weekborder'.$even_row.' weektoday"'; ! else $tclass = ' class="weektoday"'; ! } $weekdisplay .= "<td colspan=\"" . $emptyWidth . "\"$tclass> </td>\n"; } --- 530,534 ---- if ($emptyWidth > 0) { $tclass = $class; ! if ($thisday == $getdate) $tclass = ' class="weekborder'.$even_row.' weektoday"'; $weekdisplay .= "<td colspan=\"" . $emptyWidth . "\"$tclass> </td>\n"; } |