Subversion Repositories eFlore/Applications.coel-consultation

Rev

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

Rev 169 Rev 175
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: aControleur.php 169 2011-03-11 09:15:42Z jpm $
12
 * @version		SVN: $Id: aControleur.php 175 2013-11-18 13:37:01Z mathias $
13
 */
13
 */
14
abstract class aControleur extends Controleur {
14
abstract class aControleur 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 237... Line 237...
237
			$txt_a_retourner = 'oui';
237
			$txt_a_retourner = 'oui';
238
		}
238
		}
239
		return $txt_a_retourner;
239
		return $txt_a_retourner;
240
	}
240
	}
Line 241... Line 241...
241
	
241
	
242
	protected function formaterDate($date, $format = self::FMT_DATE_HEURE) {
242
	protected function formaterDate($date, $format = self::FMT_DATE_HEURE, $chaineSiVide = 'Inconnue') {
243
		if ($date == '' || $date == '0000-00-00' || $date == '0000-00-00 00:00:00') {
243
		if ($date == '' || $date == '0000-00-00' || $date == '0000-00-00 00:00:00') {
244
			$date = 'Inconnue';
244
			$date = $chaineSiVide;
245
		} else {
245
		} else {
246
			if (preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2})(?: ([0-9]{2}):([0-9]{2}):([0-9]{2})|)$/', $date, $match)) {// Date Heure
246
			if (preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2})(?: ([0-9]{2}):([0-9]{2}):([0-9]{2})|)$/', $date, $match)) {// Date Heure
247
				$annee = $match[1];
247
				$annee = $match[1];
248
				$mois = $match[2];
248
				$mois = $match[2];