Subversion Repositories eFlore/Applications.del

Rev

Rev 1168 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1168 Rev 1180
Line 307... Line 307...
307
		$str = preg_replace('#&[^;]+;#', '', $str); // supprime les autres caractères
307
		$str = preg_replace('#&[^;]+;#', '', $str); // supprime les autres caractères
Line 308... Line 308...
308
	
308
	
309
		return $str;
309
		return $str;
Line -... Line 310...
-
 
310
	}
-
 
311
	
-
 
312
	private function normaliserMotCle($mot_cle) {
-
 
313
		return mb_strtolower($this->supprimerAccents(trim($mot_cle)));
310
	}
314
	}
Line 311... Line 315...
311
	
315
	
312
	private function obtenirIdDepartement($nomDpt) {
316
	private function obtenirIdDepartement($nomDpt) {
Line 353... Line 357...
353
	private function creerFiltreMotsCles($valeurMasque) {
357
	private function creerFiltreMotsCles($valeurMasque) {
Line 354... Line 358...
354
		
358
		
355
		$mots_cles = explode(' ', $valeurMasque);
359
		$mots_cles = explode(' ', $valeurMasque);
356
		$requeteMotsClesImg = array();
360
		$requeteMotsClesImg = array();
-
 
361
		$requeteMotsClesObs = array();
Line 357... Line 362...
357
		$requeteMotsClesObs = array();
362
		$requeteMotsClesImgPublic = array();
-
 
363
		
358
		
364
		foreach($mots_cles as $mot_cle) {
-
 
365
			//TODO: rechercher sur les mots clés normalisés dans tous les cas ?
-
 
366
			$requeteMotsCles = $this->proteger('%'.$mot_cle.'%');
359
		foreach($mots_cles as $mot_cle) {
367
			$motsCleProtege = $this->proteger($this->normaliserMotCle('%'.$mot_cle.'%'));
360
			$requeteMotsCles = $this->proteger('%'.$mot_cle.'%');
368
			$requeteMotsClesImgPublic[] = 'di.id_image IN (SELECT ce_image FROM del_image_tag WHERE tag_normalise LIKE '.$motsCleProtege.' AND actif = 1)';
361
			$requeteMotsClesImg[] = 'di.mots_cles_texte LIKE '.$requeteMotsCles;
369
			$requeteMotsClesImg[] = 'di.mots_cles_texte LIKE '.$requeteMotsCles;
-
 
370
			$requeteMotsClesObs[] = 'dob.mots_cles_texte LIKE '.$requeteMotsCles;
-
 
371
		}
362
			$requeteMotsClesObs[] = 'dob.mots_cles_texte LIKE '.$requeteMotsCles;
372
 
363
		}
373
		$requeteMotsClesImgPublic = implode(' AND ', $requeteMotsClesImgPublic);
Line 364... Line 374...
364
		$requeteMotsClesImg = implode(' AND ', $requeteMotsClesImg);
374
		$requeteMotsClesImg = implode(' AND ', $requeteMotsClesImg);
-
 
375
		$requeteMotsClesObs = implode(' AND ', $requeteMotsClesObs);
365
		$requeteMotsClesObs = implode(' AND ', $requeteMotsClesObs);
376
		
366
		
377
		$masque = '('.
367
		$masque = '('.
378
					'('.$requeteMotsClesImgPublic.') OR '.
Line 368... Line 379...
368
		          	'('.$requeteMotsClesImg.') OR '.
379
		          	'('.$requeteMotsClesImg.') OR '.
Line 399... Line 410...
399
						   'FROM '.$this->gestionBdd->formaterTable('del_obs_image', 'doi').
410
						   'FROM '.$this->gestionBdd->formaterTable('del_obs_image', 'doi').
400
						   'INNER JOIN del_image di '.
411
						   'INNER JOIN del_image di '.
401
						   'ON doi.id_image = di.id_image '.
412
						   'ON doi.id_image = di.id_image '.
402
						   'INNER JOIN del_observation dob '.
413
						   'INNER JOIN del_observation dob '.
403
						   'ON doi.id_observation = dob.id_observation '.
414
						   'ON doi.id_observation = dob.id_observation '.
404
						   'INNER JOIN del_utilisateur du '.
415
						   'LEFT JOIN del_utilisateur du '.
405
						   'ON du.id_utilisateur = di.ce_utilisateur '.
416
						   'ON du.id_utilisateur = di.ce_utilisateur '.
406
							($this->doitJoindreTableTags() ?
417
							($this->doitJoindreTableTags() ?
407
						   		'LEFT JOIN del_image_tag dtag '.
418
						   		'LEFT JOIN del_image_tag dtag '.
408
						   		'ON doi.id_image = dtag.ce_image AND dtag.actif = 1 ' :
419
						   		'ON doi.id_image = dtag.ce_image AND dtag.actif = 1 ' :
409
						   		''
420
						   		''
Line 414... Line 425...
414
						   		''
425
						   		''
415
						   	);
426
						   	);
416
		$requeteLiaisons .= $this->chargerClauseWhere();
427
		$requeteLiaisons .= $this->chargerClauseWhere();
417
		$requeteLiaisons .= $this->getTri();
428
		$requeteLiaisons .= $this->getTri();
418
		$requeteLiaisons .= $this->gestionBdd->getLimitSql();
429
		$requeteLiaisons .= $this->gestionBdd->getLimitSql();
419
		//echo $requeteLiaisons;exit;
-
 
-
 
430
 
420
		return $this->bdd->recupererTous($requeteLiaisons);
431
		return $this->bdd->recupererTous($requeteLiaisons);
421
	}
432
	}
Line 422... Line 433...
422
	
433
	
423
	private function assemblercomptageOccurencesMotsClesCel() {
434
	private function assemblercomptageOccurencesMotsClesCel() {