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()
59 "<a href='index.php?module=Administration&action=index'>".translate('LBL_MODULE_NAME','Administration')."</a>",
60 $mod_strings['LBL_CONFIGURE_SETTINGS'],
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();
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", get_module_title("EmailMan", "{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_haspass", empty($focus->settings['mail_smtppass'])?0:1);
122 $this->ss->assign("MAIL_SSL_OPTIONS", get_select_options_with_id($app_list_strings['email_settings_for_ssl'], $focus->settings['mail_smtpssl']));
124 //Assign the current users email for the test send dialogue.
125 $this->ss->assign("CURRENT_USER_EMAIL", $current_user->email1);
127 $showSendMail = FALSE;
128 $outboundSendTypeCSSClass = "yui-hidden";
129 if(isset($sugar_config['allow_sendmail_outbound']) && $sugar_config['allow_sendmail_outbound'])
131 $showSendMail = TRUE;
132 $app_list_strings['notifymail_sendtype']['sendmail'] = 'sendmail';
133 $outboundSendTypeCSSClass = "";
136 $this->ss->assign("OUTBOUND_TYPE_CLASS", $outboundSendTypeCSSClass);
137 $this->ss->assign("mail_sendtype_options", get_select_options_with_id($app_list_strings['notifymail_sendtype'], $focus->settings['mail_sendtype']));
139 ///////////////////////////////////////////////////////////////////////////////
140 //// USER EMAIL DEFAULTS
142 $editors = $app_list_strings['dom_email_editor_option'];
143 $newEditors = array();
144 foreach($editors as $k => $v) {
145 if($k != "") { $newEditors[$k] = $v; }
148 // preserve attachments
149 $preserveAttachments = '';
150 if(isset($sugar_config['email_default_delete_attachments']) && $sugar_config['email_default_delete_attachments'] == true) {
151 $preserveAttachments = 'CHECKED';
153 $this->ss->assign('DEFAULT_EMAIL_DELETE_ATTACHMENTS', $preserveAttachments);
154 //// END USER EMAIL DEFAULTS
155 ///////////////////////////////////////////////////////////////////////////////
160 //tracking_entities_location_type default or custom
161 //tracking_entities_location http://www.sugarcrm.com/track/
163 //////////////////////////////////////////////////////////////////////////////
165 if(!isset($sugar_config['email_xss']) || empty($sugar_config['email_xss'])) {
166 $sugar_config['email_xss'] = getDefaultXssTags();
169 foreach(unserialize(base64_decode($sugar_config['email_xss'])) as $k => $v) {
170 $this->ss->assign($k."Checked", 'CHECKED');
174 //// END EMAIL SECURITY
175 ///////////////////////////////////////////////////////////////////////////////
177 require_once('modules/Emails/Email.php');
178 $email = new Email();
179 $this->ss->assign('ROLLOVER', $email->rolloverStyle);
181 $this->ss->assign("JAVASCRIPT",get_validate_record_js());
182 $this->ss->display('modules/EmailMan/tpls/config.tpl');