/** * Smarty {sugar_translate} function plugin * * Type: function<br> * Name: sugar_translate<br> * Purpose: translates a label into the users current language * * @author Majed Itani {majed at sugarcrm.com * @param array * @param Smarty */ function smarty_function_sugar_phone($params, &$smarty) { if (!isset($params['value'])) { $smarty->trigger_error("sugar_phone: missing 'value' parameter"); return ''; } global $system_config; if (isset($system_config->settings['system_skypeout_on']) && $system_config->settings['system_skypeout_on'] == 1 && isset($params['value']) && skype_formatted($params['value'])) { $GLOBALS['log']->fatal($params['value']); return '<a href="callto://' . format_skype($params['value']) . '">' . $params['value'] . '</a>'; } else { return $params['value']; } }
function get_list_view_data($filter_fields = array()) { global $system_config; global $current_user; $this->_create_proper_name_field(); $temp_array = $this->get_list_view_array(); $temp_array['NAME'] = $this->name; $temp_array['ENCODED_NAME'] = $this->name; if (isset($system_config->settings['system_skypeout_on']) && $system_config->settings['system_skypeout_on'] == 1) { if (!empty($temp_array['PHONE_WORK']) && skype_formatted($temp_array['PHONE_WORK'])) { $temp_array['PHONE_WORK'] = '<a href="callto://' . $temp_array['PHONE_WORK'] . '">' . $temp_array['PHONE_WORK'] . '</a>'; } } if ($filter_fields && !empty($filter_fields['sync_contact'])) { $this->load_contacts_users_relationship(); $temp_array['SYNC_CONTACT'] = !empty($this->contacts_users_id) ? 1 : 0; } $temp_array['EMAIL1'] = $this->emailAddress->getPrimaryAddress($this); $this->email1 = $temp_array['EMAIL1']; $temp_array['EMAIL1_LINK'] = $current_user->getEmailLink('email1', $this, '', '', 'ListView'); $temp_array['EMAIL_AND_NAME1'] = "{$this->full_name} <" . $temp_array['EMAIL1'] . ">"; return $temp_array; }
} $xtpl->assign("ASSIGNED_TO", $focus->assigned_user_name); $xtpl->assign("REPORTS_TO_ID", $focus->reports_to_id); $xtpl->assign("REPORTS_TO_NAME", $focus->report_to_name); global $system_config; if (isset($system_config->settings['system_skypeout_on']) && $system_config->settings['system_skypeout_on'] == 1) { if (!empty($focus->phone_home) && skype_formatted($focus->phone_home)) { $focus->phone_home = '<a href="callto://' . $focus->phone_home . '">' . $focus->phone_home . '</a>'; } if (!empty($focus->phone_work) && skype_formatted($focus->phone_work)) { $focus->phone_work = '<a href="callto://' . $focus->phone_work . '">' . $focus->phone_work . '</a>'; } if (!empty($focus->phone_mobile) && skype_formatted($focus->phone_mobile)) { $focus->phone_mobile = '<a href="callto://' . $focus->phone_mobile . '">' . $focus->phone_mobile . '</a>'; } if (!empty($focus->phone_other) && skype_formatted($focus->phone_other)) { $focus->phone_other = '<a href="callto://' . $focus->phone_other . '">' . $focus->phone_other . '</a>'; } } $xtpl->assign("PHONE_HOME", $focus->phone_home); $xtpl->assign("PHONE_MOBILE", $focus->phone_mobile); $xtpl->assign("PHONE_WORK", $focus->phone_work); $xtpl->assign("PHONE_OTHER", $focus->phone_other); $xtpl->assign("PHONE_FAX", $focus->phone_fax); $xtpl->assign('EMAIL1_LINK', $current_user->getEmailLink('email1', $focus)); $xtpl->assign('EMAIL2_LINK', $current_user->getEmailLink('email2', $focus)); $xtpl->assign("EMAIL1", $focus->email1); $xtpl->assign("EMAIL2", $focus->email2); $xtpl->assign("ASSISTANT", $focus->assistant); $xtpl->assign("ASSISTANT_PHONE", $focus->assistant_phone); if ($focus->invalid_email == '1') {
function get_list_view_data() { global $system_config, $current_user; $temp_array = $this->get_list_view_array(); $temp_array["ENCODED_NAME"] = $this->name; // $temp_array["ENCODED_NAME"]=htmlspecialchars($this->name, ENT_QUOTES); if (!empty($this->billing_address_state)) { $temp_array["CITY"] = $this->billing_address_city . ', ' . $this->billing_address_state; } else { $temp_array["CITY"] = $this->billing_address_city; } $temp_array["BILLING_ADDRESS_STREET"] = preg_replace("/[\r]/", '', $this->billing_address_street); $temp_array["SHIPPING_ADDRESS_STREET"] = preg_replace("/[\r]/", '', $this->shipping_address_street); $temp_array["BILLING_ADDRESS_STREET"] = preg_replace("/[\n]/", '\\n', $temp_array["BILLING_ADDRESS_STREET"]); $temp_array["SHIPPING_ADDRESS_STREET"] = preg_replace("/[\n]/", '\\n', $temp_array["SHIPPING_ADDRESS_STREET"]); if (isset($system_config->settings['system_skypeout_on']) && $system_config->settings['system_skypeout_on'] == 1) { if (!empty($temp_array['PHONE_OFFICE']) && skype_formatted($temp_array['PHONE_OFFICE'])) { $temp_array['PHONE_OFFICE'] = '<a href="callto://' . $temp_array['PHONE_OFFICE'] . '">' . $temp_array['PHONE_OFFICE'] . '</a>'; } } $temp_array["EMAIL1"] = $this->emailAddress->getPrimaryAddress($this); $this->email1 = $temp_array['EMAIL1']; $temp_array["EMAIL1_LINK"] = $current_user->getEmailLink('email1', $this, '', '', 'ListView'); return $temp_array; }
function get_list_view_data() { global $system_config; global $current_user; $this->_create_proper_name_field(); $temp_array = $this->get_list_view_array(); $temp_array['NAME'] = $this->name; $temp_array['ENCODED_NAME'] = $this->name; if (isset($system_config->settings['system_skypeout_on']) && $system_config->settings['system_skypeout_on'] == 1) { if (!empty($temp_array['PHONE_WORK']) && skype_formatted($temp_array['PHONE_WORK'])) { $temp_array['PHONE_WORK'] = '<a href="callto://' . $temp_array['PHONE_WORK'] . '">' . $temp_array['PHONE_WORK'] . '</a>'; } } $temp_array['EMAIL1_LINK'] = $current_user->getEmailLink('email1', $this, '', '', 'ListView'); return $temp_array; }