| Conditions | 17 |
| Paths | 48 |
| Total Lines | 98 |
| Code Lines | 57 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 306 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 83 | public function display() |
||
| 84 | { |
||
| 85 | global $mod_strings; |
||
| 86 | global $app_list_strings; |
||
| 87 | global $app_strings; |
||
| 88 | global $current_user; |
||
| 89 | global $sugar_config; |
||
| 90 | |||
| 91 | echo $this->getModuleTitle(false); |
||
| 92 | global $currentModule; |
||
| 93 | |||
| 94 | $focus = new Administration(); |
||
| 95 | $focus->retrieveSettings(); //retrieve all admin settings. |
||
| 96 | $GLOBALS['log']->info("Mass Emailer(EmailMan) ConfigureSettings view"); |
||
| 97 | |||
| 98 | $this->ss->assign("MOD", $mod_strings); |
||
| 99 | $this->ss->assign("APP", $app_strings); |
||
| 100 | |||
| 101 | $this->ss->assign("RETURN_MODULE", "Administration"); |
||
| 102 | $this->ss->assign("RETURN_ACTION", "index"); |
||
| 103 | |||
| 104 | $this->ss->assign("MODULE", $currentModule); |
||
| 105 | $this->ss->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']); |
||
| 106 | $this->ss->assign("HEADER", get_module_title("EmailMan", "{MOD.LBL_CONFIGURE_SETTINGS}", true)); |
||
|
|
|||
| 107 | $this->ss->assign("notify_fromaddress", $focus->settings['notify_fromaddress']); |
||
| 108 | $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'" : ""); |
||
| 109 | $this->ss->assign("notify_on", ($focus->settings['notify_on']) ? "checked='checked'" : ""); |
||
| 110 | $this->ss->assign("notify_fromname", $focus->settings['notify_fromname']); |
||
| 111 | $this->ss->assign("notify_allow_default_outbound_on", (!empty($focus->settings['notify_allow_default_outbound']) && $focus->settings['notify_allow_default_outbound']) ? "checked='checked'" : ""); |
||
| 112 | |||
| 113 | $this->ss->assign("mail_smtptype", $focus->settings['mail_smtptype']); |
||
| 114 | $this->ss->assign("mail_smtpserver", $focus->settings['mail_smtpserver']); |
||
| 115 | $this->ss->assign("mail_smtpport", $focus->settings['mail_smtpport']); |
||
| 116 | $this->ss->assign("mail_smtpuser", $focus->settings['mail_smtpuser']); |
||
| 117 | $this->ss->assign("mail_smtpauth_req", ($focus->settings['mail_smtpauth_req']) ? "checked='checked'" : ""); |
||
| 118 | $this->ss->assign("mail_haspass", empty($focus->settings['mail_smtppass'])?0:1); |
||
| 119 | $this->ss->assign("MAIL_SSL_OPTIONS", get_select_options_with_id($app_list_strings['email_settings_for_ssl'], $focus->settings['mail_smtpssl'])); |
||
| 120 | |||
| 121 | //Assign the current users email for the test send dialogue. |
||
| 122 | $this->ss->assign("CURRENT_USER_EMAIL", $current_user->email1); |
||
| 123 | |||
| 124 | $showSendMail = FALSE; |
||
| 125 | $outboundSendTypeCSSClass = "yui-hidden"; |
||
| 126 | if(isset($sugar_config['allow_sendmail_outbound']) && $sugar_config['allow_sendmail_outbound']) |
||
| 127 | { |
||
| 128 | $showSendMail = TRUE; |
||
| 129 | $app_list_strings['notifymail_sendtype']['sendmail'] = 'sendmail'; |
||
| 130 | $outboundSendTypeCSSClass = ""; |
||
| 131 | } |
||
| 132 | |||
| 133 | $this->ss->assign("OUTBOUND_TYPE_CLASS", $outboundSendTypeCSSClass); |
||
| 134 | $this->ss->assign("mail_sendtype_options", get_select_options_with_id($app_list_strings['notifymail_sendtype'], $focus->settings['mail_sendtype'])); |
||
| 135 | |||
| 136 | /////////////////////////////////////////////////////////////////////////////// |
||
| 137 | //// USER EMAIL DEFAULTS |
||
| 138 | // editors |
||
| 139 | $editors = $app_list_strings['dom_email_editor_option']; |
||
| 140 | $newEditors = array(); |
||
| 141 | foreach($editors as $k => $v) { |
||
| 142 | if($k != "") { $newEditors[$k] = $v; } |
||
| 143 | } |
||
| 144 | |||
| 145 | // preserve attachments |
||
| 146 | $preserveAttachments = ''; |
||
| 147 | if(isset($sugar_config['email_default_delete_attachments']) && $sugar_config['email_default_delete_attachments'] == true) { |
||
| 148 | $preserveAttachments = 'CHECKED'; |
||
| 149 | } |
||
| 150 | $this->ss->assign('DEFAULT_EMAIL_DELETE_ATTACHMENTS', $preserveAttachments); |
||
| 151 | //// END USER EMAIL DEFAULTS |
||
| 152 | /////////////////////////////////////////////////////////////////////////////// |
||
| 153 | |||
| 154 | |||
| 155 | //setting to manage. |
||
| 156 | //emails_per_run |
||
| 157 | //tracking_entities_location_type default or custom |
||
| 158 | //tracking_entities_location http://www.sugarcrm.com/track/ |
||
| 159 | |||
| 160 | ////////////////////////////////////////////////////////////////////////////// |
||
| 161 | //// EMAIL SECURITY |
||
| 162 | if(!isset($sugar_config['email_xss']) || empty($sugar_config['email_xss'])) { |
||
| 163 | $sugar_config['email_xss'] = getDefaultXssTags(); |
||
| 164 | } |
||
| 165 | |||
| 166 | foreach(unserialize(base64_decode($sugar_config['email_xss'])) as $k => $v) { |
||
| 167 | $this->ss->assign($k."Checked", 'CHECKED'); |
||
| 168 | } |
||
| 169 | |||
| 170 | //// END EMAIL SECURITY |
||
| 171 | /////////////////////////////////////////////////////////////////////////////// |
||
| 172 | |||
| 173 | require_once('modules/Emails/Email.php'); |
||
| 174 | $email = new Email(); |
||
| 175 | $this->ss->assign('ROLLOVER', $email->rolloverStyle); |
||
| 176 | $this->ss->assign('THEME', $GLOBALS['theme']); |
||
| 177 | |||
| 178 | $this->ss->assign("JAVASCRIPT",get_validate_record_js()); |
||
| 179 | $this->ss->display('modules/EmailMan/tpls/config.tpl'); |
||
| 180 | } |
||
| 181 | } |
||
| 182 |
This function has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead.