17 require_once SQ_SYSTEM_ROOT.
'/core/assets/system/simple_report/simple_report.inc';
43 parent::__construct($assetid);
67 $generated = $report[
'generated'];
68 $report = $report[
'report_data'];
70 $am = $GLOBALS[
'SQ_SYSTEM']->am;
73 <td class="sq-backend-table-cell" style="width: 10px">
76 <td class="sq-backend-table-cell">
79 <td class="sq-backend-table-cell" align="right">
85 foreach ($report as $asset_info) {
86 $rows_string .= sprintf($row_format, $am->getAssetIconURL($asset_info[
'type_code']), $asset_info[
'name'], $asset_info[
'assetid'], date(
'd M Y, H:i:s', strtotime($asset_info[
'updated'])));
89 $table_format =
'<table class="sq-backend-table">
91 <th class="sq-backend-table-header" colspan="2">Name</th>
92 <th class="sq-backend-table-header" align="right">Last Updated</th>
97 $table = sprintf($table_format, $rows_string);
101 if (empty($rows_string)) {
102 $table =
'<table class="sq-backend-table">
104 <td class="sq-backend-table-cell">There are currently no assets in the trash</td>
128 $asset_report = Report_Trash_Age::_getOldestAssetsInTrash();
131 'generated' => $today,
132 'report_data' => $asset_report,
149 private static function _getOldestAssetsInTrash()
151 $am = $GLOBALS[
'SQ_SYSTEM']->am;
152 $asset_info = Array();
155 $sql =
'SELECT a.assetid, a.type_code, a.name, a.updated '.
156 'FROM sq_ast_lnk l, sq_ast_lnk_tree t, sq_ast a, sq_ast_typ p '.
157 'WHERE a.type_code = p.type_code AND p.allowed_access != '.MatrixDAL::quote(
'system').
' AND p.instantiable = '.
MatrixDAL::quote(
'1').
' '.
158 'AND t.treeid LIKE '.
159 '(SELECT t.treeid FROM sq_ast_lnk_tree t, sq_ast_lnk l, sq_ast a '.
160 'WHERE l.minorid = a.assetid AND t.linkid = l.linkid AND a.type_code = '.MatrixDAL::quote(
'trash_folder').
')||'.
MatrixDAL::quote(
'%').
' '.
161 'AND l.linkid = t.linkid AND a.assetid = l.minorid AND a.type_code != '.MatrixDAL::quote(
'trash_folder').
' '.