Allow column headers for Excel export (bug #771299).

This commit is contained in:
Michal Čihař
2003-08-05 14:08:23 +00:00
parent 8782f0cef3
commit 0e3f37648f
5 changed files with 15 additions and 3 deletions

View File

@@ -9,6 +9,9 @@ $Source$
* sql.php3: Fixed regular expression.
* libraries/export/latex.php3: Use "table (field)" instead of
"table -> field" when dumping relations into LaTeX (bug #776957).
* libraries/display_export.lib.php3, libraries/export/csv.php3,
libraries/config_import.lib.php3, config.inc.php3: Allow column headers
for Excel export (bug #771299).
2003-08-05 Marc Delisle <lem9@users.sourceforge.net>
* libraries/sqlparser.data.php3: bug 779453, wrong count

View File

@@ -303,6 +303,7 @@ $cfg['Export']['csv_separator'] = ';';
$cfg['Export']['csv_enclosed'] = '&quot;';
$cfg['Export']['csv_escaped'] = '\\';
$cfg['Export']['csv_terminated'] = 'AUTO';
$cfg['Export']['excel_columns'] = FALSE;
$cfg['Export']['excel_null'] = 'NULL';
$cfg['Export']['latex_structure'] = TRUE;

View File

@@ -1134,15 +1134,18 @@ if (!defined('PMA_CONFIG_IMPORT_LIB_INCLUDED')) {
if (!isset($cfg['Export']['remember_file_template'])) {
$cfg['Export']['remember_file_template'] = TRUE;
}
if (!isset($cfg['Export']['csv_columns'])) {
$cfg['Export']['csv_columns'] = FALSE;
}
if (!isset($cfg['Export']['csv_null'])) {
$cfg['Export']['csv_null'] = 'NULL';
}
if (!isset($cfg['Export']['csv_columns'])) {
$cfg['Export']['csv_columns'] = FALSE;
}
if (!isset($cfg['Export']['excel_null'])) {
$cfg['Export']['excel_null'] = 'NULL';
}
if (!isset($cfg['Export']['excel_columns'])) {
$cfg['Export']['excel_columns'] = FALSE;
}
if (!isset($cfg['Export']['latex_null'])) {
$cfg['Export']['latex_null'] = '\textit{NULL}';
}

View File

@@ -300,6 +300,8 @@ if ($cfgRelation['mimework']) {
</td>
</tr>
</table>
<input type="checkbox" name="showexcelnames" value="yes" id="checkbox_dump_showexcelnames" <?php PMA_exportCheckboxCheck('excel_columns'); ?> />
<label for="checkbox_dump_showexcelnames"><?php echo $strPutColNames; ?></label>
</fieldset>
<fieldset id="none_options">

View File

@@ -37,6 +37,9 @@ function PMA_exportHeader() {
$separator = ',';
$enclosed = '"';
$escaped = '"';
if (isset($GLOBALS['showexcelnames']) && $GLOBALS['showexcelnames'] == 'yes') {
$GLOBALS['showcsvnames'] = 'yes';
}
} else {
if (empty($add_character)) {
$add_character = $GLOBALS['crlf'];