diff --git a/plugins/admin/departments/class_country.inc b/plugins/admin/departments/class_country.inc index 9003206e62fef947b280a03a2d36df81bdc61013..3fc3f5de4150e6a54205fedadb5c6b063a99b95d 100644 --- a/plugins/admin/departments/class_country.inc +++ b/plugins/admin/departments/class_country.inc @@ -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; } }