Support for exporting selected rows (RFE #927554) [still missing images/button_export.png, waiting for somebody to make it :-)].
This commit is contained in:
@@ -5,6 +5,12 @@ phpMyAdmin - Changelog
|
||||
$Id$
|
||||
$Source$
|
||||
|
||||
2004-04-15 Michal Cihar <michal@cihar.com>
|
||||
* tbl_properties_export.php, tbl_row_delete.php,
|
||||
libraries/display_tbl.lib.php: Support for exporting selected rows (RFE
|
||||
#927554) [still missing images/button_export.png, waiting for somebody
|
||||
to make it :-)].
|
||||
|
||||
2004-04-15 Olivier Mueller <om@omnis.ch>
|
||||
* left.php: RFE #859208, Logout button in left frame
|
||||
|
||||
|
@@ -1805,9 +1805,14 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
|
||||
. '<img src="./images/button_drop.png" title="' . $delete_text . '" alt="' . $delete_text . '" width="11" height="13" />' . (($propicon == 'both') ? ' ' . $delete_text : '') . "\n"
|
||||
. '</button>';
|
||||
|
||||
echo ' <button class="mult_submit" type="submit" name="submit_mult" value="row_export" title="' . $GLOBALS['strExport'] . '">' . "\n"
|
||||
. '<img src="./images/button_export.png" title="' . $GLOBALS['strExport'] . '" alt="' . $GLOBALS['strExport'] . '" width="11" height="13" />' . (($propicon == 'both') ? ' ' . $GLOBALS['strExport'] : '') . "\n"
|
||||
. '</button>';
|
||||
|
||||
} else {
|
||||
echo ' <input type="image" name="submit_mult_edit" value="row_edit" title="' . $GLOBALS['strEdit'] . '" src="./images/button_edit.png" />' . (($propicon == 'both') ? ' ' . $GLOBALS['strEdit'] : '');
|
||||
echo ' <input type="image" name="submit_mult" value="row_delete" title="' . $delete_text . '" src="./images/button_drop.png" />' . (($propicon == 'both') ? ' ' . $delete_text : '');
|
||||
echo ' <input type="image" name="submit_mult_export" value="row_export" title="' . $GLOBALS['strExport'] . '" src="./images/button_export.png" />' . (($propicon == 'both') ? ' ' . $GLOBALS['strExport'] : '');
|
||||
}
|
||||
echo "\n";
|
||||
} else {
|
||||
|
@@ -41,6 +41,21 @@ if (isset($sql_query)) {
|
||||
if (!empty($analyzed_sql[0]['where_clause'])) {
|
||||
$sql_query .= ' WHERE ' . $analyzed_sql[0]['where_clause'];
|
||||
}
|
||||
if (isset($primary_key)) {
|
||||
if (empty($analyzed_sql[0]['where_clause'])) {
|
||||
$sql_query .= ' WHERE ';
|
||||
} else {
|
||||
$sql_query .= ' AND ( ';
|
||||
}
|
||||
$conj = '';
|
||||
foreach($primary_key AS $i => $key) {
|
||||
$sql_query .= $conj . '( ' . $key . ' ) ';
|
||||
$conj = 'OR ';
|
||||
}
|
||||
if (!empty($analyzed_sql[0]['where_clause'])) {
|
||||
$sql_query .= ' ) ';
|
||||
}
|
||||
}
|
||||
if (!empty($analyzed_sql[0]['group_by_clause'])) {
|
||||
$sql_query .= ' GROUP BY ' . $analyzed_sql[0]['group_by_clause'];
|
||||
}
|
||||
|
@@ -14,6 +14,8 @@ if (isset($submit_mult_x)) {
|
||||
$submit_mult = 'row_delete';
|
||||
} elseif (isset($submit_mult_edit_x)) {
|
||||
$submit_mult = 'row_edit';
|
||||
} elseif (isset($submit_mult_export_x)) {
|
||||
$submit_mult = 'row_export';
|
||||
}
|
||||
|
||||
// garvin: If the 'Ask for confirmation' button was pressed, this can only come from 'delete' mode,
|
||||
@@ -26,7 +28,7 @@ if ($submit_mult == 'row_edit') {
|
||||
$js_to_run = 'tbl_change.js';
|
||||
}
|
||||
|
||||
if ($submit_mult == 'row_delete') {
|
||||
if ($submit_mult == 'row_delete' || $submit_mult == 'row_export') {
|
||||
$js_to_run = 'functions.js';
|
||||
}
|
||||
|
||||
@@ -47,6 +49,23 @@ if (!empty($submit_mult)) {
|
||||
}
|
||||
break;
|
||||
|
||||
case 'row_export':
|
||||
if (isset($rows_to_delete) && is_array($rows_to_delete)) {
|
||||
// Needed to allow SQL export
|
||||
$single_table = TRUE;
|
||||
|
||||
$primary_key = array();
|
||||
$sql_query = urldecode($sql_query);
|
||||
// garvin: As we got the fields to be edited from the 'rows_to_delete' checkbox, we use the index of it as the
|
||||
// indicating primary key. Then we built the array which is used for the tbl_change.php script.
|
||||
foreach($rows_to_delete AS $i_primary_key => $del_query) {
|
||||
$primary_key[] = urldecode($i_primary_key);
|
||||
}
|
||||
|
||||
include './tbl_properties_export.php';
|
||||
}
|
||||
break;
|
||||
|
||||
case 'row_delete':
|
||||
default:
|
||||
if ((isset($rows_to_delete) && is_array($rows_to_delete))
|
||||
|
Reference in New Issue
Block a user