install.sql 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. SET @sName = 'bx_donations';
  2. -- TABLE: entries
  3. CREATE TABLE IF NOT EXISTS `bx_donations_entries` (
  4. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  5. `profile_id` int(11) unsigned NOT NULL default '0',
  6. `type_id` int(11) NOT NULL default '0',
  7. `period` int(11) unsigned NOT NULL default '0',
  8. `period_unit` varchar(32) NOT NULL default '',
  9. `amount` float unsigned NOT NULL default '0',
  10. `order` varchar(32) NOT NULL default '',
  11. `license` varchar(32) NOT NULL default '',
  12. `added` int(11) unsigned NOT NULL default '0',
  13. PRIMARY KEY (`id`)
  14. );
  15. CREATE TABLE IF NOT EXISTS `bx_donations_entries_deleted` (
  16. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  17. `profile_id` int(11) unsigned NOT NULL default '0',
  18. `type_id` int(11) NOT NULL default '0',
  19. `period` int(11) unsigned NOT NULL default '0',
  20. `period_unit` varchar(32) NOT NULL default '',
  21. `amount` float unsigned NOT NULL default '0',
  22. `order` varchar(32) NOT NULL default '',
  23. `license` varchar(32) NOT NULL default '',
  24. `added` int(11) unsigned NOT NULL default '0',
  25. `reason` varchar(16) NOT NULL default '',
  26. `deleted` int(11) unsigned NOT NULL default '0',
  27. PRIMARY KEY (`id`)
  28. );
  29. -- TABLES: types
  30. CREATE TABLE IF NOT EXISTS `bx_donations_types` (
  31. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  32. `name` varchar(128) NOT NULL default '',
  33. `title` varchar(128) NOT NULL default '',
  34. `period` int(11) unsigned NOT NULL default '0',
  35. `period_unit` varchar(32) NOT NULL default '',
  36. `amount` float unsigned NOT NULL default '0',
  37. `custom` tinyint(4) NOT NULL DEFAULT '0',
  38. `active` tinyint(4) NOT NULL DEFAULT '1',
  39. `order` int(11) NOT NULL,
  40. PRIMARY KEY (`id`),
  41. UNIQUE KEY `name` (`name`)
  42. );
  43. -- FORMS
  44. 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
  45. ('bx_donations_type', @sName, '_bx_donations_form_type', '', '', 'do_submit', 'bx_donations_types', 'id', '', '', '', 0, 1, 'BxDonationsFormType', 'modules/boonex/donations/classes/BxDonationsFormType.php');
  46. INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
  47. ('bx_donations_type_add', @sName, 'bx_donations_type', '_bx_donations_form_type_display_add', 0),
  48. ('bx_donations_type_edit', @sName, 'bx_donations_type', '_bx_donations_form_type_display_edit', 0);
  49. 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
  50. ('bx_donations_type', @sName, 'name', '', '', 0, 'text', '_bx_donations_form_type_input_sys_name', '_bx_donations_form_type_input_name', '_bx_donations_form_type_input_inf_name', 1, 0, 0, '', '', '', 'Avail', '', '_bx_donations_form_type_input_err_name', 'Xss', '', 1, 0),
  51. ('bx_donations_type', @sName, 'title', '', '', 0, 'text_translatable', '_bx_donations_form_type_input_sys_title', '_bx_donations_form_type_input_title', '', 1, 0, 0, '', '', '', 'AvailTranslatable', 'a:1:{i:0;s:5:"title";}', '_bx_donations_form_type_input_err_title', 'Xss', '', 1, 0),
  52. ('bx_donations_type', @sName, 'period', '', '', 0, 'text', '_bx_donations_form_type_input_sys_period', '_bx_donations_form_type_input_period', '_bx_donations_form_type_input_inf_period', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
  53. ('bx_donations_type', @sName, 'period_unit', '', '#!bx_donations_period_units', 0, 'select', '_bx_donations_form_type_input_sys_period_unit', '_bx_donations_form_type_input_period_unit', '_bx_donations_form_type_input_inf_period_unit', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
  54. ('bx_donations_type', @sName, 'amount', '', '', 0, 'price', '_bx_donations_form_type_input_sys_amount', '_bx_donations_form_type_input_amount', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_donations_form_type_input_err_amount', 'Float', '', 1, 0),
  55. ('bx_donations_type', @sName, 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  56. ('bx_donations_type', @sName, 'do_submit', '_bx_donations_form_type_input_do_submit', '', 0, 'submit', '_bx_donations_form_type_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  57. ('bx_donations_type', @sName, 'do_cancel', '_bx_donations_form_type_input_do_cancel', '', 0, 'button', '_bx_donations_form_type_input_sys_do_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";}', '', '', '', '', '', '', '', 1, 0);
  58. INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  59. ('bx_donations_type_add', 'name', 2147483647, 1, 1),
  60. ('bx_donations_type_add', 'title', 2147483647, 1, 2),
  61. ('bx_donations_type_add', 'amount', 2147483647, 1, 3),
  62. ('bx_donations_type_add', 'period', 2147483647, 1, 4),
  63. ('bx_donations_type_add', 'period_unit', 2147483647, 1, 5),
  64. ('bx_donations_type_add', 'controls', 2147483647, 1, 6),
  65. ('bx_donations_type_add', 'do_submit', 2147483647, 1, 7),
  66. ('bx_donations_type_add', 'do_cancel', 2147483647, 1, 8),
  67. ('bx_donations_type_edit', 'name', 2147483647, 1, 1),
  68. ('bx_donations_type_edit', 'title', 2147483647, 1, 2),
  69. ('bx_donations_type_edit', 'amount', 2147483647, 1, 3),
  70. ('bx_donations_type_edit', 'period', 2147483647, 1, 4),
  71. ('bx_donations_type_edit', 'period_unit', 2147483647, 1, 5),
  72. ('bx_donations_type_edit', 'controls', 2147483647, 1, 6),
  73. ('bx_donations_type_edit', 'do_submit', 2147483647, 1, 7),
  74. ('bx_donations_type_edit', 'do_cancel', 2147483647, 1, 8);
  75. -- PRE-VALUES
  76. INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
  77. ('bx_donations_period_units', '_bx_donations_pre_lists_period_units', @sName, '0');
  78. INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES
  79. ('bx_donations_period_units', '', 0, '_sys_please_select', ''),
  80. ('bx_donations_period_units', 'day', 1, '_bx_donations_pre_values_day', ''),
  81. ('bx_donations_period_units', 'week', 2, '_bx_donations_pre_values_week', ''),
  82. ('bx_donations_period_units', 'month', 3, '_bx_donations_pre_values_month', ''),
  83. ('bx_donations_period_units', 'year', 4, '_bx_donations_pre_values_year', '');
  84. -- STUDIO PAGE & WIDGET
  85. INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
  86. (3, @sName, '_bx_donations', '_bx_donations', 'bx_donations@modules/boonex/donations/|std-icon.svg');
  87. SET @iPageId = LAST_INSERT_ID();
  88. SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
  89. SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
  90. INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
  91. (@iPageId, @sName, '{url_studio}module.php?name=bx_donations', '', 'bx_donations@modules/boonex/donations/|std-icon.svg', '_bx_donations', '', '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";}');
  92. INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
  93. (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));