2010-12-20 Miguel de Dios <miguel.dedios@artica.es>

* godmode/reporting/reporting_builder.php: fixed the action to sort up or
	down the items in the report, and improvement the order number and now
	start to each new report.
	
	Fixes: #3140930



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3672 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2010-12-20 20:45:58 +00:00
parent 2e17e34d13
commit 367f550a5c
2 changed files with 18 additions and 2 deletions

View File

@ -1,3 +1,11 @@
2010-12-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/reporting/reporting_builder.php: fixed the action to sort up or
down the items in the report, and improvement the order number and now
start to each new report.
Fixes: #3140930
2010-12-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/reporting/reporting_builder.item_editor.php: fixed the copy &

View File

@ -246,7 +246,14 @@ switch ($action) {
else {
$idItem = $result;
$max = get_db_all_rows_sql('select max(`order`) as max from treport_content;'); $max = $max[0]['max'];
$max = get_db_all_rows_sql('SELECT max(`order`) AS max
FROM treport_content WHERE id_report = ' . $idReport . ';');
if ($max === false) {
$max = 0;
}
else {
$max = $max[0]['max'];
}
process_sql_update('treport_content', array('`order`' => $max + 1), array('id_rc' => $idItem));
$resultOperationDB = true;
@ -368,7 +375,8 @@ switch ($action) {
}
process_sql_begin();
$resultOperationDB = process_sql_update('treport_content', array('`order`' => $oldOrder), array('`order`' => $newOrder, 'id_rc' => $idReport));
$resultOperationDB = process_sql_update('treport_content',
array('`order`' => $oldOrder), array('`order`' => $newOrder, 'id_report' => $idReport));
if ($resultOperationDB !== false) {
$resultOperationDB = process_sql_update('treport_content', array('`order`' => $newOrder), array('id_rc' => $idItem));
if ($resultOperationDB !== false) {