$rem_min = 0; if (!empty($focus->column_fields['reminder_time'])) { $data['set_reminder'] = $c_mod_strings['LBL_YES']; $data['reminder_str'] = $finaldata['reminder_time']; } else { $data['set_reminder'] = $c_mod_strings['LBL_NO']; } //To set recurring details $query = 'SELECT vtiger_recurringevents.*, vtiger_activity.date_start, vtiger_activity.time_start, vtiger_activity.due_date, vtiger_activity.time_end FROM vtiger_recurringevents INNER JOIN vtiger_activity ON vtiger_activity.activityid = vtiger_recurringevents.activityid WHERE vtiger_recurringevents.activityid = ?'; $res = $adb->pquery($query, array($focus->id)); $rows = $adb->num_rows($res); if ($rows > 0) { $recurringObject = RecurringType::fromDBRequest($adb->query_result_rowdata($res, 0)); $recurringInfoDisplayData = $recurringObject->getDisplayRecurringInfo(); $data = array_merge($data, $recurringInfoDisplayData); } else { $data['recurringcheck'] = getTranslatedString('LBL_NO', $currentModule); $data['repeat_str'] = ''; } $sql = 'select vtiger_users.*,vtiger_invitees.* from vtiger_invitees left join vtiger_users on vtiger_invitees.inviteeid=vtiger_users.id where activityid=?'; $result = $adb->pquery($sql, array($focus->id)); $num_rows = $adb->num_rows($result); $invited_users = array(); for ($i = 0; $i < $num_rows; $i++) { $userid = $adb->query_result($result, $i, 'inviteeid'); $username = getFullNameFromQResult($result, $i, 'Users'); $invited_users[$userid] = $username; }
static function getRecurringObjValue() { $recurring_data = array(); if (isset($_REQUEST['recurringtype']) && $_REQUEST['recurringtype'] != null && $_REQUEST['recurringtype'] != '--None--') { if (!empty($_REQUEST['date_start'])) { $startDate = $_REQUEST['date_start']; } if (!empty($_REQUEST['calendar_repeat_limit_date'])) { $endDate = $_REQUEST['calendar_repeat_limit_date']; $recurring_data['recurringenddate'] = $endDate; } elseif (isset($_REQUEST['due_date']) && $_REQUEST['due_date'] != null) { $endDate = $_REQUEST['due_date']; } if (!empty($_REQUEST['time_start'])) { $startTime = $_REQUEST['time_start']; } if (!empty($_REQUEST['time_end'])) { $endTime = $_REQUEST['time_end']; } $recurring_data['startdate'] = $startDate; $recurring_data['starttime'] = $startTime; $recurring_data['enddate'] = $endDate; $recurring_data['endtime'] = $endTime; $recurring_data['type'] = $_REQUEST['recurringtype']; if ($_REQUEST['recurringtype'] == 'Weekly') { if (isset($_REQUEST['sun_flag']) && $_REQUEST['sun_flag'] != null) { $recurring_data['sun_flag'] = true; } if (isset($_REQUEST['mon_flag']) && $_REQUEST['mon_flag'] != null) { $recurring_data['mon_flag'] = true; } if (isset($_REQUEST['tue_flag']) && $_REQUEST['tue_flag'] != null) { $recurring_data['tue_flag'] = true; } if (isset($_REQUEST['wed_flag']) && $_REQUEST['wed_flag'] != null) { $recurring_data['wed_flag'] = true; } if (isset($_REQUEST['thu_flag']) && $_REQUEST['thu_flag'] != null) { $recurring_data['thu_flag'] = true; } if (isset($_REQUEST['fri_flag']) && $_REQUEST['fri_flag'] != null) { $recurring_data['fri_flag'] = true; } if (isset($_REQUEST['sat_flag']) && $_REQUEST['sat_flag'] != null) { $recurring_data['sat_flag'] = true; } } elseif ($_REQUEST['recurringtype'] == 'Monthly') { if (isset($_REQUEST['repeatMonth']) && $_REQUEST['repeatMonth'] != null) { $recurring_data['repeatmonth_type'] = $_REQUEST['repeatMonth']; } if ($recurring_data['repeatmonth_type'] == 'date') { if (isset($_REQUEST['repeatMonth_date']) && $_REQUEST['repeatMonth_date'] != null) { $recurring_data['repeatmonth_date'] = $_REQUEST['repeatMonth_date']; } else { $recurring_data['repeatmonth_date'] = 1; } } elseif ($recurring_data['repeatmonth_type'] == 'day') { $recurring_data['repeatmonth_daytype'] = $_REQUEST['repeatMonth_daytype']; switch ($_REQUEST['repeatMonth_day']) { case 0: $recurring_data['sun_flag'] = true; break; case 1: $recurring_data['mon_flag'] = true; break; case 2: $recurring_data['tue_flag'] = true; break; case 3: $recurring_data['wed_flag'] = true; break; case 4: $recurring_data['thu_flag'] = true; break; case 5: $recurring_data['fri_flag'] = true; break; case 6: $recurring_data['sat_flag'] = true; break; } } } if (isset($_REQUEST['repeat_frequency']) && $_REQUEST['repeat_frequency'] != null) { $recurring_data['repeat_frequency'] = $_REQUEST['repeat_frequency']; } $recurObj = RecurringType::fromUserRequest($recurring_data); return $recurObj; } }
/** * Function to get the recurring object * @return Object - recurring object */ public function getRecurringObject() { $db = PearDatabase::getInstance(); $query = 'SELECT vtiger_recurringevents.*, vtiger_activity.date_start, vtiger_activity.time_start, vtiger_activity.due_date, vtiger_activity.time_end FROM vtiger_recurringevents INNER JOIN vtiger_activity ON vtiger_activity.activityid = vtiger_recurringevents.activityid WHERE vtiger_recurringevents.activityid = ?'; $result = $db->pquery($query, array($this->getId())); if ($db->num_rows($result)) { return RecurringType::fromDBRequest($db->query_result_rowdata($result, 0)); } return false; }