Commit 61debe3e authored by Côme Chilliet's avatar Côme Chilliet

Merge branch...

Merge branch '6034-handle-special-values-for-regimeinsc-and-sectdisc-in-supannetuinscription' into '1.4-dev'

Resolve "Handle special values for regimeinsc and sectdisc in supannEtuInscription"

See merge request fusiondirectory/fd-plugins!691
parents 111ee7b8 47dc02a3
#SECTEUR_DISCIPLINAIRE_SISE;LIBELLE_SECTEUR_DISCIPLINAIRE
# Vient de http://infocentre.pleiade.education.fr/bcn/ table N_SECTEUR_DISCIPLINAIRE_SISE
# Généré le 23.01.2020
-;SANS OBJET
01;MATHEMATIQUES
02;PHYSIQUE
03;CHIMIE
......
#REGIME_INSCRIPTION;LIBELLE_LONG
# Vient de http://infocentre.pleiade.education.fr/bcn/ table N_REGIME_INSCRIPTION
# Généré le 23.01.2020
$;NON RENSEIGNE
01;PARENTS ELEVANT 3 ENFANTS
02;SPORTIFS DE HAUT NIVEAU
03;CADRES PLUS DE 5 ANS
......
......@@ -28,7 +28,7 @@ class SupannCursusAnneeAttribute extends SupannPrefixedSelectAttribute
new SelectAttribute('', '', $ldapName.'_prefix', $required),
new SelectAttribute('', '', $ldapName.'_content', FALSE)
];
CompositeAttribute::__construct($description, $ldapName, $attributes, '/^{SUPANN}(.)(\\d+)$/', '{SUPANN}%s%d', $acl, $label);
CompositeAttribute::__construct($description, $ldapName, $attributes, '/^{SUPANN}(.)(\\d*)$/', '{SUPANN}%s%s', $acl, $label);
$this->setLinearRendering(TRUE);
$this->attributes[0]->setChoices(
......@@ -51,6 +51,7 @@ class SupannCursusAnneeAttribute extends SupannPrefixedSelectAttribute
$this->supannUpdateSelect();
$this->setRequired($required);
}
protected function supannUpdateSelect ()
{
$prefix = $this->attributes[0]->getValue();
......
......@@ -39,11 +39,11 @@ class SupannEtuInscriptionAttribute extends SupannCompositeAttribute
),
new SelectAttribute(
_('Registration type'), _('supannEtuRegimeInscription - The type of this registration'),
'supannEtuRegimeInscription_regimeinsc', FALSE
'supannEtuRegimeInscription_regimeinsc', TRUE
),
new SelectAttribute(
_('Disciplinary Sector'), _('supannEtuSecteurDisciplinaire - Disciplinary sector education diploma'),
'supannEtuSecteurDisciplinaire_sectdisc', FALSE
'supannEtuSecteurDisciplinaire_sectdisc', TRUE
),
new SelectAttribute(
_('Diploma type'), _('supannEtuTypeDiplome - Type of diploma'),
......@@ -72,15 +72,30 @@ class SupannEtuInscriptionAttribute extends SupannCompositeAttribute
];
parent::__construct($description, $ldapName, $attributes, $acl, $label);
/* supannEtuRegimeInscription */
list ($codes, $labels) = supann::get_choices_for('eturegimeinscription_SISE', '{SISE}');
$this->attributes[2]->setChoices($codes, $labels); // supannEtuRegimeInscription
$key = array_search('{SISE}$', $codes);
if ($key !== FALSE) {
/* Move "empty" value as first one */
array_unshift($codes, ...array_splice($codes, $key, 1));
array_unshift($labels, ...array_splice($labels, $key, 1));
}
$this->attributes[2]->setChoices($codes, $labels);
/* supannEtuSecteurDisciplinaire */
list ($codes, $labels) = supann::get_choices_for('discipline_SISE', '{SISE}');
$this->attributes[3]->setChoices($codes, $labels); // supannEtuSecteurDisciplinaire
$key = array_search('{SISE}-', $codes);
if ($key !== FALSE) {
/* Move "empty" value as first one */
array_unshift($codes, ...array_splice($codes, $key, 1));
array_unshift($labels, ...array_splice($labels, $key, 1));
}
$this->attributes[3]->setChoices($codes, $labels);
$this->attributes[3]->setSubmitForm(TRUE);
/* supannEtuTypeDiplome */
list ($codes, $labels) = supann::get_choices_for('typediplome_SISE', '{SISE}');
$this->attributes[4]->setChoices($codes, $labels); // supannEtuTypeDiplome
$this->attributes[4]->setChoices($codes, $labels);
$this->attributes[4]->setSubmitForm(TRUE);
$prefixedChoices = supann::get_prefixed_choices_for(
......
......@@ -369,6 +369,19 @@ class supannAccount extends simplePlugin
list ($codes, $labels) = supann::get_choices_for('affiliation');
$this->attributesAccess['eduPersonAffiliation']->attribute->setChoices($codes, $labels);
$this->attributesAccess['supannEtuInscription']->setHeaders([
_('Establishment'),
_('Year'),
_('Registration type'),
_('Sector'),
_('Diploma type'),
_('Curriculum'),
_('Entity'),
_('Diploma'),
_('Step'),
_('Element'),
''
]);
$this->attributesAccess['supannEtuInscription']->setLinearRendering(FALSE);
$this->updateFieldsChoices();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment