Check mandatory fields¶
Goal : check if necessary informations are filled when creating/updating an item
The feature is closed to UnicityCriteria
Add class :
class MandatoryFields extends CommonDropdown
Before checking for field unicity, check for mandatory fields
Add a new Ocs reject item status to indicate that the item add or update failed because one or more mandatory fields is missing
Table¶
CREATE TABLE IF NOT EXISTS `glpi_mandatoryfields` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `itemtype` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `entities_id` int(11) NOT NULL DEFAULT '-1', `fields` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `is_active` tinyint(1) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Stores mandatory fields';