2 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 /*********************************************************************************
4 * SugarCRM is a customer relationship management program developed by
5 * SugarCRM, Inc. Copyright (C) 2004-2011 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 * Description: TODO: To be written.
41 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
42 * All Rights Reserved.
43 * Contributor(s): ______________________________________..
44 ********************************************************************************/
46 require_once('include/MVC/View/SugarView.php');
47 require_once('modules/EmailMan/Forms.php');
49 class ViewConfig extends SugarView
52 * @see SugarView::_getModuleTitleParams()
54 protected function _getModuleTitleParams($browserTitle = false)
59 "<a href='index.php?module=Administration&action=index'>".translate('LBL_MODULE_NAME','Administration')."</a>",
60 translate('LBL_MASS_EMAIL_CONFIG_TITLE','Administration'),
65 * @see SugarView::preDisplay()
67 public function preDisplay()
71 if ( !is_admin($current_user)
72 && !is_admin_for_module($GLOBALS['current_user'],'Emails')
73 && !is_admin_for_module($GLOBALS['current_user'],'Campaigns') )
74 sugar_die("Unauthorized access to administration.");
78 * @see SugarView::display()
80 public function display()
83 global $app_list_strings;
89 echo $this->getModuleTitle(false);
90 global $currentModule;
96 $focus = new Administration();
97 $focus->retrieveSettings(); //retrieve all admin settings.
98 $GLOBALS['log']->info("Mass Emailer(EmailMan) ConfigureSettings view");
100 $this->ss->assign("MOD", $mod_strings);
101 $this->ss->assign("APP", $app_strings);
103 $this->ss->assign("RETURN_MODULE", "Administration");
104 $this->ss->assign("RETURN_ACTION", "index");
106 $this->ss->assign("MODULE", $currentModule);
107 $this->ss->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']);
108 $this->ss->assign("HEADER", getClassicModuleTitle("EmailMan", array("{MOD.LBL_CONFIGURE_SETTINGS}"), true));
110 $this->ss->assign("notify_fromaddress", $focus->settings['notify_fromaddress']);
111 $this->ss->assign("notify_send_from_assigning_user", (isset($focus->settings['notify_send_from_assigning_user']) && !empty($focus->settings['notify_send_from_assigning_user'])) ? "checked='checked'" : "");
112 $this->ss->assign("notify_on", ($focus->settings['notify_on']) ? "checked='checked'" : "");
113 $this->ss->assign("notify_fromname", $focus->settings['notify_fromname']);
114 $this->ss->assign("notify_allow_default_outbound_on", (!empty($focus->settings['notify_allow_default_outbound']) && $focus->settings['notify_allow_default_outbound']) ? "checked='checked'" : "");
116 $this->ss->assign("mail_smtptype", $focus->settings['mail_smtptype']);
117 $this->ss->assign("mail_smtpserver", $focus->settings['mail_smtpserver']);
118 $this->ss->assign("mail_smtpport", $focus->settings['mail_smtpport']);
119 $this->ss->assign("mail_smtpuser", $focus->settings['mail_smtpuser']);
120 $this->ss->assign("mail_smtpauth_req", ($focus->settings['mail_smtpauth_req']) ? "checked='checked'" : "");
121 $this->ss->assign("MAIL_SSL_OPTIONS", get_select_options_with_id($app_list_strings['email_settings_for_ssl'], $focus->settings['mail_smtpssl']));
123 //Assign the current users email for the test send dialogue.
124 $this->ss->assign("CURRENT_USER_EMAIL", $current_user->email1);
126 $showSendMail = FALSE;
127 $outboundSendTypeCSSClass = "yui-hidden";
128 if(isset($sugar_config['allow_sendmail_outbound']) && $sugar_config['allow_sendmail_outbound'])
130 $showSendMail = TRUE;
131 $app_list_strings['notifymail_sendtype']['sendmail'] = 'sendmail';
132 $outboundSendTypeCSSClass = "";
135 $this->ss->assign("OUTBOUND_TYPE_CLASS", $outboundSendTypeCSSClass);
136 $this->ss->assign("mail_sendtype_options", get_select_options_with_id($app_list_strings['notifymail_sendtype'], $focus->settings['mail_sendtype']));
138 ///////////////////////////////////////////////////////////////////////////////
139 //// USER EMAIL DEFAULTS
141 $editors = $app_list_strings['dom_email_editor_option'];
142 $newEditors = array();
143 foreach($editors as $k => $v) {
144 if($k != "") { $newEditors[$k] = $v; }
147 // preserve attachments
148 $preserveAttachments = '';
149 if(isset($sugar_config['email_default_delete_attachments']) && $sugar_config['email_default_delete_attachments'] == true) {
150 $preserveAttachments = 'CHECKED';
152 $this->ss->assign('DEFAULT_EMAIL_DELETE_ATTACHMENTS', $preserveAttachments);
153 //// END USER EMAIL DEFAULTS
154 ///////////////////////////////////////////////////////////////////////////////
159 //tracking_entities_location_type default or custom
160 //tracking_entities_location http://www.sugarcrm.com/track/
162 //////////////////////////////////////////////////////////////////////////////
164 if(!isset($sugar_config['email_xss']) || empty($sugar_config['email_xss'])) {
165 $sugar_config['email_xss'] = getDefaultXssTags();
168 foreach(unserialize(base64_decode($sugar_config['email_xss'])) as $k => $v) {
169 $this->ss->assign($k."Checked", 'CHECKED');
173 //// END EMAIL SECURITY
174 ///////////////////////////////////////////////////////////////////////////////
176 require_once('modules/Emails/Email.php');
177 $email = new Email();
178 $this->ss->assign('ROLLOVER', $email->rolloverStyle);
180 $this->ss->assign("JAVASCRIPT",get_validate_record_js());
181 $this->ss->display('modules/EmailMan/tpls/config.tpl');