From: <luc...@us...> - 2014-11-07 22:09:40
|
Revision: 12830 http://sourceforge.net/p/xoops/svn/12830 Author: luciorota Date: 2014-11-07 22:09:33 +0000 (Fri, 07 Nov 2014) Log Message: ----------- RC1 + delete multiple reports Modified Paths: -------------- XoopsModules/xhttperror/branches/luciorota/xhttperror/admin/error.php XoopsModules/xhttperror/branches/luciorota/xhttperror/admin/report.php XoopsModules/xhttperror/branches/luciorota/xhttperror/docs/changelog.txt XoopsModules/xhttperror/branches/luciorota/xhttperror/language/english/common.php XoopsModules/xhttperror/branches/luciorota/xhttperror/templates/admin/xhttperror_admin_errors_list.tpl XoopsModules/xhttperror/branches/luciorota/xhttperror/templates/admin/xhttperror_admin_reports_list.tpl XoopsModules/xhttperror/branches/luciorota/xhttperror/xoops_version.php Modified: XoopsModules/xhttperror/branches/luciorota/xhttperror/admin/error.php =================================================================== --- XoopsModules/xhttperror/branches/luciorota/xhttperror/admin/error.php 2014-11-03 18:36:48 UTC (rev 12829) +++ XoopsModules/xhttperror/branches/luciorota/xhttperror/admin/error.php 2014-11-07 22:09:33 UTC (rev 12830) @@ -78,7 +78,7 @@ } $error_id = XhttperrorRequest::getInt('error_id', 0, 'POST'); $isNewError = ($error_id == 0) ? true : false; - $errorObj = $module_skeleton->getHandler('error')->get($error_id); + $errorObj = $xhttperror->getHandler('error')->get($error_id); // Check statuscode if (isset($_REQUEST['error_statuscode'])) { $criteria = new CriteriaCompo(); Modified: XoopsModules/xhttperror/branches/luciorota/xhttperror/admin/report.php =================================================================== --- XoopsModules/xhttperror/branches/luciorota/xhttperror/admin/report.php 2014-11-03 18:36:48 UTC (rev 12829) +++ XoopsModules/xhttperror/branches/luciorota/xhttperror/admin/report.php 2014-11-07 22:09:33 UTC (rev 12830) @@ -58,6 +58,38 @@ include __DIR__ . '/admin_footer.php'; break; + case 'apply_actions': + $action = XhttperrorRequest::getString('actions_action'); + $report_ids = XhttperrorRequest::getArray('report_ids', unserialize(XhttperrorRequest::getString('serialize_report_ids'))); + $reportCriteria = new Criteria('report_id', '(' . implode(',', $report_ids) . ')', 'IN'); + switch ($action) { + case 'delete_reports': + if (XhttperrorRequest::getBool('ok', false, 'POST') == true) { + // delete subscriber (subscr), subscriptions (catsubscrs) and mailinglist + if ($xhttperror->getHandler('report')->deleteAll($reportCriteria, true, true)) { + redirect_header($currentFile, 3, _CO_XHTTPERROR_ERRORS_DELETED); + } else { + // error + redirect_header($currentFile, 3, _CO_XHTTPERROR_ERROR_DELETEREPORTS); + exit(); + } + } else { + xoops_cp_header(); + xoops_confirm( + array('ok' => true, 'op' => 'apply_actions', 'actions_action' => $action, 'serialize_report_ids' => serialize($report_ids)), + $_SERVER['REQUEST_URI'], + _CO_XHTTPERROR_ERRORS_DELETE_AREUSURE, + _DELETE + ); + xoops_cp_footer(); + } + break; + default: + // NOP + break; + } + break; + case 'delete_report' : $report_id = XhttperrorRequest::getInt('report_id', 0); $reportObj = $xhttperror->getHandler('report')->get($report_id); Modified: XoopsModules/xhttperror/branches/luciorota/xhttperror/docs/changelog.txt =================================================================== --- XoopsModules/xhttperror/branches/luciorota/xhttperror/docs/changelog.txt 2014-11-03 18:36:48 UTC (rev 12829) +++ XoopsModules/xhttperror/branches/luciorota/xhttperror/docs/changelog.txt 2014-11-07 22:09:33 UTC (rev 12830) @@ -6,8 +6,9 @@ ! Bug fix. o General comment. -version 1.01 (Released: 2014/10/24) +version 1.01 (Released: 2014/11/07) =================================== ++ delete multiple reports. o Upgraded to Xoops 2.5.7 coding standard. o Refactory all language definitions ! store wrong requested uri in reports (REDIRECT_URL, REDIRECT_QUERY_STRING) Modified: XoopsModules/xhttperror/branches/luciorota/xhttperror/language/english/common.php =================================================================== --- XoopsModules/xhttperror/branches/luciorota/xhttperror/language/english/common.php 2014-11-03 18:36:48 UTC (rev 12829) +++ XoopsModules/xhttperror/branches/luciorota/xhttperror/language/english/common.php 2014-11-07 22:09:33 UTC (rev 12830) @@ -10,7 +10,9 @@ // define('_CO_XHTTPERROR_ERROR_STORED', "Error code saved"); define('_CO_XHTTPERROR_ERROR_DELETED', "Error code deleted"); +define('_CO_XHTTPERROR_ERRORS_DELETED', "Error code deleted"); define('_CO_XHTTPERROR_ERROR_DELETE_AREUSURE', "Warning: are you sure to delete this error code?"); +define('_CO_XHTTPERROR_ERRORS_DELETE_AREUSURE', "Warning: are you sure to delete this error codes?"); define('_CO_XHTTPERROR_REPORT_STORED', "Report saved"); define('_CO_XHTTPERROR_REPORT_DELETED', "Report deleted"); define('_CO_XHTTPERROR_REPORT_DELETE_AREUSURE', "Warning: are you sure to delete this report?"); @@ -21,6 +23,7 @@ // errors define('_CO_XHTTPERROR_ERROR_NOERROR', "Error: non-existent error code"); define('_CO_XHTTPERROR_ERROR_NOREPORT', "Error: non-existent report"); +define('_CO_XHTTPERROR_ERROR_DELETEREPORTS', "Error: reports not deleted"); @@ -30,6 +33,7 @@ define('_CO_XHTTPERROR_BUTTON_EDIT', "Edit"); define('_CO_XHTTPERROR_BUTTON_ADD', "Add"); define('_CO_XHTTPERROR_BUTTON_DELETE', "Delete"); +define('_CO_XHTTPERROR_BUTTON_DELETE_SELECTED', "Delete selected"); define('_CO_XHTTPERROR_BUTTON_FILTER', "Filter"); define('_CO_XHTTPERROR_BUTTON_SEARCH', "Search"); define('_CO_XHTTPERROR_BUTTON_REORDER', "Reorder"); Modified: XoopsModules/xhttperror/branches/luciorota/xhttperror/templates/admin/xhttperror_admin_errors_list.tpl =================================================================== --- XoopsModules/xhttperror/branches/luciorota/xhttperror/templates/admin/xhttperror_admin_errors_list.tpl 2014-11-03 18:36:48 UTC (rev 12829) +++ XoopsModules/xhttperror/branches/luciorota/xhttperror/templates/admin/xhttperror_admin_errors_list.tpl 2014-11-07 22:09:33 UTC (rev 12830) @@ -27,7 +27,7 @@ <a href="error.php?op=delete_error&error_id=<{$error.error_id}>" title="<{$smarty.const._DELETE}>"><{$smarty.const._DELETE}></a> - <a href="../error.php?error=<{$error.error_statuscode}>" title="<{$smarty.const._CO_XHTTPERROR_BUTTON_TEST}>"><{$smarty.const._CO_XHTTPERROR_BUTTON_TEST}></a> + <a href="../index.php?error=<{$error.error_statuscode}>" title="<{$smarty.const._CO_XHTTPERROR_BUTTON_TEST}>"><{$smarty.const._CO_XHTTPERROR_BUTTON_TEST}></a> </td> </tr> <{/foreach}> Modified: XoopsModules/xhttperror/branches/luciorota/xhttperror/templates/admin/xhttperror_admin_reports_list.tpl =================================================================== --- XoopsModules/xhttperror/branches/luciorota/xhttperror/templates/admin/xhttperror_admin_reports_list.tpl 2014-11-03 18:36:48 UTC (rev 12829) +++ XoopsModules/xhttperror/branches/luciorota/xhttperror/templates/admin/xhttperror_admin_reports_list.tpl 2014-11-07 22:09:33 UTC (rev 12830) @@ -1,9 +1,32 @@ +<script language='JavaScript'> + function toggle(source){ + checkboxes = document.getElementsByName('report_ids[]'); + for (var i = 0, n = checkboxes.length; i < n; i++) { + checkboxes[i].checked = source.checked; + } + togglers = document.getElementsByName('togglers[]'); + for (var i = 0, n = togglers.length; i < n; i++) { + togglers[i].checked = source.checked; + } + } +</script> +<script language='JavaScript'> + function check(source){ + checkboxes = document.getElementsByName('report_ids[]'); + for (var i = 0, n= checkboxes.length; i < n; i++) { + if (checkboxes[i].checked) return true; + } + return false; + } +</script> + <form action="report.php" method="post" id="reportform"> <table> <tr> - <th colspan="9"><{$smarty.const._CO_XHTTPERROR_REPORTS_LIST}></th> + <th colspan="10"><{$smarty.const._CO_XHTTPERROR_REPORTS_LIST}></th> </tr> <tr> + <th class='center'><input type='checkbox' name='togglers[]' title='<{$smarty.const._ALL}>' onClick='toggle(this);'></th> <th><{$smarty.const._AM_XHTTPERROR_REPORT_ID}></th> <th><{$smarty.const._AM_XHTTPERROR_REPORT_USER}></th> <th><{$smarty.const._AM_XHTTPERROR_REPORT_STATUSCODE}></th> @@ -16,6 +39,7 @@ </tr> <{foreach from=$reports item='report'}> <tr class="<{cycle values='odd, even'}>"> + <td class='center'><input type='checkbox' name='report_ids[]' value='<{$report.report_id}>'></td> <td><{$report.report_id}></td> <td><{$report.report_owner_uname}></td> <td><{$report.report_statuscode}></td> @@ -29,6 +53,25 @@ </td> </tr> <{/foreach}> + <tr> + <th class='center'><input type='checkbox' name='togglers[]' title='<{$smarty.const._ALL}>' onClick='toggle(this);'></th> + <th><{$smarty.const._AM_XHTTPERROR_REPORT_ID}></th> + <th><{$smarty.const._AM_XHTTPERROR_REPORT_USER}></th> + <th><{$smarty.const._AM_XHTTPERROR_REPORT_STATUSCODE}></th> + <th><{$smarty.const._AM_XHTTPERROR_REPORT_DATE}></th> + <th><{$smarty.const._AM_XHTTPERROR_REPORT_REFERER}></th> + <th><{$smarty.const._AM_XHTTPERROR_REPORT_USERAGENT}></th> + <th><{$smarty.const._AM_XHTTPERROR_REPORT_REMOTEADDR}></th> + <th><{$smarty.const._AM_XHTTPERROR_REPORT_REQUESTEDURI}></th> + <th><{$smarty.const._CO_XHTTPERROR_ACTIONS}></th> + </tr> + <tr> + <td colspan='10'> + <input id='actions_action' type='hidden' value='delete_reports' name='actions_action'> + <input id='actions_submit' class='formButton' type='submit' title='<{$smarty.const._CO_XHTTPERROR_BUTTON_DELETE_SELECTED}>' value='<{$smarty.const._CO_XHTTPERROR_BUTTON_DELETE_SELECTED}>' name='actions_submit'> + </td> +</tr> +<input id='actions_op' type='hidden' value='apply_actions' name='op'> </table> <{$reports_pagenav}> </form> Modified: XoopsModules/xhttperror/branches/luciorota/xhttperror/xoops_version.php =================================================================== --- XoopsModules/xhttperror/branches/luciorota/xhttperror/xoops_version.php 2014-11-03 18:36:48 UTC (rev 12829) +++ XoopsModules/xhttperror/branches/luciorota/xhttperror/xoops_version.php 2014-11-07 22:09:33 UTC (rev 12830) @@ -40,8 +40,8 @@ include_once XOOPS_ROOT_PATH . '/modules/' . $modversion['dirname'] . '/include/constants.php'; // About -$modversion['module_status'] = 'Beta'; -$modversion['release_date'] = '2014/10/24'; // YYYY/mm/dd +$modversion['module_status'] = 'RC1'; +$modversion['release_date'] = '2014/11/07'; // YYYY/mm/dd $modversion['module_website_url'] = 'http://www.xoops.org/'; $modversion['module_website_name'] = 'XOOPS'; $modversion['min_php'] = '5.3.7'; |