Subversion Repositories eFlore/Applications.del

Rev

Rev 1521 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1521 Rev 1595
Line 157... Line 157...
157
	$p['navigation.depart'] = filter_var(@$params['navigation.depart'],
157
	$p['navigation.depart'] = filter_var(@$params['navigation.depart'],
158
					     FILTER_VALIDATE_INT,
158
					     FILTER_VALIDATE_INT,
159
					     array('options' => array('default' => NULL,
159
					     array('options' => array('default' => NULL,
160
								      'min_range' => 0,
160
								      'min_range' => 0,
161
								      'max_range' => _LISTE_OBS_MAX_ID_OBS)));
161
								      'max_range' => _LISTE_OBS_MAX_ID_OBS)));
162
	if(isset($params['masque.departement'])) {
162
	if (isset($params['masque.departement'])) {
163
	    // STRING: 0 -> 95, 971 -> 976, 2A + 2B (./services/configurations/config_departements_bruts.ini)
163
		// STRING: 0 -> 95, 971 -> 976, 2A + 2B (./services/configurations/config_departements_bruts.ini)
164
	    // accept leading 0 ?
164
		// accept leading 0 ?
165
	    // TODO; filter patterns like 555.
165
		// TODO; filter patterns like 555.
166
	    if(preg_match(';^(\d{2}|\d{3}|2a|2b)$;i', $params['masque.departement'])) {
166
		if (preg_match(';^(\d{2}|\d{3}|2a|2b)$;i', $params['masque.departement']) != 0) {
-
 
167
			if(is_numeric($params['masque.departement'])) {
167
		$p['masque.departement'] = $params['masque.departement'];
168
				$p['masque.departement'] = str_pad($params['masque.departement'], 5, '_');
168
	    }
169
			} else {
169
	    // cf configurations/config_departements_bruts.ini
170
				$p['masque.departement'] = $params['masque.departement'];
-
 
171
			}
170
	    elseif( !is_null($c) && ( $x = $c->getParametre(
172
		} else {
171
		strtolower(str_replace(' ','-',iconv("UTF-8", "ASCII//TRANSLIT", $params['masque.departement'])))
173
			$dpt_chaine = strtolower(str_replace(' ','-',iconv("UTF-8", "ASCII//TRANSLIT", $params['masque.departement'])));
172
	    ))) {
174
			$c->chargerConfiguration('config_departements_bruts.ini');
173
		$p['masque.departement'] = sprintf("INSEE-C:%02d___", $x);
175
			$p['masque.departement'] = str_pad($c->getParametre($dpt_chaine), 5, '_');
174
	    }
176
		}
175
	}
177
	}
Line 176... Line 178...
176
 
178
 
177
	if(isset($params['masque.date'])) {
179
	if(isset($params['masque.date'])) {
178
	    // une année, TODO: masque.annee
180
	    // une année, TODO: masque.annee