diff --git a/js/tbl_zoom_plot.js b/js/tbl_zoom_plot.js index df73c3c60f..3e760df5bd 100644 --- a/js/tbl_zoom_plot.js +++ b/js/tbl_zoom_plot.js @@ -265,6 +265,7 @@ $(document).ready(function() { //Find changed values by comparing form values with selectedRow Object var newValues = new Array();//Stores the values changed from original + var sqlTypes = new Array(); var it = 4; var xChange = false; var yChange = false; @@ -283,6 +284,10 @@ $(document).ready(function() { data[currentData][yLabel] = newVal; } } + var $input = $('#fieldID_' + it); + if ($input.hasClass('bit')) { + sqlTypes[key] = 'bit'; + } } it++; } //End data update @@ -378,7 +383,11 @@ $(document).ready(function() { if (key != 'where_clause') { sql_query += '`' + key + '`=' ; var value = newValues[key]; - if (!isNumeric(value) && value != null) { + if (sqlTypes[key] != null) { + if (sqlTypes[key] == 'bit') { + sql_query += 'b\'' + value + '\' ,'; + } + } else if (!isNumeric(value) && value != null) { sql_query += '\'' + value + '\' ,'; } else { sql_query += value + ' ,'; diff --git a/libraries/tbl_select.lib.php b/libraries/tbl_select.lib.php index 848eb288f5..53ffcb749d 100644 --- a/libraries/tbl_select.lib.php +++ b/libraries/tbl_select.lib.php @@ -154,11 +154,13 @@ function PMA_tbl_getSubTabs() * @param int $foreignMaxLimit Max limit of displaying foreign elements * @param array $fields Array of search criteria inputs * @param bool $in_fbs Whether we are in 'function based search' + * @param bool $in_edit Whether in search mode + * or edit mode (used for zoom search) * * @return string HTML content for viewing foreing data and elements * for search criteria input. */ -function PMA_getForeignFields_Values($foreigners, $foreignData, $field, $tbl_fields_type, $i, $db, $table, $titles, $foreignMaxLimit, $fields, $in_fbs = false) +function PMA_getForeignFields_Values($foreigners, $foreignData, $field, $tbl_fields_type, $i, $db, $table, $titles, $foreignMaxLimit, $fields, $in_fbs = false, $in_edit = false) { $str = ''; if ($foreigners && isset($foreigners[$field]) && is_array($foreignData['disp_row'])) { @@ -208,23 +210,39 @@ EOT; $str .= ''; } - } elseif (strncasecmp($tbl_fields_type[$i], 'enum', 4) == 0) { - // e n u m s - $enum_value=explode(', ', str_replace("'", '', substr($tbl_fields_type[$i], 5, -1))); - $cnt_enum_value = count($enum_value); - $str .= '' . "\n"; + } else { + $str .= '' . "\n"; @@ -238,6 +256,8 @@ EOT; $the_class .= ' datefield'; } elseif ($type == 'datetime' || substr($type, 0, 9) == 'timestamp') { $the_class .= ' datetimefield'; + } elseif (substr($type, 0, 3) == 'bit') { + $the_class .= ' bit'; } if (isset($fields[$i]) && is_string($fields[$i])) { diff --git a/tbl_zoom_select.php b/tbl_zoom_select.php index a110ace4b7..548b03f4f8 100644 --- a/tbl_zoom_select.php +++ b/tbl_zoom_select.php @@ -438,13 +438,16 @@ if (isset($zoom_submit) && $inputs[0] != 'pma_null' && $inputs[1] != 'pma_null' ?> - '; ?> + ' + : ''; ?>