INSERT INTO `module` (`module_id`, `is_configurable`, `name`, `title`, `description`, `admin_uri`, `icon`, `maintainers`, `version`, `license`, `state`) VALUES ({SGL_NEXT_ID}, 1, 'newsevent', 'News and Event', 'News and Event Module for Carton Web', '', '48/module_default.png', 'RV Global Soft Teams', '20081001', 'RV Global Soft', 'Stable');

SELECT @moduleId := MAX(module_id) FROM module;

#AdminArticleWebMgr  
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminnewseventmgr', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminnewseventmgr_cmd_view', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminnewseventmgr_cmd_addview', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminnewseventmgr_cmd_add', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminnewseventmgr_cmd_editview', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminnewseventmgr_cmd_edit', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminnewseventmgr_cmd_delete', '', @moduleId);

#AdminArticleWebTypeMgr
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminnewseventtypemgr', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminnewseventtypemgr_cmd_view', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminnewseventtypemgr_cmd_addview', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminnewseventtypemgr_cmd_add', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminnewseventtypemgr_cmd_editview', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminnewseventtypemgr_cmd_edit', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminnewseventtypemgr_cmd_delete', '', @moduleId);

#ArticleViewWebMgr
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'newseventviewmgr', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'newseventviewmgr_cmd_viewarticle', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'newseventviewmgr_cmd_viewarticletype', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'newseventviewmgr_cmd_viewarticlealltype', '', @moduleId);

#member role perms


INSERT INTO `article_type` (`article_type_id`, `type_icon`) VALUES (2, '');

INSERT INTO `article_type_message` (`article_type_message_id`, `article_type_id`, `web_lang_id`, `type_name`, `description`) 
    VALUES      (2, 2, 1, 'NewsAndEvent', '');

INSERT INTO `article_type_role` (`article_type_id`, `role_id`) VALUES (2, 0),(2, 1),(2, 2);