diff --git a/plugins/admin/departments/class_country.inc b/plugins/admin/departments/class_country.inc index ddc06d92bf5a47ec8c1a5ff745945a404eb28b9e..fc6a3cb94585cc2ad2ed4d83a094a114fda830ed 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; } }