enable.sql 1.8 KB

123456789101112131415161718192021222324252627282930313233343536
  1. -- Settings
  2. SET @iTypeOrder = (SELECT MAX(`order`) FROM `sys_options_types` WHERE `group` = 'modules');
  3. INSERT INTO `sys_options_types` (`group`, `name`, `caption`, `icon`, `order`) VALUES
  4. ('modules', 'bx_intercom', '_bx_intercom_adm_stg_cpt_type', 'bx_intercom@modules/boonex/intercom/|std-icon.svg', IF(NOT ISNULL(@iTypeOrder), @iTypeOrder + 1, 1));
  5. SET @iTypeId = LAST_INSERT_ID();
  6. INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )
  7. VALUES (@iTypeId, 'bx_intercom_general', '_bx_intercom_adm_stg_cpt_category_general', 1);
  8. SET @iCategId = LAST_INSERT_ID();
  9. INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_error`, `order`, `extra`) VALUES
  10. ('bx_intercom_option_app_id', '', @iCategId, '_bx_intercom_option_app_id', 'digit', '', '', 10, ''),
  11. ('bx_intercom_option_api_key', '', @iCategId, '_bx_intercom_option_api_key', 'digit', '', '', 20, '');
  12. -- Injections
  13. INSERT INTO `sys_injections` (`name`, `page_index`, `key`, `type`, `data`, `replace`, `active`) VALUES
  14. ('bx_intercom', 0, 'injection_footer', 'service', 'a:2:{s:6:"module";s:11:"bx_intercom";s:6:"method";s:16:"integration_code";}', 0, 1);
  15. -- Alerts
  16. INSERT INTO `sys_alerts_handlers` SET `name` = 'bx_intercom', `class` = 'BxIntercomAlerts', `file` = 'modules/boonex/intercom/classes/BxIntercomAlerts.php';
  17. SET @iHandlerId := (SELECT `id` FROM `sys_alerts_handlers` WHERE `name` = 'bx_intercom');
  18. INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
  19. ('account', 'delete', @iHandlerId),
  20. ('bx_persons', 'deleted', @iHandlerId),
  21. ('bx_persons', 'edited', @iHandlerId),
  22. ('bx_persons', 'added', @iHandlerId),
  23. ('bx_organizations', 'deleted', @iHandlerId),
  24. ('bx_organizations', 'edited', @iHandlerId),
  25. ('bx_organizations', 'added', @iHandlerId);