⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 view.step3.php

📁 SugarCRM5.1 开源PHP客户关系管理系统
💻 PHP
📖 第 1 页 / 共 3 页
字号:
                }                // see if we have a match                $selected = '';                if ( !empty($defaultValue) ) {                    if ( strtolower($fieldname) == strtolower($defaultValue)                        || strtolower($fieldname) == str_replace(" ","_",strtolower($defaultValue))                        || strtolower($displayname) == strtolower($defaultValue)                        || strtolower($displayname) == str_replace(" ","_",strtolower($defaultValue)) ) {                        $selected = ' selected="selected" ';                        $defaultField = $fieldname;                    }                }                // get field type information                $fieldtype = '';                if ( isset($properties['type'])                         && isset($mod_strings['LBL_IMPORT_FIELDDEF_' . strtoupper($properties['type'])]) )                    $fieldtype = ' [' . $mod_strings['LBL_IMPORT_FIELDDEF_' . strtoupper($properties['type'])] . '] ';                if ( isset($properties['comment']) )                    $fieldtype .= ' - ' . $properties['comment'];                $options .= '<option value="'.$fieldname.'" title="'. $displayname . htmlentities($fieldtype) . '"'                    . $selected . $req_class . '>' . $displayname . $req_mark . '</option>\n';            }                        // get default field value            $defaultFieldHTML = '';            if ( !empty($defaultField) ) {                $defaultFieldHTML = getControl(                    $_REQUEST['import_module'],                    $defaultField,                    $fields[$defaultField],                    ( isset($default_values[$defaultField]) ? $default_values[$defaultField] : '' )                    );            }                        if ( isset($default_values[$defaultField]) )                unset($default_values[$defaultField]);                        $columns[] = array(                'field_choices' => $options,                'default_field' => $defaultFieldHTML,                'cell1'         => str_replace("&quot;",'',htmlspecialchars($rows[0][$field_count])),                'cell2'         => str_replace("&quot;",'',htmlspecialchars($rows[1][$field_count])),                'cell3'         => str_replace("&quot;",'',htmlspecialchars($rows[2][$field_count])),                'show_remove'   => false,                );        }                // add in extra defaulted fields if they are in the mapping record        if ( count($default_values) > 0 ) {            foreach ( $default_values as $field_name => $default_value ) {                // build string of options                $fields  = $focus->get_importable_fields();                $options = "";                $defaultField = '';                foreach ( $fields as $fieldname => $properties ) {                    // get field name                    if (!empty ($properties['vname']))                        $displayname = str_replace(":","",translate($properties['vname'] ,$focus->module_dir));                    else                        $displayname = str_replace(":","",translate($properties['name'] ,$focus->module_dir));                    // see if this is required                    $req_mark  = "";                    $req_class = "";                    if ( array_key_exists($fieldname, $focus->get_import_required_fields()) ) {                        $req_mark  = ' ' . $app_strings['LBL_REQUIRED_SYMBOL'];                        $req_class = ' class="required" ';                    }                    // see if we have a match                    $selected = '';                    if ( strtolower($fieldname) == strtolower($field_name) ) {                        $selected = ' selected="selected" ';                        $defaultField = $fieldname;                    }                    // get field type information                    $fieldtype = '';                    if ( isset($properties['type'])                             && isset($mod_strings['LBL_IMPORT_FIELDDEF_' . strtoupper($properties['type'])]) )                        $fieldtype = ' [' . $mod_strings['LBL_IMPORT_FIELDDEF_' . strtoupper($properties['type'])] . '] ';                    if ( isset($properties['comment']) )                        $fieldtype .= ' - ' . $properties['comment'];                    $options .= '<option value="'.$fieldname.'" title="'. $displayname . $fieldtype . '"' . $selected . $req_class . '>'                         . $displayname . $req_mark . '</option>\n';                }                                // get default field value                $defaultFieldHTML = '';                if ( !empty($defaultField) ) {                    $defaultFieldHTML = getControl(                        $_REQUEST['import_module'],                        $defaultField,                        $fields[$defaultField],                        $default_value                        );                }                                $columns[] = array(                    'field_choices' => $options,                    'default_field' => $defaultFieldHTML,                    'show_remove'   => true,                    );                                $ret_field_count++;            }        }                $this->ss->assign("COLUMNCOUNT",$ret_field_count);        $this->ss->assign("rows",$columns);                // get list of valid date/time formats        $timeFormat = $current_user->getUserDateTimePreferences();        $timeOptions = get_select_options_with_id($sugar_config['time_formats'], $timeFormat['time']);        $dateOptions = get_select_options_with_id($sugar_config['date_formats'], $timeFormat['date']);        $this->ss->assign('TIMEOPTIONS', $timeOptions);        $this->ss->assign('DATEOPTIONS', $dateOptions);        $this->ss->assign('datetimeformat', $timeFormat['date'] .' '.$timeFormat['time']);                // get list of valid timezones        require_once('include/timezone/timezones.php');        global $timezones;                $userTZ = $current_user->getPreference('timezone');        if(empty($userTZ))            $userTZ = lookupTimezone();                $timezoneOptions = '';        ksort($timezones);        foreach($timezones as $key => $value) {            $selected =($userTZ == $key) ? ' SELECTED="true"' : '';            $dst = !empty($value['dstOffset']) ? '(+DST)' : '';            $gmtOffset =($value['gmtOffset'] / 60);                    if(!strstr($gmtOffset,'-')) {                $gmtOffset = '+'.$gmtOffset;            }            $timezoneOptions .= "<option value='$key'".$selected.">".str_replace(array('_','North'), array(' ', 'N.'),$key). "(GMT".$gmtOffset.") ".$dst."</option>";        }        $this->ss->assign('TIMEZONEOPTIONS', $timezoneOptions);        // get currency preference        require_once('modules/Currencies/ListCurrency.php');        $currency = new ListCurrency();         $cur_id = $locale->getPrecedentPreference('currency', $current_user);        if($cur_id) {            $selectCurrency = $currency->getSelectOptions($cur_id);            $this->ss->assign("CURRENCY", $selectCurrency);        } else {            $selectCurrency = $currency->getSelectOptions();            $this->ss->assign("CURRENCY", $selectCurrency);        }                $currenciesVars = "";        $i=0;        foreach($locale->currencies as $id => $arrVal) {            $currenciesVars .= "currencies[{$i}] = '{$arrVal['symbol']}';\n";            $i++;        }        $currencySymbolsJs = <<<eoqvar currencies = new Object;{$currenciesVars}function setSymbolValue(id) {    document.getElementById('symbol').value = currencies[id];}eoq;        $this->ss->assign('currencySymbolJs', $currencySymbolsJs);                        // fill significant digits dropdown        $significantDigits = $locale->getPrecedentPreference('default_currency_significant_digits', $current_user);        $sigDigits = '';        for($i=0; $i<=6; $i++) {            if($significantDigits == $i) {               $sigDigits .= '<option value="'.$i.'" selected="true">'.$i.'</option>';            } else {               $sigDigits .= '<option value="'.$i.'">'.$i.'</option>';            }        }                $this->ss->assign('sigDigits', $sigDigits);                $num_grp_sep = $current_user->getPreference('num_grp_sep');        $dec_sep = $current_user->getPreference('dec_sep');        $this->ss->assign("NUM_GRP_SEP",            ( empty($num_grp_sep)                 ? $sugar_config['default_number_grouping_seperator'] : $num_grp_sep ));        $this->ss->assign("DEC_SEP",            ( empty($dec_sep)                 ? $sugar_config['default_decimal_seperator'] : $dec_sep ));        $this->ss->assign('getNumberJs', $locale->getNumberJs());                // Name display format        $this->ss->assign('default_locale_name_format', $locale->getLocaleFormatMacro($current_user));        $this->ss->assign('getNameJs', $locale->getNameJs());                // Charset        $charsetOptions = get_select_options_with_id(            $locale->getCharsetSelect(), $locale->default_export_charset);        $this->ss->assign('CHARSETOPTIONS', $charsetOptions);                // handle building index selector        global $dictionary, $current_language;                require_once("include/templates/TemplateGroupChooser.php");                $chooser_array = array();        $chooser_array[0] = array();        $idc = new ImportDuplicateCheck($focus);        $chooser_array[1] = $idc->getDuplicateCheckIndexes();                $chooser = new TemplateGroupChooser();        $chooser->args['id'] = 'selected_indices';        $chooser->args['values_array'] = $chooser_array;        $chooser->args['left_name'] = 'choose_index';        $chooser->args['right_name'] = 'ignore_index';        $chooser->args['left_label'] =  $mod_strings['LBL_INDEX_USED'];        $chooser->args['right_label'] =  $mod_strings['LBL_INDEX_NOT_USED'];        $this->ss->assign("TAB_CHOOSER", $chooser->display());                // show notes        $module_key = "LBL_".strtoupper($_REQUEST['import_module'])."_NOTE_";        $notetext = '';        for ($i = 1;isset($mod_strings[$module_key.$i]);$i++) {            $notetext .= '<li>' . $mod_strings[$module_key.$i] . '</li>';        }        $this->ss->assign("NOTETEXT",$notetext);        $this->ss->assign("HAS_HEADER",($has_header ? 'on' : 'off' ));                // get list of required fields        $required = array();        foreach ( array_keys($focus->get_import_required_fields()) as $name ) {            $properties = $focus->getFieldDefinition($name);            if (!empty ($properties['vname']))                $required[$name] = str_replace(":","",translate($properties['vname'] ,$focus->module_dir));

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -