| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- SET @sName = 'bx_donations';
- -- TABLE: entries
- CREATE TABLE IF NOT EXISTS `bx_donations_entries` (
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
- `profile_id` int(11) unsigned NOT NULL default '0',
- `type_id` int(11) unsigned NOT NULL default '0',
- `order` varchar(32) NOT NULL default '',
- `license` varchar(32) NOT NULL default '',
- `added` int(11) unsigned NOT NULL default '0',
- PRIMARY KEY (`id`)
- );
- CREATE TABLE IF NOT EXISTS `bx_donations_entries_deleted` (
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
- `profile_id` int(11) unsigned NOT NULL default '0',
- `type_id` int(11) unsigned NOT NULL default '0',
- `order` varchar(32) NOT NULL default '',
- `license` varchar(32) NOT NULL default '',
- `added` int(11) unsigned NOT NULL default '0',
- `reason` varchar(16) NOT NULL default '',
- `deleted` int(11) unsigned NOT NULL default '0',
- PRIMARY KEY (`id`)
- );
- -- TABLES: types
- CREATE TABLE IF NOT EXISTS `bx_donations_types` (
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
- `name` varchar(128) NOT NULL default '',
- `title` varchar(128) NOT NULL default '',
- `period` int(11) unsigned NOT NULL default '1',
- `period_unit` varchar(32) NOT NULL default '',
- `price` float unsigned NOT NULL default '1',
- `order` int(11) NOT NULL,
- PRIMARY KEY (`id`),
- UNIQUE KEY `name` (`name`),
- UNIQUE KEY `type` (`period`, `period_unit`, `price`)
- );
- -- FORMS
- 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
- ('bx_donations_type', @sName, '_bx_donations_form_type', '', '', 'do_submit', 'bx_donations_types', 'id', '', '', '', 0, 1, 'BxDonationsFormType', 'modules/boonex/donations/classes/BxDonationsFormType.php');
- INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
- ('bx_donations_type_add', @sName, 'bx_donations_type', '_bx_donations_form_type_display_add', 0),
- ('bx_donations_type_edit', @sName, 'bx_donations_type', '_bx_donations_form_type_display_edit', 0);
- 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
- ('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),
- ('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),
- ('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),
- ('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),
- ('bx_donations_type', @sName, 'price', '', '', 0, 'text', '_bx_donations_form_type_input_sys_price', '_bx_donations_form_type_input_price', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_donations_form_type_input_err_price', 'Float', '', 1, 0),
- ('bx_donations_type', @sName, 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
- ('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),
- ('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);
- INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
- ('bx_donations_type_add', 'name', 2147483647, 1, 1),
- ('bx_donations_type_add', 'title', 2147483647, 1, 2),
- ('bx_donations_type_add', 'price', 2147483647, 1, 3),
- ('bx_donations_type_add', 'period', 2147483647, 1, 4),
- ('bx_donations_type_add', 'period_unit', 2147483647, 1, 5),
- ('bx_donations_type_add', 'controls', 2147483647, 1, 6),
- ('bx_donations_type_add', 'do_submit', 2147483647, 1, 7),
- ('bx_donations_type_add', 'do_cancel', 2147483647, 1, 8),
- ('bx_donations_type_edit', 'name', 2147483647, 1, 1),
- ('bx_donations_type_edit', 'title', 2147483647, 1, 2),
- ('bx_donations_type_edit', 'price', 2147483647, 1, 3),
- ('bx_donations_type_edit', 'period', 2147483647, 1, 4),
- ('bx_donations_type_edit', 'period_unit', 2147483647, 1, 5),
- ('bx_donations_type_edit', 'controls', 2147483647, 1, 6),
- ('bx_donations_type_edit', 'do_submit', 2147483647, 1, 7),
- ('bx_donations_type_edit', 'do_cancel', 2147483647, 1, 8);
- -- PRE-VALUES
- INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
- ('bx_donations_period_units', '_bx_donations_pre_lists_period_units', @sName, '0');
- INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES
- ('bx_donations_period_units', '', 0, '_sys_please_select', ''),
- ('bx_donations_period_units', 'day', 1, '_bx_donations_pre_values_day', ''),
- ('bx_donations_period_units', 'week', 2, '_bx_donations_pre_values_week', ''),
- ('bx_donations_period_units', 'month', 3, '_bx_donations_pre_values_month', ''),
- ('bx_donations_period_units', 'year', 4, '_bx_donations_pre_values_year', '');
- -- STUDIO PAGE & WIDGET
- INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
- (3, @sName, '_bx_donations', '_bx_donations', 'bx_donations@modules/boonex/donations/|std-icon.svg');
- SET @iPageId = LAST_INSERT_ID();
- SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
- SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
- INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
- (@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";}');
- INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
- (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));
|