Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 2462 Rev 3124
Line 256... Line 256...
256
	}
256
	}
Line 257... Line 257...
257
 
257
 
258
	/**
258
	/**
259
	 * Renvoie la liste des groupes de champs étendus
259
	 * Renvoie la liste des groupes de champs étendus
260
	 */
260
	 */
261
	public function consulterGroupesChampsEtendusPredefinis() {
261
	public function consulterGroupesChampsEtendusPredefinis($groupe = "", $langue = 'fr') {
262
		$groupes = array();
262
		$groupes = array();
263
		$requete =  "SELECT cc.cle as cle_groupe, cc.label as nom_groupe, ccc.cle as cle_champ, ccc.label as label_champ, ccc.invisible, ccc.prive ".
263
		$requete =  "SELECT cc.cle as cle_groupe, cc.label as nom_groupe, ccc.cle as cle_champ, ccc.label as label_champ, ccc.type as type_champ, ccc.valeur as valeur_champ, ccc.invisible, ccc.prive ".
264
			"FROM `cel_catalogue_champs_etendus` cc ".
264
			"FROM `cel_catalogue_champs_etendus` cc ".
265
			"INNER JOIN cel_catalogue_champs_etendus_liaison cl ON cc.cle = cl.groupe ".
265
			"INNER JOIN cel_catalogue_champs_etendus_liaison cl ON cc.cle = cl.groupe ".
-
 
266
			"INNER JOIN cel_catalogue_champs_etendus ccc ON ccc.cle = cl.champ ". 
-
 
267
			"WHERE cc.langue = '".$langue."' ";
266
			"INNER JOIN cel_catalogue_champs_etendus ccc ON ccc.cle = cl.champ ".
268
		if ($groupe !== "") $requete .= " AND cl.groupe = '".$groupe."'";
267
			' -- '.__FILE__.':'.__LINE__;
269
		$requete .= ' -- '.__FILE__.':'.__LINE__;
Line 268... Line 270...
268
		$groupes_champs = Cel::db()->executerRequete($requete);
270
		$groupes_champs = Cel::db()->executerRequete($requete);
269
 
271
 
Line 291... Line 293...
291
			}
293
			}
Line 292... Line 294...
292
 
294
 
293
			$infos_groupe['champs'][] = array(
295
			$infos_groupe['champs'][] = array(
294
				'cle'	=> $groupe_champ['cle_champ'],
296
				'cle'	=> $groupe_champ['cle_champ'],
-
 
297
				'label' => $groupe_champ['label_champ'],
-
 
298
				'type' => $groupe_champ['type_champ'],
295
				'label' => $groupe_champ['label_champ'],
299
				'valeur' => $groupe_champ['valeur_champ'],
296
				'options' => array(
300
				'options' => array(
297
					'invisible' => $groupe_champ['invisible'],
301
					'invisible' => $groupe_champ['invisible'],
298
					'prive'	=> $groupe_champ['prive'])
302
					'prive'	=> $groupe_champ['prive'])
299
			);
303
			);
Line 310... Line 314...
310
	}
314
	}
Line 311... Line 315...
311
 
315
 
312
	/**
316
	/**
313
	 * Renvoie le catalogue des champs étendus
317
	 * Renvoie le catalogue des champs étendus
314
	 */
318
	 */
315
	public function consulterCatalogueChampsEtendusPredefinis($ordonner_par_cle = false) {
319
	public function consulterCatalogueChampsEtendusPredefinis($ordonner_par_cle = false, $groupe = "") {
316
		$requete =  'SELECT cle, label, invisible, prive '.
320
		$requete =  'SELECT cle, label, invisible, prive '.
-
 
321
			'FROM cel_catalogue_champs_etendus AS cc ';
317
			'FROM cel_catalogue_champs_etendus AS cc '.
322
		if ($groupe !== "") $requete .= " WHERE groupe = ".$groupe;
318
			' -- '.__FILE__.':'.__LINE__;
323
		$requete .= ' -- '.__FILE__.':'.__LINE__;
Line 319... Line 324...
319
		$catalogue = Cel::db()->executerRequete($requete);
324
		$catalogue = Cel::db()->executerRequete($requete);
-
 
325
 
320
 
326
		$infos_champs = array();
321
		$infos_champs = array();
327
		if ($catalogue != false) {
322
		foreach ($catalogue as $champ) {
328
			foreach ($catalogue as $champ) {
323
			$champ_fmt = array(
329
				$champ_fmt = array(
324
				'cle'	=> $champ['cle'],
330
					'cle'	=> $champ['cle'],
325
				'label' => $champ['label'],
331
					'label' => $champ['label'],
326
				'options' => array(
332
					'options' => array(
327
					'invisible' => $champ['invisible'],
333
						'invisible' => $champ['invisible'],
328
					'prive'	=> $champ['prive'])
334
						'prive'	=> $champ['prive'])
329
			);
335
				);
330
			if ($ordonner_par_cle) {
336
				if ($ordonner_par_cle) {
331
				$infos_champs[$champ_fmt['cle']] = $champ_fmt;
337
					$infos_champs[$champ_fmt['cle']] = $champ_fmt;
-
 
338
				} else {
332
			} else {
339
					$infos_champs[] = $champ_fmt;
333
				$infos_champs[] = $champ_fmt;
340
				}
334
			}
341
			}
335
		}
342
		}