Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 1756 Rev 1760
Line 580... Line 580...
580
			// echo strftime("%Y/%m/%d 00:00:00", $timestamp); // NON
580
			// echo strftime("%Y/%m/%d 00:00:00", $timestamp); // NON
581
		}
581
		}
582
		else {
582
		else {
583
			// attend l'un des formats de
583
			// attend l'un des formats de
584
			// http://www.php.net/manual/fr/datetime.formats.date.php
584
			// http://www.php.net/manual/fr/datetime.formats.date.php
585
			// le plus simple: YYYY/MM/DD (utilisé à l'export)
585
			// le plus simple: YYYY/MM/DD (utilisé à l'export), mais DD-MM-YYYY est aussi supporté
-
 
586
			$matches = NULL;
-
 
587
			// et on essaie d'être sympa et supporter aussi DD/MM/YYYY
-
 
588
			if(preg_match(';^([0-3]?\d)/([01]\d)/([12]\d\d\d)$;', $date, $matches)) {
-
 
589
				$date = $matches[3] . '/' . $matches[2] . '/' . $matches[1];
-
 
590
			}
586
			$timestamp = strtotime($date);
591
			$timestamp = strtotime($date);
587
			if(! $timestamp) {
592
			if(! $timestamp) {
588
				if($date) trigger_error("ligne \"{$ligne[C_NOM_SEL]}\": Attention: date erronée ($date)", E_USER_NOTICE);
593
				if($date) trigger_error("ligne \"{$ligne[C_NOM_SEL]}\": Attention: date erronée ($date)", E_USER_NOTICE);
589
				return NULL;
594
				return NULL;
590
			}
595
			}
Line 600... Line 605...
600
		if(strpos($referentiel, 'isfan') !== FALSE) return 'isfan:v1.00';
605
		if(strpos($referentiel, 'isfan') !== FALSE) return 'isfan:v1.00';
601
		if(strpos($referentiel, 'autre') !== FALSE) return 'autre';
606
		if(strpos($referentiel, 'autre') !== FALSE) return 'autre';
Line 602... Line 607...
602
 
607
 
603
		if($referentiel) {
608
		if($referentiel) {
-
 
609
			trigger_error("ligne \"{$ligne[C_NOM_SEL]}\": Attention: référentiel inconnu", E_USER_NOTICE);
604
			trigger_error("ligne \"{$ligne[C_NOM_SEL]}\": Attention: référentiel inconnu", E_USER_NOTICE);
610
			return 'autre';
605
		}
611
		}
606
		return NULL;
612
		return NULL;
607
		/* TODO: cf story,
613
		/* TODO: cf story,
608
		   En cas de NULL faire une seconde passe de détection à partir du nom saisi
614
		   En cas de NULL faire une seconde passe de détection à partir du nom saisi