Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 1766 Rev 1791
Line 7... Line 7...
7
* @copyright 2013 Tela-Botanica
7
* @copyright 2013 Tela-Botanica
8
* @license   http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
8
* @license   http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
9
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
9
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
10
*/
10
*/
11
define('SEPARATEUR_IMAGES', " / ");
11
define('SEPARATEUR_IMAGES', " / ");
-
 
12
define('PREFIX_CHAMPS_ETENDUS', "ext:");
Line 12... Line 13...
12
 
13
 
Line 13... Line 14...
13
Class FormateurGroupeColonne {
14
Class FormateurGroupeColonne {
14
 
15
 
Line 737... Line 738...
737
		// TODO: optimize, 1 seule requête
738
		// TODO: optimize, 1 seule requête
738
		if(!$colonnes_champs_supp_par_obs) return Array('header' => array(), 'data' => array());
739
		if(!$colonnes_champs_supp_par_obs) return Array('header' => array(), 'data' => array());
Line 739... Line 740...
739
 
740
 
Line 740... Line 741...
740
		$champs_supp_par_obs = $gestion_champs_etendus->consulterParLots($obsids);
741
		$champs_supp_par_obs = $gestion_champs_etendus->consulterParLots($obsids);
-
 
742
 
741
 
743
		self::$cache['champsEtendus']['header'] = self::champsEtendus_prefixHeader($colonnes_champs_supp_par_obs);
742
		self::$cache['champsEtendus']['header'] = $colonnes_champs_supp_par_obs;
744
 
743
		foreach($champs_supp_par_obs as &$v) {
745
		foreach($champs_supp_par_obs as &$v) {
744
			$v = self::champsEtendus_aplatir($v);
746
			$v = self::champsEtendus_aplatir($v);
745
		}
747
		}
Line 749... Line 751...
749
		// encore utilisé pour les entêtes (self::$cache['champsEtendus']['header'])
751
		// encore utilisé pour les entêtes (self::$cache['champsEtendus']['header'])
750
		return self::$cache['champsEtendus'];
752
		return self::$cache['champsEtendus'];
751
	}
753
	}
Line 752... Line 754...
752
 
754
 
-
 
755
	// XXX: PHP-5.3, fonction anonyme + array_map
-
 
756
	static function champsEtendus_prefixHeader($array) {
-
 
757
		return array_map(create_function('$v', 'return "' . PREFIX_CHAMPS_ETENDUS . '".$v;'), $array);
-
 
758
	}
-
 
759
 
753
	// XXX: PHP-5.3, fonction anonyme + array_map
760
	// XXX: PHP-5.3, fonction anonyme + array_map
754
	static function champsEtendus_aplatir($ligne_champs_etendus) {
761
	static function champsEtendus_aplatir($ligne_champs_etendus) {
755
		$champs_etendus_fmt = array();
762
		$champs_etendus_fmt = array();
756
		if(!$ligne_champs_etendus) return $champs_etendus_fmt;
763
		if(!$ligne_champs_etendus) return $champs_etendus_fmt;
757
		foreach($ligne_champs_etendus as $champ) {
764
		foreach($ligne_champs_etendus as $champ) {
758
			$champs_etendus_fmt[$champ->cle] = $champ->valeur;
765
			$champs_etendus_fmt[PREFIX_CHAMPS_ETENDUS . $champ->cle] = $champ->valeur;
759
		}
766
		}
760
		return $champs_etendus_fmt;
767
		return $champs_etendus_fmt;
Line 761... Line 768...
761
	}
768
	}