コード例 #1
0
ファイル: TasksCommon_0.php プロジェクト: 62BRAINS/EPESI
 public static function applet_info_format($r)
 {
     // Build array representing 2-column tooltip
     // Format: array (Label,value)
     $access = Utils_CommonDataCommon::get_translated_array('CRM/Access');
     $priority = Utils_CommonDataCommon::get_translated_array('CRM/Priority');
     $status = Utils_CommonDataCommon::get_translated_array('CRM/Status');
     $contacts = array();
     $companies = array();
     $customers = '';
     foreach ($r['customers'] as $arg) {
         if ($customers) {
             $customers .= '<br>';
         }
         $customers .= CRM_ContactsCommon::autoselect_company_contact_format($arg);
     }
     $args = array(__('Task') => '<b>' . $r['title'] . '</b>', __('Description') => $r['description'], __('Assigned to') => CRM_ContactsCommon::display_contact(array('id' => $r['employees']), true, array('id' => 'id', 'param' => '::;CRM_ContactsCommon::contact_format_no_company')), __('Customers') => $customers, __('Status') => $status[$r['status']], __('Deadline') => $r['deadline'] != '' ? Base_RegionalSettingsCommon::time2reg($r['deadline'], false) : __('Not set'), __('Longterm') => $r['longterm'] != 0 ? __('Yes') : __('No'), __('Permission') => $access[$r['permission']], __('Priority') => $priority[$r['priority']]);
     $bg_color = '';
     switch ($r['priority']) {
         case 0:
             $bg_color = '#FFFFFF';
             break;
             // low priority
         // low priority
         case 1:
             $bg_color = '#FFFFD5';
             break;
             // medium
         // medium
         case 2:
             $bg_color = '#FFD5D5';
             break;
             // high
     }
     // Pass 2 arguments: array containing pairs: label/value
     // and the name of the group for translation
     //return	Utils_TooltipCommon::format_info_tooltip($args,'CRM_Tasks');
     $ret = array('notes' => Utils_TooltipCommon::format_info_tooltip($args));
     if ($bg_color) {
         $ret['row_attrs'] = 'style="background:' . $bg_color . ';"';
     }
     return $ret;
 }
コード例 #2
0
ファイル: PhoneCallCommon_0.php プロジェクト: 62BRAINS/EPESI
 public static function display_contact_name($record, $nolink)
 {
     if ($record['other_customer']) {
         return $record['other_customer_name'];
     }
     if ($record['customer'] == '') {
         return '---';
     }
     $ret = CRM_ContactsCommon::autoselect_company_contact_format($record['customer'], $nolink);
     /*		if (!$nolink) $ret .= Utils_RecordBrowserCommon::record_link_open_tag('contact', $record['customer']);
     		$cont = CRM_ContactsCommon::get_contact($record['customer']);
     		$ret .= $cont['last_name'].(($cont['first_name']!=='')?' '.$cont['first_name']:'');
     		if (!$nolink) $ret .= Utils_RecordBrowserCommon::record_link_close_tag();*/
     return $ret;
 }