Index: branches/RC/core/install/install_schema.sql
===================================================================
diff -u -N -r11599 -r11600
--- branches/RC/core/install/install_schema.sql (.../install_schema.sql) (revision 11599)
+++ branches/RC/core/install/install_schema.sql (.../install_schema.sql) (revision 11600)
@@ -33,6 +33,7 @@
DisplayOrder int(11) NOT NULL default '0',
OnGeneralTab tinyint(4) NOT NULL default '0',
IsSystem tinyint(3) unsigned NOT NULL default '0',
+ IsRequired tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (CustomFieldId),
KEY `Type` (`Type`),
KEY MultiLingual (MultiLingual),
Index: branches/RC/core/install/upgrades.sql
===================================================================
diff -u -N -r11599 -r11600
--- branches/RC/core/install/upgrades.sql (.../upgrades.sql) (revision 11599)
+++ branches/RC/core/install/upgrades.sql (.../upgrades.sql) (revision 11600)
@@ -1110,3 +1110,5 @@
UPDATE Phrase SET Module = 'Core' WHERE Phrase IN ('la_Hide', 'la_Show', 'la_fld_Requied', 'la_col_Modified');
ALTER TABLE Phrase ADD UNIQUE (LanguageId, Phrase);
+
+ALTER TABLE CustomField ADD IsRequired TINYINT( 3 ) UNSIGNED;
Index: branches/RC/core/units/custom_fields/custom_fields_config.php
===================================================================
diff -u -N -r11538 -r11600
--- branches/RC/core/units/custom_fields/custom_fields_config.php (.../custom_fields_config.php) (revision 11538)
+++ branches/RC/core/units/custom_fields/custom_fields_config.php (.../custom_fields_config.php) (revision 11600)
@@ -86,7 +86,9 @@
'DefaultValue' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
'DisplayOrder' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'OnGeneralTab' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
- 'IsSystem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0), ),
+ 'IsSystem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
+ 'IsRequired' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
+ ),
'VirtualFields' => Array(
'Value' => Array('type' => 'string', 'default' => ''),
'OriginalValue' => Array('type' => 'string', 'default' => ''),
Index: branches/RC/core/admin_templates/custom_fields/custom_fields_edit.tpl
===================================================================
diff -u -N -r11538 -r11600
--- branches/RC/core/admin_templates/custom_fields/custom_fields_edit.tpl (.../custom_fields_edit.tpl) (revision 11538)
+++ branches/RC/core/admin_templates/custom_fields/custom_fields_edit.tpl (.../custom_fields_edit.tpl) (revision 11600)
@@ -75,6 +75,7 @@
+
Index: branches/RC/core/units/custom_data/custom_data_event_handler.php
===================================================================
diff -u -N -r10856 -r11600
--- branches/RC/core/units/custom_data/custom_data_event_handler.php (.../custom_data_event_handler.php) (revision 10856)
+++ branches/RC/core/units/custom_data/custom_data_event_handler.php (.../custom_data_event_handler.php) (revision 11600)
@@ -112,6 +112,10 @@
$custom_name = $custom_params['FieldName'];
$field_options = Array('type' => 'string', 'not_null' => 1, 'default' => $custom_params['DefaultValue']);
+ if ($custom_params['IsRequired']) {
+ $field_options['required'] = 1;
+ }
+
switch ($custom_params['ElementType']) {
case 'date':
case 'datetime':