* set current version number to 2.2.0rc3 (which should become 2.2.0-final)
* tbl_change.php3: feature #442402: while editing a record, the function of the first timestamp field will be set by default to "NOW()" : same behaviour as the command line mysql client.
This commit is contained in:
@@ -5,6 +5,12 @@ phpMyAdmin - Changelog
|
|||||||
$Id$
|
$Id$
|
||||||
$Source$
|
$Source$
|
||||||
|
|
||||||
|
2001-07-18 Olivier M<>ller <om@omnis.ch>
|
||||||
|
* set current version number to 2.2.0rc3 (which should become 2.2.0-final)
|
||||||
|
* tbl_change.php3: feature #442402: while editing a record, the function
|
||||||
|
of the first timestamp field will be set by default to "NOW()" :
|
||||||
|
same behaviour as the command line mysql client.
|
||||||
|
|
||||||
2001-07-17 Lo<4C>c Chapeaux <lolo@phpheaven.net>
|
2001-07-17 Lo<4C>c Chapeaux <lolo@phpheaven.net>
|
||||||
* added credits for Benjamin Gandon <gandon@isia.cma.fr> in this file,
|
* added credits for Benjamin Gandon <gandon@isia.cma.fr> in this file,
|
||||||
credits and documentation.
|
credits and documentation.
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
// PMA_WINDOWS (bool) - mark if phpMyAdmin running on windows server
|
// PMA_WINDOWS (bool) - mark if phpMyAdmin running on windows server
|
||||||
|
|
||||||
|
|
||||||
define("PHPMYADMIN_VERSION", "2.2.0rc2");
|
define("PHPMYADMIN_VERSION", "2.2.0rc3");
|
||||||
|
|
||||||
if (!ereg("([0-9]).([0-9]).([0-9])", phpversion(), $match))
|
if (!ereg("([0-9]).([0-9]).([0-9])", phpversion(), $match))
|
||||||
$result=ereg("([0-9]).([0-9])",phpversion(),$match);
|
$result=ereg("([0-9]).([0-9])",phpversion(),$match);
|
||||||
|
@@ -45,6 +45,9 @@ if(isset($primary_key))
|
|||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
$timestamp_seen = 0; // set if we passed the first timestamp field.
|
||||||
|
|
||||||
for($i=0;$i<mysql_num_rows($table_def);$i++)
|
for($i=0;$i<mysql_num_rows($table_def);$i++)
|
||||||
{
|
{
|
||||||
$row_table_def = mysql_fetch_array($table_def);
|
$row_table_def = mysql_fetch_array($table_def);
|
||||||
@@ -53,6 +56,7 @@ for($i=0;$i<mysql_num_rows($table_def);$i++)
|
|||||||
$row[$field] = date("Y-m-d H:i:s", time());
|
$row[$field] = date("Y-m-d H:i:s", time());
|
||||||
$len = @mysql_field_len($result,$i);
|
$len = @mysql_field_len($result,$i);
|
||||||
|
|
||||||
|
$first_timestamp = 0;
|
||||||
$bgcolor = $cfgBgcolorOne;
|
$bgcolor = $cfgBgcolorOne;
|
||||||
$i % 2 ? 0: $bgcolor = $cfgBgcolorTwo;
|
$i % 2 ? 0: $bgcolor = $cfgBgcolorTwo;
|
||||||
echo "<tr bgcolor=".$bgcolor.">\n";
|
echo "<tr bgcolor=".$bgcolor.">\n";
|
||||||
@@ -65,6 +69,13 @@ for($i=0;$i<mysql_num_rows($table_def);$i++)
|
|||||||
case "enum":
|
case "enum":
|
||||||
$type = "enum";
|
$type = "enum";
|
||||||
break;
|
break;
|
||||||
|
case "timestamp":
|
||||||
|
if (!$timestamp_seen) { // can only occur once per table
|
||||||
|
$timestamp_seen = 1;
|
||||||
|
$first_timestamp = 1;
|
||||||
|
}
|
||||||
|
$type = $row_table_def['Type'];
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
$type = $row_table_def['Type'];
|
$type = $row_table_def['Type'];
|
||||||
break;
|
break;
|
||||||
@@ -91,10 +102,21 @@ for($i=0;$i<mysql_num_rows($table_def);$i++)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
echo "<td><select name=\"funcs[$field]\"><option>\n";
|
echo "<td><select name=\"funcs[$field]\"><option>\n";
|
||||||
|
|
||||||
|
if (!$first_timestamp) {
|
||||||
for($j=0; $j<count($cfgFunctions); $j++)
|
for($j=0; $j<count($cfgFunctions); $j++)
|
||||||
echo "<option>$cfgFunctions[$j]\n";
|
echo "<option>$cfgFunctions[$j]\n";
|
||||||
|
} else {
|
||||||
|
// for default function = NOW() on first timestamp field --swix/18jul01
|
||||||
|
for($j=0; $j<count($cfgFunctions); $j++) {
|
||||||
|
if ($cfgFunctions[$j] == "NOW") {
|
||||||
|
echo "<option selected>$cfgFunctions[$j]\n";
|
||||||
|
} else {
|
||||||
|
echo "<option>$cfgFunctions[$j]\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
echo "</select></td>\n";
|
echo "</select></td>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user