mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
Clean up mail and SMS log view screens
This commit is contained in:
parent
4271bb9862
commit
d68770a3ef
6 changed files with 28 additions and 82 deletions
|
|
@ -157,7 +157,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$clear_before_days = intval(Context::get('clear_before_days'));
|
||||
if (!in_array($status, array('success', 'error')))
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
$status = null;
|
||||
}
|
||||
if ($clear_before_days < 0)
|
||||
{
|
||||
|
|
@ -169,14 +169,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$obj->regdate = date('YmdHis', time() - ($clear_before_days * 86400) + zgap());
|
||||
$output = executeQuery('advanced_mailer.deleteMailLogs', $obj);
|
||||
|
||||
if ($status === 'success')
|
||||
{
|
||||
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminMailLog'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminMailErrors'));
|
||||
}
|
||||
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminMailLog', 'status', $status));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -188,7 +181,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$clear_before_days = intval(Context::get('clear_before_days'));
|
||||
if (!in_array($status, array('success', 'error')))
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
$status = null;
|
||||
}
|
||||
if ($clear_before_days < 0)
|
||||
{
|
||||
|
|
@ -200,14 +193,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$obj->regdate = date('YmdHis', time() - ($clear_before_days * 86400) + zgap());
|
||||
$output = executeQuery('advanced_mailer.deleteSMSLogs', $obj);
|
||||
|
||||
if ($status === 'success')
|
||||
{
|
||||
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminSMSLog'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminSMSErrors'));
|
||||
}
|
||||
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminSMSLog', 'status', $status));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -131,40 +131,14 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
public function dispAdvanced_MailerAdminMailLog()
|
||||
{
|
||||
$obj = new stdClass();
|
||||
$obj->status = 'success';
|
||||
$obj->status = preg_replace('/[^a-z]/', '', Context::get('status')) ?: null;
|
||||
$obj->page = $page = Context::get('page') ?: 1;
|
||||
$maillog = executeQueryArray('advanced_mailer.getMailLogByType', $obj);
|
||||
$maillog = $maillog->toBool() ? $this->procMailLog($maillog->data) : array();
|
||||
Context::set('advanced_mailer_log', $maillog);
|
||||
Context::set('advanced_mailer_status', 'success');
|
||||
Context::set('advanced_mailer_status', $obj->status);
|
||||
|
||||
$paging = $this->procPaging('success', 'mail', $page);
|
||||
Context::set('total_count', $paging->total_count);
|
||||
Context::set('total_page', $paging->total_page);
|
||||
Context::set('page', $paging->page);
|
||||
Context::set('page_navigation', $paging->page_navigation);
|
||||
|
||||
$sending_methods = Rhymix\Framework\Mail::getSupportedDrivers();
|
||||
Context::set('sending_methods', $sending_methods);
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('mail_log');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the mail error log.
|
||||
*/
|
||||
public function dispAdvanced_MailerAdminMailErrors()
|
||||
{
|
||||
$obj = new stdClass();
|
||||
$obj->status = 'error';
|
||||
$obj->page = $page = Context::get('page') ?: 1;
|
||||
$maillog = executeQueryArray('advanced_mailer.getMailLogByType', $obj);
|
||||
$maillog = $maillog->toBool() ? $this->procMailLog($maillog->data) : array();
|
||||
Context::set('advanced_mailer_log', $maillog);
|
||||
Context::set('advanced_mailer_status', 'error');
|
||||
|
||||
$paging = $this->procPaging('error', 'mail', $page);
|
||||
$paging = $this->procPaging($obj->status, 'mail', $page);
|
||||
Context::set('total_count', $paging->total_count);
|
||||
Context::set('total_page', $paging->total_page);
|
||||
Context::set('page', $paging->page);
|
||||
|
|
@ -199,40 +173,14 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
public function dispAdvanced_MailerAdminSMSLog()
|
||||
{
|
||||
$obj = new stdClass();
|
||||
$obj->status = 'success';
|
||||
$obj->status = preg_replace('/[^a-z]/', '', Context::get('status')) ?: null;
|
||||
$obj->page = $page = Context::get('page') ?: 1;
|
||||
$smslog = executeQueryArray('advanced_mailer.getSMSLogByType', $obj);
|
||||
$smslog = $smslog->toBool() ? $smslog->data : array();
|
||||
Context::set('advanced_mailer_log', $smslog);
|
||||
Context::set('advanced_mailer_status', 'success');
|
||||
Context::set('advanced_mailer_status', $obj->status);
|
||||
|
||||
$paging = $this->procPaging('success', 'sms', $page);
|
||||
Context::set('total_count', $paging->total_count);
|
||||
Context::set('total_page', $paging->total_page);
|
||||
Context::set('page', $paging->page);
|
||||
Context::set('page_navigation', $paging->page_navigation);
|
||||
|
||||
$sending_methods = Rhymix\Framework\SMS::getSupportedDrivers();
|
||||
Context::set('sending_methods', $sending_methods);
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('sms_log');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the SMS error log.
|
||||
*/
|
||||
public function dispAdvanced_MailerAdminSMSErrors()
|
||||
{
|
||||
$obj = new stdClass();
|
||||
$obj->status = 'error';
|
||||
$obj->page = $page = Context::get('page') ?: 1;
|
||||
$smslog = executeQueryArray('advanced_mailer.getSMSLogByType', $obj);
|
||||
$smslog = $smslog->toBool() ? $smslog->data : array();
|
||||
Context::set('advanced_mailer_log', $smslog);
|
||||
Context::set('advanced_mailer_status', 'error');
|
||||
|
||||
$paging = $this->procPaging('error', 'sms', $page);
|
||||
$paging = $this->procPaging($obj->status, 'sms', $page);
|
||||
Context::set('total_count', $paging->total_count);
|
||||
Context::set('total_page', $paging->total_page);
|
||||
Context::set('page', $paging->page);
|
||||
|
|
|
|||
|
|
@ -7,10 +7,8 @@
|
|||
<action name="dispAdvanced_mailerAdminSpfDkim" type="view" />
|
||||
<action name="dispAdvanced_mailerAdminMailTest" type="view" />
|
||||
<action name="dispAdvanced_mailerAdminMailLog" type="view" />
|
||||
<action name="dispAdvanced_mailerAdminMailErrors" type="view" />
|
||||
<action name="dispAdvanced_mailerAdminSMSTest" type="view" />
|
||||
<action name="dispAdvanced_mailerAdminSMSLog" type="view" />
|
||||
<action name="dispAdvanced_mailerAdminSMSErrors" type="view" />
|
||||
<action name="dispAdvanced_mailerAdminPushTest" type="view" />
|
||||
<action name="dispAdvanced_mailerAdminPushLog" type="view" />
|
||||
|
||||
|
|
|
|||
|
|
@ -9,10 +9,8 @@
|
|||
<li class="x_active"|cond="$act == 'dispAdvanced_mailerAdminSpfDkim'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminSpfDkim')}">{$lang->cmd_advanced_mailer_spf_dkim_setting}</a></li>
|
||||
<li class="x_active"|cond="$act == 'dispAdvanced_mailerAdminMailTest'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminMailTest')}">{$lang->cmd_advanced_mailer_mail_test}</a></li>
|
||||
<li class="x_active"|cond="$act == 'dispAdvanced_mailerAdminMailLog'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminMailLog')}">{$lang->cmd_advanced_mailer_log_mail}</a></li>
|
||||
<li class="x_active"|cond="$act == 'dispAdvanced_mailerAdminMailErrors'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminMailErrors')}">{$lang->cmd_advanced_mailer_log_mail_errors}</a></li>
|
||||
<li class="x_active"|cond="$act == 'dispAdvanced_mailerAdminSMSTest'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminSMSTest')}">{$lang->cmd_advanced_mailer_sms_test}</a></li>
|
||||
<li class="x_active"|cond="$act == 'dispAdvanced_mailerAdminSMSLog'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminSMSLog')}">{$lang->cmd_advanced_mailer_log_sms}</a></li>
|
||||
<li class="x_active"|cond="$act == 'dispAdvanced_mailerAdminSMSErrors'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminSMSErrors')}">{$lang->cmd_advanced_mailer_log_sms_errors}</a></li>
|
||||
<li class="x_active"|cond="$act == 'dispAdvanced_mailerAdminPushTest'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminPushTest')}">{$lang->cmd_advanced_mailer_push_test}</a></li>
|
||||
<li class="x_active"|cond="$act == 'dispAdvanced_mailerAdminPushLog'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminPushLog')}">{$lang->cmd_advanced_mailer_log_push}</a></li>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,15 @@
|
|||
|
||||
<table id="advanced_mailer_log" class="x_table x_table-striped x_table-hover">
|
||||
<caption>
|
||||
<strong>Total: {number_format($total_count)}, Page: {number_format($page)}/{number_format($total_page)}</strong>
|
||||
<div style="float: left">
|
||||
<a href="{getUrl('status', null)}" class="active"|cond="!$status">{$lang->all}</a> <i>|</i>
|
||||
<a href="{getUrl('status', 'success')}" class="active"|cond="$status == 'success'">{$lang->cmd_advanced_mailer_status_success}</a> <i>|</i>
|
||||
<a href="{getUrl('status', 'error')}" class="active"|cond="$status == 'error'">{$lang->cmd_advanced_mailer_status_error}</a>
|
||||
</div>
|
||||
<div style="float: right">
|
||||
<strong>Total: {number_format($total_count)}, Page: {number_format($page)}/{number_format($total_page)}</strong>
|
||||
</div>
|
||||
<div class="clear: both"></div>
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,15 @@
|
|||
|
||||
<table id="advanced_mailer_log" class="x_table x_table-striped x_table-hover">
|
||||
<caption>
|
||||
<strong>Total: {number_format($total_count)}, Page: {number_format($page)}/{number_format($total_page)}</strong>
|
||||
<div style="float: left">
|
||||
<a href="{getUrl('status', null)}" class="active"|cond="!$status">{$lang->all}</a> <i>|</i>
|
||||
<a href="{getUrl('status', 'success')}" class="active"|cond="$status == 'success'">{$lang->cmd_advanced_mailer_status_success}</a> <i>|</i>
|
||||
<a href="{getUrl('status', 'error')}" class="active"|cond="$status == 'error'">{$lang->cmd_advanced_mailer_status_error}</a>
|
||||
</div>
|
||||
<div style="float: right">
|
||||
<strong>Total: {number_format($total_count)}, Page: {number_format($page)}/{number_format($total_page)}</strong>
|
||||
</div>
|
||||
<div class="clear: both"></div>
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue