[Vtigercrm-commits] [vtiger-commits] r6677 - in /vtigercrm/trunk/modules/Calendar: Calendar.php addEventUI.php calendarLayout.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Mon May 29 08:56:19 EDT 2006
Author: saraj
Date: Mon May 29 06:56:14 2006
New Revision: 6677
Log:
changes made for calendar actions
Modified:
vtigercrm/trunk/modules/Calendar/Calendar.php
vtigercrm/trunk/modules/Calendar/addEventUI.php
vtigercrm/trunk/modules/Calendar/calendarLayout.php
Modified: vtigercrm/trunk/modules/Calendar/Calendar.php
==============================================================================
--- vtigercrm/trunk/modules/Calendar/Calendar.php (original)
+++ vtigercrm/trunk/modules/Calendar/Calendar.php Mon May 29 06:56:14 2006
@@ -1,4 +1,14 @@
<?php
+/*********************************************************************************
+** The contents of this file are subject to the vtiger CRM Public License Version 1.0
+ * ("License"); You may not use this file except in compliance with the License
+ * The Original Code is: vtiger CRM Open Source
+ * The Initial Developer of the Original Code is vtiger.
+ * Portions created by vtiger are Copyright (C) vtiger.
+ * All Rights Reserved.
+*
+ ********************************************************************************/
+
require_once('modules/Calendar/Appointment.php');
require_once('modules/Calendar/Date.php');
class Calendar
Modified: vtigercrm/trunk/modules/Calendar/addEventUI.php
==============================================================================
--- vtigercrm/trunk/modules/Calendar/addEventUI.php (original)
+++ vtigercrm/trunk/modules/Calendar/addEventUI.php Mon May 29 06:56:14 2006
@@ -81,47 +81,29 @@
$combo .= '<select class=small name="'.$bimode.'hr" id="'.$bimode.'hr">';
for($i=1;$i<=12;$i++)
{
- if($i == $selvalue)
- $selected = 'selected';
- else
- $selected = '';
if($i <= 9 && strlen(trim($i)) < 2)
{
$hrvalue= '0'.$i;
}
- elseif($i == 12) $hrvalue = '00';
+ //elseif($i == 12) $hrvalue = '00';
else $hrvalue= $i;
- $combo .= '<option value="'.$hrvalue.'" '.$selected.'>'.$i.'</option>';
+ $combo .= '<option value="'.$hrvalue.'">'.$i.'</option>';
}
$combo .= '</select> ';
$combo .= '<select name="'.$bimode.'min" id="'.$bimode.'min" class=small>';
for($i=0;$i<12;$i++)
{
$minvalue = 5;
- if($i == $selmin)
- $minselected = 'selected';
- else
- $minselected = '';
$value = $i*5;
if($value <= 9 && strlen(trim($value)) < 2)
{
$value= '0'.$value;
}
else $value= $value;
- $combo .= '<option value="'.$value.'" '.$minselected.'>'.$value.'</option>';
+ $combo .= '<option value="'.$value.'">'.$value.'</option>';
}
$combo .= '</select> ';
$combo .= '<select name="'.$bimode.'fmt" id="'.$bimode.'fmt" class=small>';
- if($selmin == 'am')
- {
- $amselected = 'selected';
- $pmselected = '';
- }
- else
- {
- $pmselected = 'selected';
- $amselected = '';
- }
$combo .= '<option value="am" '.$amselected.'>AM</option>';
$combo .= '<option value="pm" '.$pmselected.'>PM</option>';
$combo .= '</select>';
@@ -132,33 +114,25 @@
$combo .= '<select name="'.$bimode.'hr" id="'.$bimode.'hr" class=small>';
for($i=0;$i<=23;$i++)
{
- if($i == $selvalue)
- $selected = 'selected';
- else
- $selected = '';
if($i <= 9 && strlen(trim($i)) < 2)
{
$hrvalue= '0'.$i;
}
else $hrvalue = $i;
- $combo .= '<option value="'.$hrvalue.'" '.$selected.'>'.$i.'</option>';
+ $combo .= '<option value="'.$hrvalue.'">'.$i.'</option>';
}
$combo .= '</select>Hr ';
$combo .= '<select name="'.$bimode.'min" id="'.$bimode.'min" class=small>';
for($i=0;$i<12;$i++)
{
$minvalue = 5;
- if($i == $selmin)
- $minselected = 'selected';
- else
- $minselected = '';
$value = $i*5;
if($value <= 9 && strlen(trim($value)) < 2)
{
$value= '0'.$value;
}
else $value=$value;
- $combo .= '<option value="'.$value.'" '.$minselected.'>'.$value.'</option>';
+ $combo .= '<option value="'.$value.'">'.$value.'</option>';
}
$combo .= '</select> min<input type="hidden" name="'.$bimode.'fmt" id="'.$bimode.'fmt">';
}
@@ -277,11 +251,11 @@
<table border=0 cellspacing=0 cellpadding=3 width=100%>
<tr>
<td class="dvtTabCache" style="width:10px" nowrap> </td>
- <td id="cellTabInvite" class="dvtSelectedCell" align=center nowrap><a href="#" onClick="switchClass('cellTabInvite','on');switchClass('cellTabAlarm','off');switchClass('cellTabRepeat','off');ghide('addEventAlarmUI');gshow('addEventInviteUI',document.appSave.date_start.value,document.appSave.due_date.value,document.appSave.starthr.value,document.appSave.startmin.value,document.appSave.startfmt.value,document.appSave.endhr.value,document.appSave.endmin.value,document.appSave.endfmt.value);ghide('addEventRepeatUI');"><?php echo $mod_strings['LBL_INVITE']?></a></td>
+ <td id="cellTabInvite" class="dvtSelectedCell" align=center nowrap><a href="#" onClick="switchClass('cellTabInvite','on');switchClass('cellTabAlarm','off');switchClass('cellTabRepeat','off');ghide('addEventAlarmUI');gshow('addEventInviteUI','',document.appSave.date_start.value,document.appSave.due_date.value,document.appSave.starthr.value,document.appSave.startmin.value,document.appSave.startfmt.value,document.appSave.endhr.value,document.appSave.endmin.value,document.appSave.endfmt.value);ghide('addEventRepeatUI');"><?php echo $mod_strings['LBL_INVITE']?></a></td>
<td class="dvtTabCache" style="width:10px"> </td>
- <td id="cellTabAlarm" class="dvtUnSelectedCell" align=center nowrap><a href="#" onClick="switchClass('cellTabInvite','off');switchClass('cellTabAlarm','on');switchClass('cellTabRepeat','off');gshow('addEventAlarmUI',document.appSave.date_start.value,document.appSave.due_date.value,document.appSave.starthr.value,document.appSave.startmin.value,document.appSave.startfmt.value,document.appSave.endhr.value,document.appSave.endmin.value,document.appSave.endfmt.value);ghide('addEventInviteUI');ghide('addEventRepeatUI');"><?php echo $mod_strings['LBL_REMINDER']?></a></td>
+ <td id="cellTabAlarm" class="dvtUnSelectedCell" align=center nowrap><a href="#" onClick="switchClass('cellTabInvite','off');switchClass('cellTabAlarm','on');switchClass('cellTabRepeat','off');gshow('addEventAlarmUI','',document.appSave.date_start.value,document.appSave.due_date.value,document.appSave.starthr.value,document.appSave.startmin.value,document.appSave.startfmt.value,document.appSave.endhr.value,document.appSave.endmin.value,document.appSave.endfmt.value);ghide('addEventInviteUI');ghide('addEventRepeatUI');"><?php echo $mod_strings['LBL_REMINDER']?></a></td>
<td class="dvtTabCache" style="width:10px"> </td>
- <td id="cellTabRepeat" class="dvtUnSelectedCell" align=center nowrap><a href="#" onClick="switchClass('cellTabInvite','off');switchClass('cellTabAlarm','off');switchClass('cellTabRepeat','on');ghide('addEventAlarmUI');ghide('addEventInviteUI');gshow('addEventRepeatUI',document.appSave.date_start.value,document.appSave.due_date.value,document.appSave.starthr.value,document.appSave.startmin.value,document.appSave.startfmt.value,document.appSave.endhr.value,document.appSave.endmin.value,document.appSave.endfmt.value);"><?php echo $mod_strings['LBL_REPEAT']?></a></td>
+ <td id="cellTabRepeat" class="dvtUnSelectedCell" align=center nowrap><a href="#" onClick="switchClass('cellTabInvite','off');switchClass('cellTabAlarm','off');switchClass('cellTabRepeat','on');ghide('addEventAlarmUI');ghide('addEventInviteUI');gshow('addEventRepeatUI','',document.appSave.date_start.value,document.appSave.due_date.value,document.appSave.starthr.value,document.appSave.startmin.value,document.appSave.startfmt.value,document.appSave.endhr.value,document.appSave.endmin.value,document.appSave.endfmt.value);"><?php echo $mod_strings['LBL_REPEAT']?></a></td>
<td class="dvtTabCache" style="width:100%"> </td>
</tr>
</table>
@@ -477,7 +451,7 @@
<span style="border-top:1px dashed #CCCCCC;width:99%;display:block;"></span>
<a href="" id="postpone" class="calMnu">- <?php echo $mod_strings['LBL_POSTPONE']?></a>
<a href="" id="changeowner" class="calMnu">- <?php echo $mod_strings['LBL_CHANGEOWNER']?></a>
- <a href="" id="actdelete" class="calMnu">- <?php echo $mod_strings['LBL_DEL']?></a>
+ <a href="" id="actdelete" onclick ="alert('Are you sure?')" class="calMnu">- <?php echo $mod_strings['LBL_DEL']?></a>
</td>
</tr>
</table>
@@ -491,10 +465,10 @@
</div>
<div class="calAddEvent" style="display:none" id="createTodo" align=center>
-<form name="createTodo" onSubmit="return check_form();" method="POST" action="index.php">
- <input type="hidden" name="module" value="Activities">
+<form name="createTodo" onSubmit="task_check_form();return formValidate();" method="POST" action="index.php">
+ <input type="hidden" name="module" value="Calendar">
<input type="hidden" name="activity_mode" value="Task">
- <input type="hidden" name="action" value="Save">
+ <input type="hidden" name="action" value="TodoSave">
<input type="hidden" name="return_action" value="index">
<input type="hidden" name="return_module" value="Calendar">
<input type="hidden" name="view" value="<? echo $calendar_arr['view'] ?>">
@@ -505,7 +479,7 @@
<input type="hidden" name="record" value="">
<input type="hidden" name="assigned_user_id" value="<? echo $current_user->id ?>">
<input type="hidden" name="assigntype" value="U">
- <input type="hidden" name="time_start" id="time_start">
+ <input type="hidden" name="task_time_start" id="task_time_start">
<input type="hidden" name="takstatus" value="Planned">
<input type="hidden" name="set_reminder" value="">
<table border=0 cellspacing=0 cellpadding=5 width=100% class="addEventHeader">
@@ -518,7 +492,7 @@
<table border=0 cellspacing=0 cellpadding=5 width=90% >
<tr>
<td width=20%><b><?echo $mod_strings['LBL_TODONAME']?> :</b></td>
- <td width=80%><input name="subject" type="text" class="textbox" style="width:90%"></td>
+ <td width=80%><input name="task_subject" type="text" class="textbox" style="width:90%"></td>
</tr>
<tr>
<td><b><?echo $mod_strings['LBL_TODODATETIME']?> :</b></td>
@@ -529,10 +503,10 @@
<tr>
<td> </td>
<td>
- <input type="text" name="date_start" id="task_jscal_field_date_start" class="textbox" style="width:90px"> <img border=0 src="<?echo $image_path?>btnL3Calendar.gif" alt="Set date.." title="Set date.." id="jscal_trigger_date_start" align="absmiddle">
+ <input type="text" name="task_date_start" id="task_date_start" class="textbox" style="width:90px"> <img border=0 src="<?echo $image_path?>btnL3Calendar.gif" alt="Set date.." title="Set date.." id="jscal_trigger_date_start" align="absmiddle">
<script type="text/javascript">
Calendar.setup ({
- inputField : "task_jscal_field_date_start", ifFormat : "<?php echo $date_format; ?>", showsTime : false, button : "jscal_trigger_date_start", singleClick : true, step : 1
+ inputField : "task_date_start", ifFormat : "<?php echo $date_format; ?>", showsTime : false, button : "jscal_trigger_date_start", singleClick : true, step : 1
})
</script>
</td>
@@ -633,7 +607,11 @@
</tr>
</table>
</form>
-
+<script>
+ var fieldname = new Array('task_subject','task_date_start','task_time_start','taskstatus');
+ var fieldlabel = new Array('Subject','Date','Time','Status');
+ var fielddatatype = new Array('V~M','D~M~time_start','T~O','V~O');
+</script>
</div>
Modified: vtigercrm/trunk/modules/Calendar/calendarLayout.php
==============================================================================
--- vtigercrm/trunk/modules/Calendar/calendarLayout.php (original)
+++ vtigercrm/trunk/modules/Calendar/calendarLayout.php Mon May 29 06:56:14 2006
@@ -1,4 +1,14 @@
<?php
+/*********************************************************************************
+** The contents of this file are subject to the vtiger CRM Public License Version 1.0
+ * ("License"); You may not use this file except in compliance with the License
+ * The Original Code is: vtiger CRM Open Source
+ * The Initial Developer of the Original Code is vtiger.
+ * Portions created by vtiger are Copyright (C) vtiger.
+ * All Rights Reserved.
+*
+ ********************************************************************************/
+
require_once('include/database/PearDatabase.php');
require_once('include/utils/CommonUtils.php');
@@ -180,6 +190,7 @@
}
/*To display events/todos detail in calendar header
+ *@param $cal_arr -- The calendar array:: Type Array
*/
function get_cal_header_data(& $cal_arr)
{
@@ -212,6 +223,7 @@
echo $headerdata;
}
/*To get View Combo box
+ *@param $cal -- The calendar array:: Type Array
*/
function getEventViewOption(& $cal)
{
@@ -224,6 +236,7 @@
}
/*link to previous day/week/month/year view
+ *@param $cal -- The calendar array:: Type Array
*/
function get_previous_cal(& $cal)
{
@@ -233,6 +246,7 @@
}
/*link to next day/week/month view
+ *@param $cal -- The calendar array:: Type Array
*/
function get_next_cal(& $cal)
{
@@ -243,6 +257,7 @@
}
/*To display date info in calendar header
+ *@param $cal -- The calendar array:: Type Array
*/
function display_date($view,$date_time)
{
@@ -280,7 +295,10 @@
}
}
-
+/*To get css class name for date
+ *@param $slice_date -- The calendar date:: Type string
+ *return css class name :: Type string
+*/
function dateCheck($slice_date)
{
$today = date('Y-m-d');
@@ -294,7 +312,9 @@
}
}
-/*To get day/week/month events hourview
+/*To get day/week/month events Hourview
+ @param $view -- The calendar array :: Type Array
+ @param $type -- The type(to differntiate hourview and listview) :: Type string
*/
function getHourView(& $view,$type = 'default' )
{
@@ -321,6 +341,8 @@
}
/*To get day/week/month events listview
+ @param $cal -- The calendar array :: Type Array
+ @param $mode -- The mode(to differntiate hourview and listview) :: Type string
*/
function getEventListView(& $cal,$mode='')
{
@@ -374,7 +396,11 @@
}
-
+/*To get day/week/month todos listview
+ *@param $cal -- The calendar array :: Type Array
+ *@param $check -- The check :: Type string
+ *return todolist string or todo listview html depends on $check value
+*/
function getTodosListView($cal, $check='')
{
if($cal['calendar']->view == 'day')
@@ -426,6 +452,10 @@
}
}
+/*To get calendar layout for dayview
+ *@param $cal -- The calendar array :: Type Array
+ *@param $type -- The type :: Type string
+*/
function getDayViewLayout(& $cal,$type)
{
global $current_user,$app_strings;
@@ -500,6 +530,10 @@
echo $dayview_layout;
}
+/*To get calendar layout for week view
+ *@param $cal -- The calendar array :: Type Array
+ *@param $type -- The type :: Type string
+*/
function getWeekViewLayout(& $cal,$type)
{
global $current_user,$app_strings;
@@ -598,6 +632,10 @@
}
+/*To get calendar layout for month view
+ *@param $cal -- The calendar array :: Type Array
+ *@param $type -- The type :: Type string
+*/
function getMonthViewLayout(& $cal,$type)
{
global $current_user,$app_strings;
@@ -668,6 +706,10 @@
}
+/*To get calendar layout for year view
+ *@param $cal -- The calendar array :: Type Array
+ *@param $type -- The type :: Type string
+*/
function getYearViewLayout(& $cal,$type)
{
global $mod_strings;
@@ -772,7 +814,11 @@
}
-
+/*To display events in day view
+ *@param $cal -- The calendar array :: Type Array
+ *@param $slice -- The slice(date and time) :: Type string
+ *returns event in html div format
+*/
function getdayEventLayer(& $cal,$slice)
{
global $mod_strings;
@@ -810,7 +856,7 @@
</td>
<td align="right" width="5%">
<div id="'.$arrow_img_name.'" style="display: none;">
- <img onClick="getcalAction(this,\'calAction\','.$id.',\''.$cal['view'].'\',\''.$cal['calendar']->date_time->hour.'\',\''.$cal['calendar']->date_time->day.'\',\''.$cal['calendar']->date_time->month.'\',\''.$cal['calendar']->date_time->year.'\');" onMouseout="fninvsh(\'calAction\')" src="'.$cal['IMAGE_PATH'].'cal_event.jpg" border="0">
+ <img onClick="getcalAction(this,\'calAction\','.$id.',\''.$cal['view'].'\',\''.$cal['calendar']->date_time->hour.'\',\''.$cal['calendar']->date_time->day.'\',\''.$cal['calendar']->date_time->month.'\',\''.$cal['calendar']->date_time->year.'\',\'event\');" onMouseout="fninvsh(\'calAction\')" src="'.$cal['IMAGE_PATH'].'cal_event.jpg" border="0">
</div>
</td>
</tr>
@@ -821,6 +867,11 @@
}
}
+/*To display events in week view
+ *@param $cal -- The calendar array :: Type Array
+ *@param $slice -- The slice(date) :: Type string
+ *returns event in html div format
+*/
function getweekEventLayer(& $cal,$slice)
{
global $mod_strings;
@@ -853,6 +904,11 @@
}
+/*To display events in month view
+ *@param $cal -- The calendar array :: Type Array
+ *@param $slice -- The slice(date) :: Type string
+ *returns event in html div format
+*/
function getmonthEventLayer(& $cal,$slice)
{
global $mod_strings;
@@ -904,7 +960,13 @@
}
-
+/*To get events list scheduled between specified dates
+ *@param $calendar -- The calendar array :: Type Array
+ *@param $start_date -- the start date :: Type string
+ *@param $end_date -- the end date :: Type string
+ *@param $info -- the info :: Type string
+ *returns $Entries :: Type Array
+*/
function getEventList(& $calendar,$start_date,$end_date,$info='')
{
$Entries = Array();
@@ -971,13 +1033,21 @@
$image_tag = "<img src='".$calendar['IMAGE_PATH']."Meetings.gif' align='middle'> ".$type;
$element['eventtype'] = $image_tag;
$element['eventdetail'] = $contact_data." ".$subject." ".$more_link;
- $element['action'] ="<img onClick='getcalAction(this,\"calAction\",".$id.",\"".$calendar['view']."\",\"".$calendar['calendar']->date_time->hour."\",\"".$calendar['calendar']->date_time->day."\",\"".$calendar['calendar']->date_time->month."\",\"".$calendar['calendar']->date_time->year."\");' src='".$calendar['IMAGE_PATH']."cal_event.jpg' border='0'>";
+ $element['action'] ="<img onClick='getcalAction(this,\"calAction\",".$id.",\"".$calendar['view']."\",\"".$calendar['calendar']->date_time->hour."\",\"".$calendar['calendar']->date_time->day."\",\"".$calendar['calendar']->date_time->month."\",\"".$calendar['calendar']->date_time->year."\",\"event\");' src='".$calendar['IMAGE_PATH']."cal_event.jpg' border='0'>";
$element['status'] = $adb->query_result($result,$i,"eventstatus");
$Entries[] = $element;
}
return $Entries;
}
+
+/*To get todos list scheduled between specified dates
+ *@param $calendar -- The calendar array :: Type Array
+ *@param $start_date -- the start date :: Type string
+ *@param $end_date -- the end date :: Type string
+ *@param $info -- the info :: Type string
+ *returns $Entries :: Type Array
+*/
function getTodoList(& $calendar,$start_date,$end_date,$info='')
{
$Entries = Array();
@@ -1023,7 +1093,7 @@
$more_link = "<a href='index.php?action=DetailView&module=Activities&record=".$id."&activity_mode=Task' class='webMnu'>".$subject."</a>";
$element['tododetail'] = $more_link;
$element['status'] = $adb->query_result($result,$i,"status");
- $element['action'] = "<img onClick='getcalAction(this,\"calAction\");' src='".$calendar['IMAGE_PATH']."cal_event.jpg' border='0'>";
+ $element['action'] ="<img onClick='getcalAction(this,\"calAction\",".$id.",\"".$calendar['view']."\",\"".$calendar['calendar']->date_time->hour."\",\"".$calendar['calendar']->date_time->day."\",\"".$calendar['calendar']->date_time->month."\",\"".$calendar['calendar']->date_time->year."\",\"todo\");' src='".$calendar['IMAGE_PATH']."cal_event.jpg' border='0'>";
$Entries[] = $element;
}
return $Entries;
More information about the vtigercrm-commits
mailing list