Subversion Repositories eFlore/Applications.del

Rev

Rev 1677 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1677 Rev 1793
Line 22... Line 22...
22
	private $squelette = null;
22
	private $squelette = null;
23
	private $squelette_dossier = null;
23
	private $squelette_dossier = null;
24
	private $masque = array();
24
	private $masque = array();
25
	private $mappingFiltre = array();
25
	private $mappingFiltre = array();
26
	private $conteneur = null;
26
	private $conteneur = null;
27
	private $gestionBdd = null;
27
	private $bdd = null;
28
	private $navigation = null;
28
	private $navigation = null;
29
	private $type_rss = null;
29
	private $type_rss = null;
Line 30... Line 30...
30
 
30
 
31
	/**
31
	/**
Line 35... Line 35...
35
	public function __construct(Conteneur $conteneur = null) {
35
	public function __construct(Conteneur $conteneur = null) {
36
		$this->conteneur = $conteneur == null ? new Conteneur() : $conteneur;
36
		$this->conteneur = $conteneur == null ? new Conteneur() : $conteneur;
37
		$this->conteneur->chargerConfiguration('config_syndication_votesparprotocole.ini');
37
		$this->conteneur->chargerConfiguration('config_syndication_votesparprotocole.ini');
38
		$this->mappingFiltre = $this->conteneur->getParametre('mapping_masque');
38
		$this->mappingFiltre = $this->conteneur->getParametre('mapping_masque');
39
		$this->masque = $conteneur->getMasque();
39
		$this->masque = $conteneur->getMasque();
40
		$this->gestionBdd = $conteneur->getGestionBdd();
40
		$this->bdd = $conteneur->getBdd();
41
		$this->navigation = $conteneur->getNavigation();
41
		$this->navigation = $conteneur->getNavigation();
42
	}
42
	}
Line 43... Line 43...
43
 
43
 
44
	/**
44
	/**
Line 274... Line 274...
274
				'			= duv.id_utilisateur '.
274
				'			= duv.id_utilisateur '.
275
				$this->chargerClauseWhere().' '.
275
				$this->chargerClauseWhere().' '.
276
				'ORDER BY divo.date DESC '.
276
				'ORDER BY divo.date DESC '.
277
				'LIMIT '.$this->navigation->getDepart().','.$this->navigation->getLimite();
277
				'LIMIT '.$this->navigation->getDepart().','.$this->navigation->getLimite();
Line 278... Line 278...
278
 
278
 
279
		$elements = $this->gestionBdd->getBdd()->recupererTous($requete);
279
		$elements = $this->bdd->recupererTous($requete);
280
		return $elements;
280
		return $elements;
Line 281... Line 281...
281
	}
281
	}
282
 
282
 
Line 289... Line 289...
289
		if (!empty($tableauMasque)) {
289
		if (!empty($tableauMasque)) {
290
			foreach($tableauMasque as $idMasque => $valeurMasque) {
290
			foreach($tableauMasque as $idMasque => $valeurMasque) {
291
				$idMasque = str_replace('masque.', '', $idMasque);
291
				$idMasque = str_replace('masque.', '', $idMasque);
292
				switch ($idMasque) {
292
				switch ($idMasque) {
293
					case 'image':
293
					case 'image':
294
						$where[] = ' '.$this->mappingFiltre[$idMasque].' = '.$this->gestionBdd->getBdd()->proteger($valeurMasque);
294
						$where[] = ' '.$this->mappingFiltre[$idMasque].' = '.$this->bdd->proteger($valeurMasque);
295
					break;
295
					break;
296
					case 'protocole':
296
					case 'protocole':
297
						$where[] = ' '.$this->mappingFiltre[$idMasque].' = '.$this->gestionBdd->getBdd()->proteger($valeurMasque).' ';
297
						$where[] = ' '.$this->mappingFiltre[$idMasque].' = '.$this->bdd->proteger($valeurMasque).' ';
298
					break;
298
					break;
299
					default:
299
					default:
300
						$where[] = ' '.$this->mappingFiltre[$idMasque].' = '.$this->gestionBdd->getBdd()->proteger($valeurMasque);
300
						$where[] = ' '.$this->mappingFiltre[$idMasque].' = '.$this->bdd->proteger($valeurMasque);
301
					break;
301
					break;
302
				}
302
				}
303
			}
303
			}
304
		}
304
		}
305
		if (!empty($where)) {
305
		if (!empty($where)) {
Line 318... Line 318...
318
			if (strpos($auteurId, '@') === false) {
318
			if (strpos($auteurId, '@') === false) {
319
				$tableauNomPrenom = explode(' ',$auteurId, 2);
319
				$tableauNomPrenom = explode(' ',$auteurId, 2);
320
				if(count($tableauNomPrenom) == 2) {
320
				if(count($tableauNomPrenom) == 2) {
321
					// on teste potentiellement un nom prenom ou bien un prénom nom
321
					// on teste potentiellement un nom prenom ou bien un prénom nom
322
					$masque = '('.
322
					$masque = '('.
323
						'(dc.utilisateur_nom LIKE '.$this->gestionBdd->getBdd()->proteger($tableauNomPrenom[0].'%').' AND '.
323
						'(dc.utilisateur_nom LIKE '.$this->bdd->proteger($tableauNomPrenom[0].'%').' AND '.
324
							'dc.utilisateur_prenom LIKE '.$this->gestionBdd->getBdd()->proteger($tableauNomPrenom[1].'%').') OR '.
324
							'dc.utilisateur_prenom LIKE '.$this->bdd->proteger($tableauNomPrenom[1].'%').') OR '.
325
							'(dc.utilisateur_nom LIKE '.$this->gestionBdd->getBdd()->proteger($tableauNomPrenom[1].'%').' AND '.
325
							'(dc.utilisateur_nom LIKE '.$this->bdd->proteger($tableauNomPrenom[1].'%').' AND '.
326
							'dc.utilisateur_prenom LIKE '.$this->gestionBdd->getBdd()->proteger($tableauNomPrenom[0].'%').')'.
326
							'dc.utilisateur_prenom LIKE '.$this->bdd->proteger($tableauNomPrenom[0].'%').')'.
327
					')';
327
					')';
328
				} else {
328
				} else {
329
					$masque = '(
329
					$masque = '(
330
						(dc.utilisateur_nom LIKE '.$this->gestionBdd->getBdd()->proteger($auteurId.'%').' OR '.
330
						(dc.utilisateur_nom LIKE '.$this->bdd->proteger($auteurId.'%').' OR '.
331
						'dc.utilisateur_prenom LIKE '.$this->gestionBdd->getBdd()->proteger($auteurId.'%').')'.
331
						'dc.utilisateur_prenom LIKE '.$this->bdd->proteger($auteurId.'%').')'.
332
					')';
332
					')';
333
				}
333
				}
334
			} else {
334
			} else {
335
				$masque = " do.utilisateur_courriel LIKE ".$this->gestionBdd->getBdd()->proteger($valeurMasque.'%')." ";
335
				$masque = " do.utilisateur_courriel LIKE ".$this->bdd->proteger($valeurMasque.'%')." ";
336
			}
336
			}
337
		}
337
		}
338
		return $masque;
338
		return $masque;
339
	}
339
	}
340
}
340
}