2 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 /*********************************************************************************
4 * SugarCRM Community Edition is a customer relationship management program developed by
5 * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
7 * This program is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU Affero General Public License version 3 as published by the
9 * Free Software Foundation with the addition of the following permission added
10 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
11 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
12 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
19 * You should have received a copy of the GNU Affero General Public License along with
20 * this program; if not, see http://www.gnu.org/licenses or write to the Free
21 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
25 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
27 * The interactive user interfaces in modified source and object code versions
28 * of this program must display Appropriate Legal Notices, as required under
29 * Section 5 of the GNU Affero General Public License version 3.
31 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
32 * these Appropriate Legal Notices must retain the display of the "Powered by
33 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
34 * technical reasons, the Appropriate Legal Notices must display the words
35 * "Powered by SugarCRM".
36 ********************************************************************************/
38 /*********************************************************************************
40 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
41 * All Rights Reserved.
42 * Contributor(s): ______________________________________..
43 ********************************************************************************/
45 require_once('include/MVC/View/SugarView.php');
46 require_once('modules/Configurator/Forms.php');
47 require_once('modules/Administration/Forms.php');
48 require_once('modules/Configurator/Configurator.php');
50 class ViewAdminwizard extends SugarView
52 public function __construct()
56 $this->options['show_header'] = false;
57 $this->options['show_footer'] = false;
58 $this->options['show_javascript'] = false;
62 * @see SugarView::display()
64 public function display()
66 global $current_user, $mod_strings, $app_list_strings, $sugar_config, $locale, $sugar_version;
68 if(!is_admin($current_user)){
69 sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']);
72 $themeObject = SugarThemeRegistry::current();
74 $configurator = new Configurator();
75 $sugarConfig = SugarConfig::getInstance();
76 $focus = new Administration();
77 $focus->retrieveSettings();
79 $ut = $GLOBALS['current_user']->getPreference('ut');
81 $this->ss->assign('SKIP_URL','index.php?module=Users&action=Wizard&skipwelcome=1');
83 $this->ss->assign('SKIP_URL','index.php?module=Home&action=index');
85 // Always mark that we have got past this point
86 $focus->saveSetting('system','adminwizard',1);
87 $css = $themeObject->getCSS();
88 $favicon = $themeObject->getImageURL('sugar_icon.ico',false);
89 $this->ss->assign('FAVICON_URL',getJSPath($favicon));
90 $this->ss->assign('SUGAR_CSS', $css);
91 $this->ss->assign('MOD_USERS',return_module_language($GLOBALS['current_language'], 'Users'));
92 $this->ss->assign('CSS', '<link rel="stylesheet" type="text/css" href="'.SugarThemeRegistry::current()->getCSSURL('wizard.css').'" />');
93 $this->ss->assign('LANGUAGES', get_languages());
94 $this->ss->assign('config', $sugar_config);
95 $this->ss->assign('SUGAR_VERSION', $sugar_version);
96 $this->ss->assign('settings', $focus->settings);
97 $this->ss->assign('exportCharsets', get_select_options_with_id($locale->getCharsetSelect(), $sugar_config['default_export_charset']));
98 $this->ss->assign('getNameJs', $locale->getNameJs());
99 $this->ss->assign('NAMEFORMATS', $locale->getUsableLocaleNameOptions($sugar_config['name_formats']));
100 $this->ss->assign('JAVASCRIPT',get_set_focus_js(). get_configsettings_js());
101 $this->ss->assign('company_logo', SugarThemeRegistry::current()->getImageURL('company_logo.png'));
102 $this->ss->assign('mail_smtptype', $focus->settings['mail_smtptype']);
103 $this->ss->assign('mail_smtpserver', $focus->settings['mail_smtpserver']);
104 $this->ss->assign('mail_smtpport', $focus->settings['mail_smtpport']);
105 $this->ss->assign('mail_smtpuser', $focus->settings['mail_smtpuser']);
106 $this->ss->assign('mail_smtppass', $focus->settings['mail_smtppass']);
107 $this->ss->assign('mail_smtpauth_req', ($focus->settings['mail_smtpauth_req']) ? "checked='checked'" : '');
108 $this->ss->assign('MAIL_SSL_OPTIONS', get_select_options_with_id($app_list_strings['email_settings_for_ssl'], $focus->settings['mail_smtpssl']));
109 $this->ss->assign('notify_allow_default_outbound_on', (!empty($focus->settings['notify_allow_default_outbound']) && $focus->settings['notify_allow_default_outbound'] == 2) ? 'CHECKED' : '');
110 $this->ss->assign('THEME', SugarThemeRegistry::current()->__toString());
114 $this->options['show_javascript'] = true;
115 $this->renderJavascript();
116 $this->options['show_javascript'] = false;
117 $this->ss->assign("SUGAR_JS",ob_get_contents().$themeObject->getJS());
120 $this->ss->assign('langHeader', get_language_header());
121 $this->ss->assign('START_PAGE', !empty($_REQUEST['page']) ? $_REQUEST['page'] : 'welcome');
123 $this->ss->display('modules/Configurator/tpls/adminwizard.tpl');