
INSERT INTO `module` (`module_id`, `is_configurable`, `name`, `title`, `description`, `admin_uri`, `icon`, `maintainers`, `version`, `license`, `state`) VALUES ({SGL_NEXT_ID}, 1, 'tips', 'Tips', 'Tips 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}, 'admintipsmgr', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'admintipsmgr_cmd_view', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'admintipsmgr_cmd_addview', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'admintipsmgr_cmd_add', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'admintipsmgr_cmd_editview', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'admintipsmgr_cmd_edit', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'admintipsmgr_cmd_delete', '', @moduleId);

#AdminArticleWebTypeMgr
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'admintipstypemgr', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'admintipstypemgr_cmd_view', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'admintipstypemgr_cmd_addview', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'admintipstypemgr_cmd_add', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'admintipstypemgr_cmd_editview', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'admintipstypemgr_cmd_edit', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'admintipstypemgr_cmd_delete', '', @moduleId);

#ArticleViewWebMgr
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'tipsviewmgr', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'tipsviewmgr_cmd_viewarticle', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'tipsviewmgr_cmd_viewarticletype', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'tipsviewmgr_cmd_viewarticlealltype', '', @moduleId);

#member role perms


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

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

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