2010-08-26 Raul Mateos <raulofpandora@gmail.com>

* godmode/reporting/reporting_builder.list_items.php: Added code to
	show text if no items found, instead the table header.

git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3182 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
raulmateos 2010-08-26 14:26:14 +00:00
parent 77a86c6f42
commit bebe19af13
2 changed files with 42 additions and 34 deletions

View File

@ -1,3 +1,8 @@
2010-08-26 Raúl Mateos <raulofpandora@gmail.com>
* godmode/reporting/reporting_builder.list_items.php: Added code to
show text if no items found, instead the table header.
2010-08-25 Sergio Martin <sergio.martin@artica.es>
* pandoradb.sql

View File

@ -122,45 +122,48 @@ if($moduleFilter != 0) {
$items = get_db_all_rows_sql('SELECT * FROM treport_content WHERE ' . $where . ' AND id_report = ' . $idReport . ' ORDER BY `order` LIMIT ' . $offset . ', ' . $config["block_size"]);
$countItems = get_db_sql('SELECT COUNT(id_rc) FROM treport_content WHERE ' . $where . ' AND id_report = ' . $idReport);
$table = null;
if ($items){
$table->width = '100%';
$table->head[0] = '<span title="' . __('Sort') . '">' . __('S.') . '</span>';
$table->head[1] = __('Type');
if (!$filterEnable) {
$table->head[1] .= ' <a href="index.php?sec=greporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=up&field=type&id_report=' . $idReport . $urlFilter . '"><img src="images/sort_up.png" title="' . __('Ascendent') . '" /></a>' .
'<a href="index.php?sec=greporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=down&field=type&id_report=' . $idReport . $urlFilter . '"><img src="images/sort_down.png" title="' . __('Descent') . '" /></a>';
}
$table->head[2] = __('Agent');
if (!$filterEnable) {
$table->head[2] .= ' <a href="index.php?sec=greporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=up&field=agent&id_report=' . $idReport . $urlFilter . '"><img src="images/sort_up.png" title="' . __('Ascendent') . '" /></a>' .
'<a href="index.php?sec=greporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=down&field=agent&id_report=' . $idReport . $urlFilter . '"><img src="images/sort_down.png" title="' . __('Descent') . '" /></a>';
}
$table->head[3] = __('Module');
if (!$filterEnable) {
$table->head[3] .= ' <a href="index.php?sec=greporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=up&field=module&id_report=' . $idReport . $urlFilter . '"><img src="images/sort_up.png" title="' . __('Ascendent') . '" /></a>' .
'<a href="index.php?sec=greporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=down&field=module&id_report=' . $idReport . $urlFilter . '"><img src="images/sort_down.png" title="' . __('Descent') . '" /></a>';
}
$table->head[4] = __('Period');
$table->head[5] = __('Description');
$table->head[6] = '<span title="' . __('Options') . '">' . __('O.') . '</span>';
$table->align[6] = 'center';
} else {
echo '<br><br><div class="nf">'. __('No items') . '</div>';
}
$lastPage = true;
if (((($offset == 0) && ($config["block_size"] > $countItems)) ||
($countItems >= ($config["block_size"] + $offset))) &&
($countItems > $config["block_size"])) {
$lastPage = false;
}
$count = 0;
$rowPair = true;
if ($items === false) {
$items = array();
}
$table = null;
$table->width = '100%';
$table->head[0] = '<span title="' . __('Sort') . '">' . __('S.') . '</span>';
$table->head[1] = __('Type');
if (!$filterEnable) {
$table->head[1] .= ' <a href="index.php?sec=greporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=up&field=type&id_report=' . $idReport . $urlFilter . '"><img src="images/sort_up.png" title="' . __('Ascendent') . '" /></a>' .
'<a href="index.php?sec=greporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=down&field=type&id_report=' . $idReport . $urlFilter . '"><img src="images/sort_down.png" title="' . __('Descent') . '" /></a>';
}
$table->head[2] = __('Agent');
if (!$filterEnable) {
$table->head[2] .= ' <a href="index.php?sec=greporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=up&field=agent&id_report=' . $idReport . $urlFilter . '"><img src="images/sort_up.png" title="' . __('Ascendent') . '" /></a>' .
'<a href="index.php?sec=greporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=down&field=agent&id_report=' . $idReport . $urlFilter . '"><img src="images/sort_down.png" title="' . __('Descent') . '" /></a>';
}
$table->head[3] = __('Module');
if (!$filterEnable) {
$table->head[3] .= ' <a href="index.php?sec=greporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=up&field=module&id_report=' . $idReport . $urlFilter . '"><img src="images/sort_up.png" title="' . __('Ascendent') . '" /></a>' .
'<a href="index.php?sec=greporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=down&field=module&id_report=' . $idReport . $urlFilter . '"><img src="images/sort_down.png" title="' . __('Descent') . '" /></a>';
}
$table->head[4] = __('Period');
$table->head[5] = __('Description');
$table->head[6] = '<span title="' . __('Options') . '">' . __('O.') . '</span>';
$table->align[6] = 'center';
$lastPage = true;
if (((($offset == 0) && ($config["block_size"] > $countItems)) ||
($countItems >= ($config["block_size"] + $offset))) &&
($countItems > $config["block_size"])) {
$lastPage = false;
}
$count = 0;
$rowPair = true;
foreach ($items as $item) {
if ($rowPair)
$table->rowclass[$count] = 'rowPair';