From vtigercrm-commits at vtiger.fosslabs.com Thu Feb 1 02:47:07 2007 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 01 Feb 2007 10:47:07 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r10122 - /vtigercrm/branches/5.0.3/modules/Calendar/Save.php Message-ID: <20070201104707.C364E78CCE6@vtiger.fosslabs.com> Author: richie Date: Thu Feb 1 03:47:02 2007 New Revision: 10122 Log: fix for #2919 and event Followup integrated --Minnie Modified: vtigercrm/branches/5.0.3/modules/Calendar/Save.php Modified: vtigercrm/branches/5.0.3/modules/Calendar/Save.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Calendar/Save.php (original) +++ vtigercrm/branches/5.0.3/modules/Calendar/Save.php Thu Feb 1 03:47:02 2007 @@ -31,21 +31,13 @@ $local_log =& LoggerManager::getLogger('index'); $focus = new Activity(); $activity_mode = $_REQUEST['activity_mode']; -if($activity_mode == 'Task') -{ - $tab_type = 'Calendar'; - $focus->column_fields["activitytype"] = 'Task'; -} -elseif($activity_mode == 'Events') -{ - $tab_type = 'Events'; -} - +$tab_type = 'Calendar'; +$focus->column_fields["activitytype"] = 'Task'; if(isset($_REQUEST['record'])) { $focus->id = $_REQUEST['record']; -$local_log->debug("id is ".$id); + $local_log->debug("id is ".$id); } if(isset($_REQUEST['mode'])) { @@ -93,13 +85,33 @@ else $focus->column_fields['visibility'] = 'Private'; $focus->save($tab_type); + /* For Followup START -- by Minnie */ + if(isset($_REQUEST['followup']) && $_REQUEST['followup'] == 'on' && $activity_mode == 'Events' && isset($_REQUEST['followup_time_start']) && $_REQUEST['followup_time_start'] != '') + { + $focus->column_fields['subject'] = '[Followup] '.$focus->column_fields['subject']; + $focus->column_fields['date_start'] = $_REQUEST['followup_date']; + $focus->column_fields['due_date'] = $_REQUEST['followup_date']; + $focus->column_fields['time_start'] = $_REQUEST['followup_time_start']; + $focus->column_fields['time_end'] = $_REQUEST['followup_time_end']; + $focus->column_fields['eventstatus'] = 'Planned'; + $focus->mode = 'create'; + $focus->save($tab_type); + + } + /* For Followup END -- by Minnie */ $return_id = $focus->id; } -if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] != "") $return_module = $_REQUEST['return_module']; -else $return_module = "Calendar"; -if(isset($_REQUEST['return_action']) && $_REQUEST['return_action'] != "") $return_action = $_REQUEST['return_action']; -else $return_action = "DetailView"; -if(isset($_REQUEST['return_id']) && $_REQUEST['return_id'] != "") $return_id = $_REQUEST['return_id']; + +if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] != "") + $return_module = $_REQUEST['return_module']; +else + $return_module = "Calendar"; +if(isset($_REQUEST['return_action']) && $_REQUEST['return_action'] != "") + $return_action = $_REQUEST['return_action']; +else + $return_action = "DetailView"; +if(isset($_REQUEST['return_id']) && $_REQUEST['return_id'] != "") + $return_id = $_REQUEST['return_id']; if($_REQUEST['mode'] != 'edit' && $_REQUEST['return_module'] == 'Products') { @@ -122,7 +134,8 @@ $activemode = ""; -if($activity_mode != '') $activemode = "&activity_mode=".$activity_mode; +if($activity_mode != '') + $activemode = "&activity_mode=".$activity_mode; //Added code to send mail to the assigned to user about the details of the vtiger_activity if sendnotification = on and assigned to user if($_REQUEST['sendnotification'] == 'on' && $_REQUEST['assigntype'] == 'U') @@ -177,19 +190,30 @@ } -if(isset($_REQUEST['view']) && $_REQUEST['view']!='') $view=$_REQUEST['view']; -if(isset($_REQUEST['hour']) && $_REQUEST['hour']!='') $hour=$_REQUEST['hour']; -if(isset($_REQUEST['day']) && $_REQUEST['day']!='') $day=$_REQUEST['day']; -if(isset($_REQUEST['month']) && $_REQUEST['month']!='') $month=$_REQUEST['month']; -if(isset($_REQUEST['year']) && $_REQUEST['year']!='') $year=$_REQUEST['year']; -if(isset($_REQUEST['viewOption']) && $_REQUEST['viewOption']!='') $viewOption=$_REQUEST['viewOption']; -if(isset($_REQUEST['subtab']) && $_REQUEST['subtab']!='') $subtab=$_REQUEST['subtab']; +if(isset($_REQUEST['view']) && $_REQUEST['view']!='') + $view=$_REQUEST['view']; +if(isset($_REQUEST['hour']) && $_REQUEST['hour']!='') + $hour=$_REQUEST['hour']; +if(isset($_REQUEST['day']) && $_REQUEST['day']!='') + $day=$_REQUEST['day']; +if(isset($_REQUEST['month']) && $_REQUEST['month']!='') + $month=$_REQUEST['month']; +if(isset($_REQUEST['year']) && $_REQUEST['year']!='') + $year=$_REQUEST['year']; +if(isset($_REQUEST['viewOption']) && $_REQUEST['viewOption']!='') + $viewOption=$_REQUEST['viewOption']; +if(isset($_REQUEST['subtab']) && $_REQUEST['subtab']!='') + $subtab=$_REQUEST['subtab']; //code added for returning back to the current view after edit from list view -if($_REQUEST['return_viewname'] == '') $return_viewname='0'; -if($_REQUEST['return_viewname'] != '')$return_viewname=$_REQUEST['return_viewname']; -if($_REQUEST['parenttab'] != '')$parenttab=$_REQUEST['parenttab']; -if($_REQUEST['start'] !='')$page='&start='.$_REQUEST['start']; +if($_REQUEST['return_viewname'] == '') + $return_viewname='0'; +if($_REQUEST['return_viewname'] != '') + $return_viewname=$_REQUEST['return_viewname']; +if($_REQUEST['parenttab'] != '') + $parenttab=$_REQUEST['parenttab']; +if($_REQUEST['start'] !='') + $page='&start='.$_REQUEST['start']; if($_REQUEST['maintab'] == 'Calendar') header("Location: index.php?action=".$return_action."&module=".$return_module."&view=".$view."&hour=".$hour."&day=".$day."&month=".$month."&year=".$year."&record=".$return_id."&viewOption=".$viewOption."&subtab=".$subtab."&parenttab=$parenttab"); else From vtigercrm-commits at vtiger.fosslabs.com Thu Feb 1 03:36:21 2007 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 01 Feb 2007 11:36:21 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r10123 - /vtigercrm/branches/5.0.3/modules/Calendar/CalendarCommon.php Message-ID: <20070201113621.8B1CE78CB9B@vtiger.fosslabs.com> Author: richie Date: Thu Feb 1 04:36:15 2007 New Revision: 10123 Log: changes made for Followup events and two functions has been added --Minnie Modified: vtigercrm/branches/5.0.3/modules/Calendar/CalendarCommon.php Modified: vtigercrm/branches/5.0.3/modules/Calendar/CalendarCommon.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Calendar/CalendarCommon.php (original) +++ vtigercrm/branches/5.0.3/modules/Calendar/CalendarCommon.php Thu Feb 1 04:36:15 2007 @@ -115,69 +115,25 @@ if($format == 'am/pm') { $hr = $sthr+0; - if($hr <= 11) - { - if($hr == 0) - $sthr = 12; - $timearr['starthour'] = $sthr; - $timearr['startfmt'] = 'am'; - } - else - { - if($hr == 12) $sthr = $hr; - else $sthr = $hr - 12; - - if($sthr <= 9 && strlen(trim($sthr)) < 2) - $hrvalue= '0'.$sthr; - else $hrvalue=$sthr; - - $timearr['starthour'] = $hrvalue; - $timearr['startfmt'] = 'pm'; - } + $timearr['startfmt'] = ($hr >= 12) ? "pm" : "am"; + if($hr == 0) $hr = 12; + $timearr['starthour'] = twoDigit(($hr>12)?($hr-12):$hr); + $timearr['startmin'] = $stmin; + $edhr = $edhr+0; - if($edhr <= 11) - { - if($edhr == 0) - $edhr = 12; - - if($edhr <= 9 && strlen(trim($edhr)) < 2) - $edhr = '0'.$edhr; - $timearr['endhour'] = $edhr; - $timearr['endfmt'] = 'am'; - } - else - { - $fmt = 'pm'; - if($edhr == 12) - $edhr = $edhr; - else - { - $edhr = $edhr - 12; - if($edhr == 12) - $fmt = 'am'; - } - if($edhr <= 9 && strlen(trim($edhr)) < 2) - $hrvalue= '0'.$edhr; - else $hrvalue=$edhr; - - $timearr['endhour'] = $hrvalue; - $timearr['endfmt'] = $fmt; - } - $timearr['startmin'] = $stmin; + $timearr['endfmt'] = ($edhr >= 12) ? "pm" : "am"; + if($edhr == 0) $edhr = 12; + $timearr['endhour'] = twoDigit(($edhr>12)?($edhr-12):$edhr); $timearr['endmin'] = $edmin; return $timearr; } if($format == '24') { - if($edhr <= 9 && strlen(trim($edhr)) < 2) - $edhr = '0'.$edhr; - if($sthr <= 9 && strlen(trim($sthr)) < 2) - $sthr = '0'.$sthr; - $timearr['starthour'] = $sthr; + $timearr['starthour'] = twoDigit($sthr); $timearr['startmin'] = $stmin; $timearr['startfmt'] = ''; - $timearr['endhour'] = $edhr; - $timearr['endmin'] = $edmin; + $timearr['endhour'] = twoDigit($edhr); + $timearr['endmin'] = $edmin; $timearr['endfmt'] = ''; return $timearr; } @@ -190,13 +146,17 @@ *constructs html select combo box for time selection *and returns it in string format. */ -function getTimeCombo($format,$bimode,$hour='',$min='',$fmt='') +function getTimeCombo($format,$bimode,$hour='',$min='',$fmt='',$todocheck=false) { $combo = ''; $min = $min - ($min%5); + if($bimode == 'start' && !$todocheck) + $jsfn = 'onChange="changeEndtime_StartTime();"'; + else + $jsfn = null; if($format == 'am/pm') { - $combo .= ''; for($i=0;$i<12;$i++) { if($i == 0) @@ -205,84 +165,43 @@ $hrvalue = 12; } else - { - if($i <= 9 && strlen(trim($i)) < 2) - { - $hrtext= '0'.$i; - } - else $hrtext= $i; - $hrvalue = $hrtext; - } - if($hour == $hrvalue) - $hrsel = 'selected'; - else - $hrsel = ''; + $hrvalue = $hrtext = twoDigit($i); + $hrsel = ($hour == $hrvalue)?'selected':''; $combo .= ''; } $combo .= ' '; - $combo .= ''; for($i=0;$i<12;$i++) { - $minvalue = 5; $value = $i*5; - if($value <= 9 && strlen(trim($value)) < 2) - { - $value= '0'.$value; - } - else $value = $value; - if($min == $value) - $minsel = 'selected'; - else - $minsel = ''; - $combo .= ''; + $value = twoDigit($value); + $minsel = ($min == $value)?'selected':''; + $combo .= ''; } $combo .= ' '; $combo .= ''; } else { - $combo .= ''; for($i=0;$i<=23;$i++) { - if($i <= 9 && strlen(trim($i)) < 2) - { - $hrvalue= '0'.$i; - } - else $hrvalue = $i; - if($hour == $hrvalue) - $hrsel = 'selected'; - else - $hrsel = ''; + $hrvalue = twoDigit($i); + $hrsel = ($hour == $hrvalue)?'selected':''; $combo .= ''; } $combo .= 'Hr '; - $combo .= ''; for($i=0;$i<12;$i++) { - $minvalue = 5; $value = $i*5; - if($value <= 9 && strlen(trim($value)) < 2) - { - $value= '0'.$value; - } - else $value=$value; - if($min == $value) - $minsel = 'selected'; - else - $minsel = ''; + $value= twoDigit($value); + $minsel = ($min == $value)?'selected':''; $combo .= ''; } $combo .= ' min'; @@ -302,7 +221,10 @@ { global $adb, $mod_strings; $combo = ''; - $combo .= ''; $q = "select * from ".$tablename; $Res = $adb->query($q); $noofrows = $adb->num_rows($Res); @@ -397,4 +319,32 @@ return $list; } +function twoDigit( $no ){ + if($no < 10 && strlen(trim($no)) < 2) return "0".$no; + else return "".$no; +} + +function timeString($datetime,$fmt){ + + if(is_object($datetime)){ + $hr = $datetime->hour; + $min = $datetime->minute; + } else { + $hr = $datetime['hour']; + $min = $datetime['minute']; + } + $timeStr = ""; + if($fmt != 'am/pm'){ + $timeStr .= twoDigit($hr).":".twoDigit($min); + }else{ + $am = ($hr >= 12) ? "pm" : "am"; + if($hr == 0) $hr = 12; + $timeStr .= ($hr>12)?($hr-12):$hr; + $timeStr .= ":".twoDigit($min); + $timeStr .= $am; + } + return $timeStr; +} + + ?> From vtigercrm-commits at vtiger.fosslabs.com Thu Feb 1 03:38:56 2007 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 01 Feb 2007 11:38:56 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r10124 - /vtigercrm/branches/5.0.3/modules/Calendar/calendarLayout.php Message-ID: <20070201113856.2D25878CD26@vtiger.fosslabs.com> Author: richie Date: Thu Feb 1 04:38:49 2007 New Revision: 10124 Log: unwanted functions has been removed and changes made for multipleday events Modified: vtigercrm/branches/5.0.3/modules/Calendar/calendarLayout.php Modified: vtigercrm/branches/5.0.3/modules/Calendar/calendarLayout.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Calendar/calendarLayout.php (original) +++ vtigercrm/branches/5.0.3/modules/Calendar/calendarLayout.php Thu Feb 1 04:38:49 2007 @@ -263,8 +263,8 @@ global $current_user,$app_strings; $date_format = $current_user->date_format; $format = $cal_arr['calendar']->hour_format; - $hour_startat = convertTime2UserSelectedFmt($format,$cal_arr['calendar']->day_start_hour,false); - $hour_endat = convertTime2UserSelectedFmt($format,($cal_arr['calendar']->day_start_hour+1),false); + $hour_startat = timeString(array('hour'=>date('H:i'),'minute'=>0),'24'); + $hour_endat = timeString(array('hour'=>date('H:i',(time() + (60 * 60))),'minute'=>0),'24'); $time_arr = getaddEventPopupTime($hour_startat,$hour_endat,$format); $temp_ts = $cal_arr['calendar']->date_time->ts; //To get date in user selected format @@ -657,7 +657,6 @@ */ function getDayViewLayout(& $cal) { - //echo '
';print_r($cal);echo '
'; global $current_user,$app_strings,$cal_log,$adb; $no_of_rows = 1; $cal_log->debug("Entering getDayViewLayout() method..."); @@ -686,39 +685,11 @@ } for($i=$day_start_hour;$i<=$day_end_hour;$i++) { - - if($cal['calendar']->hour_format == 'am/pm') - { - if($i == 12) - { - $hour = $i; - $sub_str = 'pm'; - } - elseif($i>12) - { - $hour = $i - 12; - $sub_str = 'pm'; - } - else - { - if($i == 0) - $hour = 12; - else - $hour = $i; - $sub_str = 'am'; - } - - } - else - { - $hour = $i; - if($hour <= 9 && strlen(trim($hour)) < 2) - $hour = "0".$hour; - $sub_str = ':00'; - } + $time = array('hour'=>$i,'minute'=>0); + $sub_str = timeString($time,$format); $y = $i+1; - $hour_startat = convertTime2UserSelectedFmt($format,$i,false); - $hour_endat = convertTime2UserSelectedFmt($format,$y,false); + $hour_startat = timeString(array('hour'=>$i,'minute'=>0),'24'); + $hour_endat = timeString(array('hour'=>$y,'minute'=>0),'24'); $time_arr = getaddEventPopupTime($hour_startat,$hour_endat,$format); $temp_ts = $cal['calendar']->date_time->ts; $sttemp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$temp_ts)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$temp_ts)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $temp_ts)):('')))); @@ -736,7 +707,7 @@ if(isPermitted("Calendar","EditView") == "yes") $js_string = 'onClick="fnvshobj(this,\'addEvent\'); gshow(\'addEvent\',\'call\',\''.$sttemp_date.'\',\''.$endtemp_date.'\',\''.$time_arr['starthour'].'\',\''.$time_arr['startmin'].'\',\''.$time_arr['startfmt'].'\',\''.$time_arr['endhour'].'\',\''.$time_arr['endmin'].'\',\''.$time_arr['endfmt'].'\',\'hourview\',\'event\')"'; $dayview_layout .= ' - '.$hour.''.$sub_str.''; + '.$sub_str.''; //To display events in Dayview $dayview_layout .= getdayEventLayer($cal,$cal['calendar']->slices[$i],$no_of_rows); $dayview_layout .= ''; @@ -789,44 +760,17 @@ for($i=$day_start_hour;$i<=$day_end_hour;$i++) { $count = $i; - $hour_startat = convertTime2UserSelectedFmt($format,$i,false); - $hour_endat = convertTime2UserSelectedFmt($format,($i+1),false); + $hour_startat = timeString(array('hour'=>$i,'minute'=>0),'24'); + $hour_endat = timeString(array('hour'=>($i+1),'minute'=>0),'24'); $time_arr = getaddEventPopupTime($hour_startat,$hour_endat,$format); $weekview_layout .= ''; for ($column=1;$column<=1;$column++) { - if($cal['calendar']->hour_format == 'am/pm') - { - if($i == 12) - { - $hour = $i; - $sub_str = 'pm'; - } - elseif($i>12) - { - $hour = $i - 12; - $sub_str = 'pm'; - } - else - { - if($i == 0) - $hour = 12; - else - $hour = $i; - $sub_str = 'am'; - } - - } - else - { - $hour = $i; - if($hour <= 9 && strlen(trim($hour)) < 2) - $hour = "0".$hour; - $sub_str = ':00'; - } - + $time = array('hour'=>$i,'minute'=>0); + $sub_str = timeString($time,$format); + $weekview_layout .= ''; - $weekview_layout .=$hour.''.$sub_str; + $weekview_layout .=$sub_str; $weekview_layout .= ''; } for ($column=0;$column<=6;$column++) @@ -879,8 +823,8 @@ $rows = 6; } $format = $cal['calendar']->hour_format; - $hour_startat = convertTime2UserSelectedFmt($format,$cal['calendar']->day_start_hour,false); - $hour_endat = convertTime2UserSelectedFmt($format,($cal['calendar']->day_start_hour+1),false); + $hour_startat = timeString(array('hour'=>date('H:i'),'minute'=>0),'24'); + $hour_endat = timeString(array('hour'=>date('H:i',(time() + (60 * 60))),'minute'=>0),'24'); $time_arr = getaddEventPopupTime($hour_startat,$hour_endat,$format); $monthview_layout = ''; $monthview_layout .= ''; @@ -1084,8 +1028,6 @@ $id = $act[$i]->record; if(strlen($subject)>25) $subject = substr($subject,0,25)."..."; - $start_time = $act[$i]->start_time->hour.':'.$act[$i]->start_time->minute; - $end_time = $act[$i]->end_time->hour.':'.$act[$i]->end_time->minute; $format = $cal['calendar']->hour_format; $duration_hour = $act[$i]->duration_hour; $duration_min =$act[$i]->duration_minute; @@ -1098,17 +1040,16 @@ $rowspan = $duration_hour; } $row_cnt = $rowspan; - //$st_end_time = convertStEdTime2UserSelectedFmt($format,$start_time,$duration_hour,$duration_min); - //$start_hour = $st_end_time['starttime']; - //$end_hour = $st_end_time['endtime']; - $value = getaddEventPopupTime($start_time,$end_time,$format); - $start_hour = $value['starthour'].':'.$value['startmin'].''.$value['startfmt']; - $end_hour = $value['endhour'] .':'.$value['endmin'].''.$value['endfmt']; + $start_hour = timeString($act[$i]->start_time,$format); + $end_hour = timeString($act[$i]->end_time,$format); $account_name = $act[$i]->accountname; $eventstatus = $act[$i]->eventstatus; - $shared = $act[$i]->shared; $color = $act[$i]->color; $image = $cal['IMAGE_PATH'].''.$act[$i]->image_name; + if($act[$i]->recurring) + $recurring = ''; + else + $recurring = ' '; $height = $rowspan * 75; $javacript_str = ''; /*if($eventstatus != 'Held') @@ -1126,18 +1067,18 @@ $eventlayer .= '
- - - '; - $eventlayer .= ' + '; + $eventlayer .= ' + + + - - - + $eventlayer .= '
'.$start_hour.' - '.$end_hour.'
'; - if($shared) + '.$start_hour.' - '.$end_hour.'
'.$recurring; + $eventlayer .= ''.$subject.'
'; + if($act[$i]->shared) $eventlayer .= ''; else $eventlayer .= ' '; - $eventlayer .= ''.$subject.'
'.$action_str.'('.$user.' | '.$mod_strings[$eventstatus].' | '.$mod_strings[$priority].')('.$user.' | '.$mod_strings[$eventstatus].' | '.$mod_strings[$priority].')
'.$action_str.' 
'; @@ -1180,22 +1121,17 @@ if(strlen($subject)>25) $subject = substr($subject,0,25)."..."; $format = $cal['calendar']->hour_format; - $duration_hour = $act[$i]->duration_hour; - $duration_min = $act[$i]->duration_minute; - $start_time = $act[$i]->start_time->hour.':'.$act[$i]->start_time->minute; - $end_time = $act[$i]->end_time->hour.':'.$act[$i]->end_time->minute; - //$st_end_time = convertStEdTime2UserSelectedFmt($format,$start_time,$duration_hour,$duration_min); - //$start_hour = $st_end_time['starttime']; - //$end_hour = $st_end_time['endtime']; - $value = getaddEventPopupTime($start_time,$end_time,$format); - $start_hour = $value['starthour'].':'.$value['startmin'].''.$value['startfmt']; - $end_hour = $value['endhour'] .':'.$value['endmin'].''.$value['endfmt']; + $start_hour = timeString($act[$i]->start_time,$format); + $end_hour = timeString($act[$i]->end_time,$format); $account_name = $act[$i]->accountname; $eventstatus = $act[$i]->eventstatus; - $shared = $act[$i]->shared; $user = $act[$i]->owner; $priority = $act[$i]->priority; $image = $cal['IMAGE_PATH'].''.$act[$i]->image_name; + if($act[$i]->recurring) + $recurring = ''; + else + $recurring = ' '; $color = $act[$i]->color; if(isPermitted("Calendar","EditView") == "yes" || isPermitted("Calendar","Delete") == "yes") $javacript_str = 'onMouseOver="cal_show(\''.$arrow_img_name.'\');" onMouseOut="fnHide_Event(\''.$arrow_img_name.'\');"'; @@ -1204,22 +1140,25 @@ $eventlayer .='
- - + + - + + + - - - + $eventlayer .= ' + +
'.$start_hour.' - '.$end_hour.''.$start_hour.' - '.$end_hour.'
'; - if($shared) + '.$recurring; + + $eventlayer .= ''.$subject.'
'; + if($act[$i]->shared) $eventlayer .= ''; else $eventlayer .= ' '; - $eventlayer .= ' - '.$subject.'
'.$action_str.'('.$user.' | '.$eventstatus.' | '.$priority.')('.$user.' | '.$eventstatus.' | '.$priority.')
'.$action_str.' 
-

'; +
'; } $cal_log->debug("Exiting getweekEventLayer() method..."); return $eventlayer; @@ -1261,27 +1200,14 @@ $subject = $act[$i]->subject; if(strlen($subject)>10) $subject = substr($subject,0,10)."..."; - $start_time = $act[$i]->start_time->hour.':'.$act[$i]->start_time->minute; - $end_time = $act[$i]->end_time->hour.':'.$act[$i]->end_time->minute; $format = $cal['calendar']->hour_format; - $duration_hour = $act[$i]->duration_hour; - $duration_min = $act[$i]->duration_minute; - //$st_end_time = convertStEdTime2UserSelectedFmt($format,$start_time,$duration_hour,$duration_min); - //$start_hour = $st_end_time['starttime']; - //$end_hour = $st_end_time['endtime']; - $value = getaddEventPopupTime($start_time,$end_time,$format); - $start_hour = $value['starthour'].':'.$value['startmin'].''.$value['startfmt']; - $end_hour = $value['endhour'] .':'.$value['endmin'].''.$value['endfmt']; + $start_hour = timeString($act[$i]->start_time,$format); + $end_hour = timeString($act[$i]->end_time,$format); $account_name = $act[$i]->accountname; $image = $cal['IMAGE_PATH'].''.$act[$i]->image_name; $color = $act[$i]->color; $eventlayer .='
- - - - - -
'.$start_hour.' - '.$end_hour.'
+  '.$start_hour.' - '.$end_hour.'

'; } if($remin_list != null) @@ -1363,12 +1289,9 @@ $image_tag = ""; $contact_data = ""; $more_link = ""; - $duration_hour = $adb->query_result($result,$i,"duration_hours"); - $duration_min = $adb->query_result($result,$i,"duration_minutes"); $start_time = $adb->query_result($result,$i,"time_start"); $end_time = $adb->query_result($result,$i,"time_end"); $format = $calendar['calendar']->hour_format; - //$st_end_time = convertStEdTime2UserSelectedFmt($format,$start_time,$duration_hour,$duration_min); $value = getaddEventPopupTime($start_time,$end_time,$format); $start_hour = $value['starthour'].':'.$value['startmin'].''.$value['startfmt']; $end_hour = $value['endhour'] .':'.$value['endmin'].''.$value['endfmt']; @@ -1493,7 +1416,6 @@ $more_link = ""; $start_time = $adb->query_result($result,$i,"time_start"); $format = $calendar['calendar']->hour_format; - //$st_end_time = convertStEdTime2UserSelectedFmt($format,$start_time); $value = getaddEventPopupTime($start_time,$start_time,$format); $element['starttime'] = $value['starthour'].':'.$value['startmin'].''.$value['startfmt']; $date_start = $adb->query_result($result,$i,"date_start"); @@ -1566,8 +1488,8 @@ $cal_log->debug("Entering constructEventListView() method..."); $format = $cal['calendar']->hour_format; $date_format = $current_user->date_format; - $hour_startat = convertTime2UserSelectedFmt($format,$cal['calendar']->day_start_hour,false); - $hour_endat = convertTime2UserSelectedFmt($format,($cal['calendar']->day_start_hour+1),false); + $hour_startat = timeString(array('hour'=>date('H:i'),'minute'=>0),'24'); + $hour_endat = timeString(array('hour'=>date('H:i',(time() + (60 * 60))),'minute'=>0),'24'); $time_arr = getaddEventPopupTime($hour_startat,$hour_endat,$format); $temp_ts = $cal['calendar']->date_time->ts; //to get date in user selected date format @@ -1688,8 +1610,8 @@ global $current_user,$app_strings; $date_format = $current_user->date_format; $format = $cal['calendar']->hour_format; - $hour_startat = convertTime2UserSelectedFmt($format,$cal['calendar']->day_start_hour,false); - $hour_endat = convertTime2UserSelectedFmt($format,($cal['calendar']->day_start_hour+1),false); + $hour_startat = timeString(array('hour'=>date('H:i'),'minute'=>0),'24'); + $hour_endat = timeString(array('hour'=>date('H:i',(time() + (60 * 60))),'minute'=>0),'24'); $time_arr = getaddEventPopupTime($hour_startat,$hour_endat,$format); $temp_ts = $cal['calendar']->date_time->ts; //to get date in user selected date format @@ -1826,175 +1748,4 @@ return $list_view; } -/** - * Function to convert time to user selected format - * @param string $format - hour format. either 'am/pm' or '24' - * @param string $time - time - * @param boolean $format_check - true/false - * return string $hour - time string - */ -function convertTime2UserSelectedFmt($format,$time,$format_check) -{ - global $cal_log; - $cal_log->debug("Entering convertTime2UserSelectedFmt() method..."); - if($format == 'am/pm' && $format_check) - { - if($time>='12') - { - if($time == '12') - $hour = $time; - else - $hour = $time - 12; - $hour = $hour.":00pm"; - } - else - { - $hour = $time; - $hour = $hour.":00am"; - } - $cal_log->debug("Exiting convertTime2UserSelectedFmt() method..."); - return $hour; - } - else - { - $hour = $time; - if($hour <= 9 && strlen(trim($hour)) < 2) - $hour = "0".$hour; - $hour = $hour.":00"; - $cal_log->debug("Exiting convertTime2UserSelectedFmt() method..."); - return $hour; - } -} - -/** - * Function to convert events/todos start and endtime to user selected format - * @param string $format - hour format. either 'am/pm' or '24' - * @param string $start_time - time - * @param string $duration_hr - duration in hours or empty string - * @param string $duration_min - duration in minutes or empty string - * return array $return_data - start and end time in array format - */ -function convertStEdTime2UserSelectedFmt($format,$start_time,$duration_hr='',$duration_min='') -{ - global $cal_log; - $cal_log->debug("Entering convertStEdTime2UserSelectedFmt() method..."); - list($hour,$min) = explode(":",$start_time); - if($format == 'am/pm') - { - if($hour>'12') - { - $hour = $hour - 12; - $start_hour = $hour; - $start_time = $start_hour.":".$min."pm"; - $end_min = $min+$duration_min; - $end_hour = $hour+$duration_hr; - if($end_min>=60) - { - $end_min = $end_min%60; - $end_hour++; - } - if($end_hour <= 9 && strlen(trim($end_hour)) < 2) - $end_hour = "0".$end_hour; - if($end_min <= 9 && strlen(trim($end_min)) < 2) - $end_min = "0".$end_min; - $end_time = $end_hour.":".$end_min."pm"; - } - elseif($hour == '12') - { - $start_hour = $hour; - $start_time = $start_hour.":".$min."pm"; - $end_min = $min+$duration_min; - $end_hour = $hour+$duration_hr; - if($end_min>=60) - { - $end_min = $end_min%60; - $end_hour++; - } - if($end_hour>'12') - { - $end_hour = $end_hour - 12; - if($end_hour <= 9 && strlen(trim($end_hour)) < 2) - $end_hour = "0".$end_hour; - if($end_min <= 9 && strlen(trim($end_min)) < 2) - $end_min = "0".$end_min; - $end_time = $end_hour.":".$end_min."pm"; - } - else - { - if($end_hour <= 9 && strlen(trim($end_hour)) < 2) - $end_hour = "0".$end_hour; - if($end_min <= 9 && strlen(trim($end_min)) < 2) - $end_min = "0".$end_min; - $end_time = $end_hour.":".$end_min."am"; - } - } - else - { - $start_hour = $hour; - $start_time = $start_hour.":".$min."am"; - $end_min = $min+$duration_min; - $end_hour = $hour+$duration_hr; - if($end_min>=60) - { - $end_min = $end_min%60; - $end_hour++; - } - if($end_hour>='12') - { - if($end_hour == '12' && $end_hour > '00') - $end_hour = $end_hour; - else - $end_hour = $end_hour - 12; - if($end_hour <= 9 && strlen(trim($end_hour)) < 2) - $end_hour = "0".$end_hour; - if($end_min <= 9 && strlen(trim($end_min)) < 2) - $end_min = "0".$end_min; - $end_time = $end_hour.":".$end_min."pm"; - } - else - { - if($end_hour <= 9 && strlen(trim($end_hour)) < 2) - $end_hour = "0".$end_hour; - if($end_min <= 9 && strlen(trim($end_min)) < 2) - $end_min = "0".$end_min; - $end_time = $end_hour.":".$end_min."am"; - } - - } - $return_data = Array( - 'starttime'=>$start_time, - 'endtime' =>$end_time - ); - } - else - { - $hour = $hour; - $min = $min; - $end_min = $min+$duration_min; - $end_hour = $hour+$duration_hr; - if($end_min>=60) - { - $end_min = $end_min%60; - $end_hour++; - } - if($end_hour <= 9 && strlen(trim($end_hour)) < 2) - $end_hour = "0".$end_hour; - if($end_min <= 9 && strlen(trim($end_min)) < 2) - $end_min = "0".$end_min; - $end_time = $end_hour.":".$end_min; - if($hour <= 9 && strlen(trim($hour)) < 2) - $hour = "0".$hour; - $start_time = $hour.":".$min; - $return_data = Array( - 'starttime'=>$start_time, - 'endtime' =>$end_time - ); - } - $cal_log->debug("Exiting convertStEdTime2UserSelectedFmt() method..."); - return $return_data; - - -} - - ?> From vtigercrm-commits at vtiger.fosslabs.com Thu Feb 1 03:52:11 2007 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 01 Feb 2007 11:52:11 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r10125 - /vtigercrm/branches/5.0.3/modules/Calendar/addEventUI.php Message-ID: <20070201115211.3AF5978A337@vtiger.fosslabs.com> Author: richie Date: Thu Feb 1 04:52:05 2007 New Revision: 10125 Log: changes made for followup events --Minnie Modified: vtigercrm/branches/5.0.3/modules/Calendar/addEventUI.php Modified: vtigercrm/branches/5.0.3/modules/Calendar/addEventUI.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Calendar/addEventUI.php (original) +++ vtigercrm/branches/5.0.3/modules/Calendar/addEventUI.php Thu Feb 1 04:52:05 2007 @@ -195,12 +195,15 @@ + + + @@ -217,8 +220,8 @@ @@ -281,19 +284,19 @@
- +
- +

- +
- @@ -712,7 +740,7 @@ {assign var=date_val value="$date_value"} {assign var=time_val value="$time_value"} {/foreach} -
-
- +
+ +
hour_format,'start');?>
- Set date.. + Set date.. +
+
-
@@ -747,9 +765,9 @@
- +
hour_format,'start'); ?>
hour_format,'start','','','',true); ?>
- Set date.. + Set date..
- + +
+ @@ -300,6 +306,28 @@
{$MOD.LBL_EVENTEDAT}
{$ENDHOUR}
Set date.. + Set date.. {foreach key=date_fmt item=date_str from=$secondvalue.date_start} {assign var=date_vl value="$date_fmt"} {/foreach} From vtigercrm-commits at vtiger.fosslabs.com Thu Feb 1 04:12:19 2007 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 01 Feb 2007 12:12:19 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r10135 - /vtigercrm/branches/5.0.3/Smarty/templates/QuickCreate.tpl Message-ID: <20070201121219.BF62A78CD5A@vtiger.fosslabs.com> Author: richie Date: Thu Feb 1 05:12:16 2007 New Revision: 10135 Log: changes made for followup events --Minnie Modified: vtigercrm/branches/5.0.3/Smarty/templates/QuickCreate.tpl Modified: vtigercrm/branches/5.0.3/Smarty/templates/QuickCreate.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/QuickCreate.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/QuickCreate.tpl Thu Feb 1 05:12:16 2007 @@ -66,7 +66,12 @@ {$fldlabel} - {foreach item=arr from=$fldvalue} {foreach key=sel_value item=value from=$arr} {if $MOD.$sel_value neq ''} @@ -232,10 +237,22 @@ {assign var=date_val value="$date_value"} {assign var=time_val value="$time_value"} {/foreach} - + {foreach key=date_fmt item=date_str from=$secondvalue} + {assign var=dateFormat value="$date_fmt"} + {assign var=dateStr value="$date_str"} + {/foreach} + {if $uitype eq 6 && $QCMODULE eq 'Event'} + {assign var=datejsfn value="onChange='dochange(\"jscal_field_date_start\",\"jscal_field_due_date\");'"} + {assign var=timejsfn value="onChange='calQCduedatetime();'"} + + {else} + {assign var=datejsfn value=""} + {assign var=timejsfn value=""} + {/if} + {if $uitype eq 6} - + {/if} {if $uitype eq 23 && $QCMODULE eq 'Event'} @@ -243,10 +260,6 @@ getCalendarPopup('jscal_trigger_{$fldname}','jscal_field_{$fldname}','{$dateFormat}'); {/if} - {foreach key=date_format item=date_str from=$secondvalue} - {assign var=dateFormat value="$date_format"} - {assign var=dateStr value="$date_str"} - {/foreach} {if $uitype eq 5 || $uitype eq 23}
({$dateStr}) {else} From vtigercrm-commits at vtiger.fosslabs.com Thu Feb 1 04:19:31 2007 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 01 Feb 2007 12:19:31 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r10136 - /vtigercrm/branches/5.0.3/include/js/general.js Message-ID: <20070201121931.C0A6C78CD5A@vtiger.fosslabs.com> Author: richie Date: Thu Feb 1 05:19:27 2007 New Revision: 10136 Log: two js function has been included --Minnie Modified: vtigercrm/branches/5.0.3/include/js/general.js Modified: vtigercrm/branches/5.0.3/include/js/general.js ============================================================================== --- vtigercrm/branches/5.0.3/include/js/general.js (original) +++ vtigercrm/branches/5.0.3/include/js/general.js Thu Feb 1 05:19:27 2007 @@ -1887,3 +1887,71 @@ } return check; } + +function calQCduedatetime() +{ + var datefmt = document.QcEditView.dateFormat.value; + var type = document.QcEditView.activitytype.value; + var dateval1=getObj('date_start').value.replace(/^\s+/g, '').replace(/\s+$/g, ''); + var dateelements1=splitDateVal(dateval1); + dd1=parseInt(dateelements1[0],10); + mm1=dateelements1[1]; + yyyy1=dateelements1[2]; + var date1=new Date(); + date1.setYear(yyyy1); + date1.setMonth(mm1-1,dd1+1); + var yy = date1.getFullYear(); + var mm = date1.getMonth() + 1; + var dd = date1.getDate(); + var date = document.QcEditView.date_start.value; + var starttime = document.QcEditView.time_start.value; + if (!timeValidate('time_start',' Start Date & Time','OTH')) + return false; + var timearr = starttime.split(":"); + var hour = parseInt(timearr[0],10); + var min = parseInt(timearr[1],10); + dd = _2digit(dd); + mm = _2digit(mm); + var tempdate = yy+'-'+mm+'-'+dd; + if(datefmt == '%d-%m-%Y') + var tempdate = dd+'-'+mm+'-'+yy; + else if(datefmt == '%m-%d-%Y') + var tempdate = mm+'-'+dd+'-'+yy; + if(type == 'Meeting') + { + hour = hour + 1; + if(hour == 24) + { + hour = 0; + date = tempdate; + } + hour = _2digit(hour); + min = _2digit(min); + document.QcEditView.due_date.value = date; + document.QcEditView.time_end.value = hour+':'+min; + } + if(type == 'Call') + { + if(min == 55) + { + min = 0; + hour = hour + 1; + }else min = min + 5; + if(hour == 24) + { + hour = 0; + date = tempdate; + } + hour = _2digit(hour); + min = _2digit(min); + document.QcEditView.due_date.value = date; + document.QcEditView.time_end.value = hour+':'+min; + } + +} + +function _2digit( no ){ + if(no < 10) return "0" + no; + else return "" + no; +} + From vtigercrm-commits at vtiger.fosslabs.com Thu Feb 1 04:24:56 2007 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 01 Feb 2007 12:24:56 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r10137 - /vtigercrm/branches/5.0.3/modules/Settings/language/en_us.lang.php Message-ID: <20070201122456.07C7F78CD5A@vtiger.fosslabs.com> Author: richie Date: Thu Feb 1 05:24:38 2007 New Revision: 10137 Log: fix for ticket:2954 Modified: vtigercrm/branches/5.0.3/modules/Settings/language/en_us.lang.php Modified: vtigercrm/branches/5.0.3/modules/Settings/language/en_us.lang.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Settings/language/en_us.lang.php (original) +++ vtigercrm/branches/5.0.3/modules/Settings/language/en_us.lang.php Thu Feb 1 05:24:38 2007 @@ -742,7 +742,6 @@ 'LBL_LIST_SELECT'=>'Select', 'LBL_EMAIL_TEMPLATE'=>'Email Template', 'LBL_TEMPLATE_TOOLS'=>'Tools', -'LBL_DELETE' => 'Delete', 'LBL_NEW_TEMPLATE' =>'New Template', 'LBL_FOLDER'=>'Folder', 'LBL_NAME'=>'Name', From vtigercrm-commits at vtiger.fosslabs.com Thu Feb 1 05:59:11 2007 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 01 Feb 2007 13:59:11 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r10138 - in /vtigercrm/branches/5.0.3/themes: alphagrey/images/Recurring.gif bluelagoon/images/Recurring.gif woodspice/images/Recurring.gif Message-ID: <20070201135911.E6E9F78CD8B@vtiger.fosslabs.com> Author: richie Date: Thu Feb 1 06:58:57 2007 New Revision: 10138 Log: image for recurring has been added --Minnie Added: vtigercrm/branches/5.0.3/themes/alphagrey/images/Recurring.gif (with props) vtigercrm/branches/5.0.3/themes/bluelagoon/images/Recurring.gif (with props) vtigercrm/branches/5.0.3/themes/woodspice/images/Recurring.gif (with props) From vtigercrm-commits at vtiger.fosslabs.com Thu Feb 1 21:01:00 2007 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 02 Feb 2007 05:01:00 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r10139 - /vtigercrm/branches/5.0.3/Smarty/templates/DisplayFields.tpl Message-ID: <20070202050100.4D6F7789C35@vtiger.fosslabs.com> Author: richie Date: Thu Feb 1 22:00:54 2007 New Revision: 10139 Log: fix for ticketid:2956 Modified: vtigercrm/branches/5.0.3/Smarty/templates/DisplayFields.tpl Modified: vtigercrm/branches/5.0.3/Smarty/templates/DisplayFields.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/DisplayFields.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/DisplayFields.tpl Thu Feb 1 22:00:54 2007 @@ -85,8 +85,8 @@ {foreach item=arr from=$fldvalue} {foreach key=sel_value item=value from=$arr}