Skip to content

Commit

Permalink
bug#4257 - fixed test failures
Browse files Browse the repository at this point in the history
Signed-off-by: Viduranga Wijesooriya <[email protected]>
  • Loading branch information
vidurangaw committed Jan 31, 2014
1 parent 2f2dd3b commit 8cc01b3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
6 changes: 3 additions & 3 deletions js/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -859,15 +859,15 @@ function addDateTimePicker() {
if ($.timepicker !== undefined) {
$('input.datefield, input.datetimefield').each(function () {

no_decimals = $(this).data('decimals');
no_decimals = $(this).parent().data('decimals');
var showMillisec = false;
var showMicrosec = false;
var timeFormat = 'HH:mm:ss';
// check for decimal places of seconds
if (($(this).data('decimals') > 0) && ($(this).data('type').indexOf('time') != -1)){
if (($(this).parent().data('decimals') > 0) && ($(this).parent().data('type').indexOf('time') != -1)){
showMillisec = true;
timeFormat = 'HH:mm:ss.lc';
if ($(this).data('decimals') > 3) {
if ($(this).parent().data('decimals') > 3) {
showMicrosec = true;
}
}
Expand Down
1 change: 1 addition & 0 deletions libraries/DisplayResults.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -6034,3 +6034,4 @@ private function _displayBinaryAsPrintable(
}

?>
da
4 changes: 2 additions & 2 deletions libraries/Util.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -4358,9 +4358,9 @@ public static function addMicroseconds($value)
$value .= '000000';
return substr($value, 0, strpos($value, '.') + 7);
} else {
return $value;
return $value . '.000000';
}
}
}

?>
?>
26 changes: 13 additions & 13 deletions libraries/insert_edit.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1183,13 +1183,7 @@ function PMA_getHTMLinput($column, $column_name_appendix, $special_chars,
$input_type = 'text';
// do not use the 'date' or 'time' types here; they have no effect on some
// browsers and create side effects (see bug #4218)
$no_decimals=0;
$type = current(explode("(", $column['pma_type']));
if(preg_match('/\(([^()]+)\)/', $column['pma_type'], $match)){
$match[0] = trim($match[0], '()');
$no_decimals=$match[0];
}


$the_class = 'textfield';
if ($column['pma_type'] === 'date') {
$the_class .= ' datefield';
Expand All @@ -1216,9 +1210,7 @@ function PMA_getHTMLinput($column, $column_name_appendix, $special_chars,
. ' value="' . $special_chars . '" size="' . $fieldsize . '"'
. ($input_min_max !== false ? ' ' . $input_min_max : '')
. ($input_type === 'time' ? ' step="1"' : '')
. ' class="' . $the_class . '" ' . $unnullify_trigger
. ' data-decimals="' .$no_decimals .'"'
. ' data-type="' .$type .'"'
. ' class="' . $the_class . '" ' . $unnullify_trigger
. ' tabindex="' . ($tabindex + $tabindex_for_value). '"'
. ' id="field_' . ($idindex) . '_3" />';
}
Expand Down Expand Up @@ -2826,12 +2818,20 @@ function PMA_getHtmlForInsertEditFormColumn($table_columns, $i, $column,
$tabindex, $tabindex_for_null, $idindex, $vkey, $foreigners,
$foreignData
);

// The value column (depends on type)
// ----------------
// See bug #1667887 for the reason why we don't use the maxlength
// HTML attribute
$html_output .= ' <td>' . "\n";
// HTML attribute

//add data attributes "no of decimals" and "data type"
$no_decimals=0;
$type = current(explode("(", $column['pma_type']));
if(preg_match('/\(([^()]+)\)/', $column['pma_type'], $match)){
$match[0] = trim($match[0], '()');
$no_decimals=$match[0];
}
$html_output .= '<td' . ' data-type="' . $type . '"' . ' data-decimals="' . $no_decimals . '">' . "\n";
// Will be used by js/tbl_change.js to set the default value
// for the "Continue insertion" feature
$html_output .= '<span class="default_value hide">'
Expand Down

0 comments on commit 8cc01b3

Please sign in to comment.