patch #1847534 [interface] New "Inside field" in db search

This commit is contained in:
Marc Delisle
2007-12-31 14:58:20 +00:00
parent 070875cb3c
commit a3c39b0749
56 changed files with 91 additions and 13 deletions

View File

@@ -29,6 +29,8 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
- bug #1823018 [charset] Edit(Delete) img-links pointing to wrong row
- bug #1826205 [export] Problems with yaml text export
+ rfe #1840165 [interface] Enlarge column name field in vertical mode
+ patch #1847534 [interface] New "Inside field" in db search,
thanks to obiserver
2.11.4.0 (not yet released)
- bug #1843428 [GUI] Space issue with DROP/DELETE/ALTER TABLE

View File

@@ -38,6 +38,7 @@
* @uses $_REQUEST['table_select']
* @uses $_REQUEST['unselectall']
* @uses $_REQUEST['selectall']
* @uses $_REQUEST['field_str']
* @uses is_string()
* @uses htmlspecialchars()
* @uses array_key_exists()
@@ -118,6 +119,12 @@ if (isset($_REQUEST['selectall'])) {
$tables_selected = array();
}
if (empty($_REQUEST['field_str']) || ! is_string($_REQUEST['field_str'])) {
unset($field_str);
} else {
$field_str = PMA_sqlAddslashes($_REQUEST['field_str'], true);
}
/**
* Displays top links
*/
@@ -143,6 +150,7 @@ if (isset($_REQUEST['submit_search'])) {
* count
* strlen
* @param string the table name
* @param string restrict the search to this field
* @param string the string to search
* @param integer type of search (1 -> 1 word at least, 2 -> all words,
* 3 -> exact string, 4 -> regexp)
@@ -152,7 +160,7 @@ if (isset($_REQUEST['submit_search'])) {
* @global string the url to return to in case of errors
* @global string charset connection
*/
function PMA_getSearchSqls($table, $search_str, $search_option)
function PMA_getSearchSqls($table, $field, $search_str, $search_option)
{
global $err_url, $charset_connection;
@@ -198,21 +206,31 @@ if (isset($_REQUEST['submit_search'])) {
} else {
$prefix = $suffix = '';
}
$thefieldlikevalue[] = $tblfield['Field']
. ' ' . $like_or_regex . ' '
. $prefix
. "'"
. $automatic_wildcard
. $search_word
. $automatic_wildcard . "'"
. $suffix;
if ((!isset($field)) || (strlen($field) == 0) || ($tblfield['Field'] == PMA_backquote($field))) {
$thefieldlikevalue[] = $tblfield['Field']
. ' ' . $like_or_regex . ' '
. $prefix
. "'"
. $automatic_wildcard
. $search_word
. $automatic_wildcard . "'"
. $suffix;
}
} // end for
$fieldslikevalues[] = implode(' OR ', $thefieldlikevalue);
if (count($thefieldlikevalue) > 0) {
$fieldslikevalues[] = implode(' OR ', $thefieldlikevalue);
}
} // end for
$implode_str = ($search_option == 1 ? ' OR ' : ' AND ');
$sqlstr_where = ' WHERE (' . implode(') ' . $implode_str . ' (', $fieldslikevalues) . ')';
if ( empty($fieldslikevalues)) {
// this could happen when the "inside field" does not exist
// in any selected tables
$sqlstr_where = ' WHERE FALSE';
} else {
$sqlstr_where = ' WHERE (' . implode(') ' . $implode_str . ' (', $fieldslikevalues) . ')';
}
unset($fieldslikevalues);
// Builds complete queries
@@ -249,8 +267,7 @@ if (isset($_REQUEST['submit_search'])) {
foreach ($tables_selected as $each_table) {
// Gets the SQL statements
$newsearchsqls = PMA_getSearchSqls($each_table,
$search_str, $search_option);
$newsearchsqls = PMA_getSearchSqls($each_table, (! empty($field_str) ? $field_str : ''), $search_str, $search_option);
// Executes the "COUNT" statement
$res_cnt = PMA_DBI_fetch_value($newsearchsqls['select_count']);
@@ -359,6 +376,11 @@ $alter_select =
<tr><td align="right" valign="bottom">
<?php echo $alter_select; ?></td></tr>
</tr>
<tr><td align="right">
<?php echo $GLOBALS['strSearchInField']; ?></td>
<td><input type="text" name="field_str" size="60"
value="<?php echo ! empty($field_str) ? $field_str : ''; ?>" /></td>
</tr>
</table>
</fieldset>
<fieldset class="tblFooters">

View File

@@ -1062,4 +1062,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1061,4 +1061,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1063,4 +1063,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1058,4 +1058,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1055,4 +1055,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1038,4 +1038,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1037,4 +1037,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1061,4 +1061,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1035,4 +1035,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1058,4 +1058,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1031,4 +1031,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1063,4 +1063,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1042,4 +1042,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1036,4 +1036,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1037,4 +1037,5 @@ $strYes = 'Ano';
$strZeroRemovesTheLimit = 'Poznámka: Nastavení těchto parametrů na 0 (nulu) odstraní omezení.';
$strZip = '„zazipováno“';
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1037,4 +1037,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1059,4 +1059,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -700,6 +700,7 @@ $strSavePosition = 'Save position';
$strSave = 'Save';
$strScaleFactorSmall = 'The scale factor is too small to fit the schema on one page';
$strSearchFormTitle = 'Search in database';
$strSearchInField = 'Inside field:';
$strSearchInTables = 'Inside table(s):';
$strSearchNeedle = 'Word(s) or value(s) to search for (wildcard: "%"):';
$strSearchOption1 = 'at least one of the words';

View File

@@ -1043,4 +1043,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1037,4 +1037,5 @@ $strYes = 'Kyllä';
$strZeroRemovesTheLimit = 'Huom: Näiden valintojen asettaminen nollaksi (0) poistaa rajoituksen.';
$strZip = '"zip-pakattu"';
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1034,4 +1034,5 @@ $strOptimize = 'Optimiser';
$strRebuild = 'Reconstruire';
$strRepair = 'Réparer';
$strRemovePartitioning = 'Supprimer le partitionnement';
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1036,4 +1036,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1063,4 +1063,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1043,4 +1043,5 @@ $strZeroRemovesTheLimit = 'Der Wert 0 (null) entfernt die Beschränkung.';
$strZip = 'Zip-komprimiert';
$strExportImportToScale = 'Export/Import to scale'; // to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1060,4 +1060,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1055,4 +1055,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1063,4 +1063,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1054,4 +1054,5 @@ $strUploadErrorUnknown = 'Unknown error in file upload.';//to translate
$strUploadLimit = 'You probably tried to upload too large file. Please refer to %sdocumentation%s for ways to workaround this limit.';//to translate
$strUploadsNotAllowed = 'File uploads are not allowed on this server.';//to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1053,4 +1053,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1037,4 +1037,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1041,4 +1041,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1058,4 +1058,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1060,4 +1060,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1053,4 +1053,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1038,4 +1038,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1075,4 +1075,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1058,4 +1058,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1035,4 +1035,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1060,4 +1060,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1031,4 +1031,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1064,4 +1064,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1056,4 +1056,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1038,4 +1038,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1037,4 +1037,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1037,4 +1037,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1040,4 +1040,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1038,4 +1038,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1057,4 +1057,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1033,4 +1033,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1036,4 +1036,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1049,4 +1049,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1059,4 +1059,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1043,4 +1043,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>

View File

@@ -1057,4 +1057,5 @@ $strOptimize = 'Optimize'; //to translate
$strRebuild = 'Rebuild'; //to translate
$strRepair = 'Repair'; //to translate
$strRemovePartitioning = 'Remove partitioning'; //to translate
$strSearchInField = 'Inside field:'; //to translate
?>