/**
  * Fills in any added session data needed by this client type
  *
  * This method is used by child classes like portal
  */
 public function fillInAddedSessionData()
 {
     if ($this->canStartSession() && !empty($this->userBean)) {
         // Grab the user's timezone preference if it's set
         $val = $this->userBean->getPreference('timezone');
         $needPreferenceSet = false;
         // If there is no setting for the user, fall back to the system setting
         if (!$val) {
             $val = TimeDate::guessTimezone();
             $needPreferenceSet = true;
         }
         // If there is still no timezone, fallback to UTC
         if (!$val) {
             $val = 'UTC';
             $needPreferenceSet = true;
         }
         if ($needPreferenceSet === true) {
             $this->userBean->setPreference('timezone', $val);
             $this->userBean->savePreferencesToDB();
         }
         $this->userBean->loadPreferences();
     }
     return true;
 }
Beispiel #2
0
/**
 * best guesses Timezone based on webserver's TZ settings
 */
function lookupTimezone($userOffset = 0)
{
    return TimeDate::guessTimezone($userOffset);
}
Beispiel #3
0
if (isset($_SESSION['isMobile'])) {
    session_destroy();
    session_start();
    $_SESSION['login_error'] = $mod_strings['ERR_NO_LOGIN_MOBILE'];
    header("Location: index.php?module=Users&action=Login&mobile=1");
    sugar_cleanup(true);
}
///////////////////////////////////////////////////////////////////////////////
////	HELPER FUNCTIONS
////	END HELPER FUNCTIONS
///////////////////////////////////////////////////////////////////////////////
if (isset($_REQUEST['userOffset'])) {
    // ajax call to lookup timezone
    echo 'userTimezone = "' . TimeDate::guessTimezone($_REQUEST['userOffset']) . '";';
    exit;
}
$admin = Administration::getSettings();
$sugar_smarty = new Sugar_Smarty();
$sugar_smarty->assign('MOD', $mod_strings);
$sugar_smarty->assign('APP', $app_strings);
global $current_user;
$selectedZone = $current_user->getPreference('timezone');
if (empty($selectedZone) && !empty($_REQUEST['gmto'])) {
    $selectedZone = TimeDate::guessTimezone(-1 * $_REQUEST['gmto']);
}
if (empty($selectedZone)) {
    $selectedZone = TimeDate::guessTimezone();
}
$sugar_smarty->assign('TIMEZONE_CURRENT', $selectedZone);
$sugar_smarty->assign('TIMEZONEOPTIONS', TimeDate::getTimezoneList());
$sugar_smarty->display('modules/Users/SetTimezone.tpl');
Beispiel #4
0
    /**
     * @see SugarView::display()
     */
    public function display()
    {
        global $mod_strings, $current_user, $locale, $sugar_config, $app_list_strings, $sugar_version;
        $themeObject = SugarThemeRegistry::current();
        $css = $themeObject->getCSS();
        $this->ss->assign('SUGAR_CSS', $css);
        $favicon = $themeObject->getImageURL('sugar_icon.ico', false);
        $this->ss->assign('FAVICON_URL', getJSPath($favicon));
        $this->ss->assign('CSS', '<link rel="stylesheet" type="text/css" href="' . SugarThemeRegistry::current()->getCSSURL('wizard.css') . '" />');
        $this->ss->assign('JAVASCRIPT', user_get_validate_record_js() . user_get_chooser_js() . user_get_confsettings_js());
        $this->ss->assign('PRINT_URL', 'index.php?' . $GLOBALS['request_string']);
        $this->ss->assign('SKIP_WELCOME', isset($_REQUEST['skipwelcome']) && $_REQUEST['skipwelcome'] == 1);
        $this->ss->assign('ID', $current_user->id);
        $this->ss->assign('USER_NAME', $current_user->user_name);
        $this->ss->assign('FIRST_NAME', $current_user->first_name);
        $this->ss->assign('SUGAR_VERSION', $sugar_version);
        $this->ss->assign('LAST_NAME', $current_user->last_name);
        $this->ss->assign('TITLE', $current_user->title);
        $this->ss->assign('DEPARTMENT', $current_user->department);
        $this->ss->assign('REPORTS_TO_ID', $current_user->reports_to_id);
        $this->ss->assign('REPORTS_TO_NAME', $current_user->reports_to_name);
        $this->ss->assign('PHONE_HOME', $current_user->phone_home);
        $this->ss->assign('PHONE_MOBILE', $current_user->phone_mobile);
        $this->ss->assign('PHONE_WORK', $current_user->phone_work);
        $this->ss->assign('PHONE_OTHER', $current_user->phone_other);
        $this->ss->assign('PHONE_FAX', $current_user->phone_fax);
        $this->ss->assign('EMAIL1', $current_user->email1);
        $this->ss->assign('EMAIL2', $current_user->email2);
        $this->ss->assign('ADDRESS_STREET', $current_user->address_street);
        $this->ss->assign('ADDRESS_CITY', $current_user->address_city);
        $this->ss->assign('ADDRESS_STATE', $current_user->address_state);
        $this->ss->assign('ADDRESS_POSTALCODE', $current_user->address_postalcode);
        $this->ss->assign('ADDRESS_COUNTRY', $current_user->address_country);
        $configurator = new Configurator();
        if ($configurator->config['passwordsetting']['SystemGeneratedPasswordON'] || $configurator->config['passwordsetting']['forgotpasswordON']) {
            $this->ss->assign('REQUIRED_EMAIL_ADDRESS', '1');
        } else {
            $this->ss->assign('REQUIRED_EMAIL_ADDRESS', '0');
        }
        // get javascript
        ob_start();
        $this->options['show_javascript'] = true;
        $this->renderJavascript();
        $this->options['show_javascript'] = false;
        $this->ss->assign("SUGAR_JS", ob_get_contents() . $themeObject->getJS());
        ob_end_clean();
        $messenger_type = '<select tabindex="5" name="messenger_type">';
        $messenger_type .= get_select_options_with_id($app_list_strings['messenger_type_dom'], $current_user->messenger_type);
        $messenger_type .= '</select>';
        $this->ss->assign('MESSENGER_TYPE_OPTIONS', $messenger_type);
        $this->ss->assign('MESSENGER_ID', $current_user->messenger_id);
        // set default settings
        $use_real_names = $current_user->getPreference('use_real_names');
        if (empty($use_real_names)) {
            $current_user->setPreference('use_real_names', 'on');
        }
        $current_user->setPreference('reminder_time', 1800);
        $current_user->setPreference('email_reminder_time', 3600);
        $current_user->setPreference('mailmerge_on', 'on');
        //// Timezone
        if (empty($current_user->id)) {
            // remove default timezone for new users(set later)
            $current_user->user_preferences['timezone'] = '';
        }
        $userTZ = $current_user->getPreference('timezone');
        if (empty($userTZ) && !$current_user->is_group && !$current_user->portal_only) {
            $userTZ = TimeDate::guessTimezone();
            $current_user->setPreference('timezone', $userTZ);
        }
        if (!$current_user->getPreference('ut')) {
            $this->ss->assign('PROMPTTZ', ' checked');
        }
        $this->ss->assign('TIMEZONE_CURRENT', $userTZ);
        $this->ss->assign('TIMEZONEOPTIONS', TimeDate::getTimezoneList());
        //// Numbers and Currency display
        require_once 'modules/Currencies/ListCurrency.php';
        $currency = new ListCurrency();
        // 10/13/2006 Collin - Changed to use Localization.getConfigPreference
        // This was the problem- Previously, the "-99" currency id always assumed
        // to be defaulted to US Dollars.  However, if someone set their install to use
        // Euro or other type of currency then this setting would not apply as the
        // default because it was being overridden by US Dollars.
        $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);
        }
        $currenciesArray = $locale->currencies;
        $currenciesVars = $this->correctCurrenciesSymbolsSort($currenciesArray);
        $currencySymbolsJs = <<<eoq
var currencies = new Object;
{$currenciesVars}
function setSymbolValue(id) {
\tdocument.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());
        $this->ss->assign('TIMEOPTIONS', get_select_options_with_id($sugar_config['time_formats'], $current_user->_userPreferenceFocus->getDefaultPreference('default_time_format')));
        $this->ss->assign('DATEOPTIONS', get_select_options_with_id($sugar_config['date_formats'], $current_user->_userPreferenceFocus->getDefaultPreference('default_date_format')));
        $this->ss->assign("MAIL_SENDTYPE", get_select_options_with_id($app_list_strings['notifymail_sendtype'], $current_user->getPreference('mail_sendtype')));
        $this->ss->assign("NEW_EMAIL", $current_user->emailAddress->getEmailAddressWidgetEditView($current_user->id, $current_user->module_dir));
        $this->ss->assign('EMAIL_LINK_TYPE', get_select_options_with_id($app_list_strings['dom_email_link_type'], $current_user->getPreference('email_link_type')));
        $selectedLocaleNameFormat = $current_user->_userPreferenceFocus->getDefaultPreference('default_locale_name_format');
        if (array_key_exists($selectedLocaleNameFormat, $sugar_config['name_formats'])) {
            $selectedLocaleNameFormat = $sugar_config['default_locale_name_format'];
        }
        $this->ss->assign('NAMEOPTIONS', get_select_options_with_id($locale->getUsableLocaleNameOptions($sugar_config['name_formats']), $selectedLocaleNameFormat));
        // email smtp
        $systemOutboundEmail = new OutboundEmail();
        $systemOutboundEmail = $systemOutboundEmail->getSystemMailerSettings();
        $mail_smtpserver = $systemOutboundEmail->mail_smtpserver;
        $mail_smtptype = $systemOutboundEmail->mail_smtptype;
        $mail_smtpport = $systemOutboundEmail->mail_smtpport;
        $mail_smtpssl = $systemOutboundEmail->mail_smtpssl;
        $mail_smtpdisplay = $systemOutboundEmail->mail_smtpdisplay;
        $mail_smtpuser = "";
        $mail_smtppass = "";
        $hide_if_can_use_default = true;
        $mail_smtpauth_req = true;
        if (!empty($mail_smtpserver) && !empty($mail_smtptype)) {
            if (!$systemOutboundEmail->isAllowUserAccessToSystemDefaultOutbound()) {
                $mail_smtpauth_req = $systemOutboundEmail->mail_smtpauth_req;
                $userOverrideOE = $systemOutboundEmail->getUsersMailerForSystemOverride($current_user->id);
                if ($userOverrideOE != null) {
                    $mail_smtpuser = $userOverrideOE->mail_smtpuser;
                    $mail_smtppass = $userOverrideOE->mail_smtppass;
                }
                if (!$mail_smtpauth_req && (empty($systemOutboundEmail->mail_smtpserver) || empty($systemOutboundEmail->mail_smtpuser) || empty($systemOutboundEmail->mail_smtppass))) {
                    $hide_if_can_use_default = true;
                } else {
                    $hide_if_can_use_default = false;
                }
            }
        }
        $isAdmin = is_admin($current_user);
        $this->ss->assign('IS_ADMIN', $isAdmin);
        $this->ss->assign("mail_smtpdisplay", $mail_smtpdisplay);
        $this->ss->assign("mail_smtpuser", $mail_smtpuser);
        $this->ss->assign("mail_smtppass", $mail_smtppass);
        $this->ss->assign('mail_smtpserver', $mail_smtpserver);
        $this->ss->assign("mail_smtpauth_req", $mail_smtpauth_req);
        $this->ss->assign('MAIL_SMTPPORT', $mail_smtpport);
        $this->ss->assign('MAIL_SMTPSSL', $mail_smtpssl);
        $this->ss->assign('HIDE_IF_CAN_USE_DEFAULT_OUTBOUND', $hide_if_can_use_default);
        $this->ss->assign('langHeader', get_language_header());
        $this->ss->display($this->getCustomFilePathIfExists('modules/Users/tpls/wizard.tpl'));
    }
 protected function setupAdvancedTabLocaleSettings()
 {
     global $locale, $sugar_config, $app_list_strings;
     ///////////////////////////////////////////////////////////////////////////////
     ////	LOCALE SETTINGS
     ////	Date/time format
     $dformat = $locale->getPrecedentPreference($this->bean->id ? 'datef' : 'default_date_format', $this->bean);
     $tformat = $locale->getPrecedentPreference($this->bean->id ? 'timef' : 'default_time_format', $this->bean);
     $nformat = $locale->getPrecedentPreference('default_locale_name_format', $this->bean);
     if (!array_key_exists($nformat, $sugar_config['name_formats'])) {
         $nformat = $sugar_config['default_locale_name_format'];
     }
     $timeOptions = get_select_options_with_id($sugar_config['time_formats'], $tformat);
     $dateOptions = get_select_options_with_id($sugar_config['date_formats'], $dformat);
     $nameOptions = get_select_options_with_id($locale->getUsableLocaleNameOptions($sugar_config['name_formats']), $nformat);
     $this->ss->assign('TIMEOPTIONS', $timeOptions);
     $this->ss->assign('DATEOPTIONS', $dateOptions);
     $this->ss->assign('NAMEOPTIONS', $nameOptions);
     $this->ss->assign('DATEFORMAT', $sugar_config['date_formats'][$dformat]);
     $this->ss->assign('TIMEFORMAT', $sugar_config['time_formats'][$tformat]);
     $this->ss->assign('NAMEFORMAT', $sugar_config['name_formats'][$nformat]);
     //// Timezone
     if (empty($this->bean->id)) {
         // remove default timezone for new users(set later)
         $this->bean->user_preferences['timezone'] = '';
     }
     $userTZ = $this->bean->getPreference('timezone');
     if (empty($userTZ) && !$this->bean->is_group && !$this->bean->portal_only) {
         $userTZ = TimeDate::guessTimezone();
         $this->bean->setPreference('timezone', $userTZ);
     }
     if (!$this->bean->getPreference('ut')) {
         $this->ss->assign('PROMPTTZ', ' checked');
     }
     $this->ss->assign('TIMEZONE_CURRENT', $userTZ);
     $this->ss->assign('TIMEZONEOPTIONS', TimeDate::getTimezoneList());
     $this->ss->assign("TIMEZONE", TimeDate::tzName($userTZ));
     // FG - Bug 4236 - Managed First Day of Week
     $fdowDays = array();
     foreach ($app_list_strings['dom_cal_day_long'] as $d) {
         if ($d != "") {
             $fdowDays[] = $d;
         }
     }
     $this->ss->assign("FDOWOPTIONS", $fdowDays);
     $currentFDOW = $this->bean->get_first_day_of_week();
     if (!isset($currentFDOW)) {
         $currentFDOW = 0;
     }
     $this->ss->assign("FDOWCURRENT", $currentFDOW);
     $this->ss->assign("FDOWDISPLAY", $fdowDays[$currentFDOW]);
     //// Numbers and Currency display
     require_once 'modules/Currencies/ListCurrency.php';
     $currency = new ListCurrency();
     // 10/13/2006 Collin - Changed to use Localization.getConfigPreference
     // This was the problem- Previously, the "-99" currency id always assumed
     // to be defaulted to US Dollars.  However, if someone set their install to use
     // Euro or other type of currency then this setting would not apply as the
     // default because it was being overridden by US Dollars.
     $cur_id = $locale->getPrecedentPreference('currency', $this->bean);
     if ($cur_id) {
         $selectCurrency = $currency->getSelectOptions($cur_id);
         $this->ss->assign("CURRENCY", $selectCurrency);
     } else {
         $selectCurrency = $currency->getSelectOptions();
         $this->ss->assign("CURRENCY", $selectCurrency);
     }
     // convert base currency values to user preferred
     $this->ss->assign("currency_show_preferred", $locale->getPrecedentPreference('currency_show_preferred', $this->bean));
     $currencyList = array();
     foreach ($locale->currencies as $id => $val) {
         $currencyList[$id] = $val['symbol'];
     }
     $currencySymbolJSON = json_encode($currencyList);
     $this->ss->assign('currencySymbolJSON', $currencySymbolJSON);
     $currencyDisplay = BeanFactory::getBean('Currencies');
     if (isset($cur_id)) {
         $currencyDisplay->retrieve($cur_id);
         $this->ss->assign('CURRENCY_DISPLAY', $currencyDisplay->iso4217 . ' ' . $currencyDisplay->symbol);
     } else {
         $this->ss->assign("CURRENCY_DISPLAY", $currencyDisplay->getDefaultISO4217() . ' ' . $currencyDisplay->getDefaultCurrencySymbol());
     }
     // fill significant digits dropdown
     $significantDigits = $locale->getPrecedentPreference('default_currency_significant_digits', $this->bean);
     $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);
     $this->ss->assign('CURRENCY_SIG_DIGITS', $significantDigits);
     $num_grp_sep = $this->bean->getPreference('num_grp_sep');
     $dec_sep = $this->bean->getPreference('dec_sep');
     $this->ss->assign("NUM_GRP_SEP", empty($num_grp_sep) ? $GLOBALS['sugar_config']['default_number_grouping_seperator'] : $num_grp_sep);
     $this->ss->assign("DEC_SEP", empty($dec_sep) ? $GLOBALS['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($this->bean));
     $this->ss->assign('getNameJs', $locale->getNameJs());
     $this->ss->assign('NAME_FORMAT', $this->bean->getLocaleFormatDesc());
     ////	END LOCALE SETTINGS
 }
    private function getFormItems($mod_strings, $app_list_strings, $sugarConfigDefaults, $drivers, $checked, $db, $errors, $supportedLanguages, $current_language, $customSession, $customLog, $customId, $customSessionHidden, $customLogHidden, $customIdHidden)
    {
        // ------------------------------
        //  DB Type and DB configuration
        // ---------------------------------->
        // database selection
        $out_dbtypesel = "\n    <div class=\"floatbox\" id=\"fb5\">\n        <h2>{$mod_strings['LBL_DBCONF_TITLE']}</h2>\n\n        <div class=\"form_section\">\n          <h3>{$mod_strings['LBL_SYSOPTS_DB']}</h3>";
        foreach ($drivers as $type => $driver) {
            $oci = $type == "oci8" ? "" : 'none';
            // hack for special oracle message
            $out_dbtypesel .= <<<EOQ
                <input type="radio" class="checkbox" name="setup_db_type" id="setup_db_type" value="{$type}" {$checked[$type]} onclick="onDBTypeClick(this);//document.getElementById('ociMsg').style.display='{$oci}'"/>{$mod_strings[$driver->label]}<br>
EOQ;
        }
        $out_dbtypesel .= <<<EOQ
        </div>
            <div name="ociMsg" id="ociMsg" style="display:none"></div>
    <!-- </div> -->
EOQ;
        $out2 = $out_dbtypesel;
        $out2 .= <<<EOQ2

        <!-- <div class="floatbox"> -->

            <div class="form_section starhook">
            <!-- <div class="required">{$mod_strings['LBL_REQUIRED']}</div> -->
            <h3>{$mod_strings['LBL_DBCONF_TITLE_NAME']}</h3>
EOQ2;
        $config_params = $db->installConfig();
        $form = '';
        foreach ($config_params as $group => $gdata) {
            $form .= "<div class='install_block'>";
            if ($mod_strings[$group . '_LABEL']) {
                $form .= "<label>{$mod_strings[$group . '_LABEL']}" . "<i> i <div class=\"tooltip\">{$mod_strings[$group]}</div></i></label>\n";
            }
            foreach ($gdata as $name => $value) {
                if (!empty($value)) {
                    if (!empty($value['required'])) {
                        $form .= "<span class=\"required\">*</span>";
                    } else {
                    }
                    if (!empty($_SESSION[$name])) {
                        $sessval = $_SESSION[$name];
                    } else {
                        $sessval = '';
                    }
                    if (!empty($value["type"])) {
                        $type = $value["type"];
                    } else {
                        $type = '';
                    }
                    $form .= <<<FORM
FORM;
                    //if the type is password, set a hidden field to capture the value.  This is so that we can properly encode special characters, which is a limitation with password fields
                    if ($type == 'password') {
                        $form .= "</div><div class=\"install_block\"><label>{$mod_strings['LBL_DBCONF_TITLE_PSWD_INFO_LABEL']}</label><span>&nbsp;</span><input type='{$type}' name='{$name}_entry' id='{$name}_entry' value='" . urldecode($sessval) . "'><input type='hidden' name='{$name}' id='{$name}' value='" . urldecode($sessval) . "'></div><div class=\"install_block\">";
                    } else {
                        $form .= "<input type='{$type}' name='{$name}' id='{$name}' value='{$sessval}'>";
                    }
                    $form .= <<<FORM
FORM;
                } else {
                    $form .= "<input name=\"{$name}\" id=\"{$name}\" value=\"\" type=\"hidden\">\n";
                }
            }
            $form .= "</div>";
        }
        $out2 .= $form;
        // ---------- user data set (dbConfig_a.php)
        //if we are installing in custom mode, include the following html
        if ($db->supports("create_user")) {
            // create / set db user dropdown
            $auto_select = '';
            $provide_select = '';
            $create_select = '';
            $same_select = '';
            if (isset($_SESSION['dbUSRData'])) {
                //    if($_SESSION['dbUSRData']=='auto')    {$auto_select ='selected';}
                if ($_SESSION['dbUSRData'] == 'provide') {
                    $provide_select = 'selected';
                }
                if (isset($_SESSION['install_type']) && !empty($_SESSION['install_type']) && strtolower($_SESSION['install_type']) == 'custom') {
                    if ($_SESSION['dbUSRData'] == 'create') {
                        $create_select = 'selected';
                    }
                }
                if ($_SESSION['dbUSRData'] == 'same') {
                    $same_select = 'selected';
                }
            } else {
                $same_select = 'selected';
            }
            $dbUSRDD = "<select name='dbUSRData' id='dbUSRData' onchange='toggleDBUser();'>";
            $dbUSRDD .= "<option value='provide' {$provide_select}>" . $mod_strings['LBL_DBCONFIG_PROVIDE_DD'] . "</option>";
            $dbUSRDD .= "<option value='create' {$create_select}>" . $mod_strings['LBL_DBCONFIG_CREATE_DD'] . "</option>";
            $dbUSRDD .= "<option value='same' {$same_select}>" . $mod_strings['LBL_DBCONFIG_SAME_DD'] . "</option>";
            $dbUSRDD .= "</select><br>&nbsp;";
            $setup_db_sugarsales_password = urldecode($_SESSION['setup_db_sugarsales_password']);
            $setup_db_sugarsales_user = urldecode($_SESSION['setup_db_sugarsales_user']);
            $setup_db_sugarsales_password_retype = urldecode($_SESSION['setup_db_sugarsales_password_retype']);
            $out2 .= <<<EOQ2
<br>
<div class='install_block'>
<!--
    <div class="ibmsg">{$mod_strings['LBL_DBCONFIG_SECURITY']}</div>
    -->
</div>
<div class='install_block'>
    <div class="formrow">
        <label>{$mod_strings['LBL_DBCONF_SUGAR_DB_USER']}<i> i <div class="tooltip">{$mod_strings['LBL_DBCONFIG_SECURITY']}</div></i></label>
        {$dbUSRDD}
    </div>
    <div class="clear"></div>
    <span id='connection_user_div' style="display:none">
        <div class="formrow">
            <label>{$mod_strings['LBL_DBCONF_SUGAR_DB_USER']} <span class="required">*</span></label>
            <input type="text" name="setup_db_sugarsales_user" maxlength="16" value="{$_SESSION['setup_db_sugarsales_user']}" />
        </div>
        <div class="clear"></div>
        <div class="formrow">
            <label>{$mod_strings['LBL_DBCONF_DB_PASSWORD']}</label>
            <input type="password" name="setup_db_sugarsales_password_entry" value="{$setup_db_sugarsales_password}" />
            <input type="hidden" name="setup_db_sugarsales_password" value="{$setup_db_sugarsales_password}" />
        </div>
        <div class="clear"></div>
        <div class="formrow">
            <label>{$mod_strings['LBL_DBCONF_DB_PASSWORD2']}</label>
            <input type="password" name="setup_db_sugarsales_password_retype_entry" value="{$setup_db_sugarsales_password_retype}"  />
            <input type="hidden" name="setup_db_sugarsales_password_retype" value="{$setup_db_sugarsales_password_retype}" />
        </div>
    </span>
</div>

EOQ2;
        }
        $out = $out2;
        // ------ siteConfig_a.php
        $out .= <<<EOQ
        </div>
    </div>
    <div class="floatbox" id="fb6">
                    <h2>{$mod_strings['LBL_SITECFG_TITLE']}</h2>
                    <div class="form_section">
                    <p>{$errors}</p>
                    <div class="required">{$mod_strings['LBL_REQUIRED']}</div>

                    <h3>{$mod_strings['LBL_SITECFG_TITLE2']}<div class="tooltip-toggle"><em> i </em><div class="tooltip">{$mod_strings['LBL_SITECFG_PASSWORD_MSG']}</div></div></h3>
EOQ;
        //hide this in typical mode
        if (!empty($_SESSION['install_type']) && strtolower($_SESSION['install_type']) == 'custom') {
            $out .= <<<EOQ
<div class='install_block'>
    {$mod_strings['LBL_SITECFG_URL_MSG']}
    <span class="required">*</span>
    <label><b>{$mod_strings['LBL_SITECFG_URL']}</b></label>
    <input type="text" name="setup_site_url" value="{$_SESSION['setup_site_url']}" size="40" />
    <br>{$mod_strings['LBL_SITECFG_SYS_NAME_MSG']}
    <span class="required">*</span>
    <label><b>{$mod_strings['LBL_SYSTEM_NAME']}</b></label>
    <input type="text" name="setup_system_name" value="{$_SESSION['setup_system_name']}" size="40" /><br>
</div>
EOQ;
            $db = getDbConnection();
            if ($db->supports("collation")) {
                $collationOptions = $db->getCollationList();
            }
            if (!empty($collationOptions)) {
                if (isset($_SESSION['setup_db_options']['collation'])) {
                    $default = $_SESSION['setup_db_options']['collation'];
                } else {
                    $default = $db->getDefaultCollation();
                }
                $options = get_select_options_with_id(array_combine($collationOptions, $collationOptions), $default);
                $out .= <<<EOQ
     <div class='install_block'>
        <br>{$mod_strings['LBL_SITECFG_COLLATION_MSG']}
        <span class="required">*</span>
        <label><b>{$mod_strings['LBL_COLLATION']}</b></label>
        <select name="setup_db_collation" id="setup_db_collation">{$options}</select><br>
     </div>
EOQ;
            }
        }
        $help_url = get_help_button_url();
        if (!isset($_SESSION['email1'])) {
            $_SESSION['email1'] = null;
        }
        if (!isset($_SESSION['setup_site_admin_user_name'])) {
            $_SESSION['setup_site_admin_user_name'] = null;
        }
        $out .= <<<EOQ
<div class='install_block'>
    <!--
    <p class="ibmsg">{$mod_strings['LBL_SITECFG_PASSWORD_MSG']}</p>
    -->
    <div class="formrow big">
        <label>{$mod_strings['LBL_SITECFG_ADMIN_Name']} <span class="required">*</span></label>
        <input type="text" name="setup_site_admin_user_name" value="{$_SESSION['setup_site_admin_user_name']}" size="20" maxlength="60" />
    </div>

    <div class="clear"></div>

    <div class="formrow big">
        <label>{$mod_strings['LBL_SITECFG_ADMIN_PASS']} <span class="required">*</span></label>
        <input type="password" name="setup_site_admin_password" value="{$_SESSION['setup_site_admin_password']}" size="20" />
    </div>

    <div class="clear"></div>

    <div class="formrow big">
        <label>{$mod_strings['LBL_SITECFG_ADMIN_PASS_2']} <span class="required">*</span></label>
        <input type="password" name="setup_site_admin_password_retype" value="{$_SESSION['setup_site_admin_password_retype']}" size="20" />
    </div>

    <div class="clear"></div>

    <div class="formrow big">
        <label>{$mod_strings['LBL_SITECFG_URL']} <span class="required">*</span></label>
        <input type="text" name="setup_site_url" value="{$_SESSION['setup_site_url']}" size="40" />
    </div>

    <div class="clear"></div>


    <div class="formrow big">
        <label>{$mod_strings['LBL_EMAIL_ADDRESS']} <span class="required">*</span></label>
        <input type="email" name="email1" value="{$_SESSION['email1']}" size="40" />
    </div>

    <div class="clear"></div>


    <div class="clear"></div>
<!--
    <a href="javascript:;" onclick="\$('.security-block').toggle();">More..</a><br/><br/>
-->
EOQ;
        $out .= <<<EOQ
</div>
EOQ;
        $out .= <<<EOQ
EOQ;
        // ------------------
        //  Choose Demo Data
        // ------------------------->
        //demo data select
        $demoDD = "<select name='demoData' id='demoData' class='select'><option value='no' >" . $mod_strings['LBL_NO'] . "</option><option value='yes'>" . $mod_strings['LBL_YES'] . "</option>";
        $demoDD .= "</select>";
        $out .= <<<EOQ3
        </div>
        </div>

        <div class="floatbox full" id="fb0">
            <h2>{$mod_strings['LBL_MORE_OPTIONS_TITLE']}</h2>
        </div>

        <div class="floatbox full" id="fb1">
            <div class="install_block">
                <h3 onclick="\$(this).next().toggle();" class="toggler">&raquo; {$mod_strings['LBL_DBCONF_DEMO_DATA_TITLE']}</h3>

                <div class="form_section" style="display: none;">
                <div class="clear"></div>
                    <div class="formrow big">
                        <label>{$mod_strings['LBL_DBCONF_DEMO_DATA']}</label>
                        {$demoDD}
                    </div>
                </div>
            </div>
        </div>
EOQ3;
        // ------------------
        //  Choose Scenarios
        // ------------------------->
        $scenarioSelection = "<p class='ibmsg'>{$mod_strings['LBL_WIZARD_SCENARIO_EMPTY']}</p>";
        if (isset($_SESSION['installation_scenarios']) && !empty($_SESSION['installation_scenarios'])) {
            $scenarioSelection = "";
            foreach ($_SESSION['installation_scenarios'] as $scenario) {
                $key = $scenario['key'];
                $description = $scenario['description'];
                $scenarioModuleList = implode($scenario['modulesScenarioDisplayName'], ',');
                $title = $scenario['title'];
                $scenarioSelection .= "<input type='checkbox' name='scenarios[]' value='{$key}' checked><b>{$title}</b>.  {$description} ({$scenarioModuleList}).<br>";
            }
        }
        $out .= <<<EOQ

        <!-- Scenario Selection -->
        <div class="floatbox full" id="fb3">
            <h3 onclick="\$(this).next().toggle();" class="toggler">&raquo; {$mod_strings['LBL_WIZARD_SCENARIO_TITLE']}</h3>
            <div class="form_section" style="display: none;">
                <p class="ibmsg">{$mod_strings['LBL_WIZARD_SCENARIO_DESC']}</p>
                <div class="formrow">{$scenarioSelection}</div>
                <div class="clear"></div>
            </div>
        </div>

EOQ;
        //--End of scenarios
        //---------------
        // SMTP Settings
        //-------------------->
        // smtp
        // TODO-t: test it for all types
        $MAIL_SSL_OPTIONS_GMAIL = get_select_options_with_id($app_list_strings['email_settings_for_ssl'], '2');
        //$MAIL_SSL_OPTIONS_YAHOO = get_select_options_with_id($app_list_strings['email_settings_for_ssl'], '1');
        $MAIL_SSL_OPTIONS_EXCHG = get_select_options_with_id($app_list_strings['email_settings_for_ssl'], 'none');
        $MAIL_SSL_OPTIONS_OTHER = get_select_options_with_id($app_list_strings['email_settings_for_ssl'], 'none');
        // set default notify_allow_default_outbound checkbox value
        $notify_allow_default_outbound_checked = empty($_SESSION['notify_allow_default_outbound']) ? '' : ' checked="checked" ';
        // set default smtp toggle buttons selected value
        if (empty($_SESSION['smtp_tab_selected'])) {
            $_SESSION['smtp_tab_selected'] = 'smtp_tab_other';
        }
        $out .= <<<EOQ
        <div class="floatbox full" id="fb2">
            <!-- smtp settings -->
            <h3 onclick="\$(this).next().toggle();" class="toggler">&raquo; {$mod_strings['LBL_MAIL_SMTP_SETTINGS']}</h3>
            <div style="display: none;">

            <br>
            <!--
            <p>{$mod_strings['LBL_WIZARD_SMTP_DESC']}</p>
            -->

            <!-- smtp types toggler buttons -->

            <p style="display: inline;">{$mod_strings['LBL_CHOOSE_EMAIL_PROVIDER']} </p><div class="tooltip-toggle"> <em>i</em> <div class="tooltip">{$mod_strings['LBL_WIZARD_SMTP_DESC']}</div></div>
            <div class="clear"></div>
            <div>
                <input type="button" class="smtp_tab_toggler" id="smtp_tab_gmail_toggler" for="smtp_tab_gmail" value="{$mod_strings['LBL_SMTPTYPE_GMAIL']}" />
                <input type="button" class="smtp_tab_toggler" id="smtp_tab_yahoo_toggler" for="smtp_tab_yahoo" value="{$mod_strings['LBL_SMTPTYPE_YAHOO']}" />
                <input type="button" class="smtp_tab_toggler" id="smtp_tab_exchange_toggler" for="smtp_tab_exchange" value="{$mod_strings['LBL_SMTPTYPE_EXCHANGE']}" />
                <input type="button" class="smtp_tab_toggler selected" id="smtp_tab_other_toggler" for="smtp_tab_other" value="{$mod_strings['LBL_SMTPTYPE_OTHER']}" />
                <input type="hidden" name="smtp_tab_selected" value="{$_SESSION['smtp_tab_selected']}">
            </div>
            <!-- smtp / gmail tab -->

            <div class="form_section smtp_tab" id="smtp_tab_gmail">

                <div class="formrow">
                    <label>{$mod_strings['LBL_MAIL_SMTPSERVER']}</label>
                    <input type="text" name="smtp_tab_gmail[mail_smtpserver]" size="25" maxlength="64" value="smtp.gmail.com">
                </div>

                <div class="formrow">
                    <label>{$mod_strings['LBL_MAIL_SMTPPORT']}</label>
                    <input type="text" name="smtp_tab_gmail[mail_smtpport]" size="5" maxlength="5" value="587">
                </div>

                <div class="clear"></div>

                <div class="formrow">
                    <label>{$mod_strings['LBL_MAIL_SMTPAUTH_REQ']}</label>
                    <input type="checkbox" name="smtp_tab_gmail[mail_smtpauth_req]" id="smtp_tab_gmail__mail_smtpauth_req" value="1" checked="checked" onclick="toggleSMTPAuthSettings(this, 'toggleArea_1');">
                </div>

                <div class="formrow">
                    <label>{$mod_strings['LBL_EMAIL_SMTP_SSL_OR_TLS']}</label>
                    <select name="smtp_tab_gmail[mail_smtpssl]">
                        {$MAIL_SSL_OPTIONS_GMAIL}
                    </select>
                </div>

                <div class="clear"></div>


                <div class="toggleArea" id="toggleArea_1">
                <div class="formrow">
                    <label>{$mod_strings['LBL_GMAIL_SMTPUSER']}</label>
                        <input type="text" name="smtp_tab_gmail[mail_smtpuser]" id="smtp_tab_gmail__mail_smtpuser" size="25" maxlength="64">
                </div>

                <div class="clear"></div>

                <div class="formrow">
                    <label>{$mod_strings['LBL_GMAIL_SMTPPASS']}</label>
                        <input type="password" name="smtp_tab_gmail[mail_smtppass]" id="smtp_tab_gmail__mail_smtppass" size="25" maxlength="64" value="" tabindex="1">
                </div>

                <div class="clear"></div>

                <div class="formrow">
                    <label>{$mod_strings['LBL_ALLOW_DEFAULT_SELECTION']} <i>i<div class="tooltip">{$mod_strings['LBL_ALLOW_DEFAULT_SELECTION_HELP']}</div></i></label>
                        <input name="smtp_tab_gmail[notify_allow_default_outbound]" id="smtp_tab_gmail__notify_allow_default_outbound" value="2" tabindex="1" class="checkbox" type="checkbox" {$notify_allow_default_outbound_checked}>
                    </div>
                </div>

                <div class="clear"></div>
            </div>

            <!-- smtp / yahoo! mail tab -->

            <div class="form_section smtp_tab" id="smtp_tab_yahoo">

                <input type="hidden" name="smtp_tab_yahoo[mail_smtpserver]" size="25" maxlength="64" value="smtp.mail.yahoo.com">
                <input type="text" name="smtp_tab_yahoo[mail_smtpport]" size="5" maxlength="5" value="465">
                <input type="hidden" name="smtp_tab_yahoo[mail_smtpssl]" value="1">

                <div class="formrow">
                    <label>{$mod_strings['LBL_YAHOOMAIL_SMTPUSER']}</label>
                    <input type="text" name="smtp_tab_yahoo[mail_smtpuser]" size="25" maxlength="64">
                </div>

                <div class="clear"></div>

                <div class="formrow">
                    <label>{$mod_strings['LBL_YAHOOMAIL_SMTPPASS']}</label>
                    <input type="password" name="smtp_tab_yahoo[mail_smtppass]" size="25" maxlength="64" value="" tabindex="1">
                </div>

                <div class="clear"></div>

                <div class="formrow">
                    <label>{$mod_strings['LBL_ALLOW_DEFAULT_SELECTION']} <i>i<div class="tooltip">{$mod_strings['LBL_ALLOW_DEFAULT_SELECTION_HELP']}</div></i></label>
                    <input name="smtp_tab_yahoo[notify_allow_default_outbound]" value="2" tabindex="1" class="checkbox" type="checkbox" {$notify_allow_default_outbound_checked}>
                </div>

                <div class="clear"></div>
            </div>

            <!-- smtp / ms-exchange tab -->

            <div class="form_section smtp_tab" id="smtp_tab_exchange">

                <div class="formrow">
                    <label>{$mod_strings['LBL_EXCHANGE_SMTPSERVER']}</label>
                    <input type="text" name="smtp_tab_exchange[mail_smtpserver]" size="25" maxlength="64" value="">
                </div>

                <div class="formrow">
                    <label>{$mod_strings['LBL_EXCHANGE_SMTPPORT']}</label>
                    <input type="text" name="smtp_tab_exchange[mail_smtpport]" size="5" maxlength="5" value="25">
                </div>

                <div class="clear"></div>

                <div class="formrow">
                    <label>{$mod_strings['LBL_MAIL_SMTPAUTH_REQ']}</label>
                    <input type="checkbox" name="smtp_tab_exchange[mail_smtpauth_req]" id="smtp_tab_exchange__mail_smtpauth_req" value="1" checked="checked" onclick="toggleSMTPAuthSettings(this, 'toggleArea_2');">
                </div>

                <div class="formrow">
                    <label>{$mod_strings['LBL_EMAIL_SMTP_SSL_OR_TLS']}</label>
                    <select name="smtp_tab_exchange[mail_smtpssl]" tabindex="501">
                        {$MAIL_SSL_OPTIONS_EXCHG}
                    </select>
                </div>

                <div class="clear"></div>

                <div class="toggleArea" id="toggleArea_2">
                <div class="formrow">
                    <label>{$mod_strings['LBL_EXCHANGE_SMTPUSER']}</label>
                        <input type="text" name="smtp_tab_exchange[mail_smtpuser]" id="smtp_tab_exchange__mail_smtpuser" size="25" maxlength="64">
                </div>

                <div class="clear"></div>

                <div class="formrow">
                    <label>{$mod_strings['LBL_EXCHANGE_SMTPPASS']}</label>
                        <input type="password" name="smtp_tab_exchange[mail_smtppass]" id="smtp_tab_exchange__mail_smtppass" size="25" maxlength="64" value="" tabindex="1">
                </div>

                <div class="clear"></div>

                <div class="formrow">
                    <label>{$mod_strings['LBL_ALLOW_DEFAULT_SELECTION']} <i>i<div class="tooltip">{$mod_strings['LBL_ALLOW_DEFAULT_SELECTION_HELP']}</div></i></label>
                        <input name="smtp_tab_exchange[notify_allow_default_outbound]" id="smtp_tab_exchange__notify_allow_default_outbound" value="2" tabindex="1" class="checkbox" type="checkbox" {$notify_allow_default_outbound_checked}>
                    </div>
                </div>

                <div class="clear"></div>
            </div>

            <!-- smtp / other tab-->

            <div class="form_section smtp_tab" id="smtp_tab_other">

                <div class="formrow">
                    <label>{$mod_strings['LBL_MAIL_SMTPSERVER']}</label>
                    <input type="text" name="smtp_tab_other[mail_smtpserver]" size="25" maxlength="64" value="">
                </div>

                <div class="formrow">
                    <label>{$mod_strings['LBL_MAIL_SMTPPORT']}</label>
                    <input type="text" name="smtp_tab_other[mail_smtpport]" size="5" maxlength="5" value="25">
                </div>

                <div class="clear"></div>

                <div class="formrow">
                    <label>{$mod_strings['LBL_MAIL_SMTPAUTH_REQ']}</label>
                    <input type="hidden" name="smtp_tab_other[mail_smtpauth_req]" value="0">
                    <input type="checkbox" id="mail_smtpauth_req_chk" name="smtp_tab_other[mail_smtpauth_req]" value="1" checked="checked" onclick="toggleSMTPAuthSettings(this, 'toggleArea_3');">
                </div>

                <div class="formrow">
                    <label>{$mod_strings['LBL_EMAIL_SMTP_SSL_OR_TLS']}</label>
                    <select name="smtp_tab_other[mail_smtpssl]" tabindex="501">
                        {$MAIL_SSL_OPTIONS_OTHER}
                    </select>
                </div>

                <div class="clear"></div>

                <div class="toggleArea" id="toggleArea_3">
                <div class="formrow">
                    <label>{$mod_strings['LBL_MAIL_SMTPUSER']}</label>
                        <input type="text" name="smtp_tab_other[mail_smtpuser]" id="smtp_tab_other__mail_smtpuser" size="25" maxlength="64">
                </div>

                <div class="clear"></div>

                <div class="formrow">
                    <label>{$mod_strings['LBL_MAIL_SMTPPASS']}</label>
                        <input type="password" name="smtp_tab_other[mail_smtppass]" id="smtp_tab_other__mail_smtppass" size="25" maxlength="64" value="" tabindex="1">
                </div>

                <div class="clear"></div>

                <div class="formrow">
                    <label>{$mod_strings['LBL_ALLOW_DEFAULT_SELECTION']} <i>i<div class="tooltip">{$mod_strings['LBL_ALLOW_DEFAULT_SELECTION_HELP']}</div></i></label>
                    <input type="hidden" name="smtp_tab_other[notify_allow_default_outbound]" value="0">
                    <input id="notify_allow_default_outbound_chk" name="smtp_tab_other[notify_allow_default_outbound]" value="2" tabindex="1" class="checkbox" type="checkbox" {$notify_allow_default_outbound_checked}>
                </div>
                </div>

                <div class="clear"></div>
            <!-- </div> -->

            <!-- smtp default values & tabs toggler js & tooltip help -->

            <script>

                var toggleSMTPAuthFields = {
                    toggleArea_1 : {
                        user: '******',
                        pass: '******',
                        allow: 'smtp_tab_gmail__notify_allow_default_outbound'
                    },
                    toggleArea_2 : {
                        user: '******',
                        pass: '******',
                        allow: 'smtp_tab_exchange__notify_allow_default_outbound'
                    },
                    toggleArea_3 : {
                        user: '******',
                        pass: '******',
                        allow: 'notify_allow_default_outbound_chk'
                    }
                };

                var toggleSMTPAuthSettings = function(chkbox, elemID) {
                    if(\$(chkbox).prop('checked')) {
                        \$('#' + elemID).show();
                    }
                    else {
                        \$('#' + toggleSMTPAuthFields[elemID].user).val('');
                        \$('#' + toggleSMTPAuthFields[elemID].pass).val('');
                        \$('#' + toggleSMTPAuthFields[elemID].allow).prop('checked', false);
                        \$('#' + elemID).hide();
                    }
                };

                \$(function(){

                    \$('.smtp_tab_toggler').click(function(){
                        \$('.smtp_tab_toggler.selected').removeClass('selected');
                        \$(this).addClass('selected');
                        \$('.smtp_tab').hide();
                        \$('#'+\$(this).attr('for')).show();
                        \$('input[name="smtp_tab_selected"]').val(\$(this).attr('for'));
                    });

                    // save last selected tab and set as default when form (re)load
                    \$('#{$_SESSION['smtp_tab_selected']}_toggler').click();

                    \$('select[name="smtp_tab_gmail[mail_smtpssl]"] option').each(function(){
                        if(!\$(this).html()) {
                            \$(this).html('-none-');
                        }
                    });
                    \$('select[name="smtp_tab_yahoo[mail_smtpssl]"] option').each(function(){
                        if(!\$(this).html()) {
                            \$(this).html('-none-');
                        }
                    });
                    \$('select[name="smtp_tab_exchange[mail_smtpssl]"] option').each(function(){
                        if(!\$(this).html()) {
                            \$(this).html('-none-');
                        }
                    });
                    \$('select[name="smtp_tab_other[mail_smtpssl]"] option').each(function(){
                        if(!\$(this).html()) {
                            \$(this).html('-none-');
                        }
                    });


                    toggleSMTPAuthSettings(document.getElementById('smtp_tab_gmail__mail_smtpauth_req'), 'toggleArea_1');
                    toggleSMTPAuthSettings(document.getElementById('smtp_tab_exchange__mail_smtpauth_req'), 'toggleArea_2');
                    toggleSMTPAuthSettings(document.getElementById('mail_smtpauth_req_chk'), 'toggleArea_3');

                });
            </script>

            </div> <!-- toggle hidden box end -->
EOQ;
        // db setup (dbConfig_a.php)
        $out2 = <<<EOQ2
            <input type='hidden' name='setup_db_drop_tables' id='setup_db_drop_tables' value=''>
        </div>
EOQ2;
        // ----------
        //  Branding
        // ------------->
        // company logo
        $currentLogoLink = SugarThemeRegistry::current()->getImageURL('company_logo.png');
        // show logo if we have
        $hiddenLogo = '';
        if (!file_exists($currentLogoLink)) {
            $hiddenLogo = 'display:none;';
        }
        // TODO--low: check the tooltip text at the logo image!
        $out .= <<<EOQ

            <!-- Branding  -->
            </div>
        </div>
        <div class="floatbox full" id="fb3">
            <h3 onclick="\$(this).next().toggle();" class="toggler">&raquo; {$mod_strings['LBL_WIZARD_SYSTEM_TITLE']}</h3>

            <div class="form_section" style="display: none;">

                <p class="ibmsg">{$mod_strings['LBL_WIZARD_SYSTEM_DESC']}</p>

                <p class="ibmsg">{$mod_strings['LBL_SITECFG_SYS_NAME_MSG']}</p>

                <div class="formrow">
                    <label>{$mod_strings['SYSTEM_NAME_WIZARD']} <i>i<div class="tooltip">{$mod_strings['SYSTEM_NAME_HELP']}</div></i></label>
                    <input type="text" name="setup_system_name" size="25" maxlength="64" value="{$_SESSION['setup_system_name']}">
                </div>

                <div class="clear"></div>

                <div class="formrow">
                    <!-- file upload -->
                    <label>{$mod_strings['NEW_LOGO']} <i>i<div class="tooltip">{$mod_strings['NEW_LOGO_HELP']}</div></i></label>
                    <input type="file" name="company_logo" id="company_logo">
                </div>

                <div class="clear"></div>

                <div class="formrow">
                    <label>&nbsp;</label>
                    <input type="button" name="company_logo_upload_btn" value="{$mod_strings['COMPANY_LOGO_UPLOAD_BTN']}" onclick="onUploadImageClick(this);">
                </div>


                <div class="clear"></div>

                <div class="formrow" id="current_logo_row">
                    <label>{$mod_strings['CURRENT_LOGO']} <i>i<div class="tooltip">{$mod_strings['CURRENT_LOGO_HELP']}</div></i> </label>
                    <img height="100" src="{$currentLogoLink}" alt="Company Logo" style="max-height: 100px; max-width: 230px; float:left; {$hiddenLogo}" />
                </div>

                <div class="clear"></div>
            </div>

EOQ;
        // System location defaults
        // TODO--low: 1000s sep, Decimal Symb, Name Format
        $defaultDateFormatSelect = self::getSelect('default_date_format', $sugarConfigDefaults['date_formats'], empty($_SESSION['default_date_format']) ? $sugarConfigDefaults['default_date_format'] : $_SESSION['default_date_format']);
        $defaultTimeFormatSelect = self::getSelect('default_time_format', $sugarConfigDefaults['time_formats'], empty($_SESSION['default_time_format']) ? 'h:ia' : $_SESSION['default_time_format']);
        $timezoneSelect = self::getSelect('timezone', array_merge(array(TimeDate::guessTimezone() => TimeDate::guessTimezone()), TimeDate::getTimezoneList()), TimeDate::guessTimezone());
        //$defaultLanguageSelect = get_select_options_with_id($supportedLanguages, $current_language);
        $defaultLanguageSelect = self::getSelect('default_language', $supportedLanguages, $current_language);
        // example name formats (its are in the original language file so may this functionality was there in the original sugarcrm installer also)
        $nonDBLocalization = new NonDBLocalization();
        $sugarConfigDefaults['name_formats'] = $nonDBLocalization->getUsableLocaleNameOptions($sugarConfigDefaults['name_formats']);
        $defaultLocalNameFormatSelect = self::getSelect('default_locale_name_format', $sugarConfigDefaults['name_formats'], empty($_SESSION['default_locale_name_format']) ? $sugarConfigDefaults['default_locale_name_format'] : $_SESSION['default_locale_name_format']);
        $out .= <<<EOQ
        </div>
            <!-- System Local Settings  -->
            <!-- TODO--low: add the time-zone settings here!! -->
        <div class="floatbox full" id="fb4">
            <h3 onclick="\$(this).next().toggle();" class="toggler">&raquo; {$mod_strings['LBL_LOCALE_TITLE']}</h3>

            <div class="form_section" style="display: none;">

                <p class="ibmsg">{$mod_strings['LBL_WIZARD_LOCALE_DESC']}</p>

                <div class="formrow">
                    <label>{$mod_strings['LBL_DATE_FORMAT']}</label>
                    {$defaultDateFormatSelect}
                </div>

                <div class="formrow">
                    <label>{$mod_strings['LBL_TIME_FORMAT']}</label>
                    {$defaultTimeFormatSelect}
                </div>

                <div class="clear"></div>

                <div class="formrow">
                    <label>{$mod_strings['LBL_TIMEZONE']}</label>
                    {$timezoneSelect}
                </div>

                <div class="clear"></div>

                <div class="formrow" style="display: none;">
                    <label>{$mod_strings['LBL_LANGUAGE']}</label>
                    {$defaultLanguageSelect}
                </div>

                <div class="clear"></div>

                <div class="formrow">
                    <label>{$mod_strings['LBL_CURRENCY']}</label>
                    <input type="text" name="default_currency_name" value="{$sugarConfigDefaults['default_currency_name']}">
                </div>

                <div class="formrow">
                    <label>{$mod_strings['LBL_CURRENCY_SYMBOL']}</label>
                    <input type="text" name="default_currency_symbol" size="4" value="{$sugarConfigDefaults['default_currency_symbol']}">
                </div>

                <div class="clear"></div>

                <div class="formrow">
                    <label>{$mod_strings['LBL_CURRENCY_ISO4217']}</label>
                    <input type="text" name="default_currency_iso4217" size="4" value="{$sugarConfigDefaults['default_currency_iso4217']}">
                </div>

                <!--
                <div class="formrow">
                    <label>{$mod_strings['LBL_NUMBER_GROUPING_SEP']}</label>
                    <input type="text" name="default_number_grouping_seperator" size="3" maxlength="1" value="{$sugarConfigDefaults['default_number_grouping_seperator']}">
                </div>


                <div class="formrow">
                    <label>{$mod_strings['LBL_DECIMAL_SEP']}</label>
                    <input type="text" name="default_decimal_seperator" size="3" maxlength="1" value="{$sugarConfigDefaults['default_decimal_seperator']}">
                </div>

                <div class="clear"></div>

                <div class="formrow">
                    <label>{$mod_strings['LBL_NAME_FORMAT']}</label>
                    {$defaultLocalNameFormatSelect}
                </div>
                -->

                <div class="clear"></div>
            </div>
        </div>

EOQ;
        $out .= "<div class=\"floatbox full\">";
        $out .= "    <h3 onclick=\"\$(this).next().toggle();\" class=\"toggler\">&raquo; {$mod_strings['LBL_SITECFG_SECURITY_TITLE']}</h3>";
        $out .= <<<EOQ

<div class="security-block" style="display:none;">
<table cellspacing="0" cellpadding="0" border="0" align="center" class="shell">
      <tr><td colspan="2" id="help"><!-- <a href="{$help_url}" target='_blank'>{$mod_strings['LBL_HELP']} </a> --></td></tr>
    <tr>
      <th width="500">
   </th>
   <th width="200" style="text-align: right;">&nbsp;</th>
   </tr>
<tr>
    <td colspan="2">
    {$errors}
   <div class="required">{$mod_strings['LBL_REQUIRED']}</div>
   <table width="100%" cellpadding="0" cellpadding="0" border="0" class="StyleDottedHr">
   <tr><th colspan="3" align="left">{$mod_strings['LBL_SITECFG_SITE_SECURITY']}</td></tr>

EOQ;
        $checked = '';
        //if(!empty($_SESSION['setup_site_sugarbeet_anonymous_stats'])) $checked = 'checked=""';
        $out .= "\n   <tr style='display:none'><td></td>\n       <td><input type='checkbox' class='checkbox' name='setup_site_sugarbeet_anonymous_stats' value='yes' {$checked} /></td>\n       <td><b>{$mod_strings['LBL_SITECFG_ANONSTATS']}</b><br><i>{$mod_strings['LBL_SITECFG_ANONSTATS_DIRECTIONS']}</i></td></tr>\n\n";
        $checked = '';
        //if(!empty($_SESSION['setup_site_sugarbeet_automatic_checks'])) $checked = 'checked=""';
        $out .= <<<EOQ
   <tr style='display:none'><td></td>
       <td><input type="checkbox" class="checkbox" name="setup_site_sugarbeet_automatic_checks" value="yes" /></td>
       <td><b>{$mod_strings['LBL_SITECFG_SUGAR_UP']}</b><br><i>{$mod_strings['LBL_SITECFG_SUGAR_UP_DIRECTIONS']}</i><br>&nbsp;</td></tr>
   <tbody id="setup_site_session_section_pre">
   <tr><td></td>
       <td><input type="checkbox" class="checkbox" name="setup_site_custom_session_path" value="yes" onclick="javascript:\$('#setup_site_session_section').toggle();" {$customSession} /></td>
       <td><b>{$mod_strings['LBL_SITECFG_CUSTOM_SESSION']}</b><br>
            <em>{$mod_strings['LBL_SITECFG_CUSTOM_SESSION_DIRECTIONS']}</em><br>&nbsp;</td>
   </tr>
   </tbody>
   <tbody id="setup_site_session_section" {$customSessionHidden}>
   <tr><td></td>
       <td style="text-align : right;"></td>
       <td align="left">
\t       <div><div style="width:200px;float:left">{$mod_strings['LBL_SITECFG_SESSION_PATH']} <span class="required">*</span></div>
\t               <input type="text" name="setup_site_session_path" size='40' value="{$_SESSION['setup_site_session_path']}" /></td>
\t       </div>
       </td>
   </tr>
   </tbody>
   <tbody id="setup_site_log_dir_pre">
   <tr><td></td>
       <td><input type="checkbox" class="checkbox" name="setup_site_custom_log_dir" value="yes" onclick="javascript:\$('#setup_site_log_dir').toggle();" {$customLog} /></td>
       <td><b>{$mod_strings['LBL_SITECFG_CUSTOM_LOG']}</b><br>
            <em>{$mod_strings['LBL_SITECFG_CUSTOM_LOG_DIRECTIONS']}</em><br>&nbsp;</td>
   </tr>
   </tbody>
   <tbody id="setup_site_log_dir" {$customLogHidden}>
   <tr><td></td>
       <td style="text-align : right;" ></td>
       <td align="left">
       <div><div style="width:200px;float:left">{$mod_strings['LBL_SITECFG_LOG_DIR']} <span class="required">*</span></div>
            <input type="text" name="setup_site_log_dir" size='30' value="{$_SESSION['setup_site_log_dir']}" />
       </div>
   </tr>
   </tbody>
   <tbody id="setup_site_guid_section_pre">
   <tr><td></td>
       <td><input type="checkbox" class="checkbox" name="setup_site_specify_guid" value="yes" onclick="javascript:\$('#setup_site_guid_section').toggle();" {$customId} /></td>
       <td><b>{$mod_strings['LBL_SITECFG_CUSTOM_ID']}</b><br>
            <em>{$mod_strings['LBL_SITECFG_CUSTOM_ID_DIRECTIONS']}</em><br>&nbsp;</td>
   </tr>
   </tbody>
   <tbody id="setup_site_guid_section" {$customIdHidden}>
   <tr><td></td>
       <td style="text-align : right;"></td>
       <td align="left">
\t       <div><div style="width:200px;float:left">{$mod_strings['LBL_SITECFG_APP_ID']} <span class="required">*</span></div>
\t               <input type="text" name="setup_site_guid" size='30' value="{$_SESSION['setup_site_guid']}" />
\t       </div>
       </td>
   </tr>
   </tbody>
</table>
</td>
</tr>
</table>
</div>
EOQ;
        $out .= "</div>";
        return $out;
    }
Beispiel #7
0
////	LOCALE SETTINGS
////	Date/time format
$dformat = $locale->getPrecedentPreference($focus->id ? 'datef' : 'default_date_format', $focus);
$tformat = $locale->getPrecedentPreference($focus->id ? 'timef' : 'default_time_format', $focus);
$timeOptions = get_select_options_with_id($sugar_config['time_formats'], $tformat);
$dateOptions = get_select_options_with_id($sugar_config['date_formats'], $dformat);
$sugar_smarty->assign('TIMEOPTIONS', $timeOptions);
$sugar_smarty->assign('DATEOPTIONS', $dateOptions);
//// Timezone
if (empty($focus->id)) {
    // remove default timezone for new users(set later)
    $focus->user_preferences['timezone'] = '';
}
$userTZ = $focus->getPreference('timezone');
if (empty($userTZ) && !$focus->is_group && !$focus->portal_only) {
    $userTZ = TimeDate::guessTimezone();
    $focus->setPreference('timezone', $userTZ);
}
if (!$focus->getPreference('ut')) {
    $sugar_smarty->assign('PROMPTTZ', ' checked');
}
//$sugar_smarty->assign('TIMEZONE_CURRENT', $userTZ); // fix bug 1034
$sugar_smarty->assign('TIMEZONE_CURRENT', "Asia/Ho_Chi_Minh");
$sugar_smarty->assign('TIMEZONEOPTIONS', TimeDate::getTimezoneList());
//// Numbers and Currency display
require_once 'modules/Currencies/ListCurrency.php';
$currency = new ListCurrency();
// 10/13/2006 Collin - Changed to use Localization.getConfigPreference
// This was the problem- Previously, the "-99" currency id always assumed
// to be defaulted to US Dollars.  However, if someone set their install to use
// Euro or other type of currency then this setting would not apply as the
Beispiel #8
0
            }
            // end outer forloop
        }
        // end foreach loop
    }
    $display .= "<br><b>" . $mod_strings['LBL_DST_FIX_DONE_DESC'] . "</b>";
} elseif (!$done) {
    // show primary screen
    $disabled = "";
    $confirmed = 'true';
    require_once 'include/timezone/timezones.php';
    global $timezones;
    $timezoneOptions = '';
    ksort($timezones);
    if (!isset($defaultServerZone)) {
        $defaultServerZone = TimeDate::guessTimezone(0);
    }
    foreach ($timezones as $key => $value) {
        if (!empty($value['dstOffset'])) {
            $dst = " (+DST)";
        } else {
            $dst = "";
        }
        if ($key == $defaultServerZone) {
            $selected = 'selected';
        } else {
            $selected = '';
        }
        $gmtOffset = $value['gmtOffset'] / 60;
        if (!strstr($gmtOffset, '-')) {
            $gmtOffset = "+" . $gmtOffset;