1
0

install.sql 7.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. -- TABLE: entries
  2. CREATE TABLE IF NOT EXISTS `bx_fdb_questions` (
  3. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  4. `author` int(11) unsigned NOT NULL,
  5. `added` int(11) NOT NULL default '0',
  6. `changed` int(11) NOT NULL default '0',
  7. `text` text NOT NULL,
  8. `lifetime` int(11) NOT NULL default '0',
  9. `allow_view_to` varchar(16) NOT NULL DEFAULT '3',
  10. `status_admin` enum('active','hidden') NOT NULL DEFAULT 'active',
  11. PRIMARY KEY (`id`),
  12. FULLTEXT KEY `search_fields` (`text`)
  13. );
  14. CREATE TABLE IF NOT EXISTS `bx_fdb_answers` (
  15. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  16. `question_id` int(11) unsigned NOT NULL default '0',
  17. `title` varchar(255) NOT NULL,
  18. `important` tinyint(4) NOT NULL default '0',
  19. `data` text NOT NULL default '',
  20. `votes` int(11) NOT NULL default '0',
  21. `order` int(11) NOT NULL default '0',
  22. PRIMARY KEY (`id`),
  23. FULLTEXT KEY `title` (`title`)
  24. );
  25. CREATE TABLE IF NOT EXISTS `bx_fdb_answers2users` (
  26. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  27. `answer_id` int(11) unsigned NOT NULL default '0',
  28. `profile_id` int(11) unsigned NOT NULL default '0',
  29. `text` varchar(255) NOT NULL default '',
  30. `added` int(11) NOT NULL default '0',
  31. PRIMARY KEY (`id`),
  32. UNIQUE KEY `answer` (`answer_id`, `profile_id`)
  33. );
  34. -- FORMS
  35. INSERT INTO `sys_objects_form`(`object`, `module`, `title`, `action`, `form_attrs`, `table`, `key`, `uri`, `uri_title`, `submit_name`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
  36. ('bx_feedback_question', 'bx_feedback', '_bx_feedback_form_question', '', 'a:1:{s:7:"enctype";s:19:"multipart/form-data";}', 'bx_fdb_questions', 'id', '', '', 'a:1:{i:0;s:9:"do_submit";}', 'a:2:{s:7:"checker";s:24:"BxFdbFormQuestionChecker";s:14:"checker_helper";s:30:"BxFdbFormQuestionCheckerHelper";}', 0, 1, 'BxFdbFormQuestion', 'modules/boonex/feedback/classes/BxFdbFormQuestion.php');
  37. INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES
  38. ('bx_feedback_question', 'bx_feedback_question_add', 'bx_feedback', 0, '_bx_feedback_form_question_display_add'),
  39. ('bx_feedback_question', 'bx_feedback_question_delete', 'bx_feedback', 0, '_bx_feedback_form_question_display_delete'),
  40. ('bx_feedback_question', 'bx_feedback_question_edit', 'bx_feedback', 0, '_bx_feedback_form_question_display_edit'),
  41. ('bx_feedback_question', 'bx_feedback_question_view', 'bx_feedback', 1, '_bx_feedback_form_question_display_view');
  42. 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
  43. ('bx_feedback_question', 'bx_feedback', 'text', '', '', 0, 'textarea_translatable', '_bx_feedback_form_question_input_sys_text', '_bx_feedback_form_question_input_text', '', 1, 0, 0, '', '', '', 'AvailTranslatable', 'a:1:{i:0;s:4:"text";}', '_bx_feedback_form_question_input_text_err', 'Xss', '', 1, 0),
  44. ('bx_feedback_question', 'bx_feedback', 'answers', '', '', 0, 'list_translatable', '_bx_feedback_form_question_input_sys_answers', '_bx_feedback_form_question_input_answers', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  45. ('bx_feedback_question', 'bx_feedback', 'lifetime', '', '', 0, 'text', '_bx_feedback_form_question_input_sys_lifetime', '_bx_feedback_form_question_input_lifetime', '_bx_feedback_form_question_input_lifetime_inf', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
  46. ('bx_feedback_question', 'bx_feedback', 'allow_view_to', '', '', 0, 'custom', '_bx_feedback_form_question_input_sys_allow_view_to', '_bx_feedback_form_question_input_allow_view_to', '', 1, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  47. ('bx_feedback_question', 'bx_feedback', 'delete_confirm', 1, '', 0, 'checkbox', '_bx_feedback_form_question_input_sys_delete_confirm', '_bx_feedback_form_question_input_delete_confirm', '_bx_feedback_form_question_input_delete_confirm_info', 1, 0, 0, '', '', '', 'Avail', '', '_bx_feedback_form_question_input_delete_confirm_error', '', '', 1, 0),
  48. ('bx_feedback_question', 'bx_feedback', 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  49. ('bx_feedback_question', 'bx_feedback', 'do_submit', '_bx_feedback_form_question_input_do_submit', '', 0, 'submit', '_bx_feedback_form_question_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  50. ('bx_feedback_question', 'bx_feedback', 'do_cancel', '_bx_feedback_form_question_input_do_cancel', '', 0, 'button', '_bx_feedback_form_question_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),
  51. ('bx_feedback_question', 'bx_feedback', 'added', '', '', 0, 'datetime', '_bx_feedback_form_question_input_sys_date_added', '_bx_feedback_form_question_input_date_added', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  52. ('bx_feedback_question', 'bx_feedback', 'changed', '', '', 0, 'datetime', '_bx_feedback_form_question_input_sys_date_changed', '_bx_feedback_form_question_input_date_changed', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0);
  53. INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  54. ('bx_feedback_question_add', 'text', 2147483647, 1, 1),
  55. ('bx_feedback_question_add', 'answers', 2147483647, 1, 2),
  56. ('bx_feedback_question_add', 'lifetime', 2147483647, 1, 3),
  57. ('bx_feedback_question_add', 'allow_view_to', 2147483647, 0, 4),
  58. ('bx_feedback_question_add', 'controls', 2147483647, 1, 5),
  59. ('bx_feedback_question_add', 'do_submit', 2147483647, 1, 6),
  60. ('bx_feedback_question_add', 'do_cancel', 2147483647, 1, 7),
  61. ('bx_feedback_question_delete', 'delete_confirm', 2147483647, 1, 1),
  62. ('bx_feedback_question_delete', 'do_submit', 2147483647, 1, 2),
  63. ('bx_feedback_question_edit', 'text', 2147483647, 1, 1),
  64. ('bx_feedback_question_edit', 'answers', 2147483647, 1, 2),
  65. ('bx_feedback_question_edit', 'lifetime', 2147483647, 1, 3),
  66. ('bx_feedback_question_edit', 'allow_view_to', 2147483647, 0, 4),
  67. ('bx_feedback_question_edit', 'controls', 2147483647, 1, 5),
  68. ('bx_feedback_question_edit', 'do_submit', 2147483647, 1, 6),
  69. ('bx_feedback_question_edit', 'do_cancel', 2147483647, 1, 7),
  70. ('bx_feedback_question_view', 'added', 2147483647, 1, 1),
  71. ('bx_feedback_question_view', 'changed', 2147483647, 1, 2);
  72. -- STUDIO: page & widget
  73. INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
  74. (3, 'bx_feedback', '_bx_feedback', '_bx_feedback', 'bx_feedback@modules/boonex/feedback/|std-icon.svg');
  75. SET @iPageId = LAST_INSERT_ID();
  76. SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
  77. SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
  78. INSERT INTO `sys_std_widgets` (`page_id`, `module`, `type`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
  79. (@iPageId, 'bx_feedback', 'content', '{url_studio}module.php?name=bx_feedback', '', 'bx_feedback@modules/boonex/feedback/|std-icon.svg', '_bx_feedback', '', '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";}');
  80. INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
  81. (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));