From 1734880bbbe6ef30dd9f60a86c40712af5fd6f5b Mon Sep 17 00:00:00 2001 From: Cameron Date: Sat, 15 Nov 2014 13:29:37 -0800 Subject: [PATCH] Corrected missing mail handlers preference. Added Debug-active warning. Enabling e_DEBUG in e107_config.php will now enable debug in the mailout class. --- e107_admin/mailout.php | 47 +++++++++++--------- e107_handlers/admin_ui.php | 2 +- e107_handlers/mail_manager_class.php | 12 +++++ e107_handlers/mailout_admin_class.php | 6 +++ e107_languages/English/admin/lan_mailout.php | 2 +- 5 files changed, 45 insertions(+), 24 deletions(-) diff --git a/e107_admin/mailout.php b/e107_admin/mailout.php index fd88ccfb5..c2df0ebd7 100644 --- a/e107_admin/mailout.php +++ b/e107_admin/mailout.php @@ -848,6 +848,28 @@ class mailout_main_ui extends e_admin_ui + + ".LAN_MAILOUT_77." + "; + + $mail_enable = explode(',',vartrue($pref['mailout_enabled'],'core')); + + $coreCheck = (in_array('core',$mail_enable)) ? "checked='checked'" : ""; + $text .= $frm->checkbox('mail_mailer_enabled[]','core', $coreCheck, 'users'); + + if(!empty($pref['e_mailout_list'])) + { + foreach ($pref['e_mailout_list'] as $mailer => $v) + { + $check = (in_array($mailer,$mail_enable)) ? "checked='checked'" : ""; + $text .= $frm->checkbox('mail_mailer_enabled[]',$mailer,$check,$mailer); + // $text .= "  {$mailer}
"; + } + } + + $text .= " + + ".LAN_MAILOUT_115."
@@ -965,29 +987,10 @@ class mailout_main_ui extends e_admin_ui ".LAN_MAILOUT_156." ".$frm->number('mail_workpertick',varset($pref['mail_workpertick'],5))."".LAN_MAILOUT_157." - \n"; + - if (isset($pref['e_mailout_list'])) // Allow selection of email address sources - { - $text .= " - - ".LAN_MAILOUT_77." - "; - - $mail_enable = explode(',',$pref['mailout_enabled']); - - $coreCheck = (in_array('core',$mail_enable)) ? "checked='checked'" : ""; - $text .= $frm->checkbox('mail_mailer_enabled[]','core', $coreCheck, 'users'); - - foreach ($pref['e_mailout_list'] as $mailer => $v) - { - $check = (in_array($mailer,$mail_enable)) ? "checked='checked'" : ""; - $text .= $frm->checkbox('mail_mailer_enabled[]',$mailer,$check,$mailer); - // $text .= "  {$mailer}
"; - } - - $text .= "\n"; - } + + "; list($mail_log_option,$mail_log_email) = explode(',',varset($pref['mail_log_options'],'0,0')); diff --git a/e107_handlers/admin_ui.php b/e107_handlers/admin_ui.php index 10bac5dc8..b197bff73 100644 --- a/e107_handlers/admin_ui.php +++ b/e107_handlers/admin_ui.php @@ -3822,7 +3822,7 @@ class e_admin_controller_ui extends e_admin_controller } // Debug Filter Query. - e107::getMessage()->addDebug('QRY='.$qry); + e107::getMessage()->addDebug('QRY='.str_replace('#', MPREFIX, $qry)); // echo $qry.'
'; // print_a($this->fields); // print_a($_GET); diff --git a/e107_handlers/mail_manager_class.php b/e107_handlers/mail_manager_class.php index 2f9c675c6..719a1beeb 100644 --- a/e107_handlers/mail_manager_class.php +++ b/e107_handlers/mail_manager_class.php @@ -218,6 +218,18 @@ class e107MailManager { $this->e107 = e107::getInstance(); $this->mailOverrides = $overrides; + + if(deftrue('e_DEBUG')) + { + $this->debugMode = true; + } + + if($this->debugMode === true) + { + e107::getMessage()->addWarning('Debug Mode is active. Emailing will only be simulated!'); + } + + } diff --git a/e107_handlers/mailout_admin_class.php b/e107_handlers/mailout_admin_class.php index 32d654c10..44ead7f26 100644 --- a/e107_handlers/mailout_admin_class.php +++ b/e107_handlers/mailout_admin_class.php @@ -556,6 +556,12 @@ class mailoutAdminClass extends e107MailManager $ret++; } + if(empty($pref['e_mailout_list'])) + { + return $ret; + } + + // Load additional configured handlers e_mailout.php from plugins. foreach($pref['e_mailout_list'] as $mailer => $v) { diff --git a/e107_languages/English/admin/lan_mailout.php b/e107_languages/English/admin/lan_mailout.php index 7cf1706f4..43a6f1b2b 100644 --- a/e107_languages/English/admin/lan_mailout.php +++ b/e107_languages/English/admin/lan_mailout.php @@ -87,7 +87,7 @@ define("LAN_MAILOUT_73", "No logging"); define("LAN_MAILOUT_74", "Logging only (no send)"); define("LAN_MAILOUT_75", "Log and send"); define("LAN_MAILOUT_76", "Include email info in log"); -define("LAN_MAILOUT_77", "Supplementary email address sources"); +define("LAN_MAILOUT_77", "Email address sources"); define("LAN_MAILOUT_78", "Mailshot Status"); define("LAN_MAILOUT_79", "No mailshots to display"); define("LAN_MAILOUT_80", "Date");