Subversion Repositories eFlore/Applications.coel-consultation

Rev

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

Rev 91 Rev 93
Line 7... Line 7...
7
 * @package		Collection
7
 * @package		Collection
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
9
 * @copyright	2010 Tela-Botanica
9
 * @copyright	2010 Tela-Botanica
10
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
10
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
12
 * @version		SVN: $Id: ColControleur.php 91 2010-06-21 10:12:41Z jpm $
12
 * @version		SVN: $Id: ColControleur.php 93 2010-06-21 14:15:13Z jpm $
13
 */
13
 */
14
abstract class ColControleur extends Controleur {
14
abstract class ColControleur extends Controleur {
Line 15... Line 15...
15
	
15
	
16
	const FMT_DATE = '%d/%m/%Y';// Supporte les formats de dates non valides (1989-00-00)
16
	const FMT_DATE = '%d/%m/%Y';// Supporte les formats de dates non valides (1989-00-00)
Line 104... Line 104...
104
	protected function construireTxtTruckSimple($chaine_a_analyser) {
104
	protected function construireTxtTruckSimple($chaine_a_analyser) {
105
		return $this->construireTxtTruck($chaine_a_analyser, false, false);
105
		return $this->construireTxtTruck($chaine_a_analyser, false, false);
106
	}
106
	}
Line 107... Line 107...
107
	
107
	
108
	protected function construireTxtTruckSansMajuscule($chaine_a_analyser) {
108
	protected function construireTxtTruckSansMajuscule($chaine_a_analyser) {
109
		return $this->construireTxtTruck($chaine_a_analyser, false);
109
		return $this->construireTxtTruck($chaine_a_analyser, false, true);
Line 110... Line 110...
110
	}
110
	}
111
	
111
	
112
	protected function construireTxtTruckSansPointFinal($chaine_a_analyser) {
112
	protected function construireTxtTruckSansPointFinal($chaine_a_analyser) {
Line 113... Line 113...
113
		return $this->construireTxtTruck($chaine_a_analyser, true, false);
113
		return $this->construireTxtTruck($chaine_a_analyser, true, false);
-
 
114
	}
-
 
115
	
-
 
116
	protected function construireTxtTruck($chaine_a_analyser, $majuscule = true, $point_final = true) {
-
 
117
		$termes = $this->traiterTxtTruck($chaine_a_analyser);
-
 
118
		$chaine_a_retourner = $this->formaterTableauDeTxt($termes, $majuscule, $point_final);
-
 
119
		return $chaine_a_retourner;
114
	}
120
	}
115
	
121
	
116
	protected function construireTxtTruck($chaine_a_analyser, $majuscule = true, $point_final = true) {
122
	protected function traiterTxtTruck($chaine_a_analyser) {
117
		$termes = array();
123
		$termes = array();
118
		if ((!is_null($chaine_a_analyser)) && (trim($chaine_a_analyser) != ''))	{
124
		if ((!is_null($chaine_a_analyser)) && (trim($chaine_a_analyser) != ''))	{
Line 126... Line 132...
126
						$termes[] = $valeur_formatee;
132
						$termes[] = $valeur_formatee;
127
					}
133
					}
128
				}
134
				}
129
			}
135
			}
130
		}
136
		}
131
		
-
 
132
		$chaine_a_retourner = $this->formaterTableauDeTxt($termes, $majuscule, $point_final);
-
 
133
		return $chaine_a_retourner;
137
		return $termes;
134
	}
138
	}
Line 135... Line 139...
135
	
139
	
136
	protected function getTxtTruckParPosition($chaine_a_analyser, $position = 1) {
140
	protected function getTxtTruckParPosition($chaine_a_analyser, $position = 1) {
137
		$retour = '';
141
		$retour = '';
Line 261... Line 265...
261
			}
265
			}
262
		}
266
		}
263
		return $date;
267
		return $date;
264
	}
268
	}
Line -... Line 269...
-
 
269
	
-
 
270
	protected function formaterCourriels($courriels) {
-
 
271
		$fmt_courriels = array();
-
 
272
		$courriels = (is_array($courriels)) ? $courriels : array($courriels);
-
 
273
		foreach ($courriels as $cle => $courriel) {
-
 
274
			$courriel = preg_replace('/@/', ' [arrobase] ', $courriel);
-
 
275
			$courriel = preg_replace('/[.]([^.]+)$/', " [point] $1", $courriel);
-
 
276
			$fmt_courriels[] = $this->getVue('courriel', array('courriel' => $courriel));
-
 
277
		}
-
 
278
		$fmt_courriels = implode(', ', $fmt_courriels);
-
 
279
		return $fmt_courriels;
-
 
280
	}
265
	
281
	
266
	protected function nettoyerPointFinal($mot) {
282
	protected function nettoyerPointFinal($mot) {
267
		$mot = preg_replace('/[.]$/', '', $mot);
283
		$mot = preg_replace('/[.]$/', '', $mot);
268
		return $mot;
284
		return $mot;