Modification des valeurs par default des champs dates

This commit is contained in:
Damien LASSERRE 2012-01-16 13:49:46 +00:00
parent d7459aee6e
commit bd0903538e

View File

@ -114,21 +114,21 @@ Class Fields
'dateCrea_ent' => array(
'label' => 'Date de création de l\'entreprose',
'fields' => array(
'date' => array('value' => null)
'interval' => array('value' => array('0', '1000'))
),
'famille' => 'entreprise',
'activated' => true,
'type' => 'date',
'type' => 'interval',
'userValue' => null
),
'dateCrea_etab' => array(
'label' => 'Date de création de l\'etablissement',
'fields' => array(
'date' => array('value' => null)
'interval' => array('value' => array('0', '1000'))
),
'famille' => 'entreprise',
'activated' => true,
'type' => 'date',
'type' => 'interval',
'userValue' => null
),
'nbActio' => array(
@ -356,11 +356,11 @@ Class Fields
'dateImmat' => array(
'label' => 'Date d\'immatriculation',
'fields' => array(
'date' => array('value' => null),
'interval' => array('value' => array('0', '1000'))
),
'famille' => 'juridique',
'activated' => true,
'type' => 'date',
'type' => 'interval',
'userValue' => null
),
//financier
@ -407,21 +407,21 @@ Class Fields
'bilAnnee' => array(
'label' => 'Dernière année de bilan',
'fields' => array(
'date' => array('value' => null),
'interval' => array('value' => array('0', '1000'))
),
'famille' => 'financier',
'activated' => true,
'type' => 'date',
'type' => 'interval',
'userValue' => null
),
'bilCloture' => array(
'label' => 'Dernière date de clôture du bilan',
'fields' => array(
'date' => array('value' => null),
'interval' => array('value' => array('0', '1000'))
),
'famille' => 'financier',
'activated' => true,
'type' => 'date',
'type' => 'interval',
'userValue' => null
),
'bilEE' => array(
@ -565,6 +565,7 @@ Class Fields
'userValue' => null
)
);
protected $requeteSql = array('cj');
public function __construct($login)
{
@ -581,6 +582,7 @@ Class Fields
$json = $prefs->json;
foreach($this->fields as $name => $valeur) {
$sessionValeur = $session->getCritere($name);
if(!empty($json))
{
$prefs = json_decode($json);
@ -593,8 +595,15 @@ Class Fields
}
}
}
if($session->getCritere($name) != null) {
$this->fields[$name]['userValue'] = $session->getCritere($name);
if(in_array($name, $this->requeteSql) and (empty($sessionValeur))) {
$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'];
}
$this->fields['cj']['fields']['select']['value'] = $value;
}
}
}
@ -633,4 +642,9 @@ Class Fields
}
return (json_encode($desactivated));
}
public function getLibelle($name)
{
return ($this->fields[$name]['label']);
}
}