[Vtigercrm-commits] [vtiger-commits] r9923 - in /vtigercrm/branches/5.0.3/modules/Calendar: CalendarCommon.php Save.php TodoSave.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Tue Nov 28 01:07:39 EST 2006
Author: richie
Date: Mon Nov 27 23:07:32 2006
New Revision: 9923
Log:
Problem in send notification in ToDo - fixed
Modified:
vtigercrm/branches/5.0.3/modules/Calendar/CalendarCommon.php
vtigercrm/branches/5.0.3/modules/Calendar/Save.php
vtigercrm/branches/5.0.3/modules/Calendar/TodoSave.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 Mon Nov 27 23:07:32 2006
@@ -359,4 +359,42 @@
}
//Code Added by Minnie -Ends
+/**
+ * Function to get the vtiger_activity details for mail body
+ * @param string $description - activity description
+ * return string $list - HTML in string format
+ */
+function getActivityDetails($description,$inviteeid='')
+{
+ global $log,$current_user;
+ global $adb,$mod_strings;
+ $log->debug("Entering getActivityDetails(".$description.") method ...");
+
+ $reply = (($_REQUEST['mode'] == 'edit')?'Replied':'Created');
+ if($inviteeid=='')
+ $name = getUserName($_REQUEST['assigned_user_id']);
+ else
+ $name = getUserName($inviteeid);
+
+ $current_username = getUserName($current_user->id);
+ $status = (($_REQUEST['activity_mode']=='Task')?($_REQUEST['taskstatus']):($_REQUEST['eventstatus']));
+
+ $list = $mod_strings['LBL_DEAR'].' ' .$name.',';
+ $list .= '<br><br>'.$mod_strings['LBL_ACTIVITY_STRING'].' '.$reply.'. '.$mod_strings['LBL_DETAILS_STRING'].':';
+ $list .= '<br>'.$mod_strings["LBL_SUBJECT"].' '.$_REQUEST['subject'];
+ $list .= '<br>'.$mod_strings["LBL_STATUS"].': '.$status;
+ $list .= '<br>'.$mod_strings["Priority"].': '.$_REQUEST['taskpriority'];
+ $list .= '<br>'.$mod_strings["Related To"].' : '.$_REQUEST['parent_name'];
+ if($_REQUEST['activity_mode']!= 'Events')
+ {
+ $list .= '<br>'.$mod_strings["LBL_CONTACT"].' '.$_REQUEST['contactlist'];
+ }
+ $list .= '<br>'.$mod_strings["LBL_APP_DESCRIPTION"].': '.$description;
+ $list .= '<br><br>'.$mod_strings["LBL_REGARDS_STRING"].' ,';
+ $list .= '<br>'.$current_username.'.';
+
+ $log->debug("Exiting getActivityDetails method ...");
+ return $list;
+}
+
?>
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 Mon Nov 27 23:07:32 2006
@@ -26,6 +26,7 @@
//require("modules/Emails/class.phpmailer.php");
require_once("config.php");
require_once('include/database/PearDatabase.php');
+require_once('modules/Calendar/CalendarCommon.php');
global $adb;
$local_log =& LoggerManager::getLogger('index');
$focus = new Activity();
@@ -194,38 +195,4 @@
else
header("Location: index.php?action=$return_action&module=$return_module$view$hour$day$month$year&record=$return_id$activemode&viewname=$return_viewname$page&parenttab=$parenttab");
-/**
- * Function to get the vtiger_activity details for mail body
- * @param string $description - activity description
- * return string $list - HTML in string format
- */
-function getActivityDetails($description,$inviteeid='')
-{
- global $log,$current_user;
- global $adb,$mod_strings;
- $log->debug("Entering getActivityDetails(".$description.") method ...");
-
- $reply = (($_REQUEST['mode'] == 'edit')?'Replied':'Created');
- if($inviteeid=='')
- $name = getUserName($_REQUEST['assigned_user_id']);
- else
- $name = getUserName($inviteeid);
-
- $current_username = getUserName($current_user->id);
- $status = (($_REQUEST['activity_mode']=='Task')?($_REQUEST['taskstatus']):($_REQUEST['eventstatus']));
-
- $list = $mod_strings['LBL_DEAR'].' ' .$name.',';
- $list .= '<br><br>'.$mod_strings['LBL_ACTIVITY_STRING'].' '.$reply.'. '.$mod_strings['LBL_DETAILS_STRING'].':';
- $list .= '<br>'.$mod_strings["LBL_SUBJECT"].' '.$_REQUEST['subject'];
- $list .= '<br>'.$mod_strings["LBL_STATUS"].': '.$status;
- $list .= '<br>'.$mod_strings["Priority"].': '.$_REQUEST['taskpriority'];
- $list .= '<br>'.$mod_strings["Related To"].' : '.$_REQUEST['parent_name'];
- $list .= '<br>'.$mod_strings["LBL_CONTACT"].' '.$_REQUEST['contact_name'];
- $list .= '<br>'.$mod_strings["LBL_APP_DESCRIPTION"].': '.$description;
- $list .= '<br><br>'.$mod_strings["LBL_REGARDS_STRING"].' ,';
- $list .= '<br>'.$current_username.'.';
-
- $log->debug("Exiting getActivityDetails method ...");
- return $list;
-}
?>
Modified: vtigercrm/branches/5.0.3/modules/Calendar/TodoSave.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Calendar/TodoSave.php (original)
+++ vtigercrm/branches/5.0.3/modules/Calendar/TodoSave.php Mon Nov 27 23:07:32 2006
@@ -9,6 +9,7 @@
*
********************************************************************************/
require_once('modules/Calendar/Activity.php');
+require_once('modules/Calendar/CalendarCommon.php');
require_once('include/logging.php');
require_once("config.php");
require_once('include/database/PearDatabase.php');
@@ -46,6 +47,23 @@
if(isset($_REQUEST['task_sendnotification']) && $_REQUEST['task_sendnotification'] != null)
$focus->column_fields["sendnotification"] = $_REQUEST["task_sendnotification"];
- $focus->save($tab_type);
+ $focus->save($tab_type);
+ if($_REQUEST["task_sendnotification"]=='on' && $_REQUEST['task_assigntype'] == 'U')
+ {
+
+ global $current_user;
+ $local_log->info("send notification is on");
+ require_once("modules/Emails/mail.php");
+ $to_email = getUserEmailId('id',$_REQUEST['task_assigned_user_id']);
+ $subject = $_REQUEST['activity_mode'].' : '.$_REQUEST['task_subject'];
+ $_REQUEST["assigned_user_id"]= $_REQUEST["task_assigned_user_id"];
+ $_REQUEST["subject"]=$subject;
+ $_REQUEST["parent_name"]=$_REQUEST["task_parent_name"];
+ $_REQUEST['contactlist']=$_REQUEST['task_contact_name'];
+ $description = getActivityDetails($_REQUEST['task_description']);
+ $mail_status = send_mail('Calendar',$to_email,$current_user->user_name,'',$subject,$description);
+
+ }
+
header("Location: index.php?action=index&module=Calendar&view=".$_REQUEST['view']."&hour=".$_REQUEST['hour']."&day=".$_REQUEST['day']."&month=".$_REQUEST['month']."&year=".$_REQUEST['year']."&viewOption=".$_REQUEST['viewOption']."&subtab=".$_REQUEST['subtab']."&parenttab=".$_REQUEST['parenttab']);
?>
More information about the vtigercrm-commits
mailing list