44 if (isset($_GET[
'report_type_code'])) {
45 $report = $_GET[
'report_type_code'];
47 $this->_processReport($o, $report);
48 $this->_paintReport($o, $report);
52 $o->setHeading(translate(
'system_maintenance'), sq_get_icon($o->filesPath(
'/images/icons/header/system_maintenance.png'), 20, 20, translate(
'system_maintenance')));
53 $o->setPageTitle(translate(
'system_maintenance'));
55 $o->openSection(translate(
'reports_and_maintenance_tasks'));
57 $reports = $GLOBALS[
'SQ_SYSTEM']->am->getTypeDescendants(
'simple_report');
59 if (count($reports) > 0) {
60 $backend_url = $backend->getBackendUrl(
'main');
63 <script type=
"text/javascript" src=
"<?php echo sq_web_path('lib'); ?>/js/JsHttpConnector.js"></script>
64 <script type=
"text/javascript">
65 var selectedReport =
'';
67 function toggleDiv(
id)
69 var d = document.getElementById(
id);
72 if (d.style.display ==
"none") {
76 d.style.display = disp;
80 function regenCallback(responseText)
82 document.getElementById(selectedReport).innerHTML = responseText;
83 bg = document.getElementById(selectedReport+
"_regen").style.background;
84 document.getElementById(selectedReport+
"_regen").style.background =
"#e8ddeb";
85 window.setTimeout(
'document.getElementById(selectedReport+"_regen").style.background = bg;', 1500);
89 function regen(report)
91 selectedReport = report;
92 var regenElement = document.getElementById(report+
"_regen");
93 var reportElement = document.getElementById(report+
"_report");
94 reportElement.style.opacity =
"0.4";
95 reportElement.style.filter =
"alpha(opacity=40)";
96 regenElement.innerHTML =
"Regenerating...";
97 JsHttpConnector.submitRequest(
'<?php echo $backend_url; ?>&backend_section=sys_maintenance&report_type_code='+report, regenCallback);
101 <table
class=
"sq-backend-table">
103 <th><?php echo translate(
'name'); ?></th>
104 <th><?php echo translate(
'description'); ?></th>
109 $report_list = Array();
110 foreach ($reports as $report_type_code) {
111 $report_info = $GLOBALS[
'SQ_SYSTEM']->am->getTypeInfo($report_type_code);
112 $report_name = $report_info[
'name'];
113 $report_list[$report_name] = Array(
114 'type_code' => $report_type_code,
115 'description' => $report_info[
'description'],
122 $expand_reports =
'';
123 if (isset($_REQUEST[
'expand'])) $expand_reports = $_REQUEST[
'expand'];
125 foreach ($report_list as $report_name => $report_info) {
128 <td
class=
"sq-backend-table-cell" style=
"background: white;"><a href=
"#<?php echo $report_info['type_code']; ?>" onclick=
"toggleDiv('<?php echo $report_info['type_code']; ?>');"><?php echo $report_name; ?></a></td>
129 <td
class=
"sq-backend-table-cell" style=
"background: white;"><?php echo $report_info[
'description']; ?>
130 <div
id=
"<?php echo $report_info['type_code']; ?>" style=
"display: <?php echo (($report_info['type_code'] == 'report_'.$expand_reports)?'block':'none'); ?>">
133 $this->_paintReport($o, $report_info[
'type_code']);
145 echo translate(
'general_reports_not_installed');
162 private function _paintReport(&$o, $report_type_code)
164 $am =& $GLOBALS[
'SQ_SYSTEM']->am;
166 if ($am->installed($report_type_code)) {
167 $am->includeAsset($report_type_code);
170 <div
id=
"<?php echo $report_type_code; ?>_report">
172 call_user_func_array(Array($report_type_code,
'paintReport'), Array($o, $report_type_code));
191 private function _processReport(&$o, $report_type_code)
193 $am =& $GLOBALS[
'SQ_SYSTEM']->am;
195 if ($am->installed($report_type_code)) {
196 $am->includeAsset($report_type_code);
197 call_user_func_array(Array($report_type_code,
'processReport'), Array($o, $report_type_code));