Overview
Comment:Rejeter les recherches invalides
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dev
Files: files | file ages | folders
SHA1: ef3a17ceddcdb93ed6ba377a833389fabcd6da8c
User & Date: bohwaz on 2018-10-09 16:50:15
Other Links: branch diff | manifest | tags
Context
2018-10-09
16:56
Ajout recherche exemple à la mise à jour check-in: 01e4da6f6e user: bohwaz tags: dev
16:50
Rejeter les recherches invalides check-in: ef3a17cedd user: bohwaz tags: dev
16:46
Création d'une recherche par défaut à l'installation check-in: 96bf857cc1 user: bohwaz tags: dev
Changes

Modified src/include/lib/Garradin/Recherche.php from [4a862884ec] to [330b3b6bc8].

267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
				}

				if (!array_key_exists($condition['column'], $target_columns))
				{
					// Ignorer une condition qui se rapporte à une colonne
					// qui n'existe pas, cas possible si on reprend une recherche
					// après avoir modifié les fiches de membres
					continue;
				}

				$query_columns[] = $condition['column'];
				$column = $target_columns[$condition['column']];

				if ($column->textMatch == 'text')
				{







|







267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
				}

				if (!array_key_exists($condition['column'], $target_columns))
				{
					// Ignorer une condition qui se rapporte à une colonne
					// qui n'existe pas, cas possible si on reprend une recherche
					// après avoir modifié les fiches de membres
					throw new UserException('Cette recherche fait référence à un champ qui n\'existe plus dans les fiches de membres.');
				}

				$query_columns[] = $condition['column'];
				$column = $target_columns[$condition['column']];

				if ($column->textMatch == 'text')
				{
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
						$query = substr_replace($query, $db->quote(array_shift($values)), $pos, 1);
					}
				}

				$query_group_conditions[] = $query;
			}

			if ($query_group_conditions)
			{
				$query_groups[] = implode(' ' . $group['operator'] . ' ', $query_group_conditions);
			}
		}

		$query_columns = array_unique($query_columns);








|







338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
						$query = substr_replace($query, $db->quote(array_shift($values)), $pos, 1);
					}
				}

				$query_group_conditions[] = $query;
			}

			if (count($query_group_conditions))
			{
				$query_groups[] = implode(' ' . $group['operator'] . ' ', $query_group_conditions);
			}
		}

		$query_columns = array_unique($query_columns);