Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 1714 Rev 1715
Line 153... Line 153...
153
		}
153
		}
Line 154... Line 154...
154
 
154
 
155
		if(isset($groupe_de_champs['etendu'])) {
155
		if(isset($groupe_de_champs['etendu'])) {
156
			$colonnes += array(
156
			$colonnes += array(
157
				// champ dynamique
157
				// champ dynamique
158
				'etendu'			=> self::GenColInfo('etendu', '', 1, NULL, NULL, FALSE, NULL, NULL),
158
				'etendu'			=> self::GenColInfo('etendu', '', 1, NULL, NULL, FALSE, array(__CLASS__, 'champsEtendus_preload'), NULL),
159
			);
159
			);
Line 160... Line 160...
160
		}
160
		}
161
 
161
 
Line 572... Line 572...
572
 
572
 
573
		// cache
573
		// cache
574
		self::$cache['getBaseflor'][$cache_id] = $data;
574
		self::$cache['getBaseflor'][$cache_id] = $data;
575
		$ligne = array_merge($ligne, $data);
575
		$ligne = array_merge($ligne, $data);
576
	}
-
 
577
}
576
	}
-
 
577
 
-
 
578
	static function champsEtendus_preload($cel, $obsids) {
-
 
579
		$gestion_champs_etendus = new GestionChampsEtendus($cel->config, 'obs');
-
 
580
		$champs_supp_par_obs = $gestion_champs_etendus->consulterParLots($obsids);
-
 
581
		$colonnes_champs_supp_par_obs = $gestion_champs_etendus->consulterClesParLots($obsids);
-
 
582
		self::$cache['champsEtendus']['header'] = $colonnes_champs_supp_par_obs;
-
 
583
		foreach($champs_supp_par_obs as &$v) {
-
 
584
			$v = self::champsEtendus_aplatir($v);
-
 
585
		}
-
 
586
		self::$cache['champsEtendus']['data'] = $champs_supp_par_obs;
-
 
587
		// ce return est temporaire,
-
 
588
		// le temps que toutes les fonctions bougent ici et utilise plutôt le cache statique
-
 
589
		return self::$cache['champsEtendus'];
-
 
590
	}
-
 
591
 
-
 
592
	// XXX: PHP-5.3, fonction anonyme + array_map
-
 
593
	static function champsEtendus_aplatir($ligne_champs_etendus) {
-
 
594
		$champs_etendus_fmt = array();
-
 
595
		if(!$ligne_champs_etendus) return $champs_etendus_fmt;
-
 
596
		foreach($ligne_champs_etendus as $champ) {
-
 
597
			$champs_etendus_fmt[$champ->cle] = $champ->valeur;
-
 
598
		}
-
 
599
		return $champs_etendus_fmt;
-
 
600
	}
-
 
601
}