install.sql 1.3 KB

12345678910111213141516171819202122232425
  1. SET @sName = 'bx_xero';
  2. -- TABLE: contacts
  3. CREATE TABLE IF NOT EXISTS `bx_xero_contacts` (
  4. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  5. `email` varchar(128) NOT NULL default '',
  6. `contact` varchar(64) NOT NULL default '',
  7. `added` int(11) NOT NULL default '0',
  8. PRIMARY KEY (`id`),
  9. UNIQUE KEY `email` (`email`)
  10. );
  11. -- STUDIO PAGE & WIDGET
  12. INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
  13. (3, @sName, '_bx_xero', '_bx_xero', 'bx_xero@modules/boonex/xero/|std-icon.svg');
  14. SET @iPageId = LAST_INSERT_ID();
  15. SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
  16. SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
  17. INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
  18. (@iPageId, @sName, '{url_studio}module.php?name=bx_xero', '', 'bx_xero@modules/boonex/xero/|std-icon.svg', '_bx_xero', '', '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";}');
  19. INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
  20. (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));