[Alba-desarrollo] SVN Alba r4813 - in
prosistem/alba/trunk/alba/apps/principal/modules/icalVisualizador:
lib templates
commits en pressenter.com.ar
commits en pressenter.com.ar
Lun Jul 16 17:43:10 CEST 2007
Author: josx
Date: 2007-07-16 12:43:09 -0300 (Mon, 16 Jul 2007)
New Revision: 4813
Modified:
prosistem/alba/trunk/alba/apps/principal/modules/icalVisualizador/lib/ical_parser.php
prosistem/alba/trunk/alba/apps/principal/modules/icalVisualizador/templates/_verPorSemana.php
Log:
Arreglo para visualizar correctamente los eventos en la vista semanal
Modified: prosistem/alba/trunk/alba/apps/principal/modules/icalVisualizador/lib/ical_parser.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/icalVisualizador/lib/ical_parser.php 2007-07-12 20:00:18 UTC (rev 4812)
+++ prosistem/alba/trunk/alba/apps/principal/modules/icalVisualizador/lib/ical_parser.php 2007-07-16 15:43:09 UTC (rev 4813)
@@ -550,10 +550,10 @@
function icalToArray($filename, $fromdate, $todate) {
-// $filename = "/var/www/phpicalendar/calendars/pepe.ics";
+// $filename = "/var/www/phpicalendar/calendars/pepe.ics";
-$timezone = "America/Buenos_Aires";
-$tz_array['America/Buenos_Aires'] = array('-0300', '-0300');
+ $timezone = "America/Buenos_Aires";
+ $tz_array['America/Buenos_Aires'] = array('-0300', '-0300');
$master_array = array();
$ifile = @fopen($filename, "r");
@@ -572,7 +572,7 @@
$calendar_name = $cal_filename;
$master_array['calendar_name'] = $calendar_name;
-$overlap_array = array();
+ $overlap_array = array();
// read file in line by line
// XXX end line is skipped because of the 1-line readahead
Modified: prosistem/alba/trunk/alba/apps/principal/modules/icalVisualizador/templates/_verPorSemana.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/icalVisualizador/templates/_verPorSemana.php 2007-07-12 20:00:18 UTC (rev 4812)
+++ prosistem/alba/trunk/alba/apps/principal/modules/icalVisualizador/templates/_verPorSemana.php 2007-07-16 15:43:09 UTC (rev 4813)
@@ -94,10 +94,11 @@
$aTimeIdx[2] = date("Hi",$aTime[($i+2)]);
$aTimeIdx[3] = date("Hi",$aTime[($i+3)]);
$find = 0;
-
+ $cant = 0;
for($k=0;$k<4;$k++) {
echo "<tr>\n";
$j=0;
+
foreach($aWeek as $week) { //each day of the week
$drawWidth = 1;
// echo $nbrGridCols[$week['day']]."<br>";
@@ -105,7 +106,7 @@
$each_date = date("Ymd", $week['day']);
// echo $each_date." ".$aTimeIdx[$k]."<br>";
if(array_key_exists($each_date, $aEvent) AND array_key_exists($aTimeIdx[$k], $aEvent[$each_date])) {
-
+ $cant++;
$find = 1;
if($j == 0 AND $k == 0) {
echo '<td colspan="4" rowspan="4" align="center" valign="top" width="60" class="timeborder">'.date("H:i A",$aTime[$i]).'</td><td bgcolor="#a1a5a9" width="1" height="15"></td>';
@@ -126,10 +127,9 @@
</div>
</td>
<?
-if($event['event_overlap']>1) {
-// echo "<td colspan='".($event['event_overlap']+1)."' class='weekborder'> </td>";
-}
-
+ if($event['event_overlap']>1) {
+ // echo "<td colspan='".($event['event_overlap']+1)."' class='weekborder'> </td>";
+ }
}
} else {
if($j == 0 AND $k == 0) { // first time
@@ -141,9 +141,15 @@
}
}
- if($k>0 AND $find == 1 AND $j==6) { // only write 6 td if event was find
+ if($k > 0 AND $find == 1 AND $j == 6) { // only write 6 td if event was find
} else {
- echo '<td width="'.$width.'" colspan="'.$nbrGridCols[$week['day']].'" class="weekborder"> </td>'."\n";
+ if($k > 0 AND $find == 1) {
+ if($cant <= $j+1) {
+ echo '<td width="'.$width.'" colspan="1" class="weekborder"> </td>'."\n";
+ }
+ } else {
+ echo '<td width="'.$width.'" colspan="'.$nbrGridCols[$week['day']].'" class="weekborder"> </td>'."\n";
+ }
}
}
Más información sobre la lista de distribución Alba-desarrollo