1
0

install.sql 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. SET @sName = 'bx_notifications';
  2. -- TABLES
  3. CREATE TABLE IF NOT EXISTS `bx_notifications_events` (
  4. `id` int(11) NOT NULL auto_increment,
  5. `author_id` int(11) NOT NULL default '0',
  6. `owner_id` int(11) NOT NULL default '0',
  7. `type` varchar(255) NOT NULL,
  8. `action` varchar(255) NOT NULL,
  9. `object_id` text NOT NULL,
  10. `object_owner_id` int(11) NOT NULL default '0',
  11. `object_privacy_view` varchar(32) NOT NULL default '3',
  12. `subobject_id` int(11) NOT NULL default '0',
  13. `content` text NOT NULL,
  14. `source` varchar(48) NOT NULL default '',
  15. `source_mac` varchar(64) NOT NULL default '',
  16. `allow_view_event_to` varchar(32) NOT NULL default '3',
  17. `date` int(11) NOT NULL default '0',
  18. `processed` tinyint(4) NOT NULL default '0',
  19. `active` tinyint(4) NOT NULL default '1',
  20. PRIMARY KEY (`id`),
  21. KEY `owner_id` (`owner_id`),
  22. KEY `object_owner_id` (`object_owner_id`)
  23. );
  24. CREATE TABLE IF NOT EXISTS `bx_notifications_events2users` (
  25. `id` int(11) NOT NULL auto_increment,
  26. `user_id` int(11) NOT NULL DEFAULT '0',
  27. `event_id` int(11) NOT NULL DEFAULT '0',
  28. `clicked` tinyint(4) NOT NULL default '0',
  29. PRIMARY KEY (`id`),
  30. UNIQUE `event` (`user_id`, `event_id`)
  31. );
  32. CREATE TABLE IF NOT EXISTS `bx_notifications_read` (
  33. `user_id` int(11) NOT NULL DEFAULT '0',
  34. `event_id` int(11) NOT NULL DEFAULT '0',
  35. PRIMARY KEY (`user_id`)
  36. );
  37. CREATE TABLE IF NOT EXISTS `bx_notifications_handlers` (
  38. `id` int(11) NOT NULL auto_increment,
  39. `group` varchar(64) NOT NULL default '',
  40. `type` enum('insert','update','delete') NOT NULL DEFAULT 'insert',
  41. `alert_unit` varchar(64) NOT NULL default '',
  42. `alert_action` varchar(64) NOT NULL default '',
  43. `content` text NOT NULL,
  44. `privacy` varchar(64) NOT NULL default '',
  45. `priority` int(11) NOT NULL default '0',
  46. PRIMARY KEY (`id`),
  47. UNIQUE `handler` (`group`, `type`),
  48. UNIQUE `alert` (`alert_unit`, `alert_action`)
  49. );
  50. CREATE TABLE IF NOT EXISTS `bx_notifications_settings` (
  51. `id` int(11) NOT NULL auto_increment,
  52. `group` varchar(64) NOT NULL default '',
  53. `handler_id` int(11) NOT NULL DEFAULT '0',
  54. `delivery` enum('site','email','push') NOT NULL DEFAULT 'site',
  55. `type` enum('personal','follow_member','follow_context','other') NOT NULL DEFAULT 'personal',
  56. `title` varchar(64) NOT NULL default '',
  57. `value` tinyint(4) NOT NULL default '1',
  58. `active` tinyint(4) NOT NULL default '1',
  59. `order` int(11) NOT NULL default '0',
  60. PRIMARY KEY (`id`),
  61. UNIQUE `setting` (`handler_id`, `type`, `delivery`)
  62. );
  63. CREATE TABLE IF NOT EXISTS `bx_notifications_settings2users` (
  64. `id` int(11) NOT NULL auto_increment,
  65. `user_id` int(11) NOT NULL DEFAULT '0',
  66. `setting_id` int(11) NOT NULL DEFAULT '0',
  67. `active` tinyint(4) NOT NULL default '1',
  68. PRIMARY KEY (`id`),
  69. UNIQUE `setting` (`setting_id`, `user_id`)
  70. );
  71. INSERT INTO `bx_notifications_handlers`(`group`, `type`, `alert_unit`, `alert_action`, `content`) VALUES
  72. ('profile', 'delete', 'profile', 'delete', '');
  73. -- Mentions
  74. INSERT INTO `bx_notifications_handlers`(`group`, `type`, `alert_unit`, `alert_action`, `content`, `privacy`, `priority`) VALUES
  75. ('mention', 'insert', 'meta_mention', 'added', 'a:3:{s:11:"module_name";s:6:"system";s:13:"module_method";s:30:"get_notifications_post_mention";s:12:"module_class";s:20:"TemplServiceMetatags";}', '', 0);
  76. SET @iHandlerId = LAST_INSERT_ID();
  77. INSERT INTO `bx_notifications_settings`(`group`, `handler_id`, `delivery`, `type`, `title`, `order`) VALUES
  78. ('mention', @iHandlerId, 'site', 'personal', '_bx_ntfs_alert_action_mention_added_personal', 1),
  79. ('mention', @iHandlerId, 'email', 'personal', '_bx_ntfs_alert_action_mention_added_personal', 1),
  80. ('mention', @iHandlerId, 'push', 'personal', '_bx_ntfs_alert_action_mention_added_personal', 1);
  81. -- Friendship
  82. INSERT INTO `bx_notifications_handlers`(`group`, `type`, `alert_unit`, `alert_action`, `content`) VALUES
  83. ('friendship', 'insert', 'sys_profiles_friends', 'connection_added', 'a:3:{s:11:"module_name";s:6:"system";s:13:"module_method";s:33:"get_notifications_post_friendship";s:12:"module_class";s:23:"TemplServiceConnections";}');
  84. SET @iHandlerId = LAST_INSERT_ID();
  85. INSERT INTO `bx_notifications_settings`(`group`, `handler_id`, `delivery`, `type`, `title`, `order`) VALUES
  86. ('friendship', @iHandlerId, 'site', 'personal', '_bx_ntfs_alert_action_friendship_added_personal', 2),
  87. ('friendship', @iHandlerId, 'email', 'personal', '_bx_ntfs_alert_action_friendship_added_personal', 2),
  88. ('friendship', @iHandlerId, 'push', 'personal', '_bx_ntfs_alert_action_friendship_added_personal', 2);
  89. INSERT INTO `bx_notifications_handlers`(`group`, `type`, `alert_unit`, `alert_action`, `content`) VALUES
  90. ('friendship', 'delete', 'sys_profiles_friends', 'connection_removed', '');
  91. -- Subscription
  92. INSERT INTO `bx_notifications_handlers`(`group`, `type`, `alert_unit`, `alert_action`, `content`) VALUES
  93. ('subscription', 'insert', 'sys_profiles_subscriptions', 'connection_added', 'a:3:{s:11:"module_name";s:6:"system";s:13:"module_method";s:22:"get_notifications_post";s:12:"module_class";s:23:"TemplServiceConnections";}');
  94. SET @iHandlerId = LAST_INSERT_ID();
  95. INSERT INTO `bx_notifications_settings`(`group`, `handler_id`, `delivery`, `type`, `title`, `order`) VALUES
  96. ('subscription', @iHandlerId, 'site', 'personal', '_bx_ntfs_alert_action_subscription_added_personal', 3),
  97. ('subscription', @iHandlerId, 'email', 'personal', '_bx_ntfs_alert_action_subscription_added_personal', 3),
  98. ('subscription', @iHandlerId, 'push', 'personal', '_bx_ntfs_alert_action_subscription_added_personal', 3);
  99. INSERT INTO `bx_notifications_handlers`(`group`, `type`, `alert_unit`, `alert_action`, `content`) VALUES
  100. ('subscription', 'delete', 'sys_profiles_subscriptions', 'connection_removed', '');
  101. -- Comments
  102. INSERT INTO `bx_notifications_handlers`(`group`, `type`, `alert_unit`, `alert_action`, `content`) VALUES
  103. ('comment', 'insert', 'comment', 'added', 'a:3:{s:11:"module_name";s:6:"system";s:13:"module_method";s:31:"get_notifications_comment_added";s:12:"module_class";s:17:"TemplCmtsServices";}');
  104. SET @iHandlerId = LAST_INSERT_ID();
  105. INSERT INTO `bx_notifications_settings`(`group`, `handler_id`, `delivery`, `type`, `title`, `order`) VALUES
  106. ('comment', @iHandlerId, 'site', 'personal', '_bx_ntfs_alert_action_comment_added_personal', 1),
  107. ('comment', @iHandlerId, 'email', 'personal', '_bx_ntfs_alert_action_comment_added_personal', 1),
  108. ('comment', @iHandlerId, 'push', 'personal', '_bx_ntfs_alert_action_comment_added_personal', 1);
  109. INSERT INTO `bx_notifications_handlers`(`group`, `type`, `alert_unit`, `alert_action`, `content`) VALUES
  110. ('comment', 'delete', 'comment', 'deleted', '');
  111. -- Comments Actions (Like, Reaction, Score Up\Down)
  112. INSERT INTO `bx_notifications_handlers`(`group`, `type`, `alert_unit`, `alert_action`, `content`, `privacy`) VALUES
  113. ('sys_cmts_vote', 'insert', 'sys_cmts', 'doVote', 'a:3:{s:11:"module_name";s:6:"system";s:13:"module_method";s:22:"get_notifications_vote";s:12:"module_class";s:17:"TemplCmtsServices";}', '');
  114. SET @iHandlerId = LAST_INSERT_ID();
  115. INSERT INTO `bx_notifications_settings`(`group`, `handler_id`, `delivery`, `type`, `title`, `order`) VALUES
  116. ('vote', @iHandlerId, 'site', 'personal', '_bx_ntfs_alert_action_doVote_personal', 4),
  117. ('vote', @iHandlerId, 'email', 'personal', '_bx_ntfs_alert_action_doVote_personal', 4),
  118. ('vote', @iHandlerId, 'push', 'personal', '_bx_ntfs_alert_action_doVote_personal', 4),
  119. ('vote', @iHandlerId, 'site', 'follow_member', '_bx_ntfs_alert_action_doVote_follow_member', 1),
  120. ('vote', @iHandlerId, 'email', 'follow_member', '_bx_ntfs_alert_action_doVote_follow_member', 1),
  121. ('vote', @iHandlerId, 'push', 'follow_member', '_bx_ntfs_alert_action_doVote_follow_member', 1),
  122. ('vote', @iHandlerId, 'site', 'follow_context', '_bx_ntfs_alert_action_doVote_follow_context', 1),
  123. ('vote', @iHandlerId, 'email', 'follow_context', '_bx_ntfs_alert_action_doVote_follow_context', 1),
  124. ('vote', @iHandlerId, 'push', 'follow_context', '_bx_ntfs_alert_action_doVote_follow_context', 1);
  125. INSERT INTO `bx_notifications_handlers`(`group`, `type`, `alert_unit`, `alert_action`, `content`) VALUES
  126. ('sys_cmts_vote', 'delete', 'sys_cmts', 'undoVote', '');
  127. INSERT INTO `bx_notifications_handlers`(`group`, `type`, `alert_unit`, `alert_action`, `content`, `privacy`) VALUES
  128. ('sys_cmts_reaction', 'insert', 'sys_cmts_reactions', 'doVote', 'a:3:{s:11:"module_name";s:6:"system";s:13:"module_method";s:26:"get_notifications_reaction";s:12:"module_class";s:17:"TemplCmtsServices";}', '');
  129. SET @iHandlerId = LAST_INSERT_ID();
  130. INSERT INTO `bx_notifications_settings`(`group`, `handler_id`, `delivery`, `type`, `title`, `order`) VALUES
  131. ('vote', @iHandlerId, 'site', 'personal', '_bx_ntfs_alert_action_doVote_personal', 5),
  132. ('vote', @iHandlerId, 'email', 'personal', '_bx_ntfs_alert_action_doVote_personal', 5),
  133. ('vote', @iHandlerId, 'push', 'personal', '_bx_ntfs_alert_action_doVote_personal', 5),
  134. ('vote', @iHandlerId, 'site', 'follow_member', '_bx_ntfs_alert_action_doVote_follow_member', 2),
  135. ('vote', @iHandlerId, 'email', 'follow_member', '_bx_ntfs_alert_action_doVote_follow_member', 2),
  136. ('vote', @iHandlerId, 'push', 'follow_member', '_bx_ntfs_alert_action_doVote_follow_member', 2),
  137. ('vote', @iHandlerId, 'site', 'follow_context', '_bx_ntfs_alert_action_doVote_follow_context', 2),
  138. ('vote', @iHandlerId, 'email', 'follow_context', '_bx_ntfs_alert_action_doVote_follow_context', 2),
  139. ('vote', @iHandlerId, 'push', 'follow_context', '_bx_ntfs_alert_action_doVote_follow_context', 2);
  140. INSERT INTO `bx_notifications_handlers`(`group`, `type`, `alert_unit`, `alert_action`, `content`) VALUES
  141. ('sys_cmts_reaction', 'delete', 'sys_cmts_reactions', 'undoVote', '');
  142. INSERT INTO `bx_notifications_handlers`(`group`, `type`, `alert_unit`, `alert_action`, `content`, `privacy`) VALUES
  143. ('sys_cmts_score_up', 'insert', 'sys_cmts', 'doVoteUp', 'a:3:{s:11:"module_name";s:6:"system";s:13:"module_method";s:26:"get_notifications_score_up";s:12:"module_class";s:17:"TemplCmtsServices";}', '');
  144. SET @iHandlerId = LAST_INSERT_ID();
  145. INSERT INTO `bx_notifications_settings`(`group`, `handler_id`, `delivery`, `type`, `title`, `order`) VALUES
  146. ('score_up', @iHandlerId, 'site', 'personal', '_bx_ntfs_alert_action_doVoteUp_personal', 6),
  147. ('score_up', @iHandlerId, 'email', 'personal', '_bx_ntfs_alert_action_doVoteUp_personal', 6),
  148. ('score_up', @iHandlerId, 'push', 'personal', '_bx_ntfs_alert_action_doVoteUp_personal', 6),
  149. ('score_up', @iHandlerId, 'site', 'follow_member', '_bx_ntfs_alert_action_doVoteUp_follow_member', 3),
  150. ('score_up', @iHandlerId, 'email', 'follow_member', '_bx_ntfs_alert_action_doVoteUp_follow_member', 3),
  151. ('score_up', @iHandlerId, 'push', 'follow_member', '_bx_ntfs_alert_action_doVoteUp_follow_member', 3),
  152. ('score_up', @iHandlerId, 'site', 'follow_context', '_bx_ntfs_alert_action_doVoteUp_follow_context', 3),
  153. ('score_up', @iHandlerId, 'email', 'follow_context', '_bx_ntfs_alert_action_doVoteUp_follow_context', 3),
  154. ('score_up', @iHandlerId, 'push', 'follow_context', '_bx_ntfs_alert_action_doVoteUp_follow_context', 3);
  155. INSERT INTO `bx_notifications_handlers`(`group`, `type`, `alert_unit`, `alert_action`, `content`, `privacy`) VALUES
  156. ('sys_cmts_score_down', 'insert', 'sys_cmts', 'doVoteDown', 'a:3:{s:11:"module_name";s:6:"system";s:13:"module_method";s:28:"get_notifications_score_down";s:12:"module_class";s:17:"TemplCmtsServices";}', '');
  157. SET @iHandlerId = LAST_INSERT_ID();
  158. INSERT INTO `bx_notifications_settings`(`group`, `handler_id`, `delivery`, `type`, `title`, `order`) VALUES
  159. ('score_down', @iHandlerId, 'site', 'personal', '_bx_ntfs_alert_action_doVoteDown_personal', 7),
  160. ('score_down', @iHandlerId, 'email', 'personal', '_bx_ntfs_alert_action_doVoteDown_personal', 7),
  161. ('score_down', @iHandlerId, 'push', 'personal', '_bx_ntfs_alert_action_doVoteDown_personal', 7),
  162. ('score_down', @iHandlerId, 'site', 'follow_member', '_bx_ntfs_alert_action_doVoteDown_follow_member', 4),
  163. ('score_down', @iHandlerId, 'email', 'follow_member', '_bx_ntfs_alert_action_doVoteDown_follow_member', 4),
  164. ('score_down', @iHandlerId, 'push', 'follow_member', '_bx_ntfs_alert_action_doVoteDown_follow_member', 4),
  165. ('score_down', @iHandlerId, 'site', 'follow_context', '_bx_ntfs_alert_action_doVoteDown_follow_context', 4),
  166. ('score_down', @iHandlerId, 'email', 'follow_context', '_bx_ntfs_alert_action_doVoteDown_follow_context', 4),
  167. ('score_down', @iHandlerId, 'push', 'follow_context', '_bx_ntfs_alert_action_doVoteDown_follow_context', 4);
  168. INSERT INTO `bx_notifications_handlers`(`group`, `type`, `alert_unit`, `alert_action`, `content`, `privacy`) VALUES
  169. ('sys_cmts_object_reported', 'insert', 'sys_cmts', 'reported_content', 'a:3:{s:11:"module_name";s:6:"system";s:13:"module_method";s:34:"get_notifications_comment_reported";s:12:"module_class";s:17:"TemplCmtsServices";}', '');
  170. SET @iHandlerId = LAST_INSERT_ID();
  171. INSERT INTO `bx_notifications_settings`(`group`, `handler_id`, `delivery`, `type`, `title`, `order`) VALUES
  172. ('action_required', @iHandlerId, 'site', 'personal', '_bx_ntfs_alert_action_reported_content_personal', 8),
  173. ('action_required', @iHandlerId, 'email', 'personal', '_bx_ntfs_alert_action_reported_content_personal', 8),
  174. ('action_required', @iHandlerId, 'push', 'personal', '_bx_ntfs_alert_action_reported_content_personal', 8);
  175. CREATE TABLE IF NOT EXISTS `bx_notifications_aggregator` (
  176. `id` int(11) NOT NULL auto_increment,
  177. `profile_id` int(11) NOT NULL DEFAULT '0',
  178. `event_id` int(11) NOT NULL DEFAULT '0',
  179. `delivery` varchar(64) NOT NULL default '',
  180. PRIMARY KEY (`id`),
  181. UNIQUE KEY `item` (`profile_id`, `event_id`, `delivery`(16))
  182. );
  183. CREATE TABLE IF NOT EXISTS `bx_notifications_queue` (
  184. `id` int(11) NOT NULL auto_increment,
  185. `profile_id` int(11) NOT NULL DEFAULT '0',
  186. `event_id` int(11) NOT NULL DEFAULT '0',
  187. `delivery` varchar(64) NOT NULL default '',
  188. `content` text NOT NULL,
  189. `date` int(11) NOT NULL default '0',
  190. PRIMARY KEY (`id`)
  191. );
  192. CREATE TABLE IF NOT EXISTS `bx_notifications_etemplates` (
  193. `id` int(11) NOT NULL auto_increment,
  194. `type` varchar(255) NOT NULL,
  195. `action` varchar(255) NOT NULL,
  196. `subject` varchar(255) NOT NULL default '',
  197. `body` text NOT NULL,
  198. `active` tinyint(4) NOT NULL default '0',
  199. PRIMARY KEY (`id`),
  200. UNIQUE KEY `etemplate` (`type`(32), `action`(127))
  201. );
  202. -- FORMS: etemplate
  203. 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
  204. ('bx_notifications_etemplate', @sName, '_bx_ntfs_form_etemplate', '', '', 'do_submit', 'bx_notifications_etemplates', 'id', '', '', '', 0, 1, '', '');
  205. INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
  206. ('bx_notifications_etemplate_add', @sName, 'bx_notifications_etemplate', '_bx_ntfs_form_etemplate_display_add', 0),
  207. ('bx_notifications_etemplate_edit', @sName, 'bx_notifications_etemplate', '_bx_ntfs_form_etemplate_display_edit', 0);
  208. 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
  209. ('bx_notifications_etemplate', @sName, 'type', '', '', 0, 'select', '_bx_ntfs_form_etemplate_input_sys_type', '_bx_ntfs_form_etemplate_input_type', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_ntfs_form_etemplate_input_err_select', 'Xss', '', 0, 0),
  210. ('bx_notifications_etemplate', @sName, 'action', '', '', 0, 'select', '_bx_ntfs_form_etemplate_input_sys_action', '_bx_ntfs_form_etemplate_input_action', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_ntfs_form_etemplate_input_err_select', 'Xss', '', 0, 0),
  211. ('bx_notifications_etemplate', @sName, 'subject', '', '', 0, 'text', '_bx_ntfs_form_etemplate_input_sys_subject', '_bx_ntfs_form_etemplate_input_subject', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_ntfs_form_etemplate_input_err_enter', 'Xss', '', 0, 0),
  212. ('bx_notifications_etemplate', @sName, 'body', '', '', 0, 'textarea', '_bx_ntfs_form_etemplate_input_sys_body', '_bx_ntfs_form_etemplate_input_body', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_ntfs_form_etemplate_input_err_enter', 'XssHtml', '', 0, 0),
  213. ('bx_notifications_etemplate', @sName, 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '_bx_ntfs_form_etemplate_input_controls', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  214. ('bx_notifications_etemplate', @sName, 'do_submit', '_bx_ntfs_form_etemplate_input_do_submit', '', 0, 'submit', '_bx_ntfs_form_etemplate_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  215. ('bx_notifications_etemplate', @sName, 'do_cancel', '_bx_ntfs_form_etemplate_input_do_cancel', '', 0, 'button', '_bx_ntfs_form_etemplate_input_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";}', '', '', '', '', '', '', '', 0, 0);
  216. INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  217. ('bx_notifications_etemplate_add', 'type', 2147483647, 1, 1),
  218. ('bx_notifications_etemplate_add', 'action', 2147483647, 1, 2),
  219. ('bx_notifications_etemplate_add', 'subject', 2147483647, 1, 3),
  220. ('bx_notifications_etemplate_add', 'body', 2147483647, 1, 4),
  221. ('bx_notifications_etemplate_add', 'controls', 2147483647, 1, 5),
  222. ('bx_notifications_etemplate_add', 'do_submit', 2147483647, 1, 6),
  223. ('bx_notifications_etemplate_add', 'do_cancel', 2147483647, 1, 7),
  224. ('bx_notifications_etemplate_edit', 'subject', 2147483647, 1, 1),
  225. ('bx_notifications_etemplate_edit', 'body', 2147483647, 1, 2),
  226. ('bx_notifications_etemplate_edit', 'controls', 2147483647, 1, 3),
  227. ('bx_notifications_etemplate_edit', 'do_submit', 2147483647, 1, 4),
  228. ('bx_notifications_etemplate_edit', 'do_cancel', 2147483647, 1, 5);
  229. -- STUDIO PAGE & WIDGET
  230. INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
  231. (3, @sName, '_bx_ntfs', '_bx_ntfs', 'bx_notifications@modules/boonex/notifications/|std-icon.svg');
  232. SET @iPageId = LAST_INSERT_ID();
  233. SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
  234. SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
  235. INSERT INTO `sys_std_widgets` (`page_id`, `module`, `type`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
  236. (@iPageId, @sName, 'extensions', '{url_studio}module.php?name=bx_notifications', '', 'bx_notifications@modules/boonex/notifications/|std-icon.svg', '_bx_ntfs', '', '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";}');
  237. INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
  238. (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));