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

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 ...@@ -136,6 +136,39 @@ class supannConfig extends simplePlugin
'/^.+@.+$/', 'unicampus@univ.example.com' '/^.+@.+$/', '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 OrderedArrayAttribute(
new CharSeparatedCompositeAttribute( new CharSeparatedCompositeAttribute(
_('Domains for card applications'), _('Domains for card applications'),
......
# Formats
# TECHONOLOGY:ENCODING;label
MIFARE:XLSB;Mifare XLSB
...@@ -7,5 +7,5 @@ lecteur;lecteur de bibliothèque ...@@ -7,5 +7,5 @@ lecteur;lecteur de bibliothèque
prestataire;prestataire de services prestataire;prestataire de services
vehicule;véhicule vehicule;véhicule
externe;externe 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 # {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' ...@@ -46,6 +46,12 @@ attributetype ( 1.3.6.1.4.1.38414.17.1.7 NAME 'fdSupannCMSAppDomains'
SUBSTR caseIgnoreSubstringsMatch SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15) 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 # Object Class
objectclass ( 1.3.6.1.4.1.38414.17.2.1 NAME 'fdSupannPluginConf' objectclass ( 1.3.6.1.4.1.38414.17.2.1 NAME 'fdSupannPluginConf'
DESC 'FusionDirectory SupAnn plugin configuration' DESC 'FusionDirectory SupAnn plugin configuration'
...@@ -54,5 +60,5 @@ objectclass ( 1.3.6.1.4.1.38414.17.2.1 NAME 'fdSupannPluginConf' ...@@ -54,5 +60,5 @@ objectclass ( 1.3.6.1.4.1.38414.17.2.1 NAME 'fdSupannPluginConf'
MAY ( MAY (
fdSupannStructuresRDN $ fdSupannPasswordRecovery $ fdSupannStructuresRDN $ fdSupannPasswordRecovery $
fdSupannRessourceSubStates $ fdSupannRessourceSubStatesLabels $ fdSupannRessourceLabels $ fdSupannRessourceSubStates $ fdSupannRessourceSubStatesLabels $ fdSupannRessourceLabels $
fdSupannCMSSources $ fdSupannCMSAppDomains fdSupannCMSSources $ fdSupannCMSFormats $ fdSupannCMSAppDomains
) ) ) )
...@@ -26,7 +26,13 @@ class SupannCMSAffectationAttribute extends SupannCompositeAttribute ...@@ -26,7 +26,13 @@ class SupannCMSAffectationAttribute extends SupannCompositeAttribute
{ {
global $config; global $config;
list($types, $typeLabels) = supann::get_choices_for('cmstype'); 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 = [ $attributes = [
new SelectAttribute( new SelectAttribute(
_('Type'), _('supannCMSType - Card type'), _('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