Skip to content
Snippets Groups Projects
Commit e830c9a1 authored by Prasad's avatar Prasad
Browse files

Merge branch 'master' into 'master'

Fix date comparison bug to get reminders

See merge request vtiger/vtigercrm!890
parents 5a349ee9 2fd2defd
No related branches found
No related tags found
No related merge requests found
......@@ -863,15 +863,19 @@ class Calendar_Module_Model extends Vtiger_Module_Model {
$currentTime = time();
$date = date('Y-m-d', strtotime("+$activityReminder seconds", $currentTime));
$time = date('H:i', strtotime("+$activityReminder seconds", $currentTime));
$dateAndTime = $date.' '.$time;
$reminderActivitiesResult = "SELECT reminderid, recordid FROM vtiger_activity_reminder_popup
INNER JOIN vtiger_activity on vtiger_activity.activityid = vtiger_activity_reminder_popup.recordid
INNER JOIN vtiger_crmentity ON vtiger_activity_reminder_popup.recordid = vtiger_crmentity.crmid
WHERE vtiger_activity_reminder_popup.status = 0
AND vtiger_crmentity.smownerid = ? AND vtiger_crmentity.deleted = 0
AND ((DATE_FORMAT(vtiger_activity_reminder_popup.date_start,'%Y-%m-%d') <= ?)
AND (TIME_FORMAT(vtiger_activity_reminder_popup.time_start,'%H:%i') <= ?))
and CONCAT(
DATE_FORMAT(vtiger_activity_reminder_popup.date_start,'%Y-%m-%d'),
' ',
TIME_FORMAT(vtiger_activity_reminder_popup.time_start,'%H:%i')
) <= ?
AND vtiger_activity.eventstatus <> 'Held' AND (vtiger_activity.status <> 'Completed' OR vtiger_activity.status IS NULL) LIMIT 20";
$result = $db->pquery($reminderActivitiesResult, array($currentUserModel->getId(), $date, $time));
$result = $db->pquery($reminderActivitiesResult, array($currentUserModel->getId(), $dateAndTime));
$rows = $db->num_rows($result);
for($i=0; $i<$rows; $i++) {
$recordId = $db->query_result($result, $i, 'recordid');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment