]> git.joonet.de Git - adminer.git/commitdiff
Edit default values directly in table creation
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Fri, 21 Aug 2009 16:54:10 +0000 (16:54 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Fri, 21 Aug 2009 16:54:10 +0000 (16:54 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@993 7c3ca157-0c34-0410-bff1-cbf682f78f5c

21 files changed:
adminer/create.inc.php
adminer/edit.inc.php
adminer/editing.js
adminer/include/adminer.inc.php
adminer/include/editing.inc.php
adminer/include/functions.inc.php
adminer/index.php
adminer/lang/cs.inc.php
adminer/lang/de.inc.php
adminer/lang/es.inc.php
adminer/lang/et.inc.php
adminer/lang/fr.inc.php
adminer/lang/it.inc.php
adminer/lang/nl.inc.php
adminer/lang/ru.inc.php
adminer/lang/sk.inc.php
adminer/lang/zh-tw.inc.php
adminer/lang/zh.inc.php
adminer/table.inc.php
changes.txt
todo.txt

index eb37ad483b5109c6ec9a4f855fce8ee8c2f40787..b636ca1856a593cc598635a007e1539574a189db 100644 (file)
@@ -36,7 +36,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"] && !$_POST["up"]
                        $fields[] = "\n" . (strlen($_GET["create"]) ? (strlen($field["orig"]) ? "CHANGE " . idf_escape($field["orig"]) . " " : "ADD ") : "  ")
                                . idf_escape($field["field"]) . process_type($type_field)
                                . ($field["null"] ? " NULL" : " NOT NULL") // NULL for timestamp
-                               . (strlen($_GET["create"]) && strlen($field["orig"]) && isset($orig_fields[$field["orig"]]["default"]) && $field["type"] != "timestamp" ? " DEFAULT " . $dbh->quote($orig_fields[$field["orig"]]["default"]) : "") //! timestamp
+                               . (!$field["has_default"] || $field["auto_increment"] || ereg('text|blob', $field["type"]) ? "" : " DEFAULT " . ($field["type"] == "timestamp" && eregi("^CURRENT_TIMESTAMP( on update CURRENT_TIMESTAMP)?$", $field["default"]) ? $field["default"] : $dbh->quote($field["default"])))
                                . ($key == $_POST["auto_increment_col"] ? " AUTO_INCREMENT$auto_increment_index" : "")
                                . " COMMENT " . $dbh->quote($field["comment"])
                                . (strlen($_GET["create"]) ? " $after" : "")
@@ -105,7 +105,14 @@ if ($_POST) {
        $row = table_status($_GET["create"]);
        table_comment($row);
        $row["name"] = $_GET["create"];
-       $row["fields"] = array_values($orig_fields);
+       $row["fields"] = array();
+       foreach ($orig_fields as $field) {
+               $field["has_default"] = isset($field["default"]);
+               if ($field["on_update"]) {
+                       $field["default"] .= " ON UPDATE $field[on_update]"; // CURRENT_TIMESTAMP
+               }
+               $row["fields"][] = $field;
+       }
        if ($dbh->server_info >= 5.1) {
                $from = "FROM information_schema.PARTITIONS WHERE TABLE_SCHEMA = " . $dbh->quote($_GET["db"]) . " AND TABLE_NAME = " . $dbh->quote($_GET["create"]);
                $result = $dbh->query("SELECT PARTITION_METHOD, PARTITION_ORDINAL_POSITION, PARTITION_EXPRESSION $from ORDER BY PARTITION_ORDINAL_POSITION DESC LIMIT 1");
@@ -124,7 +131,7 @@ if ($_POST) {
 }
 $collations = collations();
 
-$suhosin = floor(extension_loaded("suhosin") ? (min(ini_get("suhosin.request.max_vars"), ini_get("suhosin.post.max_vars")) - 13) / 8 : 0);
+$suhosin = floor(extension_loaded("suhosin") ? (min(ini_get("suhosin.request.max_vars"), ini_get("suhosin.post.max_vars")) - 13) / 10 : 0); // 10 - number of fields per row, 13 - number of other fields
 if ($suhosin && count($row["fields"]) > $suhosin) {
        echo "<p class='error'>" . h(lang('Maximum number of allowed fields exceeded. Please increase %s and %s.', 'suhosin.post.max_vars', 'suhosin.request.max_vars')) . "\n";
 }
@@ -143,7 +150,8 @@ if ($suhosin && count($row["fields"]) > $suhosin) {
 <?php echo lang('Auto Increment'); ?>: <input name="Auto_increment" size="6" value="<?php echo intval($row["Auto_increment"]); ?>">
 <?php echo lang('Comment'); ?>: <input name="Comment" value="<?php echo h($row["Comment"]); ?>" maxlength="60">
 <script type="text/javascript">
-document.write('<label><input type="checkbox"<?php if ($column_comments) { ?> checked<?php } ?> onclick="column_comments_click(this.checked);"><?php echo lang('Show column comments'); ?><\/label>');
+document.write('<label><input type="checkbox" onclick="column_show(this.checked, 5);"><?php echo lang('Default values'); ?><\/label>');
+document.write('<label><input type="checkbox"<?php if ($column_comments) { ?> checked<?php } ?> onclick="column_show(this.checked, 6);"><?php echo lang('Show column comments'); ?><\/label>');
 </script>
 <p>
 <input type="hidden" name="token" value="<?php echo $token; ?>">
index ffe892e780a60449f9b34486337e2c48b4e91309..951be334ced0caf5a7b6bd8ce8252c30fcbb9c43 100644 (file)
@@ -3,14 +3,14 @@ $where = (isset($_GET["select"]) ? "" : where($_GET));
 $update = ($where || $_POST["edit"]);
 $fields = fields($_GET["edit"]);
 foreach ($fields as $name => $field) {
-       if ((isset($_GET["default"]) ? $field["auto_increment"] || ereg('text|blob', $field["type"]) : !isset($field["privileges"][$update ? "update" : "insert"])) || !strlen($adminer->fieldName($field))) {
+       if (!isset($field["privileges"][$update ? "update" : "insert"]) || !strlen($adminer->fieldName($field))) {
                unset($fields[$name]);
        }
 }
 if ($_POST && !$error && !isset($_GET["select"])) {
        $location = $_SERVER["REQUEST_URI"]; // continue edit or insert
        if (!$_POST["insert"]) {
-               $location = ME . (isset($_GET["default"]) ? "table=" : "select=") . urlencode($_GET["edit"]);
+               $location = ME . "select=" . urlencode($_GET["edit"]);
                $i = 0; // append &set converted to &where
                foreach ((array) $_GET["set"] as $key => $val) {
                        if ($val == $_POST["fields"][$key]) {
@@ -21,24 +21,14 @@ if ($_POST && !$error && !isset($_GET["select"])) {
        $set = array();
        foreach ($fields as $name => $field) {
                $val = process_input($field);
-               if (!isset($_GET["default"])) {
-                       if ($val !== false || !$update) {
-                               $set[] = "\n" . idf_escape($name) . " = " . ($val !== false ? $val : "''");
-                       }
-               } elseif ($val !== false) {
-                       if ($field["type"] == "timestamp" && $val != "NULL") { //! doesn't allow DEFAULT NULL and no ON UPDATE
-                               $set[] = "\nMODIFY " . idf_escape($name) . " timestamp" . ($field["null"] ? " NULL" : "") . " DEFAULT $val" . ($_POST["on_update"][bracket_escape($name)] ? " ON UPDATE CURRENT_TIMESTAMP" : "");
-                       } else {
-                               $set[] = "\nALTER " . idf_escape($name) . ($val == "NULL" ? " DROP DEFAULT" : " SET DEFAULT $val");
-                       }
+               if ($val !== false || !$update) {
+                       $set[] = "\n" . idf_escape($name) . " = " . ($val !== false ? $val : "''");
                }
        }
        if (!$set) {
                redirect($location);
        }
-       if (isset($_GET["default"])) {
-               query_redirect("ALTER TABLE " . idf_escape($_GET["edit"]) . implode(",", $set), $location, lang('Default values have been set.'));
-       } elseif ($update) {
+       if ($update) {
                query_redirect("UPDATE " . idf_escape($_GET["edit"]) . " SET" . implode(",", $set) . "\nWHERE $where\nLIMIT 1", $location, lang('Item has been updated.'));
        } else {
                query_redirect("INSERT INTO " . idf_escape($_GET["edit"]) . " SET" . implode(",", $set), $location, lang('Item has been inserted.'));
@@ -47,9 +37,9 @@ if ($_POST && !$error && !isset($_GET["select"])) {
 
 $table_name = $adminer->tableName(table_status($_GET["edit"]));
 page_header(
-       (isset($_GET["default"]) ? lang('Default values') : ($update ? lang('Edit') : lang('Insert'))),
+       ($update ? lang('Edit') : lang('Insert')),
        $error,
-       array((isset($_GET["default"]) ? "table" : "select") => array($_GET["edit"], $table_name)),
+       array("select" => array($_GET["edit"], $table_name)),
        $table_name
 );
 
@@ -89,14 +79,6 @@ if ($fields) {
                }
                $function = ($_POST["save"] ? (string) $_POST["function"][$name] : ($where && $field["on_update"] == "CURRENT_TIMESTAMP" ? "now" : ($value === false ? null : (isset($value) ? '' : 'NULL'))));
                input($field, $value, $function);
-               if (isset($_GET["default"]) && $field["type"] == "timestamp") {
-                       if (!isset($create) && !$_POST) {
-                               //! disable sql_mode NO_FIELD_OPTIONS
-                               $create = $dbh->result($dbh->query("SHOW CREATE TABLE " . idf_escape($_GET["edit"])), 1);
-                       }
-                       $checked = ($_POST ? $_POST["on_update"][bracket_escape($name)] : preg_match("~\n\\s*" . preg_quote(idf_escape($name), '~') . " timestamp.* on update CURRENT_TIMESTAMP~i", $create));
-                       echo '<label><input type="checkbox" name="on_update[' . h(bracket_escape($name)) . ']" value="1"' . ($checked ? ' checked' : '') . '>' . lang('ON UPDATE CURRENT_TIMESTAMP') . '</label>';
-               }
                echo "\n";
        }
        echo "</table>\n";
@@ -111,7 +93,7 @@ if (isset($_GET["select"])) {
 }
 if ($fields) {
        echo "<input type='submit' value='" . lang('Save') . "'>\n";
-       if (!isset($_GET["default"]) && !isset($_GET["select"])) {
+       if (!isset($_GET["select"])) {
                echo "<input type='submit' name='insert' value='" . ($update ? lang('Save and continue edit') : lang('Save and insert next')) . "'>\n";
        }
 }
index 802b4abca8d5fc7ee53f35257866608455268954..1d1bafcbbaf33a2684cf4b0e0a20d1d7cee2462a 100644 (file)
@@ -125,10 +125,10 @@ function editing_type_change(type) {
        }
 }
 
-function column_comments_click(checked) {
+function column_show(checked, column) {
        var trs = document.getElementById('edit-fields').getElementsByTagName('tr');
        for (var i=0; i < trs.length; i++) {
-               trs[i].getElementsByTagName('td')[5].className = (checked ? '' : 'hidden');
+               trs[i].getElementsByTagName('td')[column].className = (checked ? 'nowrap' : 'hidden');
        }
 }
 
index 779542985469a4773f19cbe88434ea952d330d78..2cbfa2d1993d4308fe973a76bd83b969d866dc61 100644 (file)
@@ -346,26 +346,24 @@ class Adminer {
        */
        function editFunctions($field) {
                $return = array("");
-               if (!isset($_GET["default"])) {
-                       if (ereg('char|date|time', $field["type"])) {
-                               $return = (ereg('char', $field["type"]) ? array("", "md5", "sha1", "password", "uuid") : array("", "now")); //! JavaScript for disabling maxlength
+               if (ereg('char|date|time', $field["type"])) {
+                       $return = (ereg('char', $field["type"]) ? array("", "md5", "sha1", "password", "uuid") : array("", "now")); //! JavaScript for disabling maxlength
+               }
+               if (!isset($_GET["call"]) && (isset($_GET["select"]) || where($_GET))) {
+                       // relative functions
+                       if (ereg('int|float|double|decimal', $field["type"])) {
+                               $return = array("", "+", "-");
                        }
-                       if (!isset($_GET["call"]) && (isset($_GET["select"]) || where($_GET))) {
-                               // relative functions
-                               if (ereg('int|float|double|decimal', $field["type"])) {
-                                       $return = array("", "+", "-");
-                               }
-                               if (ereg('date', $field["type"])) {
-                                       $return[] = "+ interval";
-                                       $return[] = "- interval";
-                               }
-                               if (ereg('time', $field["type"])) {
-                                       $return[] = "addtime";
-                                       $return[] = "subtime";
-                               }
+                       if (ereg('date', $field["type"])) {
+                               $return[] = "+ interval";
+                               $return[] = "- interval";
+                       }
+                       if (ereg('time', $field["type"])) {
+                               $return[] = "addtime";
+                               $return[] = "subtime";
                        }
                }
-               if ($field["null"] || isset($_GET["default"])) {
+               if ($field["null"]) {
                        array_unshift($return, "NULL");
                }
                return $return;
index e0168b0d35a847a6e428983975120250fcda3e35..e5f187999b274283efb460c92b896f5344d63fe9 100644 (file)
@@ -73,6 +73,7 @@ function edit_fields($fields, $collations, $type = "TABLE", $allowed = 0, $forei
 <?php if ($type == "TABLE") { ?>
 <td><?php echo lang('NULL'); ?>
 <td><input type="radio" name="auto_increment_col" value=""><?php echo lang('Auto Increment'); ?>
+<td class="hidden"><?php echo lang('Default values'); ?>
 <td<?php echo ($column_comments ? "" : " class='hidden'"); ?>><?php echo lang('Comment'); ?>
 <?php } ?>
 <td><?php echo "<input type='image' name='add[0]' src='../adminer/plus.gif' alt='+' title='" . lang('Add next') . "'>"; ?><script type="text/javascript">row_count = <?php echo count($fields); ?>;</script>
@@ -89,6 +90,7 @@ function edit_fields($fields, $collations, $type = "TABLE", $allowed = 0, $forei
 <?php if ($type == "TABLE") { ?>
 <td><input type="checkbox" name="fields[<?php echo $i; ?>][null]" value="1"<?php if ($field["null"]) { ?> checked<?php } ?>>
 <td><input type="radio" name="auto_increment_col" value="<?php echo $i; ?>"<?php if ($field["auto_increment"]) { ?> checked<?php } ?>>
+<td class="nowrap hidden"><input type="checkbox" name="fields[<?php echo $i; ?>][has_default]" value="1"<?php echo ($field["has_default"] ? " checked" : ""); ?>><input name="fields[<?php echo $i; ?>][default]" value="<?php echo h($field["default"]); ?>" onchange="this.previousSibling.checked = true;">
 <td<?php echo ($column_comments ? "" : " class='hidden'"); ?>><input name="fields[<?php echo $i; ?>][comment]" value="<?php echo h($field["comment"]); ?>" maxlength="255">
 <?php } ?>
 <?php
index a4b29bb19f8ced75856baa7cc1706d130345070a..7bf84ca2d761c0c07c7276ef46a64879ef11d1ad 100644 (file)
@@ -287,17 +287,15 @@ function input($field, $value, $function) {
        echo "<td class='function'>";
        if ($field["type"] == "enum") {
                echo "&nbsp;<td>" . (isset($_GET["select"]) ? " <label><input type='radio' name='fields[$name]' value='-1' checked><em>" . lang('original') . "</em></label>" : "");
-               if ($field["null"] || isset($_GET["default"])) {
+               if ($field["null"]) {
                        echo " <label><input type='radio' name='fields[$name]' value=''" . (($field["null"] ? isset($value) : strlen($value)) || isset($_GET["select"]) ? '' : ' checked') . '>' . ($field["null"] ? '<em>NULL</em>' : '') . '</label>';
                }
-               if (!isset($_GET["default"])) {
-                       echo "<input type='radio' name='fields[$name]' value='0'" . ($value === 0 ? ' checked' : '') . '>';
-               }
+               echo "<input type='radio' name='fields[$name]' value='0'" . ($value === 0 ? ' checked' : '') . '>';
                preg_match_all("~'((?:[^']|'')*)'~", $field["length"], $matches);
                foreach ($matches[1] as $i => $val) {
                        $val = stripcslashes(str_replace("''", "'", $val));
                        $checked = (is_int($value) ? $value == $i+1 : $value === $val);
-                       echo " <label><input type='radio' name='fields[$name]' value='" . (isset($_GET["default"]) ? (strlen($val) ? h($val) : " ") : $i+1) . "'" . ($checked ? ' checked' : '') . '>' . h($val) . '</label>';
+                       echo " <label><input type='radio' name='fields[$name]' value='" . ($i+1) . "'" . ($checked ? ' checked' : '') . '>' . h($val) . '</label>';
                }
        } else {
                $functions = (isset($_GET["select"]) ? array("orig" => lang('original')) : array()) + $adminer->editFunctions($field);
@@ -312,7 +310,7 @@ function input($field, $value, $function) {
                        foreach ($matches[1] as $i => $val) {
                                $val = stripcslashes(str_replace("''", "'", $val));
                                $checked = (is_int($value) ? ($value >> $i) & 1 : in_array($val, explode(",", $value), true));
-                               echo " <label><input type='checkbox' name='fields[$name][$i]' value='" . (isset($_GET["default"]) ? h($val) : 1 << $i) . "'" . ($checked ? ' checked' : '') . "$onchange>" . h($val) . '</label>';
+                               echo " <label><input type='checkbox' name='fields[$name][$i]' value='" . (1 << $i) . "'" . ($checked ? ' checked' : '') . "$onchange>" . h($val) . '</label>';
                        }
                } elseif (strpos($field["type"], "text") !== false) {
                        echo "<textarea name='fields[$name]' cols='50' rows='12'$onchange>" . h($value) . '</textarea>';
@@ -336,9 +334,9 @@ function process_input($field) {
        } elseif ($field["type"] == "enum" || $field["auto_increment"] ? !strlen($value) : $function == "NULL") {
                return "NULL";
        } elseif ($field["type"] == "enum") {
-               return (isset($_GET["default"]) ? $dbh->quote($value) : intval($value));
+               return intval($value);
        } elseif ($field["type"] == "set") {
-               return (isset($_GET["default"]) ? $dbh->quote(implode(",", (array) $value)) : array_sum((array) $value));
+               return array_sum((array) $value);
        } elseif (ereg('binary|blob', $field["type"])) {
                $file = get_file($idf);
                if (!is_string($file)) {
index 4770b84e760e471d07fb1ef7c39261d6a52fb60e..180e0bcbffe17a9b9807a952ac945411f0bfc37e 100644 (file)
@@ -22,10 +22,6 @@ if (isset($_GET["download"])) {
 } elseif (isset($_GET["privileges"])) {
        include "./privileges.inc.php";
 } else {
-       if (isset($_GET["default"])) {
-               // edit form is used for default values and distinguished by checking isset($_GET["default"]) in edit.inc.php
-               $_GET["edit"] = $_GET["default"];
-       }
        if (isset($_GET["select"]) && ($_POST["edit"] || $_POST["clone"]) && !$_POST["save"]) {
                $_GET["edit"] = $_GET["select"];
        }
index 15fc7bee50ff511313d2afbfcbd611e642804724..4adeaa745685db975e84b540d515b98542a2641f 100644 (file)
@@ -72,7 +72,6 @@ $translations = array(
        'Unable to select the table' => 'Nepodařilo se vypsat tabulku',
        'Invalid CSRF token. Send the form again.' => 'Neplatný token CSRF. Odešlete formulář znovu.',
        'Comment' => 'Komentář',
-       'Default values have been set.' => 'Výchozí hodnoty byly nastaveny.',
        'Default values' => 'Výchozí hodnoty',
        'BOOL' => 'BOOL',
        'Show column comments' => 'Zobrazit komentáře sloupců',
@@ -134,7 +133,6 @@ $translations = array(
        'MySQL version: %s through PHP extension %s' => 'Verze MySQL: %s přes PHP extenzi %s',
        '%d row(s)' => array('%d řádek', '%d řádky', '%d řádků'),
        '~ %s' => '~ %s',
-       'ON UPDATE CURRENT_TIMESTAMP' => 'Při změně aktuální čas',
        'Remove' => 'Odebrat',
        'Are you sure?' => 'Opravdu?',
        'Privileges' => 'Oprávnění',
index 83bc2a06448bfc7f2c05c28c142f105aadbb7e12..7b49b316c1f7a117a6fc6c80f6dd6c7fd2b34e5c 100644 (file)
@@ -72,7 +72,6 @@ $translations = array(
        'Unable to select the table' => 'Auswahl der Tabelle fehlgeschlagen',
        'Invalid CSRF token. Send the form again.' => 'CSRF Token ungültig. Bitte die Formulardaten erneut abschicken.',
        'Comment' => 'Kommentar',
-       'Default values have been set.' => 'Standard Vorgabewerte sind erstellt worden.',
        'Default values' => 'Vorgabewerte festlegen',
        'BOOL' => 'BOOL',
        'Show column comments' => 'Spaltenkommentare zeigen',
@@ -134,7 +133,6 @@ $translations = array(
        'MySQL version: %s through PHP extension %s' => 'Version MySQL: %s, mit PHP-Erweiterung %s',
        '%d row(s)' => array('%d Datensatz', '%d Datensätze'),
        '~ %s' => '~ %s',
-       'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
        'Remove' => 'Entfernen',
        'Are you sure?' => 'Sind Sie sicher ?',
        'Privileges' => 'Rechte',
index ea5aa861a5ef4a85453c8b272fe8023310e3ac0d..0fbfa93dbfdc14f27b71b20f8e10b68083f74e0b 100644 (file)
@@ -72,7 +72,6 @@ $translations = array(
        'Unable to select the table' => 'No posible seleccionar la tabla',
        'Invalid CSRF token. Send the form again.' => 'Token CSRF inválido. Vuelva a enviar los datos del formulario.',
        'Comment' => 'Comentario',
-       'Default values have been set.' => 'Valores predeterminados establecidos.',
        'Default values' => 'Valores predeterminados',
        'BOOL' => 'BOOL',
        'Show column comments' => 'Mostrar comentario de columnas',
@@ -134,7 +133,6 @@ $translations = array(
        'MySQL version: %s through PHP extension %s' => 'Versión MySQL: %s a través de extensión PHP %s',
        '%d row(s)' => array('%d registro', '%d registros'),
        '~ %s' => '~ %s',
-       'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
        'Remove' => 'Eliminar',
        'Are you sure?' => 'Está seguro?',
        'Privileges' => 'Privilegios',
index c66429e6f5371c27e96af5be41fd5b2aac56cc36..1ff8f028720e19d6840bb50c98bebb92ff98289d 100644 (file)
@@ -72,7 +72,6 @@ $translations = array(
        'Unable to select the table' => 'Tabeli valimine ebaõnnestus',
        'Invalid CSRF token. Send the form again.' => 'Sobimatu CSRF, palun postitage vorm uuesti.',
        'Comment' => 'Kommentaar',
-       'Default values have been set.' => 'Vaimimisi väärtused on edukalt määratud.',
        'Default values' => 'Vaikimisi väärtused',
        'BOOL' => 'Jah/Ei (BOOL)',
        'Show column comments' => 'Kuva veeru kommentaarid',
@@ -133,7 +132,6 @@ $translations = array(
        'Event' => 'Sündmus',
        '%d row(s)' => array('%d rida', '%d rida'),
        '~ %s' => '~ %s',
-       'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
        'Remove' => 'Eemalda',
        'Are you sure?' => 'Kas oled kindel?',
        'Privileges' => 'Õigused',
index 269d0719e893f637c4f50ea811fda64feafffc6b..fd5dc5dfbbd726d4d4771548bd1b9a61be7c266c 100644 (file)
@@ -72,7 +72,6 @@ $translations = array(
        'Unable to select the table' => 'Impossible de sélectionner la table',
        'Invalid CSRF token. Send the form again.' => 'Token CSRF invalide. Veuillez réenvoyer le formulaire.',
        'Comment' => 'Commentaire',
-       'Default values have been set.' => 'Valeur par défaut établie .',
        'Default values' => 'Valeurs par défaut',
        'BOOL' => 'BOOL',
        'Show column comments' => 'Voir les commentaires sur les colonnes',
@@ -133,7 +132,6 @@ $translations = array(
        'Event' => 'Évènement',
        '%d row(s)' => array('%d ligne', '%d lignes'),
        '~ %s' => '~ %s',
-       'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
        'Remove' => 'Effacer',
        'Are you sure?' => 'Êtes-vous certain?',
        'Privileges' => 'Privilège',
index ca124a3cc69278b0b0ec3d2c1c7274400671261b..9c47872c9f1062ebf75dfc88ea7024056f367f1d 100644 (file)
@@ -72,7 +72,6 @@ $translations = array(
        'Unable to select the table' => 'Selezione della tabella non riuscita',
        'Invalid CSRF token. Send the form again.' => 'Token CSRF non valido. Reinvia la richiesta.',
        'Comment' => 'Commento',
-       'Default values have been set.' => 'Valore predefinito impostato.',
        'Default values' => 'Valori predefiniti',
        'BOOL' => 'BOOL',
        'Show column comments' => 'Mostra i commenti delle colonne',
@@ -134,7 +133,6 @@ $translations = array(
        'MySQL version: %s through PHP extension %s' => 'Versione MySQL: %s via estensione PHP %s',
        '%d row(s)' => array('%d riga', '%d righe'),
        '~ %s' => '~ %s',
-       'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
        'Remove' => 'Rimuovi',
        'Are you sure?' => 'Sicuro?',
        'Privileges' => 'Privilegi',
index 24a7e172d283d10e4f67fde0f14eea7846650e39..5befed992ec0a96812f5fd69f8914ee3e1774900 100644 (file)
@@ -72,7 +72,6 @@ $translations = array(
        'Unable to select the table' => 'Onmogelijk tabel te selecteren',
        'Invalid CSRF token. Send the form again.' => 'Ongeldig CSRF token. Verstuur het formulier opnieuw.',
        'Comment' => 'Commentaar',
-       'Default values have been set.' => 'Standaard waarde ingesteld.',
        'Default values' => 'Standaard waarden',
        'BOOL' => 'BOOL',
        'Show column comments' => 'Kolomcommentaar weergeven',
@@ -134,7 +133,6 @@ $translations = array(
        'MySQL version: %s through PHP extension %s' => 'MySQL versie: %s met PHP extensie %s',
        '%d row(s)' => array('%d rij', '%d rijen'),
        '~ %s' => '~ %s',
-       'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
        'Remove' => 'Verwijderen',
        'Are you sure?' => 'Weet u het zeker?',
        'Privileges' => 'Rechten',
index b2ee83295be2a51ba3b289f071a9f86427dbb204..740b95d1594a6ab0217f08d0160635a05585b788 100644 (file)
@@ -72,7 +72,6 @@ $translations = array(
        'Unable to select the table' => 'Не удалось получить данные из таблицы',
        'Invalid CSRF token. Send the form again.' => 'Недействительный CSRF токен. Отправите форму ещё раз.',
        'Comment' => 'Комментарий',
-       'Default values have been set.' => 'Были установлены значения по умолчанию.',
        'Default values' => 'Значения по умолчанию',
        'BOOL' => 'Булев тип',
        'Show column comments' => 'Показать комментарии к колонке',
@@ -134,7 +133,6 @@ $translations = array(
        'MySQL version: %s through PHP extension %s' => 'Версия MySQL: %s с PHP-расширением %s',
        '%d row(s)' => array('%d строка', '%d строки', '%d строк'),
        '~ %s' => '~ %s',
-       'ON UPDATE CURRENT_TIMESTAMP' => 'ПРИ ИЗМЕНЕНИИ ТЕКУЩЕГО TIMESTAMP',
        'Remove' => 'Удалить',
        'Are you sure?' => 'Вы уверены?',
        'Privileges' => 'Полномочия',
index 953e298f4f1376c889324daee26eaf00335adaf1..cc21aadf925029810a05dc06f33432f2449f38c0 100644 (file)
@@ -72,7 +72,6 @@ $translations = array(
        'Unable to select the table' => 'Tabuľku sa nepodarilo vypísať',
        'Invalid CSRF token. Send the form again.' => 'Neplatný token CSRF. Odošlite formulár znova.',
        'Comment' => 'Komentár',
-       'Default values have been set.' => 'Východzie hodnoty boli nastavené.',
        'Default values' => 'Východzie hodnoty',
        'BOOL' => 'BOOL',
        'Show column comments' => 'Zobraziť komentáre stĺpcov',
@@ -134,7 +133,6 @@ $translations = array(
        'MySQL version: %s through PHP extension %s' => 'Verzia MySQL: %s cez PHP rozšírenie %s',
        '%d row(s)' => array('%d riadok', '%d riadky', '%d riadkov'),
        '~ %s' => '~ %s',
-       'ON UPDATE CURRENT_TIMESTAMP' => 'Pri zmene aktuálny čas',
        'Remove' => 'Odobrať',
        'Are you sure?' => 'Naozaj?',
        'Privileges' => 'Oprávnenia',
index c00119260a85abf0793cc21843eefc5a47f4b9df..9c32277e664c8d5ac4901a8676f1626791e430ed 100644 (file)
@@ -72,7 +72,6 @@ $translations = array(
        'Unable to select the table' => '無法選擇該資料表',
        'Invalid CSRF token. Send the form again.' => '無效的 CSRF token。請重新發送表單。',
        'Comment' => '註解',
-       'Default values have been set.' => '預設值已設置。',
        'Default values' => '預設值',
        'BOOL' => 'BOOL',
        'Show column comments' => '顯示列註解',
@@ -134,7 +133,6 @@ $translations = array(
        'MySQL version: %s through PHP extension %s' => 'MySQL版本:%s 透過PHP擴充模組 %s',
        '%d row(s)' => '%d行',
        '~ %s' => '~ %s',
-       'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
        'Remove' => '移除',
        'Are you sure?' => '你確定嗎?',
        'Privileges' => '權限',
index 63c24f25e344d59fc8461fb492ca057799a4e829..add1c201c4d5e0f0a84330d6be59a0e357fc294b 100644 (file)
@@ -72,7 +72,6 @@ $translations = array(
        'Unable to select the table' => '不能选择该表',
        'Invalid CSRF token. Send the form again.' => '无效 CSRF 令牌。重新发送表单。',
        'Comment' => '注释',
-       'Default values have been set.' => '默认值已设置。',
        'Default values' => '默认值',
        'BOOL' => 'BOOL',
        'Show column comments' => '显示列注释',
@@ -134,7 +133,6 @@ $translations = array(
        'MySQL version: %s through PHP extension %s' => 'MySQL 版本:%s 通过 PHP 扩展 %s',
        '%d row(s)' => '%d 行',
        '~ %s' => '~ %s',
-       'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
        'Remove' => '移除',
        'Are you sure?' => '你确定吗?',
        'Privileges' => '权限',
index 47c5cffa806b8ed072df3f52988c719dcb698736..c5655058958ee7c5870ca8cfdc12c4ae9c6afe49 100644 (file)
@@ -9,13 +9,9 @@ $is_view = !isset($table_status["Rows"]);
 page_header(($result && $is_view ? lang('View') : lang('Table')) . ": " . h($_GET["table"]), $error);
 
 if ($result) {
-       $auto_increment_only = true;
        echo "<table cellspacing='0'>\n";
        echo "<thead><tr><th>" . lang('Column') . "<td>" . lang('Type') . "<td>" . lang('Comment') . "</thead>\n";
        while ($row = $result->fetch_assoc()) {
-               if (!$row["auto_increment"]) {
-                       $auto_increment_only = false;
-               }
                echo "<tr><th>" . h($row["Field"]);
                echo "<td>" . h($row["Type"]) . ($row["Null"] == "YES" ? " <i>NULL</i>" : "");
                echo "<td>" . (strlen(trim($row["Comment"])) ? h($row["Comment"]) : "&nbsp;");
@@ -29,7 +25,6 @@ if ($result) {
                echo '<a href="' . h(ME) . 'view=' . urlencode($_GET["table"]) . '">' . lang('Alter view') . '</a>';
        } else {
                echo '<a href="' . h(ME) . 'create=' . urlencode($_GET["table"]) . '">' . lang('Alter table') . '</a>';
-               echo ($auto_increment_only ? '' : ' <a href="' . h(ME) . 'default=' . urlencode($_GET["table"]) . '">' . lang('Default values') . '</a>');
        }
        echo ' <a href="' . h(ME) . 'select=' . urlencode($_GET["table"]) . '">' . lang('Select table') . '</a>';
        echo ' <a href="' . h(ME) . 'edit=' . urlencode($_GET["table"]) . '">' . lang('New item') . '</a>';
index c7936053090c259496dc82c086bda131392c8a93..41197ea7b15b469004454516acdf3a1576a66a95 100644 (file)
@@ -1,4 +1,5 @@
-Adminer 2.0.1:
+Adminer 2.1.0:
+Edit default values directly in table creation
 Display column comments in table overview
 Respect max_allowed_packet in CSV import
 Fix Editor date format
index 6466889bb48e051713bb64403d95cfcd8f396996..25f4e0c3584c591be2b76c357ad3bcef62c105d8 100644 (file)
--- a/todo.txt
+++ b/todo.txt
@@ -9,7 +9,6 @@ Function to fix database encoding - http://php.vrana.cz/prevod-kodovani-mysql.ph
 Highlight SQL textarea - may use external CodePress
 Mass editation of individual rows
 IE6 - <label for>
-Edit default values directly in table creation
 Offer enum and set items in search - whisperer
 Use event $intervals + microseconds in relative date functions
 Table status cache - SHOW TABLE STATUS is slow with big InnoDB tables