Commit ac185782 authored by Côme Chilliet's avatar Côme Chilliet

Merge branch '6015-add-support-for-supann-cms-carte-multi-service' into '1.4-dev'

Resolve "Add support for SupAnn CMS (Carte Multi Service)"

See merge request fusiondirectory/fd-plugins!708
parents 34e72f78 eb94970e
......@@ -136,6 +136,39 @@ class supannConfig extends simplePlugin
'/^.+@.+$/', 'unicampus@univ.example.com'
)
),
new OrderedArrayAttribute(
new CompositeAttribute(
_('Allowed formats for multiservice cards'),
'fdSupannCMSFormats',
[
new StringAttribute(
_('Technology'), _('Technology name in uppercase'),
'fdSupannCMSFormats_techno', TRUE,
'', '',
'/^[A-Z]+$/', 'MIFARE'
),
new StringAttribute(
_('Encoding'), _('Encoding name in uppercase'),
'fdSupannCMSFormats_encoding', TRUE,
'', '',
'/^[A-Z]+$/', 'XLSB'
),
new StringAttribute(
_('Label'), _('Format label'),
'fdSupannCMSFormats_label', TRUE,
'', '',
'', 'Mifare XLSB'
),
],
'/^([A-Z]*):([A-Z]*);(.*)$/',
'%s:%s;%s',
'',
_('Card formats')
),
FALSE,
['MIFARE:XLSB;Mifare XLSB'],
TRUE
),
new OrderedArrayAttribute(
new CharSeparatedCompositeAttribute(
_('Domains for card applications'),
......
# Formats
# TECHONOLOGY:ENCODING;label
MIFARE:XLSB;Mifare XLSB
......@@ -7,5 +7,5 @@ lecteur;lecteur de bibliothèque
prestataire;prestataire de services
vehicule;véhicule
externe;externe
# Ajouter ici les types locaux étiqueté si besoin
# Ajouter ici les types locaux étiquetés si besoin
# {ORIGINE}type_local;Type de carte défini localement par l'établissement ORIGINE
......@@ -46,6 +46,12 @@ attributetype ( 1.3.6.1.4.1.38414.17.1.7 NAME 'fdSupannCMSAppDomains'
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
attributetype ( 1.3.6.1.4.1.38414.17.1.8 NAME 'fdSupannCMSFormats'
DESC 'FusionDirectory - SupAnn possible labels for supannCMSIdEtiquette - format TECHNOLOGY:ENCODING;Label'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
# Object Class
objectclass ( 1.3.6.1.4.1.38414.17.2.1 NAME 'fdSupannPluginConf'
DESC 'FusionDirectory SupAnn plugin configuration'
......@@ -54,5 +60,5 @@ objectclass ( 1.3.6.1.4.1.38414.17.2.1 NAME 'fdSupannPluginConf'
MAY (
fdSupannStructuresRDN $ fdSupannPasswordRecovery $
fdSupannRessourceSubStates $ fdSupannRessourceSubStatesLabels $ fdSupannRessourceLabels $
fdSupannCMSSources $ fdSupannCMSAppDomains
fdSupannCMSSources $ fdSupannCMSFormats $ fdSupannCMSAppDomains
) )
......@@ -26,7 +26,13 @@ class SupannCMSAffectationAttribute extends SupannCompositeAttribute
{
global $config;
list($types, $typeLabels) = supann::get_choices_for('cmstype');
list($formats, $formatLabels) = supann::get_choices_for('cmsformat');
$formats = [];
$formatLabels = [];
foreach ($config->get_cfg_value('SupannCMSFormats', ['MIFARE:XLSB;Mifare XLSB']) as $supannCMSFormat) {
list($format, $label) = explode(';', $supannCMSFormat);
$formats[] = $format;
$formatLabels[] = $label;
}
$attributes = [
new SelectAttribute(
_('Type'), _('supannCMSType - Card type'),
......
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