当前位置: 首页>>代码示例>>PHP>>正文


PHP Utils_RecordBrowserCommon::get_field_tooltip方法代码示例

本文整理汇总了PHP中Utils_RecordBrowserCommon::get_field_tooltip方法的典型用法代码示例。如果您正苦于以下问题:PHP Utils_RecordBrowserCommon::get_field_tooltip方法的具体用法?PHP Utils_RecordBrowserCommon::get_field_tooltip怎么用?PHP Utils_RecordBrowserCommon::get_field_tooltip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Utils_RecordBrowserCommon的用法示例。


在下文中一共展示了Utils_RecordBrowserCommon::get_field_tooltip方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: QFfield_autonumber

 public static function QFfield_autonumber(&$form, $field, $label, $mode, $default, $desc, $rb_obj)
 {
     if (self::QFfield_static_display($form, $field, $label, $mode, $default, $desc, $rb_obj)) {
         return;
     }
     $label = Utils_RecordBrowserCommon::get_field_tooltip($label, $desc['type']);
     $value = $default ? $default : self::format_autonumber_str($desc['param'], null);
     $form->addElement('static', $field, $label);
     $record_id = isset($rb_obj->record['id']) ? $rb_obj->record['id'] : null;
     $field_id = Utils_RecordBrowserCommon::get_calculated_id($rb_obj->tab, $field, $record_id);
     $val = '<div class="static_field" id="' . $field_id . '">' . $value . '</div>';
     $form->setDefaults(array($field => $val));
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:13,代码来源:RecordBrowserCommon_0.php

示例2: QFfield_company

 public static function QFfield_company(&$form, $field, $label, $mode, $default, $desc, $rb, $display_callbacks)
 {
     static $showed_create_company = false;
     if (($mode == 'add' || $mode == 'edit') && is_object($rb) && $rb->tab === 'contact' && !$showed_create_company) {
         $showed_create_company = true;
         if (self::$paste_or_new == 'new') {
             $access = Utils_RecordBrowserCommon::get_access('contact', $mode, Utils_RecordBrowser::$last_record);
             $c_access = Utils_RecordBrowserCommon::get_access('company', 'add');
             if ($c_access && $access['company_name']) {
                 $form->addElement('checkbox', 'create_company', __('Create new company'), null, 'onClick="document.getElementById(\'company_name\').disabled = this.checked;document.getElementsByName(\'create_company_name\')[0].disabled=!this.checked;" ' . Utils_TooltipCommon::open_tag_attrs(__('Create a new company for this contact')));
                 $form->addElement('text', 'create_company_name', __('New company name'), array('disabled' => 1));
                 $form->addFormRule(array('CRM_ContactsCommon', 'check_new_company_name'));
                 if (isset($rb) && isset($rb->record['last_name']) && isset($rb->record['first_name'])) {
                     $form->setDefaults(array('create_company_name' => $rb->record['last_name'] . ' ' . $rb->record['first_name']));
                 }
                 eval_js('Event.observe(\'last_name\',\'change\', update_create_company_name_field);' . 'Event.observe(\'first_name\',\'change\', update_create_company_name_field);' . 'function update_create_company_name_field() {' . 'document.forms[\'' . $form->getAttribute('name') . '\'].create_company_name.value = document.forms[\'' . $form->getAttribute('name') . '\'].last_name.value+" "+document.forms[\'' . $form->getAttribute('name') . '\'].first_name.value;' . '}');
                 eval_js('$("company_name").disabled = document.getElementsByName("create_company")[0].checked;document.getElementsByName("create_company_name")[0].disabled=!document.getElementsByName("create_company")[0].checked;');
             }
         } else {
             $comp = self::get_company(self::$paste_or_new);
             foreach ($comp as &$cf) {
                 if (is_string($cf)) {
                     $cf = escapeJS($cf);
                 }
             }
             $paste_company_info = 'document.getElementsByName(\'address_1\')[0].value=\'' . $comp['address_1'] . '\';' . 'document.getElementsByName(\'address_2\')[0].value=\'' . $comp['address_2'] . '\';' . 'document.getElementsByName(\'work_phone\')[0].value=\'' . $comp['phone'] . '\';' . 'document.getElementsByName(\'fax\')[0].value=\'' . $comp['fax'] . '\';' . 'document.getElementsByName(\'city\')[0].value=\'' . $comp['city'] . '\';' . 'document.getElementsByName(\'postal_code\')[0].value=\'' . $comp['postal_code'] . '\';' . 'var country = $(\'country\');' . 'var k = 0; while (k < country.options.length) if (country.options[k].value==\'' . $comp['country'] . '\') break; else k++;' . 'country.selectedIndex = k;' . 'country.fire(\'e_u_cd:load\');' . 'setTimeout(\'' . 'var zone = $(\\\'zone\\\'); k = 0; while (k < zone.options.length) if (zone.options[k].value==\\\'' . $comp['zone'] . '\\\') break; else k++;' . 'zone.selectedIndex = k;' . '\',900);' . 'document.getElementsByName(\'web_address\')[0].value=\'' . $comp['web_address'] . '\';';
             Base_ActionBarCommon::add('add', __('Paste Company Info'), 'href="javascript:void(0);" onclick="' . $paste_company_info . '"');
         }
     }
     $comp = array();
     $param = explode(';', $desc['param']);
     if ($mode == 'add' || $mode == 'edit') {
         if (isset($param[1]) && $param[1] != '::') {
             $crits = call_user_func(explode('::', $param[1]), false, isset($rb->record) ? $rb->record : null);
         } else {
             $crits = array();
         }
         if (isset($crits['_no_company_option'])) {
             $no_company_option = true;
             unset($crits['_no_company_option']);
         } else {
             $no_company_option = false;
         }
         $count = Utils_RecordBrowserCommon::get_records_count('company', $crits);
         if ($count > Utils_RecordBrowserCommon::$options_limit) {
             $companies = array();
         } else {
             $companies = self::get_companies($crits);
             if (!is_array($default)) {
                 if ($default != '') {
                     $default = array($default);
                 } else {
                     $default = array();
                 }
             }
             $ext_rec = array_flip($default);
             foreach ($companies as $v) {
                 $comp[$v['id']] = $v['company_name'];
                 unset($ext_rec[$v['id']]);
             }
             foreach ($ext_rec as $k => $v) {
                 $c = CRM_ContactsCommon::get_company($k);
                 $comp[$k] = $c['company_name'];
             }
             natcasesort($comp);
             $key = '';
             if ($no_company_option) {
                 $comp = array('' => '[' . __('w/o company') . ']') + $comp;
                 $key = -1;
             }
             if ($desc['type'] !== 'multiselect') {
                 $comp = array($key => '---') + $comp;
             }
         }
         $label = Utils_RecordBrowserCommon::get_field_tooltip($label, $desc['type'], 'company', $crits);
         if ($count > Utils_RecordBrowserCommon::$options_limit) {
             $callback = array('CRM_ContactsCommon', 'display_company');
             if ($desc['type'] !== 'multiselect') {
                 $form->addElement('autoselect', $field, $label, array(), array(array('CRM_ContactsCommon', 'autoselect_company_suggestbox'), array($crits, $callback)), $callback, array('id' => $field));
             } else {
                 $form->addElement('automulti', $field, $label, array('CRM_ContactsCommon', 'autoselect_company_suggestbox'), array($crits, $callback), $callback);
             }
             //                  $form->addElement($desc['type'], $field, $label, $comp, array('id'=>$field));
         } else {
             $form->addElement($desc['type'], $field, $label, $comp, array('id' => $field));
         }
         if ($mode !== 'add') {
             $form->setDefaults(array($field => $default));
         }
     } else {
         /*$def = '';
           $first = true;
           if (is_numeric($default) || is_array($default)) {
               if (!is_array($default)) $default = array($default);
               foreach($default as $k=>$v){
                   if ($v=='') break;
                   if ($first) $first = false;
                   else $def .= '<br>';
                   $def .= Utils_RecordBrowserCommon::no_wrap(Utils_RecordBrowserCommon::create_linked_label('company', 'Company Name', $v));
               }
//.........这里部分代码省略.........
开发者ID:62BRAINS,项目名称:EPESI,代码行数:101,代码来源:ContactsCommon_0.php


注:本文中的Utils_RecordBrowserCommon::get_field_tooltip方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。