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

Merge branch '5864-name-field-for-countries-should-be-limited-to-two-characters' into '1.3-dev'

Resolve "Name field for countries should be limited to two characters"

See merge request fusiondirectory/fd!350
Showing with 8 additions and 2 deletions
+8 -2
......@@ -50,8 +50,14 @@ class country extends department
$attributesInfo = parent::getDepartmentAttributesInfo(_('country'));
unset($attributesInfo['location']);
unset($attributesInfo['properties']['attrs'][3]); // category
/* Country c attribut cannot contain any underscore */
$attributesInfo['properties']['attrs'][1]->setPattern('/^[a-z0-9\.-]+$/i');
/* Replace Name field by country code */
$attributesInfo['properties']['attrs'][1] =
new StringAttribute(
_('Country code'), _('A two-letter country code from ISO 3166'),
static::$namingAttr, TRUE,
'', '',
'/^[a-z0-9\.-]{2}$/i', 'IT'
);
return $attributesInfo;
}
}
......
Supports Markdown
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