[Vtigercrm-commits] [vtiger-commits] r5947 - in /vtigercrm/trunk/modules/Calendar: Calendar.php Date.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Sun May 14 04:18:27 EDT 2006
Author: saraj
Date: Sun May 14 02:18:23 2006
New Revision: 5947
Log:
changes made to get activities list for weekview
Modified:
vtigercrm/trunk/modules/Calendar/Calendar.php
vtigercrm/trunk/modules/Calendar/Date.php
Modified: vtigercrm/trunk/modules/Calendar/Calendar.php
==============================================================================
--- vtigercrm/trunk/modules/Calendar/Calendar.php (original)
+++ vtigercrm/trunk/modules/Calendar/Calendar.php Sun May 14 02:18:23 2006
@@ -12,10 +12,11 @@
var $week_slice;
var $week_array;
var $month_array;
+ var $week_hour_slices = Array();
var $slices = Array();
/* for dayview */
- var $day_start_hour=0;
- var $day_end_hour=23;
+ var $day_start_hour=8;
+ var $day_end_hour=18;
var $sharedusers=Array();
/*
constructor
@@ -51,31 +52,26 @@
switch($this->view)
{
case 'day':
- $day_start_hour = $this->day_start_hour;
- $day_end_hour = $this->day_end_hour;
- //$dayview_hours = $day_end_hour - $day_start_hour;
- for($i=$day_start_hour;$i<=$day_end_hour;$i++)
+ for($i=0;$i<=23;$i++)
{
$layout = new Layout('hour',$this->date_time->getTodayDatetimebyIndex($i));
$this->day_slice[$layout->start_time->get_formatted_date().':'.$layout->start_time->hour] = $layout;
array_push($this->slices, $layout->start_time->get_formatted_date().":".$layout->start_time->hour);
}
+ //echo '<pre>';print_r($this);echo'</pre>';
break;
case 'week':
$weekview_days = 7;
- $day_start_hour = $this->day_start_hour;
- $day_end_hour = $this->day_end_hour;
- $dayview_hours = $day_end_hour - $day_start_hour;
for($i=0;$i<$weekview_days;$i++)
{
$layout = new Layout('day',$this->date_time->getThisweekDaysbyIndex($i));
$this->week_array[$layout->start_time->get_formatted_date()] = $layout;
- /*for($h=0;$h<$dayview_hours;$h++)
+ for($h=0;$h<=23;$h++)
{
- $hour_list = new Layout('hour',$this->date_time->getTodayDatetimebyIndex($h));
- $this->day_slice[$layout->start_time->hour] = $layout;
- array_push($this->slices, $layout->start_time->get_formatted_date().":".$layout->start_time->hour);
- }*/
+ $hour_list = new Layout('hour',$this->date_time->getTodayDatetimebyIndex($h,$layout->start_time->z_day,$layout->start_time->z_month,$layout->start_time->z_year));
+ $this->week_slice[$layout->start_time->get_formatted_date().':'.$hour_list->start_time->hour] = $hour_list;
+ array_push($this->week_hour_slices, $layout->start_time->get_formatted_date().":".$hour_list->start_time->hour);
+ }
array_push($this->slices, $layout->start_time->get_formatted_date());
}
@@ -139,7 +135,6 @@
$activities = Array();
$activities = Appointment::readAppointment($current_user->id,$start_datetime,$end_datetime,$this->view);
-
if(!empty($activities))
{
foreach($activities as $key=>$value)
@@ -150,7 +145,7 @@
}
elseif($this->view == 'week')
{
-
+ array_push($this->week_slice[$value->formatted_datetime]->activities, $value);
}
elseif($this->view == 'month')
{
@@ -164,7 +159,7 @@
}
}
- //echo '<pre>';print_r($this->month_array);echo'</pre>';
+ //echo '<pre>';print_r($this->week_slice);echo'</pre>';
}
Modified: vtigercrm/trunk/modules/Calendar/Date.php
==============================================================================
--- vtigercrm/trunk/modules/Calendar/Date.php (original)
+++ vtigercrm/trunk/modules/Calendar/Date.php Sun May 14 02:18:23 2006
@@ -77,8 +77,14 @@
}
- function getTodayDatetimebyIndex($index)
- {
+ function getTodayDatetimebyIndex($index,$day='', $month='', $year='')
+ {
+ if($day == '')
+ {
+ $day = $this->day;
+ $month = $this->month;
+ $year = $this->year;
+ }
$day_array = array();
if($index < 0 || $index > 23)
{
@@ -86,9 +92,9 @@
}
$day_array['hour'] = $index;
$day_array['min'] = 0;
- $day_array['day'] = $this->day;
- $day_array['month'] = $this->month;
- $day_array['year'] = $this->year;
+ $day_array['day'] = $day;
+ $day_array['month'] = $month;
+ $day_array['year'] = $year;
$datetimevalue = new DateTime($day_array,true);
return $datetimevalue;
}
More information about the vtigercrm-commits
mailing list