install.sql 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. SET @sName = 'bx_stripe_connect';
  2. -- TABLES
  3. CREATE TABLE IF NOT EXISTS `bx_stripe_connect_accounts` (
  4. `id` int(11) NOT NULL auto_increment,
  5. `added` int(11) NOT NULL default '0',
  6. `changed` int(11) NOT NULL default '0',
  7. `profile_id` int(11) NOT NULL default '0',
  8. `live_account_id` varchar(64) NOT NULL default '',
  9. `live_details` tinyint(4) NOT NULL default '0',
  10. `test_account_id` varchar(64) NOT NULL default '',
  11. `test_details` tinyint(4) NOT NULL default '0',
  12. PRIMARY KEY (`id`),
  13. UNIQUE KEY `profile_id` (`profile_id`)
  14. );
  15. CREATE TABLE IF NOT EXISTS `bx_stripe_connect_commissions` (
  16. `id` int(11) NOT NULL auto_increment,
  17. `name` varchar(64) NOT NULL default '',
  18. `acl_id` int(11) NOT NULL default '0',
  19. `fee_single` varchar(8) NOT NULL default '',
  20. `fee_recurring` varchar(8) NOT NULL default '',
  21. `active` tinyint(4) NOT NULL default '0',
  22. `order` tinyint(4) NOT NULL default '0',
  23. PRIMARY KEY(`id`),
  24. UNIQUE KEY `name`(`name`)
  25. );
  26. -- FORMS
  27. INSERT INTO `sys_objects_form` (`object`, `module`, `title`, `action`, `form_attrs`, `submit_name`, `table`, `key`, `uri`, `uri_title`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
  28. ('bx_stripe_connect_form_commissions', @sName, '_bx_stripe_connect_form_commissions_form', '', '', 'do_submit', 'bx_stripe_connect_commissions', 'id', '', '', '', 0, 1, 'BxStripeConnectFormCommissions', 'modules/boonex/stripe_connect/classes/BxStripeConnectFormCommissions.php');
  29. INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
  30. ('bx_stripe_connect_form_commissions_add', @sName, 'bx_stripe_connect_form_commissions', '_bx_stripe_connect_form_commissions_display_add', 0),
  31. ('bx_stripe_connect_form_commissions_edit', @sName, 'bx_stripe_connect_form_commissions', '_bx_stripe_connect_form_commissions_display_edit', 0);
  32. INSERT INTO `sys_form_inputs` (`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES
  33. ('bx_stripe_connect_form_commissions', @sName, 'name', '0', '', 0, 'text', '_bx_stripe_connect_form_commissions_input_sys_name', '_bx_stripe_connect_form_commissions_input_name', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_stripe_connect_form_commissions_input_name_err', 'Xss', '', 0, 0),
  34. ('bx_stripe_connect_form_commissions', @sName, 'acl_id', '0', '', 0, 'select', '_bx_stripe_connect_form_commissions_input_sys_acl_id', '_bx_stripe_connect_form_commissions_input_acl_id', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_stripe_connect_form_commissions_input_acl_id_err', 'Int', '', 0, 0),
  35. ('bx_stripe_connect_form_commissions', @sName, 'fee_single', '0', '', 0, 'text', '_bx_stripe_connect_form_commissions_input_sys_fee_single', '_bx_stripe_connect_form_commissions_input_fee_single', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
  36. ('bx_stripe_connect_form_commissions', @sName, 'fee_recurring', '0', '', 0, 'text', '_bx_stripe_connect_form_commissions_input_sys_fee_recurring', '_bx_stripe_connect_form_commissions_input_fee_recurring', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
  37. ('bx_stripe_connect_form_commissions', @sName, 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  38. ('bx_stripe_connect_form_commissions', @sName, 'do_submit', '_bx_stripe_connect_form_commissions_input_submit', '', 0, 'submit', '_bx_stripe_connect_form_commissions_input_sys_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  39. ('bx_stripe_connect_form_commissions', @sName, 'do_cancel', '_bx_stripe_connect_form_commissions_input_cancel', '', 0, 'button', '_bx_stripe_connect_form_commissions_input_sys_cancel', '', '', 0, 0, 0, 'a:2:{s:7:"onclick";s:45:"$(''.bx-popup-applied:visible'').dolPopupHide()";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 0, 0);
  40. INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  41. ('bx_stripe_connect_form_commissions_add', 'name', 2147483647, 1, 1),
  42. ('bx_stripe_connect_form_commissions_add', 'acl_id', 2147483647, 1, 2),
  43. ('bx_stripe_connect_form_commissions_add', 'fee_single', 2147483647, 1, 3),
  44. ('bx_stripe_connect_form_commissions_add', 'fee_recurring', 2147483647, 1, 4),
  45. ('bx_stripe_connect_form_commissions_add', 'controls', 2147483647, 1, 5),
  46. ('bx_stripe_connect_form_commissions_add', 'do_submit', 2147483647, 1, 6),
  47. ('bx_stripe_connect_form_commissions_add', 'do_cancel', 2147483647, 1, 7),
  48. ('bx_stripe_connect_form_commissions_edit', 'name', 2147483647, 1, 1),
  49. ('bx_stripe_connect_form_commissions_edit', 'acl_id', 2147483647, 1, 2),
  50. ('bx_stripe_connect_form_commissions_edit', 'fee_single', 2147483647, 1, 3),
  51. ('bx_stripe_connect_form_commissions_edit', 'fee_recurring', 2147483647, 1, 4),
  52. ('bx_stripe_connect_form_commissions_edit', 'controls', 2147483647, 1, 6),
  53. ('bx_stripe_connect_form_commissions_edit', 'do_submit', 2147483647, 1, 7),
  54. ('bx_stripe_connect_form_commissions_edit', 'do_cancel', 2147483647, 1, 8);
  55. -- LOGS
  56. INSERT INTO `sys_objects_logs` (`object`, `module`, `logs_storage`, `title`, `active`, `class_name`, `class_file`) VALUES
  57. ('bx_stripe_connect', 'bx_stripe_connect', 'Auto', '_bx_stripe_connect_log', 1, '', '');
  58. -- Studio page and widget
  59. INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
  60. (3, @sName, '_bx_stripe_connect', '_bx_stripe_connect', 'bx_stripe_connect@modules/boonex/stripe_connect/|std-icon.svg');
  61. SET @iPageId = LAST_INSERT_ID();
  62. SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
  63. SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
  64. INSERT INTO `sys_std_widgets` (`page_id`, `module`, `type`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
  65. (@iPageId, @sName, 'integrations', '{url_studio}module.php?name=bx_stripe_connect', '', 'bx_stripe_connect@modules/boonex/stripe_connect/|std-icon.svg', '_bx_stripe_connect', '', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:18:"TemplStudioModules";}');
  66. INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
  67. (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));