$this->add('select', 'permission_operator', NULL, $operators);
//make separator location configurable
- $separator = [ts('None'), ts('After menu element'), ts('Before menu element')];
+ $separator = CRM_Core_SelectValues::navigationMenuSeparator();
$this->add('select', 'has_separator', ts('Separator'), $separator);
$active = $this->add('advcheckbox', 'is_active', ts('Enabled'));
default:
$field['phpType'] = $this->value('phpType', $fieldXML, $type);
$field['sqlType'] = $type;
- if ($type == 'int unsigned') {
+ if ($type == 'int unsigned' || $type == 'tinyint') {
$field['phpType'] = 'int';
$field['crmType'] = 'CRM_Utils_Type::T_INT';
}
*
* Generated from xml/schema/CRM/Core/Navigation.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:3819d9a3e40bfbc36a06809c1f4bd98c)
+ * (GenCodeChecksum:8d6052b04bcd4a7bdfff07ecfa14e60b)
*/
/**
public $is_active;
/**
- * If separator needs to be added after this menu item
+ * Place a separator either before or after this menu item.
*
- * @var bool
+ * @var int
*/
public $has_separator;
],
'has_separator' => [
'name' => 'has_separator',
- 'type' => CRM_Utils_Type::T_BOOLEAN,
- 'title' => ts('Use separator'),
- 'description' => ts('If separator needs to be added after this menu item'),
+ 'type' => CRM_Utils_Type::T_INT,
+ 'title' => ts('Separator'),
+ 'description' => ts('Place a separator either before or after this menu item.'),
'where' => 'civicrm_navigation.has_separator',
+ 'default' => '0',
'table_name' => 'civicrm_navigation',
'entity' => 'Navigation',
'bao' => 'CRM_Core_BAO_Navigation',
'localizable' => 0,
+ 'pseudoconstant' => [
+ 'callback' => 'CRM_Core_SelectValues::navigationMenuSeparator',
+ ],
],
'weight' => [
'name' => 'weight',
return $ret;
}
+ /**
+ * @return string[]
+ */
public static function fieldSerialization() {
return [
CRM_Core_DAO::SERIALIZE_SEPARATOR_BOOKEND => 'separator_bookend',
];
}
+ /**
+ * @return array
+ */
+ public static function navigationMenuSeparator() {
+ return [
+ ts('None'),
+ ts('After menu element'),
+ ts('Before menu element'),
+ ];
+ }
+
}
{* file to handle db changes in 5.28.alpha1 during upgrade *}
+-- https://github.com/civicrm/civicrm-core/pull/17579
+ALTER TABLE `civicrm_navigation` CHANGE `has_separator`
+`has_separator` tinyint DEFAULT 0 COMMENT 'Place a separator either before or after this menu item.';
+
-- https://github.com/civicrm/civicrm-core/pull/17450
ALTER TABLE `civicrm_activity` CHANGE `activity_date_time` `activity_date_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Date and time this activity is scheduled to occur. Formerly named scheduled_date_time.';
ALTER TABLE `civicrm_activity` CHANGE `created_date` `created_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'When was the activity was created.';
#civicrm-menu li li a {
padding: 6px 36px 6px 10px;
}
-#civicrm-menu li.crm-menu-border-bottom:not(:last-child) {
- border-bottom: 1px solid #bbb;
-}
-#civicrm-menu li:not(.crm-menu-border-bottom) + li.crm-menu-border-top {
+#civicrm-menu li.crm-menu-border-bottom + li,
+#civicrm-menu li + li.crm-menu-border-top {
border-top: 1px solid #bbb;
}
#civicrm-menu li a:focus,
</field>
<field>
<name>has_separator</name>
- <title>Use separator</title>
- <type>boolean</type>
- <comment>If separator needs to be added after this menu item</comment>
+ <title>Separator</title>
+ <type>tinyint</type>
+ <comment>Place a separator either before or after this menu item.</comment>
+ <default>0</default>
<add>3.0</add>
+ <pseudoconstant>
+ <callback>CRM_Core_SelectValues::navigationMenuSeparator</callback>
+ </pseudoconstant>
</field>
<field>
<name>weight</name>