Ajout des valeurs pas defaut mix max contenues dans la base local
This commit is contained in:
parent
af568d45d2
commit
9a70310c6a
@ -776,43 +776,30 @@ Class Fields
|
||||
{
|
||||
require_once('Scores/SessionCiblage.php');
|
||||
$session = new SessionCiblage();
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$db = Zend_Registry::get('db');
|
||||
/*$prefsModel = new Application_Model_Prefs($db);
|
||||
|
||||
$prefs = $prefsModel->find($login);
|
||||
$json = $prefs->json;*/
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
$db = Zend_Registry::get('db');
|
||||
|
||||
|
||||
foreach($this->fields as $name => $valeur) {
|
||||
/*if(!empty($json))
|
||||
{
|
||||
$prefs = json_decode($json);
|
||||
if(!empty($prefs)) {
|
||||
if(array_key_exists($name, $prefs)) {
|
||||
$this->fields[$name]['activated'] = false;
|
||||
if(is_array($this->fields[$name]['type'])) {
|
||||
$this->fields[$name]['type'] = $prefs[$name];
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
/*if(in_array($name, $this->requeteSql)) {
|
||||
$formeJuridiques = new Application_Model_Formejuridique();
|
||||
$sql = $formeJuridiques->select()->where('fjCode > 1000');
|
||||
$formeJuridiques = $formeJuridiques->fetchAll($sql)->toArray();
|
||||
$value = array();
|
||||
foreach($formeJuridiques as $form) {
|
||||
$value[$form['fjCode']] = $form['fjLibelle'].' ['.$form['fjCode'].']';
|
||||
}
|
||||
asort($value);
|
||||
$this->fields[$name]['fields']['select']['value'] = $value;
|
||||
}*/
|
||||
if($this->fields[$name]['type'] == 'interval') {
|
||||
$minmax = $this->getMinMax($name);
|
||||
$this->fields[$name]['fields'][$this->fields['type']]['value']
|
||||
= array($minmax[0]['min'], $minmax[0]['max']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static public function getMinMax($name)
|
||||
{
|
||||
$tab = array('dateCrea_ent','dateCrea_etab');
|
||||
if(!in_array($name, $tab)) {
|
||||
$table = new Table_Minmaxs();
|
||||
return ($table->fetchAll($table->select()->where('cle = ?', $name))->toArray());
|
||||
}
|
||||
return (array());
|
||||
}
|
||||
|
||||
public function getFields() {
|
||||
return ($this->fields);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user