From 3b42848fda9182e09319b77347a8f5ca2cf90c15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Chapeaux?= Date: Thu, 25 Oct 2001 21:35:26 +0000 Subject: [PATCH] merged patch #470575 (Inserting rows in loop) thanks to Tomas Polak --- ChangeLog | 3 ++ lang/brazilian_portuguese.inc.php3 | 2 + lang/bulgarian-win1251.inc.php3 | 2 + lang/catala.inc.php3 | 2 + lang/chinese_big5.inc.php3 | 2 + lang/chinese_gb.inc.php3 | 2 + lang/czech-iso.inc.php3 | 2 + lang/czech-win1250.inc.php3 | 4 ++ lang/danish.inc.php3 | 2 + lang/dutch.inc.php3 | 2 + lang/english.inc.php3 | 2 + lang/finnish.inc.php3 | 2 + lang/french.inc.php3 | 2 + lang/galician.inc.php3 | 2 + lang/german.inc.php3 | 2 + lang/greek.inc.php3 | 2 + lang/italian.inc.php3 | 2 + lang/japanese.inc.php3 | 2 + lang/korean.inc.php3 | 2 + lang/norwegian.inc.php3 | 2 + lang/polish.inc.php3 | 2 + lang/portuguese.inc.php3 | 2 + lang/romanian.inc.php3 | 2 + lang/russian-koi8.inc.php3 | 4 ++ lang/russian-win1251.inc.php3 | 4 ++ lang/slovak-iso.inc.php3 | 2 + lang/spanish.inc.php3 | 2 + lang/swedish.inc.php3 | 2 + lang/thai.inc.php3 | 2 + lang/turkish.inc.php3 | 6 ++- tbl_change.php3 | 76 ++++++++++++++++++++++++++---- tbl_replace.php3 | 21 +++++++-- 32 files changed, 154 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7a01f3996..61d4a80a1 100755 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,9 @@ $Source$ * config.inc.php3, line 159; Documentation.html, lines 646-652; libraries/display_tbl.lib.php3, line 607: merged patch #472575 (indicator in table rows) thanks to Darklord . + * tbl_change.php3; tbl_replace.php3; lang/*: merged patch #470575 + (Inserting rows in loop) thanks to + Tomas Polak . * libraries/defines.inc.php3, line 20: starting 2.2.2-dev. version. 2001-10-24 Robin Johnson diff --git a/lang/brazilian_portuguese.inc.php3 b/lang/brazilian_portuguese.inc.php3 index 73732c5b1..54cff76c3 100644 --- a/lang/brazilian_portuguese.inc.php3 +++ b/lang/brazilian_portuguese.inc.php3 @@ -298,6 +298,8 @@ $strWrongUser = 'Usu $strYes = 'Sim'; // To translate +$strAfterInsertBack = 'Return'; +$strAfterInsertNewInsert = 'Insert a new record'; $strCopyTable = 'Copy table to (database.table):'; $strDatabaseHasBeenDropped = 'Database %s has been dropped.'; //to translate $strFlushTable = 'Flush the table ("FLUSH")'; diff --git a/lang/bulgarian-win1251.inc.php3 b/lang/bulgarian-win1251.inc.php3 index bbf977556..b863eb246 100644 --- a/lang/bulgarian-win1251.inc.php3 +++ b/lang/bulgarian-win1251.inc.php3 @@ -309,6 +309,8 @@ $strYes = ' $strZip = '"ôîðìàò zip"'; // To translate +$strAfterInsertBack = 'Return'; +$strAfterInsertNewInsert = 'Insert a new record'; $strExtendedInserts = 'Extended inserts'; $strFlushTable = 'Flush the table ("FLUSH")'; $strFullText = 'Full Texts';//to translate diff --git a/lang/catala.inc.php3 b/lang/catala.inc.php3 index 187c61751..dad49c9ef 100644 --- a/lang/catala.inc.php3 +++ b/lang/catala.inc.php3 @@ -264,6 +264,8 @@ $strZip = '"comprimit amb zip"'; // To translate $strAffectedRows = 'Affected rows:'; +$strAfterInsertBack = 'Return'; +$strAfterInsertNewInsert = 'Insert a new record'; $strAnIndex = 'An index has been added on %s';//to translate $strAPrimaryKey = 'A primary key has been added on %s';//to translate $strCopyTable = 'Copy table to (database.table):'; diff --git a/lang/chinese_big5.inc.php3 b/lang/chinese_big5.inc.php3 index f847e4a39..9ba65237b 100644 --- a/lang/chinese_big5.inc.php3 +++ b/lang/chinese_big5.inc.php3 @@ -263,6 +263,8 @@ $strYes = ' // To translate $strAffectedRows = ' Rows affected: '; //to translate +$strAfterInsertBack = 'Return'; +$strAfterInsertNewInsert = 'Insert a new record'; $strAnIndex = 'An index has been added on %s';//to translate $strAPrimaryKey = 'A primary key has been added on %s';//to translate $strCopyTable = 'Copy table to (database.table):'; diff --git a/lang/chinese_gb.inc.php3 b/lang/chinese_gb.inc.php3 index 876477450..5d7820278 100644 --- a/lang/chinese_gb.inc.php3 +++ b/lang/chinese_gb.inc.php3 @@ -265,6 +265,8 @@ $strZip = '"zipped"'; //to translate // To translate $strAffectedRows = 'Affected rows:'; +$strAfterInsertBack = 'Return'; +$strAfterInsertNewInsert = 'Insert a new record'; $strAnIndex = 'An index has been added on %s';//to translate $strAPrimaryKey = 'A primary key has been added on %s';//to translate $strCopyTable = 'Copy table to (database.table):'; diff --git a/lang/czech-iso.inc.php3 b/lang/czech-iso.inc.php3 index c6ed4b223..eb0355857 100644 --- a/lang/czech-iso.inc.php3 +++ b/lang/czech-iso.inc.php3 @@ -319,4 +319,6 @@ $strYes = 'Ano'; $strZip = '"zazipováno"'; // To translate +$strAfterInsertBack = 'Return'; +$strAfterInsertNewInsert = 'Insert a new record'; ?> diff --git a/lang/czech-win1250.inc.php3 b/lang/czech-win1250.inc.php3 index 4ed066dbf..d9dae42d5 100644 --- a/lang/czech-win1250.inc.php3 +++ b/lang/czech-win1250.inc.php3 @@ -319,4 +319,8 @@ $strWrongUser = ' $strYes = 'Ano'; $strZip = '"zazipováno"'; + +// To translate +$strAfterInsertBack = 'Return'; +$strAfterInsertNewInsert = 'Insert a new record'; ?> diff --git a/lang/danish.inc.php3 b/lang/danish.inc.php3 index 2475ed815..2f280ac79 100644 --- a/lang/danish.inc.php3 +++ b/lang/danish.inc.php3 @@ -315,6 +315,8 @@ $strYes = 'Ja'; $strZip = '"zipped"'; //to translate // To translate +$strAfterInsertBack = 'Return'; +$strAfterInsertNewInsert = 'Insert a new record'; $strFlushTable = 'Flush the table ("FLUSH")'; $strNoFrames = 'phpMyAdmin is more friendly with a frames-capable browser.'; $strTableHasBeenFlushed = 'Table %s has been flushed'; diff --git a/lang/dutch.inc.php3 b/lang/dutch.inc.php3 index d2554f232..4f539bf9c 100644 --- a/lang/dutch.inc.php3 +++ b/lang/dutch.inc.php3 @@ -280,6 +280,8 @@ $strYes = 'Ja'; // To translate $strAffectedRows = 'Affected rows:'; //to translate +$strAfterInsertBack = 'Return'; +$strAfterInsertNewInsert = 'Insert a new record'; $strAnIndex = 'An index has been added on %s';//to translate $strAPrimaryKey = 'A primary key has been added on %s';//to translate $strBzip = '"bzipped"'; //to translate diff --git a/lang/english.inc.php3 b/lang/english.inc.php3 index 1a339a918..bdf703b04 100644 --- a/lang/english.inc.php3 +++ b/lang/english.inc.php3 @@ -27,6 +27,8 @@ $strAddUser = 'Add a new User'; $strAddUserMessage = 'You have added a new user.'; $strAffectedRows = 'Affected rows:'; $strAfter = 'After'; +$strAfterInsertBack = 'Return'; +$strAfterInsertNewInsert = 'Insert a new record'; $strAll = 'All'; $strAlterOrderBy = 'Alter table order by'; $strAnalyzeTable = 'Analyze table'; diff --git a/lang/finnish.inc.php3 b/lang/finnish.inc.php3 index 1fe2e867e..95242d8b8 100644 --- a/lang/finnish.inc.php3 +++ b/lang/finnish.inc.php3 @@ -321,5 +321,7 @@ $strYes = 'Kyll $strZip = '"zip-pakattu"'; // To translate +$strAfterInsertBack = 'Return'; +$strAfterInsertNewInsert = 'Insert a new record'; $strOverhead = 'Overhead'; ?> diff --git a/lang/french.inc.php3 b/lang/french.inc.php3 index 79e3922b2..efa42f8fd 100644 --- a/lang/french.inc.php3 +++ b/lang/french.inc.php3 @@ -27,6 +27,8 @@ $strAddUser = 'Ajouter un utilisateur'; $strAddUserMessage = 'Vous avez ajouté un utilisateur'; $strAffectedRows = 'Nombre d\'enregistrements affectés :'; $strAfter = 'Après'; +$strAfterInsertBack = 'Retourner à la page précédente'; +$strAfterInsertNewInsert = 'Insérer un nouvel enregistrement'; $strAll = 'Tout'; $strAlterOrderBy = 'Ordonner la table par'; $strAnalyzeTable = 'Analyser la table'; diff --git a/lang/galician.inc.php3 b/lang/galician.inc.php3 index 373f252d5..3d17356f7 100644 --- a/lang/galician.inc.php3 +++ b/lang/galician.inc.php3 @@ -315,6 +315,8 @@ $strYes = 'Si'; $strZip = 'comprimido no formato "zipped"'; // To translate +$strAfterInsertBack = 'Return'; +$strAfterInsertNewInsert = 'Insert a new record'; $strCopyTable = 'Copy table to (database.table):'; $strMoveTable = 'Move table to (database.table):'; $strMoveTableOK = 'Table %s has been moved to %s.'; diff --git a/lang/german.inc.php3 b/lang/german.inc.php3 index d8f9d1781..e2e41d092 100644 --- a/lang/german.inc.php3 +++ b/lang/german.inc.php3 @@ -311,6 +311,8 @@ $strYes = 'Ja'; $strZip = '"Zip komprimiert"'; // To translate +$strAfterInsertBack = 'Return'; +$strAfterInsertNewInsert = 'Insert a new record'; $strFieldHasBeenDropped = 'Field %s has been dropped';//to translate $strFlushTable = 'Flush the table ("FLUSH")'; $strIndexHasBeenDropped = 'Index %s has been dropped';//to translate diff --git a/lang/greek.inc.php3 b/lang/greek.inc.php3 index 6387345b7..1e6d114da 100644 --- a/lang/greek.inc.php3 +++ b/lang/greek.inc.php3 @@ -289,6 +289,8 @@ $strYes = ' $strZip = 'óõìðßåóç «zip»'; // To translate +$strAfterInsertBack = 'Return'; +$strAfterInsertNewInsert = 'Insert a new record'; $strAPrimaryKey = 'A primary key has been added on %s';//to translate $strAnIndex = 'An index has been added on %s';//to translate $strCopyTable = 'Copy table to (database.table):'; diff --git a/lang/italian.inc.php3 b/lang/italian.inc.php3 index 25901e4d2..55b444d86 100644 --- a/lang/italian.inc.php3 +++ b/lang/italian.inc.php3 @@ -321,4 +321,6 @@ $strYes = ' Si '; $strZip = '"compresso con zip"'; // To translate +$strAfterInsertBack = 'Return'; +$strAfterInsertNewInsert = 'Insert a new record'; ?> diff --git a/lang/japanese.inc.php3 b/lang/japanese.inc.php3 index 9afb49e63..df514f7dc 100644 --- a/lang/japanese.inc.php3 +++ b/lang/japanese.inc.php3 @@ -265,6 +265,8 @@ $strZip = '"zipped"'; //to translate // To translate $strAffectedRows = 'Affected rows:'; +$strAfterInsertBack = 'Return'; +$strAfterInsertNewInsert = 'Insert a new record'; $strAnIndex = 'An index has been added on %s';//to translate $strAPrimaryKey = 'A primary key has been added on %s';//to translate $strCopyTable = 'Copy table to (database.table):'; diff --git a/lang/korean.inc.php3 b/lang/korean.inc.php3 index d234f5ae0..2007de59a 100644 --- a/lang/korean.inc.php3 +++ b/lang/korean.inc.php3 @@ -265,6 +265,8 @@ $strZip = '"zipped"'; //to translate // To translate $strAffectedRows = 'Affected rows:'; +$strAfterInsertBack = 'Return'; +$strAfterInsertNewInsert = 'Insert a new record'; $strAnIndex = 'An index has been added on %s';//to translate $strAPrimaryKey = 'A primary key has been added on %s';//to translate $strCopyTable = 'Copy table to (database.table):'; diff --git a/lang/norwegian.inc.php3 b/lang/norwegian.inc.php3 index 4519f043b..8211f7d14 100644 --- a/lang/norwegian.inc.php3 +++ b/lang/norwegian.inc.php3 @@ -318,4 +318,6 @@ $strYes = 'Ja'; $strZip = '"komprimert (zip)"'; // To translate +$strAfterInsertBack = 'Return'; +$strAfterInsertNewInsert = 'Insert a new record'; ?> diff --git a/lang/polish.inc.php3 b/lang/polish.inc.php3 index f76bc3af1..c68975911 100644 --- a/lang/polish.inc.php3 +++ b/lang/polish.inc.php3 @@ -314,6 +314,8 @@ $strYes = 'Tak'; $strZip = '".zip"'; // To translate +$strAfterInsertBack = 'Return'; +$strAfterInsertNewInsert = 'Insert a new record'; $strCopyTable = 'Copy table to (database.table):'; $strMoveTable = 'Move table to (database.table):'; $strMoveTableOK = 'Table %s has been moved to %s.'; diff --git a/lang/portuguese.inc.php3 b/lang/portuguese.inc.php3 index 75ceba12e..e078df41b 100644 --- a/lang/portuguese.inc.php3 +++ b/lang/portuguese.inc.php3 @@ -265,6 +265,8 @@ $strZip = '"zipped"'; //to translate // To translate $strAffectedRows = 'Affected rows:'; +$strAfterInsertBack = 'Return'; +$strAfterInsertNewInsert = 'Insert a new record'; $strAnIndex = 'An index has been added on %s';//to translate $strAPrimaryKey = 'A primary key has been added on %s';//to translate $strCopyTable = 'Copy table to (database.table):'; diff --git a/lang/romanian.inc.php3 b/lang/romanian.inc.php3 index 606c03bc9..7830d2c5e 100644 --- a/lang/romanian.inc.php3 +++ b/lang/romanian.inc.php3 @@ -313,6 +313,8 @@ $strWithChecked = 'Verificat cu:'; $strYes = 'Da'; // To translate +$strAfterInsertBack = 'Return'; +$strAfterInsertNewInsert = 'Insert a new record'; $strCopyTable = 'Copy table to (database.table):'; $strMoveTable = 'Move table to (database.table):'; $strMoveTableOK = 'Table %s has been moved to %s.'; diff --git a/lang/russian-koi8.inc.php3 b/lang/russian-koi8.inc.php3 index ddc18da43..13a1e964a 100644 --- a/lang/russian-koi8.inc.php3 +++ b/lang/russian-koi8.inc.php3 @@ -317,4 +317,8 @@ $strWrongUser = ' $strYes = 'äÁ'; $strZip = 'ÕÐÁËÏ×ÁÔØ × "zip"'; + +// To translate +$strAfterInsertBack = 'Return'; +$strAfterInsertNewInsert = 'Insert a new record'; ?> diff --git a/lang/russian-win1251.inc.php3 b/lang/russian-win1251.inc.php3 index 8c5b8780d..b990a4fed 100644 --- a/lang/russian-win1251.inc.php3 +++ b/lang/russian-win1251.inc.php3 @@ -317,4 +317,8 @@ $strWrongUser = ' $strYes = 'Äà'; $strZip = 'óïàêîâàòü â "zip"'; + +// To translate +$strAfterInsertBack = 'Return'; +$strAfterInsertNewInsert = 'Insert a new record'; ?> diff --git a/lang/slovak-iso.inc.php3 b/lang/slovak-iso.inc.php3 index 5a3223d49..794c3370a 100644 --- a/lang/slovak-iso.inc.php3 +++ b/lang/slovak-iso.inc.php3 @@ -318,6 +318,8 @@ $strYes = ' $strZip = '"zo zipované"'; // To translate +$strAfterInsertBack = 'Return'; +$strAfterInsertNewInsert = 'Insert a new record'; $strFlushTable = 'Flush the table ("FLUSH")'; $strNoFrames = 'phpMyAdmin is more friendly with a frames-capable browser.'; $strTableHasBeenFlushed = 'Table %s has been flushed'; diff --git a/lang/spanish.inc.php3 b/lang/spanish.inc.php3 index f2d01a232..87e054d77 100644 --- a/lang/spanish.inc.php3 +++ b/lang/spanish.inc.php3 @@ -282,6 +282,8 @@ $strYes = 'Si'; // To translate $strAnIndex = 'An index has been added on %s';//to translate +$strAfterInsertBack = 'Return'; +$strAfterInsertNewInsert = 'Insert a new record'; $strAPrimaryKey = 'A primary key has been added on %s';//to translate $strBzip = '"bzipped"'; //to translate $strCopyTable = 'Copy table to (database.table):'; diff --git a/lang/swedish.inc.php3 b/lang/swedish.inc.php3 index 3cf94fd56..69926616b 100644 --- a/lang/swedish.inc.php3 +++ b/lang/swedish.inc.php3 @@ -319,4 +319,6 @@ $strYes = 'Ja'; $strZip = '"zippad"'; // To translate +$strAfterInsertBack = 'Return'; +$strAfterInsertNewInsert = 'Insert a new record'; ?> diff --git a/lang/thai.inc.php3 b/lang/thai.inc.php3 index 308a46bd7..dd391e46e 100644 --- a/lang/thai.inc.php3 +++ b/lang/thai.inc.php3 @@ -265,6 +265,8 @@ $strZip = '"zipped"'; //to translate // To translate $strAffectedRows = 'Affected rows:'; +$strAfterInsertBack = 'Return'; +$strAfterInsertNewInsert = 'Insert a new record'; $strAnIndex = 'An index has been added on %s';//to translate $strAPrimaryKey = 'A primary key has been added on %s';//to translate $strCopyTable = 'Copy table to (database.table):'; diff --git a/lang/turkish.inc.php3 b/lang/turkish.inc.php3 index 49a5946f2..8b65cdb67 100644 --- a/lang/turkish.inc.php3 +++ b/lang/turkish.inc.php3 @@ -177,7 +177,7 @@ $strNext = 'Sonraki'; $strNo = 'Hayýr'; $strNoDatabases = 'Veritabaný yok'; $strNoDropDatabases = '"DROP DATABASE" cümlesi burada kullanýlamaz.'; -$strNoFrames = 'phpMyAdmin frame destekli bir tarayıcı ile daha iyi çalışmaktadır...'; +$strNoFrames = 'phpMyAdmin frame destekli bir tarayıcı ile daha iyi çalışmaktadır...'; $strNoModification = 'Deðiþiklik yok'; $strNoPassword = 'Þifre yok'; $strNoPrivileges = 'Ayrýcalýk yok'; @@ -317,4 +317,8 @@ $strWrongUser = 'Hatal $strYes = 'Evet'; $strZip = '"ziplenmiþ"'; + +// To translate +$strAfterInsertBack = 'Return'; +$strAfterInsertNewInsert = 'Insert a new record'; ?> diff --git a/tbl_change.php3 b/tbl_change.php3 index d1662ebfb..a06f4966b 100755 --- a/tbl_change.php3 +++ b/tbl_change.php3 @@ -6,7 +6,39 @@ * Get the variables sent or posted to this script and displays the header */ require('./libraries/grab_globals.lib.php3'); -require('./header.inc.php3'); +include('./header.inc.php3'); +// Displays the query submitted and its result +if (!empty($message)) { + if (isset($goto)) { + $goto_cpy = $goto; + $goto = 'tbl_properties.php3' + . '?lang=' . $lang + . '&server=' . $server + . '&db=' . urlencode($db) + . '&table=' . urlencode($table) + . '&$show_query=y' + . '&sql_query=' . urlencode($disp_query); + unset($goto); + } else { + $show_query = 'y'; + } + if (isset($sql_query)) { + $sql_query_cpy = $sql_query; + unset($sql_query); + } + if (isset($disp_query)) { + $sql_query = (get_magic_quotes_gpc() ? stripslashes($disp_query) : $disp_query); + } + show_message($message); + if (isset($goto_cpy)) { + $goto = $goto_cpy; + unset($goto_cpy); + } + if (isset($sql_query_cpy)) { + $sql_query = $sql_query_cpy; + unset($sql_query_cpy); + } +} if (get_magic_quotes_gpc()) { if (!empty($sql_query)) { $sql_query = stripslashes($sql_query); @@ -14,7 +46,7 @@ if (get_magic_quotes_gpc()) { if (!empty($primary_key)) { $primary_key = stripslashes($primary_key); } -} +} // end if /** @@ -62,10 +94,10 @@ if (isset($primary_key)) { } $sql_query = $local_query; show_message($strEmptyResultSet); - $goto = $goto_cpy; + $goto = $goto_cpy; unset($goto_cpy); if (isset($sql_query_cpy)) { - $sql_query = $sql_query_cpy; + $sql_query = $sql_query_cpy; unset($sql_query_cpy); } } // end if (no record returned) @@ -411,17 +443,45 @@ echo "\n"; } // end for ?> -

+
- + + + + + + + + + + +
- +
+       
+ + + +
+    -- --    + +
+       
+ +
+ +
+ diff --git a/tbl_replace.php3 b/tbl_replace.php3 index 61b94e14d..050ef56f8 100755 --- a/tbl_replace.php3 +++ b/tbl_replace.php3 @@ -16,7 +16,17 @@ require('./libraries/common.lib.php3'); if (isset($sql_query)) { $sql_query = urldecode($sql_query); } -if ($goto == 'sql.php3') { +if (isset($after_insert) && $after_insert == 'new_insert') { + $goto = 'tbl_change.php3' + . '?lang=' . $lang + . '&server=' . $server + . '&db=' . urlencode($db) + . '&table=' . urlencode($table) + . '&goto=' . urlencode($goto) + . (empty($primary_key) ? '' : '&primary_key=' . $primary_key) + . '&pos=' . $pos + . (empty($sql_query) ? '' : '&sql_query=' . urlencode($sql_query)); +} else if ($goto == 'sql.php3') { $goto = 'sql.php3?' . 'lang=' . $lang . '&server=' . $server @@ -116,13 +126,13 @@ if (isset($primary_key) && ($submit_type != $strInsertAsNewRow)) { } // No change -> move back to the calling script else { + $message = $strNoModification; if (file_exists('./' . $goto)) { $js_to_run = 'functions.js'; include('./header.inc.php3'); - $message = $strNoModification; include('./' . ereg_replace('\.\.*', '.', $goto)); } else { - header('Location: ' . $cfgPmaAbsoluteUri . $goto . '&message=' . $strNoModification); + header('Location: ' . $cfgPmaAbsoluteUri . $goto . '&message=' . urlencode($message)); } exit(); } @@ -182,7 +192,7 @@ else { && (ereg('^(NOW|CURDATE|CURTIME|UNIX_TIMESTAMP|RAND|USER|LAST_INSERT_ID)$', $funcs[$encoded_key]))) { $valuelist .= $funcs[$encoded_key] . '(), '; } else { - $valuelist .= $funcs[$encoded_key] . "($val), "; + $valuelist .= $funcs[$encoded_key] . '(' . $val . '), '; } } // end while @@ -220,7 +230,8 @@ if (!$result) { include('./header.inc.php3'); include('./' . ereg_replace('\.\.*', '.', $goto)); } else { - header('Location: ' . $cfgPmaAbsoluteUri . $goto . '&message=' . $message); + $add_query = (strpos(' ' . $goto, 'tbl_change') ? '&disp_query=' . urlencode($sql_query) : ''); + header('Location: ' . $cfgPmaAbsoluteUri . $goto . '&message=' . urlencode($message) . $add_query); } exit(); } // end if