install.sql 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. -- TABLE: PROFILES
  2. CREATE TABLE IF NOT EXISTS `bx_organizations_data` (
  3. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  4. `author` int(10) unsigned NOT NULL,
  5. `added` int(11) NOT NULL,
  6. `changed` int(11) NOT NULL,
  7. `picture` int(11) NOT NULL,
  8. `cover` int(11) NOT NULL,
  9. `org_name` varchar(255) NOT NULL,
  10. `org_cat` int(11) NOT NULL,
  11. `views` int(11) NOT NULL default '0',
  12. PRIMARY KEY (`id`)
  13. );
  14. -- TABLE: STORAGES & TRANSCODERS
  15. CREATE TABLE `bx_organizations_pics` (
  16. `id` int(11) NOT NULL AUTO_INCREMENT,
  17. `profile_id` int(10) unsigned NOT NULL,
  18. `remote_id` varchar(255) NOT NULL,
  19. `path` varchar(255) NOT NULL,
  20. `file_name` varchar(255) NOT NULL,
  21. `mime_type` varchar(128) NOT NULL,
  22. `ext` varchar(32) NOT NULL,
  23. `size` int(11) NOT NULL,
  24. `added` int(11) NOT NULL,
  25. `modified` int(11) NOT NULL,
  26. `private` int(11) NOT NULL,
  27. PRIMARY KEY (`id`),
  28. UNIQUE KEY `remote_id` (`remote_id`)
  29. );
  30. CREATE TABLE `bx_organizations_pics_resized` (
  31. `id` int(11) NOT NULL AUTO_INCREMENT,
  32. `profile_id` int(10) unsigned NOT NULL,
  33. `remote_id` varchar(255) NOT NULL,
  34. `path` varchar(255) NOT NULL,
  35. `file_name` varchar(255) NOT NULL,
  36. `mime_type` varchar(128) NOT NULL,
  37. `ext` varchar(32) NOT NULL,
  38. `size` int(11) NOT NULL,
  39. `added` int(11) NOT NULL,
  40. `modified` int(11) NOT NULL,
  41. `private` int(11) NOT NULL,
  42. PRIMARY KEY (`id`),
  43. UNIQUE KEY `remote_id` (`remote_id`)
  44. );
  45. -- TABLE: VIEWS
  46. CREATE TABLE `bx_organizations_views_track` (
  47. `object_id` int(11) NOT NULL default '0',
  48. `viewer_id` int(11) NOT NULL default '0',
  49. `viewer_nip` int(11) unsigned NOT NULL default '0',
  50. `date` int(11) NOT NULL default '0',
  51. KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
  52. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  53. -- FORMS
  54. 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
  55. ('bx_organization', 'bx_organizations', '_bx_orgs_form_profile', '', 'a:1:{s:7:\"enctype\";s:19:\"multipart/form-data\";}', 'bx_organizations_data', 'id', '', '', 'do_submit', '', 0, 1, 'BxOrgsFormEntry', 'modules/boonex/organizations/classes/BxOrgsFormEntry.php');
  56. INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES
  57. ('bx_organization', 'bx_organization_add', 'bx_organizations', 0, '_bx_orgs_form_profile_display_add'),
  58. ('bx_organization', 'bx_organization_delete', 'bx_organizations', 0, '_bx_orgs_form_profile_display_delete'),
  59. ('bx_organization', 'bx_organization_edit', 'bx_organizations', 0, '_bx_orgs_form_profile_display_edit'),
  60. ('bx_organization', 'bx_organization_edit_cover', 'bx_organizations', 0, '_bx_orgs_form_profile_display_edit_cover'),
  61. ('bx_organization', 'bx_organization_view', 'bx_organizations', 1, '_bx_orgs_form_profile_display_view');
  62. 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
  63. ('bx_organization', 'bx_organizations', 'cover', '', '', 0, 'file', '_bx_orgs_form_profile_input_sys_cover', '_bx_orgs_form_profile_input_cover', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
  64. ('bx_organization', 'bx_organizations', 'cover_preview', '', '', 0, 'custom', '_bx_orgs_form_profile_input_sys_cover_preview', '_bx_orgs_form_profile_input_cover_preview', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  65. ('bx_organization', 'bx_organizations', 'delete_confirm', 1, '', 0, 'checkbox', '_bx_orgs_form_profile_input_sys_delete_confirm', '_bx_orgs_form_profile_input_delete_confirm', '_bx_orgs_form_profile_input_delete_confirm_info', 1, 0, 0, '', '', '', 'avail', '', '_bx_orgs_form_profile_input_delete_confirm_error', '', '', 1, 0),
  66. ('bx_organization', 'bx_organizations', 'do_submit', '_sys_form_account_input_submit', '', 0, 'submit', '_bx_orgs_form_profile_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  67. ('bx_organization', 'bx_organizations', 'org_name', '', '', 0, 'text', '_bx_orgs_form_profile_input_sys_org_name', '_bx_orgs_form_profile_input_org_name', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_orgs_form_profile_input_org_name_err', 'Xss', '', 1, 0),
  68. ('bx_organization', 'bx_organizations', 'picture', '', '', 0, 'file', '_bx_orgs_form_profile_input_sys_picture', '_bx_orgs_form_profile_input_picture', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_orgs_form_profile_input_picture_err', 'Int', '', 1, 0),
  69. ('bx_organization', 'bx_organizations', 'picture_preview', '', '', 0, 'custom', '_bx_orgs_form_profile_input_sys_picture_preview', '_bx_orgs_form_profile_input_picture_preview', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  70. ('bx_organization', 'bx_organizations', 'org_cat', '', '#!bx_organizations_cats', 0, 'select', '_bx_orgs_form_profile_input_sys_org_cat', '_bx_orgs_form_profile_input_org_cat', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_orgs_form_profile_input_org_cat_err', 'Xss', '', 1, 1);
  71. INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  72. ('bx_organization_add', 'cover_preview', 2147483647, 0, 1),
  73. ('bx_organization_add', 'picture_preview', 2147483647, 0, 2),
  74. ('bx_organization_add', 'delete_confirm', 2147483647, 0, 3),
  75. ('bx_organization_add', 'cover', 2147483647, 0, 4),
  76. ('bx_organization_add', 'picture', 2147483647, 1, 5),
  77. ('bx_organization_add', 'org_name', 2147483647, 1, 6),
  78. ('bx_organization_add', 'org_cat', 2147483647, 1, 7),
  79. ('bx_organization_add', 'do_submit', 2147483647, 1, 8),
  80. ('bx_organization_delete', 'cover_preview', 2147483647, 0, 0),
  81. ('bx_organization_delete', 'picture_preview', 2147483647, 0, 0),
  82. ('bx_organization_delete', 'delete_confirm', 2147483647, 1, 0),
  83. ('bx_organization_delete', 'cover', 2147483647, 0, 0),
  84. ('bx_organization_delete', 'picture', 2147483647, 0, 0),
  85. ('bx_organization_delete', 'do_submit', 2147483647, 1, 1),
  86. ('bx_organization_delete', 'org_name', 2147483647, 0, 2),
  87. ('bx_organization_delete', 'org_cat', 2147483647, 0, 3),
  88. ('bx_organization_edit', 'cover_preview', 2147483647, 0, 1),
  89. ('bx_organization_edit', 'delete_confirm', 2147483647, 0, 2),
  90. ('bx_organization_edit', 'cover', 2147483647, 0, 3),
  91. ('bx_organization_edit', 'picture_preview', 2147483647, 1, 4),
  92. ('bx_organization_edit', 'picture', 2147483647, 1, 5),
  93. ('bx_organization_edit', 'org_name', 2147483647, 1, 6),
  94. ('bx_organization_edit', 'org_cat', 2147483647, 1, 7),
  95. ('bx_organization_edit', 'do_submit', 2147483647, 1, 8),
  96. ('bx_organization_edit_cover', 'delete_confirm', 2147483647, 0, 1),
  97. ('bx_organization_edit_cover', 'org_name', 2147483647, 0, 2),
  98. ('bx_organization_edit_cover', 'picture', 2147483647, 0, 3),
  99. ('bx_organization_edit_cover', 'picture_preview', 2147483647, 0, 4),
  100. ('bx_organization_edit_cover', 'org_cat', 2147483647, 0, 5),
  101. ('bx_organization_edit_cover', 'cover_preview', 2147483647, 1, 6),
  102. ('bx_organization_edit_cover', 'cover', 2147483647, 1, 7),
  103. ('bx_organization_edit_cover', 'do_submit', 2147483647, 1, 8),
  104. ('bx_organization_view', 'cover_preview', 2147483647, 0, 1),
  105. ('bx_organization_view', 'picture_preview', 2147483647, 0, 2),
  106. ('bx_organization_view', 'delete_confirm', 2147483647, 0, 3),
  107. ('bx_organization_view', 'picture', 2147483647, 0, 4),
  108. ('bx_organization_view', 'cover', 2147483647, 0, 5),
  109. ('bx_organization_view', 'do_submit', 2147483647, 0, 6),
  110. ('bx_organization_view', 'org_name', 2147483647, 1, 7),
  111. ('bx_organization_view', 'org_cat', 2147483647, 1, 8);
  112. -- PRE-VALUES
  113. INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
  114. ('bx_organizations_cats', '_bx_orgs_pre_lists_cats', 'bx_organizations', '0');
  115. INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES
  116. ('bx_organizations_cats', '', 0, '_sys_please_select', ''),
  117. ('bx_organizations_cats', '1', 1, '_bx_orgs_cat_Agriculture', ''),
  118. ('bx_organizations_cats', '2', 2, '_bx_orgs_cat_Financial', ''),
  119. ('bx_organizations_cats', '3', 3, '_bx_orgs_cat_Biotech', ''),
  120. ('bx_organizations_cats', '4', 4, '_bx_orgs_cat_Cause', ''),
  121. ('bx_organizations_cats', '5', 5, '_bx_orgs_cat_Chemical', ''),
  122. ('bx_organizations_cats', '6', 6, '_bx_orgs_cat_Religious', ''),
  123. ('bx_organizations_cats', '7', 7, '_bx_orgs_cat_Community', ''),
  124. ('bx_organizations_cats', '8', 8, '_bx_orgs_cat_Company', ''),
  125. ('bx_organizations_cats', '9', 9, '_bx_orgs_cat_Entertainment', ''),
  126. ('bx_organizations_cats', '10', 10, '_bx_orgs_cat_Technology', ''),
  127. ('bx_organizations_cats', '11', 11, '_bx_orgs_cat_Consulting', ''),
  128. ('bx_organizations_cats', '12', 12, '_bx_orgs_cat_Education', ''),
  129. ('bx_organizations_cats', '13', 13, '_bx_orgs_cat_Energy', ''),
  130. ('bx_organizations_cats', '14', 14, '_bx_orgs_cat_Engineering', ''),
  131. ('bx_organizations_cats', '15', 15, '_bx_orgs_cat_Food', ''),
  132. ('bx_organizations_cats', '16', 16, '_bx_orgs_cat_Government', ''),
  133. ('bx_organizations_cats', '17', 17, '_bx_orgs_cat_Health', ''),
  134. ('bx_organizations_cats', '18', 18, '_bx_orgs_cat_Medical', ''),
  135. ('bx_organizations_cats', '19', 19, '_bx_orgs_cat_Industrial', ''),
  136. ('bx_organizations_cats', '20', 20, '_bx_orgs_cat_Insurance', ''),
  137. ('bx_organizations_cats', '21', 21, '_bx_orgs_cat_Internet', ''),
  138. ('bx_organizations_cats', '22', 22, '_bx_orgs_cat_Software', ''),
  139. ('bx_organizations_cats', '23', 23, '_bx_orgs_cat_Legal', ''),
  140. ('bx_organizations_cats', '24', 24, '_bx_orgs_cat_Media', ''),
  141. ('bx_organizations_cats', '25', 25, '_bx_orgs_cat_School', ''),
  142. ('bx_organizations_cats', '26', 26, '_bx_orgs_cat_NGO', ''),
  143. ('bx_organizations_cats', '27', 27, '_bx_orgs_cat_NPO', ''),
  144. ('bx_organizations_cats', '28', 28, '_bx_orgs_cat_Political', ''),
  145. ('bx_organizations_cats', '29', 29, '_bx_orgs_cat_Retail', ''),
  146. ('bx_organizations_cats', '30', 30, '_bx_orgs_cat_Small_Business', ''),
  147. ('bx_organizations_cats', '31', 31, '_bx_orgs_cat_Telecommunication', ''),
  148. ('bx_organizations_cats', '32', 32, '_bx_orgs_cat_Transport', ''),
  149. ('bx_organizations_cats', '33', 33, '_bx_orgs_cat_Travel', ''),
  150. ('bx_organizations_cats', '34', 34, '_bx_orgs_cat_University', ''),
  151. ('bx_organizations_cats', '35', 35, '_bx_orgs_cat_Other', '');
  152. -- STUDIO PAGE & WIDGET
  153. INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
  154. (3, 'bx_organizations', '_bx_orgs', '_bx_orgs', 'bx_organizations@modules/boonex/organizations/|std-pi.png');
  155. SET @iPageId = LAST_INSERT_ID();
  156. SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
  157. SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
  158. INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
  159. (@iPageId, 'bx_organizations', '{url_studio}module.php?name=bx_organizations', '', 'bx_organizations@modules/boonex/organizations/|std-wi.png', '_bx_orgs', '', '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";}');
  160. INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
  161. (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));