[Vtigercrm-commits] [vtiger-commits] r10091 - in /vtigercrm/branches/5.0.3: include/utils/RecurringType.php modules/Calendar/Appointment.php modules/Calendar/Calendar.php modules/Calendar/Date.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Fri Jan 19 09:50:48 EST 2007


Author: richie
Date: Fri Jan 19 07:50:38 2007
New Revision: 10091

Log:
* Modified the class Name from DateTime to vt_DateTime to avoid conflict with PHP 5.2 class name DateTime, Fixes #2805

Modified:
    vtigercrm/branches/5.0.3/include/utils/RecurringType.php
    vtigercrm/branches/5.0.3/modules/Calendar/Appointment.php
    vtigercrm/branches/5.0.3/modules/Calendar/Calendar.php
    vtigercrm/branches/5.0.3/modules/Calendar/Date.php

Modified: vtigercrm/branches/5.0.3/include/utils/RecurringType.php
==============================================================================
--- vtigercrm/branches/5.0.3/include/utils/RecurringType.php (original)
+++ vtigercrm/branches/5.0.3/include/utils/RecurringType.php Fri Jan 19 07:50:38 2007
@@ -44,8 +44,8 @@
 		);
 		$this->recur_type = $repeat_arr['type'];
 		$this->recur_freq = $repeat_arr['repeat_frequency'];
-		$this->startdate = new DateTime($start_date,true);
-		$this->enddate = new DateTime($end_date,true);
+		$this->startdate = new vt_DateTime($start_date,true);
+		$this->enddate = new vt_DateTime($end_date,true);
 		if($repeat_arr['sun_flag'])
 		{
 			$this->dayofweek_to_rpt[] = 0;
@@ -114,7 +114,7 @@
 					'month' => $st_date[1],
 					'year'  => $st_date[0]
 				);
-				$tempdateObj = new DateTime($date_arr,true);
+				$tempdateObj = new vt_DateTime($date_arr,true);
 				
 				if(isset($this->dayofweek_to_rpt) && $this->dayofweek_to_rpt != null)
 				{
@@ -138,7 +138,7 @@
 							'month' => $st_date[1],
 							'year'  => $st_date[0]
 						);
-						$tempdateObj = new DateTime($date_arr,true);
+						$tempdateObj = new vt_DateTime($date_arr,true);
 						
 						//echo '<pre>';print_r($recurringDates); echo '</pre>';
 						
@@ -173,7 +173,7 @@
 							'month' => $st_date[1],
 							'year'  => $st_date[0]
 						);
-						$tempdateObj = new DateTime($date_arr,true);
+						$tempdateObj = new vt_DateTime($date_arr,true);
 						
 					}
 				}
@@ -189,7 +189,7 @@
 						'month' => $st_date[1],
 						'year'  => $st_date[0]
 					);
-					$tempdateObj = new DateTime($date_arr,true);
+					$tempdateObj = new vt_DateTime($date_arr,true);
 				}
 				$tempdate = $tempdateObj->get_formatted_date();
 			}
@@ -201,7 +201,7 @@
 					'month' => $st_date[1],
 					'year'  => $st_date[0]
 				);
-				$startdateObj = new DateTime($date_arr,true);
+				$startdateObj = new vt_DateTime($date_arr,true);
 				if($this->repeat_monthby == 'date')
 				{
 					if($this->rptmonth_datevalue <= $st_date[2])
@@ -233,7 +233,7 @@
 						        'month' => $st_date[1],
 						 	'year'  => $st_date[0]
 					        );
-						$tempdateObj = new DateTime($date_arr,true);
+						$tempdateObj = new vt_DateTime($date_arr,true);
 						$firstdayofmonthObj = $this->getFistdayofmonth($this->dayofweek_to_rpt[0],$tempdateObj); 
 						if($firstdayofmonthObj->get_formatted_date() <= $tempdate)
 						{
@@ -258,7 +258,7 @@
 							'month' => $startdateObj->month,
 							'year'  => $startdateObj->year
 						);
-						$tempdateObj = new DateTime($date_arr,true);
+						$tempdateObj = new vt_DateTime($date_arr,true);
 						$lastdayofmonthObj = $this->getLastdayofmonth($this->dayofweek_to_rpt[0],$tempdateObj);
 						if($lastdayofmonthObj->get_formatted_date() <= $tempdate)
 						{
@@ -284,7 +284,7 @@
 						'month' => $st_date[1]+1,
 						'year'  => $st_date[0]
 					);
-					$tempdateObj = new DateTime($date_arr,true);
+					$tempdateObj = new vt_DateTime($date_arr,true);
 				}
 				$tempdate = $tempdateObj->get_formatted_date();
 				$recurringDates[] = $tempdate;
@@ -307,7 +307,7 @@
 					'month' => $st_date[1],
 					'year'  => $index
 				);
-				$tempdateObj = new DateTime($date_arr,true);
+				$tempdateObj = new vt_DateTime($date_arr,true);
 				$tempdate = $tempdateObj->get_formatted_date();
 			}
 			else
@@ -320,8 +320,8 @@
 
 	/** Function to get first day of the month(like first Monday or Friday and etc.)
 	 *  @param $dayofweek   -- day of the week to repeat the event :: Type string
-	 *  @param $dateObj     -- date object  :: Type DateTime Object
-	 *  return $dateObj -- the date object on which the event repeats :: Type DateTime Object
+	 *  @param $dateObj     -- date object  :: Type vt_DateTime Object
+	 *  return $dateObj -- the date object on which the event repeats :: Type vt_DateTime Object
 	 */
 	function getFistdayofmonth($dayofweek,& $dateObj)
 	{
@@ -346,8 +346,8 @@
 
 	/** Function to get last day of the month(like last Monday or Friday and etc.)
          *  @param $dayofweek   -- day of the week to repeat the event :: Type string
-	 *  @param $dateObj     -- date object  :: Type DateTime Object
-	 *  return $dateObj -- the date object on which the event repeats :: Type DateTime Object
+	 *  @param $dateObj     -- date object  :: Type vt_DateTime Object
+	 *  return $dateObj -- the date object on which the event repeats :: Type vt_DateTime Object
          */
 					    
 	function getLastdayofmonth($dayofweek,& $dateObj)

Modified: vtigercrm/branches/5.0.3/modules/Calendar/Appointment.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Calendar/Appointment.php (original)
+++ vtigercrm/branches/5.0.3/modules/Calendar/Appointment.php Fri Jan 19 07:50:38 2007
@@ -235,8 +235,8 @@
 			'month' => $emonth,
 			'year'  => $eyear
 		);
-                $this->start_time        = new DateTime($start_date_arr,true);
-                $this->end_time          = new DateTime($end_date_arr,true);
+                $this->start_time        = new vt_DateTime($start_date_arr,true);
+                $this->end_time          = new vt_DateTime($end_date_arr,true);
 		if($view == 'day' || $view == 'week')
 		{
 			$this->formatted_datetime= $act_array["date_start"].":".$st_hour;

Modified: vtigercrm/branches/5.0.3/modules/Calendar/Calendar.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Calendar/Calendar.php (original)
+++ vtigercrm/branches/5.0.3/modules/Calendar/Calendar.php Fri Jan 19 07:50:38 2007
@@ -33,7 +33,7 @@
 	function Calendar($view='',$data=Array())
 	{
 		$this->view = $view;
-		$this->date_time = new DateTime($data,true);
+		$this->date_time = new vt_DateTime($data,true);
 		$this->constructLayout();
 	}
 	/**

Modified: vtigercrm/branches/5.0.3/modules/Calendar/Date.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Calendar/Date.php (original)
+++ vtigercrm/branches/5.0.3/modules/Calendar/Date.php Fri Jan 19 07:50:38 2007
@@ -9,7 +9,7 @@
 *
  ********************************************************************************/
 
-class DateTime
+class vt_DateTime
 {
 	var $second = '00';
 	var $minute = '00';
@@ -35,11 +35,11 @@
 	var $tz;
 	var $ts_def;
 	/**
-	 * Constructor for DateTime class
+	 * Constructor for vt_DateTime class
 	 * @param array  $timearr - collection of string
 	 * @param string $check   - check string
 	 */
-	function DateTime(&$timearr,$check)
+	function vt_DateTime(&$timearr,$check)
 	{
 		if (! isset( $timearr) || count($timearr) == 0 )
                 {
@@ -96,7 +96,7 @@
 	  * @param string        $day   - date  
 	  * @param string        $month - month
 	  * @param string        $year  - year
-	  * return DateTime obj  $datetimevalue
+	  * return vt_DateTime obj  $datetimevalue
 	  */
 	function getTodayDatetimebyIndex($index,$day='', $month='', $year='')
 	{
@@ -116,13 +116,13 @@
                 $day_array['day'] = $day;
                 $day_array['month'] = $month;
                 $day_array['year'] = $year;
-		$datetimevalue = new DateTime($day_array,true);
+		$datetimevalue = new vt_DateTime($day_array,true);
                 return $datetimevalue;
 	}
 	/**
 	 * function to get days in week using index
 	 * @param integer       $index - number between 0 to 6
-	 * return DateTime obj  $datetimevalue
+	 * return vt_DateTime obj  $datetimevalue
 	 */
 
 	function getThisweekDaysbyIndex($index)
@@ -135,7 +135,7 @@
                 $week_array['day'] = $this->day + ($index - $this->dayofweek);
                 $week_array['month'] = $this->month;
                 $week_array['year'] = $this->year;
-                $datetimevalue = new DateTime($week_array,true);
+                $datetimevalue = new vt_DateTime($week_array,true);
                 return $datetimevalue;
         }
 
@@ -145,7 +145,7 @@
 	 * @param string        $day   - date
 	 * @param string        $month - month
 	 * @param string        $year  - year
-	 * return DateTime obj  $datetimevalue
+	 * return vt_DateTime obj  $datetimevalue
 	 */
 
 	function getThismonthDaysbyIndex($index,$day='', $month='', $year='')
@@ -160,14 +160,14 @@
                 $month_array['day'] = $day;
                 $month_array['month'] = $month;
                 $month_array['year'] = $year;
-                $datetimevalue = new DateTime($month_array,true);
+                $datetimevalue = new vt_DateTime($month_array,true);
                 return $datetimevalue;
         }
 
 	/**
 	* function to get months in year using index
 	* @param integer       $index - number between 0 to 11
-	* return DateTime obj  $datetimevalue
+	* return vt_DateTime obj  $datetimevalue
 	*/
 
 	function getThisyearMonthsbyIndex($index)
@@ -180,13 +180,13 @@
                 }
                 $year_array['month'] = $index+1;
                 $year_array['year'] = $this->year;
-                $datetimevalue = new DateTime($year_array,true);
+                $datetimevalue = new vt_DateTime($year_array,true);
                 return $datetimevalue;
         }
 	
 	/**
 	* function to get hour end time 
-	* return DateTime obj  $datetimevalue
+	* return vt_DateTime obj  $datetimevalue
 	*/
 
 	function getHourendtime()
@@ -198,13 +198,13 @@
 		$date_array['sec'] = 59;
                 $date_array['month'] = $this->month;
                 $date_array['year'] = $this->year;
-		$datetimevalue = new DateTime($date_array,true);
+		$datetimevalue = new vt_DateTime($date_array,true);
                 return $datetimevalue;
         }
 
 	/**
 	* function to get day end time
-	* return DateTime obj  $datetimevalue
+	* return vt_DateTime obj  $datetimevalue
 	*/
 	function getDayendtime()
         {
@@ -215,13 +215,13 @@
                 $date_array['day'] = $this->day;
                 $date_array['month'] = $this->month;
                 $date_array['year'] = $this->year;
-		$datetimevalue = new DateTime($date_array,true);
+		$datetimevalue = new vt_DateTime($date_array,true);
                 return $datetimevalue;
         }
 
 	/**
 	* function to get month end time
-	* return DateTime obj  $datetimevalue
+	* return vt_DateTime obj  $datetimevalue
 	*/
 	function getMonthendtime()
         {
@@ -232,7 +232,7 @@
                 $date_array['day'] = $this->daysinmonth;
                 $date_array['month'] = $this->month;
                 $date_array['year'] = $this->year;
-                $datetimevalue = new DateTime($date_array,true);
+                $datetimevalue = new vt_DateTime($date_array,true);
                 return $datetimevalue;
         }
 	
@@ -289,7 +289,7 @@
 	}
 
 	/**
-	* function to set values for DateTime object
+	* function to set values for vt_DateTime object
 	* @param integer   $ts  - Time stamp
 	*/
 	function setDateTime($ts)
@@ -338,7 +338,7 @@
 	}
 
 	/**
-	* function to get values from DateTime object
+	* function to get values from vt_DateTime object
 	*/
 	function getDateTime()
         {
@@ -401,7 +401,7 @@
 	/**
 	* function to get date depends on mode value
 	* @param string $mode  - 'increment' or 'decrement'
-	* return DateTime obj
+	* return vt_DateTime obj
 	*/
 	function get_changed_day($mode)
 	{
@@ -415,13 +415,13 @@
                                         'year'=>$this->year
                                   );
 
-                return new DateTime($date_data,true);
+                return new vt_DateTime($date_data,true);
 	}
 	
 	/**
 	* function to get changed week depends on mode value
 	* @param string $mode  - 'increment' or 'decrement'
-	* return DateTime obj
+	* return vt_DateTime obj
 	*/
 	function get_first_day_of_changed_week($mode)
 	{
@@ -435,13 +435,13 @@
                                         'month'=>$first_day->month,
                                         'year'=>$first_day->year
                                   );
-		return new DateTime($date_data,true);
+		return new vt_DateTime($date_data,true);
 	}
 	
 	/**
 	* function to get month depends on mode value
 	* @param string $mode  - 'increment' or 'decrement'
-	* return DateTime obj
+	* return vt_DateTime obj
 	*/
 	function get_first_day_of_changed_month($mode)
 	{
@@ -469,13 +469,13 @@
 					'year'=>$year
 				  );
 
-                return new DateTime($date_data,true);
+                return new vt_DateTime($date_data,true);
 	}
 
 	/**
 	* function to get year depends on mode value
 	* @param string $mode  - 'increment' or 'decrement'
-	* return DateTime obj
+	* return vt_DateTime obj
 	*/
 	function get_first_day_of_changed_year($mode)
 	{
@@ -489,7 +489,7 @@
                                         'year'=>$year
                                   );
 
-                return new DateTime($date_data,true);	
+                return new vt_DateTime($date_data,true);	
 	}
 	
 	/**





More information about the vtigercrm-commits mailing list