[Alba-desarrollo] SVN Alba r5130 - in
prosistem/alba/trunk/alba/apps/principal/modules/cal: actions lib
commits en pressenter.com.ar
commits en pressenter.com.ar
Lun Sep 24 15:36:07 CEST 2007
Author: sabino
Date: 2007-09-24 10:36:06 -0300 (Mon, 24 Sep 2007)
New Revision: 5130
Modified:
prosistem/alba/trunk/alba/apps/principal/modules/cal/actions/components.class.php
prosistem/alba/trunk/alba/apps/principal/modules/cal/lib/default_config.php
prosistem/alba/trunk/alba/apps/principal/modules/cal/lib/ical_parser.php
prosistem/alba/trunk/alba/apps/principal/modules/cal/lib/overlapping_events.php
Log:
Modificaciones parciales al moulo cal
Modified: prosistem/alba/trunk/alba/apps/principal/modules/cal/actions/components.class.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/cal/actions/components.class.php 2007-09-19 21:52:24 UTC (rev 5129)
+++ prosistem/alba/trunk/alba/apps/principal/modules/cal/actions/components.class.php 2007-09-24 13:36:06 UTC (rev 5130)
@@ -218,6 +218,11 @@
$page->subscribe_path = $subscribe_path;
$page->download_filename = $download_filename;
+// foreach ($page as $key => &$var) {
+// echo $key .'=> ' .$var;
+// echo "<br/>";
+// }
+// die;
$relativeUrlRoot = sfContext::getInstance()->getRequest()->getRelativeUrlRoot();
// echo $relativeUrlRoot;die;
Modified: prosistem/alba/trunk/alba/apps/principal/modules/cal/lib/default_config.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/cal/lib/default_config.php 2007-09-19 21:52:24 UTC (rev 5129)
+++ prosistem/alba/trunk/alba/apps/principal/modules/cal/lib/default_config.php 2007-09-24 13:36:06 UTC (rev 5130)
@@ -14,7 +14,7 @@
$language = 'Spanish'; // Language support - 'English', 'Polish', 'German', 'French', 'Dutch', 'Danish', 'Italian', 'Japanese', 'Norwegian', 'Spanish', 'Swedish', 'Portuguese', 'Catalan', 'Traditional_Chinese', 'Esperanto', 'Korean'
$week_start_day = 'Sunday'; // Day of the week your week starts on
$week_length = '7'; // Number of days to display in the week view
-$day_start = '0600'; // Start time for day grid
+$day_start = '0700'; // Start time for day grid
$day_end = '2000'; // End time for day grid
$gridLength = '15'; // Grid distance in minutes for day view, multiples of 15 preferred
$num_years = '1'; // Number of years (up and back) to display in 'Jump to'
Modified: prosistem/alba/trunk/alba/apps/principal/modules/cal/lib/ical_parser.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/cal/lib/ical_parser.php 2007-09-19 21:52:24 UTC (rev 5129)
+++ prosistem/alba/trunk/alba/apps/principal/modules/cal/lib/ical_parser.php 2007-09-24 13:36:06 UTC (rev 5130)
@@ -219,7 +219,8 @@
if (!isset($status)) $status = $master_array[$old_start_date][$old_start_time][$uid]['status'];
if (!isset($attendee)) $attendee = $master_array[$old_start_date][$old_start_time][$uid]['attendee'];
if (!isset($url)) $url = $master_array[$old_start_date][$old_start_time][$uid]['url'];
- removeOverlap($start_date_tmp, $old_start_time, $uid);
+ //reemplazo
+ removeOverlap($start_date_tmp, $old_start_time, $uid, $master_array, $overlap_array);
if (isset($master_array[$start_date_tmp][$old_start_time][$uid])) {
unset($master_array[$start_date_tmp][$old_start_time][$uid]); // SJBO added $uid twice here
if (sizeof($master_array[$start_date_tmp][$old_start_time]) == 0) {
@@ -359,7 +360,7 @@
if (isset($display_end_tmp)){
$master_array[$start_date_tmp][$time_tmp][$uid]['display_end'] = $display_end_tmp;
}
- checkOverlap($start_date_tmp, $time_tmp, $uid);
+ checkOverlap($start_date_tmp, $time_tmp, $uid, $master_array, $overlap_array);
$start_tmp = strtotime('+1 day',$start_tmp);
}
if (!$write_processed) $master_array[$start_date][($hour.$minute)][$uid]['exception'] = true;
@@ -394,7 +395,7 @@
if (isset($display_end_tmp)){
$master_array[($start_date)][($hour.$minute)][$uid]['display_end'] = $display_end_tmp;
}
- checkOverlap($start_date, ($hour.$minute), $uid);
+ checkOverlap($start_date, ($hour.$minute), $uid, $master_array, $overlap_array);
if (!$write_processed) $master_array[($start_date)][($hour.$minute)][$uid]['exception'] = true;
}
}
@@ -856,7 +857,7 @@
if (isset($display_end_tmp)){
$master_array[$start_date_tmp][$time_tmp][$uid]['display_end'] = $display_end_tmp;
}
- checkOverlap($start_date_tmp, $time_tmp, $uid);
+ checkOverlap($start_date_tmp, $time_tmp, $uid, $master_array, $overlap_array);
}
$start_tmp = strtotime('+1 day',$start_tmp);
}
@@ -893,7 +894,7 @@
if (isset($display_end_tmp)){
$master_array[($recur_data_date)][($hour.$minute)][$uid]['display_end'] = $display_end_tmp;
}
- checkOverlap($recur_data_date, ($hour.$minute), $uid);
+ checkOverlap($recur_data_date, ($hour.$minute), $uid, $master_array, $overlap_array);
}
}
}
Modified: prosistem/alba/trunk/alba/apps/principal/modules/cal/lib/overlapping_events.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/cal/lib/overlapping_events.php 2007-09-19 21:52:24 UTC (rev 5129)
+++ prosistem/alba/trunk/alba/apps/principal/modules/cal/lib/overlapping_events.php 2007-09-24 13:36:06 UTC (rev 5130)
@@ -1,4 +1,10 @@
<?php
+
+// Josx en este archivo esta el comienzo de los problemas.
+// Yo ya hice algunas modficaciones, en las funciones que reciben "ahora" $master y $overlap_array
+// fijate que estan comentadas la variables globales
+
+
// function to determine maximum necessary columns per day
// actually an algorithm to get the smallest multiple for two numbers
function kgv($a, $b) {
@@ -71,9 +77,9 @@
}
// Merges overlapping blocks
-function flatten_ol_blocks($event_date, $ol_blocks, $new_block_key) {
+function flatten_ol_blocks($event_date, $ol_blocks, $new_block_key, $master_array) {
- global $master_array;
+// global $master_array;
// Loop block = each other block in the array, the ones we're merging into new block.
// New block = the changed block that caused the flatten_ol_blocks call. Everything gets merged into this.
@@ -109,8 +115,9 @@
}
// Builds $overlap_array structure, and updates event_overlap in $master_array for the given events.
-function checkOverlap($event_date, $event_time, $uid) {
- global $master_array, $overlap_array;
+function checkOverlap($event_date, $event_time, $uid, $master_array, $overlap_array) {
+// global $master_array, $overlap_array;
+ //@annotation las globales se reemplazaron por parametros en las invocaciones de iacl_parser y aca
if (!isset($event_date)) return;
$event = $master_array[$event_date][$event_time][$uid];
// Copy out the array - we replace this at the end.
@@ -162,7 +169,7 @@
$master_array[$event_date][$max_overlap_event['time']][$max_overlap_event['key']]['event_overlap'] = $loop_ol_block['maxOverlaps'];
}
$ol_day_array[$loop_block_key] = $loop_ol_block;
- $ol_day_array = flatten_ol_blocks($event_date, $ol_day_array, $loop_block_key);
+ $ol_day_array = flatten_ol_blocks($event_date, $ol_day_array, $loop_block_key, $master_array);
$already_merged_once = true;
break;
// Handle repeat calls to checkOverlap - semi-bogus since the event shouldn't be created more than once, but this makes sure we don't get an invalid event_overlap.
@@ -208,7 +215,7 @@
// Make sure we pass in the key of the newly added item above.
end($ol_day_array);
$last_day_key = key($ol_day_array);
- $ol_day_array = flatten_ol_blocks($event_date, $ol_day_array, $last_day_key);
+ $ol_day_array = flatten_ol_blocks($event_date, $ol_day_array, $last_day_key, $master_array);
}
}
}
@@ -230,8 +237,9 @@
// Remove an event from the overlap data.
// This could be completely bogus, since overlap array is empty when this gets called in my tests, but I'm leaving it in anyways.
-function removeOverlap($ol_start_date, $ol_start_time, $ol_key) {
- global $master_array, $overlap_array;
+function removeOverlap($ol_start_date, $ol_start_time, $ol_key, $master_array, $overlap_array) {
+// global $master_array, $overlap_array;
+ //@annotation las globales se reemplazaron por parametros en las invocaciones de iacl_parser y aca
if (isset($overlap_array[$ol_start_date])) {
if (sizeof($overlap_array[$ol_start_date]) > 0) {
$ol_end_time = $master_array[$ol_start_date][$ol_start_time][$ol_key]['event_end'];
Más información sobre la lista de distribución Alba-desarrollo