function fill_in_additional_detail_fields() { if (isset($this->contact_id) && $this->contact_id != "") { $query = "SELECT first_name, last_name from contacts where id='{$this->contact_id}' AND deleted=0"; $result = $this->db->query($query, true, " Error filling in additional detail fields: "); // Get the id and the name. $row = $this->db->fetchByAssoc($result); if ($row != null) { $this->contact_name = return_name($row, 'first_name', 'last_name'); } } if (isset($this->bug_id) && $this->bug_id != "") { $query = "SELECT name from bugs where id='{$this->bug_id}' AND deleted=0"; $result = $this->db->query($query, true, " Error filling in additional detail fields: "); // Get the id and the name. $row = $this->db->fetchByAssoc($result); if ($row != null) { $this->bug_name = $row['name']; } } }
function get_list_view_data() { global $action, $currentModule, $focus, $current_module_strings, $app_list_strings, $timedate; $today = $timedate->handle_offset(date($GLOBALS['timedate']->get_db_date_time_format(), time()), $timedate->dbDayFormat, true); $task_fields = $this->get_list_view_array(); //$date_due = $timedate->to_db_date($task_fields['DATE_DUE'],false); if (isset($this->parent_type)) { $task_fields['PARENT_MODULE'] = $this->parent_type; } /* if ($this->status != "Completed" && $this->status != "Deferred" ) { $task_fields['SET_COMPLETE'] = "<a href='index.php?return_module=$currentModule&return_action=$action&return_id=" . ((!empty($focus->id)) ? $focus->id : "") . "&module=ProjectTask&action=EditView&record={$this->id}&status=Completed'>".SugarThemeRegistry::current()->getImage("close_inline","alt='Close' border='0'")."</a>"; } if( $date_due < $today){ $task_fields['DATE_DUE']= "<font class='overdueTask'>".$task_fields['DATE_DUE']."</font>"; }else if( $date_due == $today ){ $task_fields['DATE_DUE'] = "<font class='todaysTask'>".$task_fields['DATE_DUE']."</font>"; }else{ $task_fields['DATE_DUE'] = "<font class='futureTask'>".$task_fields['DATE_DUE']."</font>"; } */ $task_fields['CONTACT_NAME'] = return_name($task_fields, "FIRST_NAME", "LAST_NAME"); $task_fields['TITLE'] = ''; if (!empty($task_fields['CONTACT_NAME'])) { $task_fields['TITLE'] .= $current_module_strings['LBL_LIST_CONTACT'] . ": " . $task_fields['CONTACT_NAME']; } return $task_fields; }
function fill_in_additional_detail_fields() { global $app_list_strings, $mod_strings; // Fill in the assigned_user_name $this->assigned_user_name = get_assigned_user_name($this->assigned_user_id, ''); $query = "SELECT contacts.first_name, contacts.last_name, contacts.phone_work, contacts.email1, contacts.id, contacts.assigned_user_id contact_name_owner, 'Contacts' contact_name_mod FROM contacts, emails_contacts "; $query .= "WHERE emails_contacts.contact_id=contacts.id AND emails_contacts.email_id='{$this->id}' AND emails_contacts.deleted=0 AND contacts.deleted=0"; $result = $this->db->query($query, true, " Error filling in additional detail fields: "); // Get the id and the name. $row = $this->db->fetchByAssoc($result); $GLOBALS['log']->info($row); if ($row != null) { $this->contact_name = return_name($row, 'first_name', 'last_name'); $this->contact_phone = $row['phone_work']; $this->contact_id = $row['id']; $this->contact_email = $row['email1']; $this->contact_name_owner = $row['contact_name_owner']; $this->contact_name_mod = $row['contact_name_mod']; $GLOBALS['log']->debug("Call({$this->id}): contact_name = {$this->contact_name}"); $GLOBALS['log']->debug("Call({$this->id}): contact_phone = {$this->contact_phone}"); $GLOBALS['log']->debug("Call({$this->id}): contact_id = {$this->contact_id}"); $GLOBALS['log']->debug("Call({$this->id}): contact_email1 = {$this->contact_email}"); } else { $this->contact_name = ''; $this->contact_phone = ''; $this->contact_id = ''; $this->contact_email = ''; $this->contact_name_owner = ''; $this->contact_name_mod = ''; $GLOBALS['log']->debug("Call({$this->id}): contact_name = {$this->contact_name}"); $GLOBALS['log']->debug("Call({$this->id}): contact_phone = {$this->contact_phone}"); $GLOBALS['log']->debug("Call({$this->id}): contact_id = {$this->contact_id}"); $GLOBALS['log']->debug("Call({$this->id}): contact_email1 = {$this->contact_email}"); } $this->created_by_name = get_assigned_user_name($this->created_by); $this->modified_by_name = get_assigned_user_name($this->modified_user_id); $this->link_action = 'DetailView'; if (!empty($this->type)) { if ($this->type == 'out' && $this->status == 'send_error') { $this->type_name = $mod_strings['LBL_NOT_SENT']; } else { $this->type_name = $app_list_strings['dom_email_types'][$this->type]; } if ($this->type == 'out' && $this->status == 'send_error' || $this->type == 'draft') { $this->link_action = 'EditView'; } } //todo this isset( $app_list_strings['dom_email_status'][$this->status]) is hack for 3261. if (!empty($this->status) && isset($app_list_strings['dom_email_status'][$this->status])) { $this->status_name = $app_list_strings['dom_email_status'][$this->status]; } if (empty($this->name) && empty($_REQUEST['record'])) { $this->name = '(no subject)'; } $this->fill_in_additional_parent_fields(); }
/** * Function to process the activity list query * @param string $query - query string * return array $response - activity lists */ function process_list_query1($query) { global $log; $log->debug("Entering process_list_query1(" . $query . ") method ..."); $result =& $this->db->query($query, true, "Error retrieving {$this->object_name} list: "); $list = array(); $rows_found = $this->db->getRowCount($result); if ($rows_found != 0) { $task = array(); for ($index = 0, $row = $this->db->fetchByAssoc($result, $index); $row && $index < $rows_found; $index++, $row = $this->db->fetchByAssoc($result, $index)) { foreach ($this->range_fields as $columnName) { if (isset($row[$columnName])) { if ($columnName == 'time_start') { $startDate = new DateTimeField($row['date_start'] . ' ' . $row[$columnName]); $task[$columnName] = $startDate->getDBInsertTimeValue(); } else { $task[$columnName] = $row[$columnName]; } } else { $task[$columnName] = ""; } } $task[contact_name] = return_name($row, 'cfn', 'cln'); $list[] = $task; } } $response = array(); $response['list'] = $list; $response['row_count'] = $rows_found; $response['next_offset'] = $next_offset; $response['previous_offset'] = $previous_offset; $log->debug("Exiting process_list_query1 method ..."); return $response; }
function fill_in_additional_detail_fields() { // Fill in the assigned_user_name $this->assigned_user_name = get_assigned_user_name($this->assigned_user_id); $query = "SELECT c.first_name, c.last_name, c.phone_work, c.email1, c.id FROM contacts c, calls_contacts c_c "; $query .= "WHERE c_c.contact_id=c.id AND c_c.call_id='{$this->id}' AND c_c.deleted=0 AND c.deleted=0"; $result = $this->db->query($query, true, " Error filling in additional detail fields: "); // Get the id and the name. $row = array(); $row = $this->db->fetchByAssoc($result); $GLOBALS['log']->info("additional call fields {$query}"); if ($row != null) { $this->contact_name = return_name($row, 'first_name', 'last_name'); $this->contact_phone = $row['phone_work']; $this->contact_id = $row['id']; $this->contact_email = $row['email1']; $GLOBALS['log']->debug("Call({$this->id}): contact_name = {$this->contact_name}"); $GLOBALS['log']->debug("Call({$this->id}): contact_phone = {$this->contact_phone}"); $GLOBALS['log']->debug("Call({$this->id}): contact_id = {$this->contact_id}"); $GLOBALS['log']->debug("Call({$this->id}): contact_email1 = {$this->contact_email}"); } else { $this->contact_name = ''; $this->contact_phone = ''; $this->contact_id = ''; $this->contact_email = ''; $GLOBALS['log']->debug("Call({$this->id}): contact_name = {$this->contact_name}"); $GLOBALS['log']->debug("Call({$this->id}): contact_phone = {$this->contact_phone}"); $GLOBALS['log']->debug("Call({$this->id}): contact_id = {$this->contact_id}"); $GLOBALS['log']->debug("Call({$this->id}): contact_email1 = {$this->contact_email}"); } $this->fill_in_additional_parent_fields(); $this->created_by_name = get_assigned_user_name($this->created_by); $this->modified_by_name = get_assigned_user_name($this->modified_user_id); }
function get_list_view_data() { global $action, $currentModule, $focus, $current_module_strings, $app_list_strings, $image_path, $timedate; $today = $timedate->handle_offset(date("Y-m-d H:i:s", time()), $timedate->dbDayFormat, true); $task_fields = $this->get_list_view_array(); $date_due = $timedate->to_db_date($task_fields['DATE_DUE'], false); if (isset($this->parent_type)) { $task_fields['PARENT_MODULE'] = $this->parent_type; } if ($this->status != "Completed" && $this->status != "Deferred") { $task_fields['SET_COMPLETE'] = "<a href='index.php?return_module={$currentModule}&return_action={$action}&return_id=" . (!empty($focus->id) ? $focus->id : "") . "&module=ProductComponents&action=EditView&record={$this->id}&status=Completed'>" . get_image($image_path . "close_inline", "alt='Close' border='0'") . "</a>"; } if ($date_due < $today) { $task_fields['DATE_DUE'] = "<font class='overdueTask'>" . $task_fields['DATE_DUE'] . "</font>"; } else { if ($date_due == $today) { $task_fields['DATE_DUE'] = "<font class='todaysTask'>" . $task_fields['DATE_DUE'] . "</font>"; } else { $task_fields['DATE_DUE'] = "<font class='futureTask'>" . $task_fields['DATE_DUE'] . "</font>"; } } $task_fields['CONTACT_NAME'] = return_name($task_fields, "FIRST_NAME", "LAST_NAME"); $task_fields['TITLE'] = ''; if (!empty($task_fields['CONTACT_NAME'])) { $task_fields['TITLE'] .= $current_module_strings['LBL_LIST_CONTACT'] . ": " . $task_fields['CONTACT_NAME']; } return $task_fields; }
function fill_in_additional_detail_fields() { // Fill in the assigned_user_name $this->assigned_user_name = get_assigned_user_name($this->assigned_user_id); global $app_strings; if (isset($this->contact_id)) { require_once "modules/Contacts/Contact.php"; $contact = new Contact(); $query = "SELECT first_name, last_name, phone_work, email1, assigned_user_id contact_name_owner from {$contact->table_name} where id = '{$this->contact_id}'"; $result = $this->db->query($query, true, $app_strings['ERR_CREATING_FIELDS']); // Get the id and the name. $row = $this->db->fetchByAssoc($result); if ($row != null) { $this->contact_name = return_name($row, 'first_name', 'last_name'); $this->contact_name_owner = $row['contact_name_owner']; $this->contact_name_mod = 'Contacts'; if ($row['phone_work'] != '') { $this->contact_phone = $row['phone_work']; } if ($row['email1'] != '') { $this->contact_email = $row['email1']; } } else { $this->contact_name_mod = ''; $this->contact_name_owner = ''; $this->contact_name = ''; $this->contact_email = ''; $this->contact_id = ''; } } $this->created_by_name = get_assigned_user_name($this->created_by); $this->modified_by_name = get_assigned_user_name($this->modified_user_id); $this->fill_in_additional_parent_fields(); }
function fill_in_additional_detail_fields() { parent::fill_in_additional_detail_fields(); $query = "SELECT c.first_name, c.last_name, c.phone_work, c.id FROM contacts c, calls_contacts c_c "; $query .= "WHERE c_c.contact_id=c.id AND c_c.call_id='{$this->id}' AND c_c.deleted=0 AND c.deleted=0"; $result = $this->db->limitQuery($query, 0, 1, true, " Error filling in additional detail fields: "); // Get the id and the name. $row = array(); $row = $this->db->fetchByAssoc($result); $GLOBALS['log']->info("additional call fields {$query}"); if ($row != null) { $this->contact_name = return_name($row, 'first_name', 'last_name'); $this->contact_phone = $row['phone_work']; $this->contact_id = $row['id']; $GLOBALS['log']->debug("Call({$this->id}): contact_name = {$this->contact_name}"); $GLOBALS['log']->debug("Call({$this->id}): contact_phone = {$this->contact_phone}"); $GLOBALS['log']->debug("Call({$this->id}): contact_id = {$this->contact_id}"); } else { $this->contact_name = ''; $this->contact_phone = ''; $this->contact_id = ''; $GLOBALS['log']->debug("Call({$this->id}): contact_name = {$this->contact_name}"); $GLOBALS['log']->debug("Call({$this->id}): contact_phone = {$this->contact_phone}"); $GLOBALS['log']->debug("Call({$this->id}): contact_id = {$this->contact_id}"); } if (!isset($this->duration_minutes)) { $this->duration_minutes = $this->minutes_value_default; } global $timedate; //setting default date and time if (is_null($this->date_start)) { $this->date_start = $timedate->to_display_date_time(gmdate($GLOBALS['timedate']->get_db_date_time_format())); } if (is_null($this->duration_hours)) { $this->duration_hours = "0"; } if (is_null($this->duration_minutes)) { $this->duration_minutes = "1"; } $this->fill_in_additional_parent_fields(); global $app_list_strings; $parent_types = $app_list_strings['record_type_display']; $disabled_parent_types = ACLController::disabledModuleList($parent_types, false, 'list'); foreach ($disabled_parent_types as $disabled_parent_type) { if ($disabled_parent_type != $this->parent_type) { unset($parent_types[$disabled_parent_type]); } } $this->parent_type_options = get_select_options_with_id($parent_types, $this->parent_type); if (empty($this->reminder_time)) { $this->reminder_time = -1; } $this->reminder_checked = $this->reminder_time == -1 ? false : true; if (isset($_REQUEST['parent_type'])) { $this->parent_type = $_REQUEST['parent_type']; } elseif (is_null($this->parent_type)) { $this->parent_type = $app_list_strings['record_type_default_key']; } }
function fill_in_additional_detail_fields() { // Fill in the assigned_user_name $this->assigned_user_name = get_assigned_user_name($this->assigned_user_id); $query = "SELECT contacts.first_name, contacts.last_name, contacts.phone_work, contacts.id , contacts.assigned_user_id contact_name_owner FROM contacts, meetings_contacts "; $query .= " WHERE meetings_contacts.contact_id=contacts.id AND meetings_contacts.meeting_id='{$this->id}' AND meetings_contacts.deleted=0 AND contacts.deleted=0"; $result = $this->db->limitQuery($query, 0, 1, true, " Error filling in additional detail fields: "); // Get the id and the name. $row = $this->db->fetchByAssoc($result); $GLOBALS['log']->info($row); if ($row != null) { $this->contact_name = return_name($row, 'first_name', 'last_name'); $this->contact_phone = $row['phone_work']; $this->contact_id = $row['id']; $this->contact_name_owner = $row['contact_name_owner']; $GLOBALS['log']->debug("Call({$this->id}): contact_name = {$this->contact_name}"); $GLOBALS['log']->debug("Call({$this->id}): contact_phone = {$this->contact_phone}"); $GLOBALS['log']->debug("Call({$this->id}): contact_id = {$this->contact_id}"); } else { $this->contact_name = ''; $this->contact_phone = ''; $this->contact_id = ''; $GLOBALS['log']->debug("Call({$this->id}): contact_name = {$this->contact_name}"); $GLOBALS['log']->debug("Call({$this->id}): contact_phone = {$this->contact_phone}"); $GLOBALS['log']->debug("Call({$this->id}): contact_id = {$this->contact_id}"); } $this->created_by_name = get_assigned_user_name($this->created_by); $this->modified_by_name = get_assigned_user_name($this->modified_user_id); $this->fill_in_additional_parent_fields(); if (!isset($this->time_hour_start)) { $this->time_start_hour = intval(substr($this->time_start, 0, 2)); } //if-else if (isset($this->time_minute_start)) { $time_start_minutes = $this->time_minute_start; } else { $time_start_minutes = substr($this->time_start, 3, 5); if ($time_start_minutes > 0 && $time_start_minutes < 15) { $time_start_minutes = "15"; } else { if ($time_start_minutes > 15 && $time_start_minutes < 30) { $time_start_minutes = "30"; } else { if ($time_start_minutes > 30 && $time_start_minutes < 45) { $time_start_minutes = "45"; } else { if ($time_start_minutes > 45) { $this->time_start_hour += 1; $time_start_minutes = "00"; } } } } //if-else } //if-else if (isset($this->time_hour_start)) { $time_start_hour = $this->time_hour_start; } else { $time_start_hour = intval(substr($this->time_start, 0, 2)); } global $timedate; $this->time_meridiem = $timedate->AMPMMenu('', $this->time_start, 'onchange="SugarWidgetScheduler.update_time();"'); $hours_arr = array(); $num_of_hours = 13; $start_at = 1; if (empty($time_meridiem)) { $num_of_hours = 24; $start_at = 0; } //if for ($i = $start_at; $i < $num_of_hours; $i++) { $i = $i . ""; if (strlen($i) == 1) { $i = "0" . $i; } $hours_arr[$i] = $i; } //for if (!isset($this->duration_minutes)) { $this->duration_minutes = $this->minutes_value_default; } //setting default date and time if (is_null($this->date_start)) { $this->date_start = $timedate->to_display_date_time(gmdate($GLOBALS['timedate']->get_db_date_time_format())); } if (is_null($this->time_start)) { $this->time_start = $timedate->to_display_time(gmdate($GLOBALS['timedate']->get_db_date_time_format()), true); } if (is_null($this->duration_hours)) { $this->duration_hours = "0"; } if (is_null($this->duration_minutes)) { $this->duration_minutes = "1"; } global $current_user; $reminder_t = $current_user->getPreference('reminder_time'); if (!empty($this->reminder_time)) { $reminder_t = $this->reminder_time; } global $app_list_strings; $parent_types = $app_list_strings['record_type_display']; $disabled_parent_types = ACLController::disabledModuleList($parent_types, false, 'list'); foreach ($disabled_parent_types as $disabled_parent_type) { if ($disabled_parent_type != $this->parent_type) { unset($parent_types[$disabled_parent_type]); } } $this->parent_type_options = get_select_options_with_id($parent_types, $this->parent_type); if (empty($this->reminder_time)) { $this->reminder_time = -1; } $this->reminder_checked = $this->reminder_time == -1 ? false : true; if (isset($_REQUEST['parent_type'])) { $this->parent_type = $_REQUEST['parent_type']; } elseif (is_null($this->parent_type)) { $this->parent_type = $app_list_strings['record_type_default_key']; } }
function fill_in_additional_detail_fields() { //TODO: Seems odd we need to clear out these values so that list views don't show the previous rows value if current value is blank $this->contact_name = ''; $this->contact_phone = ''; $this->contact_email = ''; $this->parent_name = ''; $this->contact_name_owner = ''; $this->contact_name_mod = ''; if (isset($this->contact_id) && $this->contact_id != '') { require_once "modules/Contacts/Contact.php"; $contact = new Contact(); $query = "SELECT first_name, last_name, phone_work, email1, assigned_user_id contact_name_owner from {$contact->table_name} where id = '{$this->contact_id}'"; $result = $this->db->query($query, true, " Error filling in additional detail fields: "); // Get the id and the name. $row = $this->db->fetchByAssoc($result); if ($row != null) { echo $this->contact_name_owner; $this->contact_name_owner = $row['contact_name_owner']; $this->contact_name_mod = 'Contacts'; $this->contact_name = return_name($row, 'first_name', 'last_name'); if ($row['phone_work'] != '') { $this->contact_phone = $row['phone_work']; } else { $this->contact_phone = ''; } if ($row['email1'] != '') { $this->contact_email = $row['email1']; } else { $this->contact_email = ''; } } } $this->created_by_name = get_assigned_user_name($this->created_by); $this->modified_by_name = get_assigned_user_name($this->modified_user_id); $this->fill_in_additional_parent_fields(); }
function get_list_view_data() { global $action, $currentModule, $focus, $current_module_strings, $app_list_strings, $image_path, $timedate; $today = $timedate->handle_offset(date("Y-m-d H:i:s", time()), $timedate->dbDayFormat, true); $task_fields = $this->get_list_view_array(); if (isset($this->parent_type)) { $task_fields['PARENT_MODULE'] = $this->parent_type; } $task_fields['CONTACT_NAME'] = return_name($task_fields, "FIRST_NAME", "LAST_NAME"); $task_fields['TITLE'] = ''; if (!empty($task_fields['CONTACT_NAME'])) { $task_fields['TITLE'] .= $current_module_strings['LBL_LIST_CONTACT'] . ": " . $task_fields['CONTACT_NAME']; } return $task_fields; }