Reputation: 51
How to add new tab under PIM module in 3.1 version??I edited many pages in orangehrm coding,but none of them help,so anyone help me what are files to edit to add new tabs or provide me any reference links or suggestions
Upvotes: 0
Views: 2786
Reputation: 480
Go to table ohrm_menu_item add what you want to appear in the menu or child menu.Remenber you must make the status 1.unless it cannot be active.
Upvotes: 1
Reputation: 1883
You need to execute 3 queries (the menu item, screen and access) . In order to see the menu you have to delete the session once, because the menu is stored in it.
INSERT INTO `ohrm_menu_item` (`id`, `menu_title`, `screen_id`, `parent_id`, `level`, `order_hint`, `url_extras`, `status`)
VALUES (NULL, 'My Menu', '103', '68', '2', '600', '/mode/new', '1');
INSERT INTO `ohrm_screen` (`name`, `module_id`, `action_url`)
VALUES ('My new menu', '9', 'action url');
INSERT INTO `ohrm_user_role_screen` (`user_role_id`, `screen_id`, `can_read`, `can_create`, `can_update`, `can_delete`)
VALUES ('1', '103', '1', '1', '1', '1');
Upvotes: 2
Reputation: 785
The trick to achieving this is in adding to the OrangeHRM database.
The following MySQL query will create a menu item under the PIM menu (at the start).
INSERT INTO `orangehrm_mysql`.`ohrm_menu_item` (`id`, `menu_title`, `screen_id`, `parent_id`, `level`, `order_hint`, `url_extras`, `status`) VALUES (NULL, 'Name of Menu Item', '75', '30', '3', '100', NULL, '1');
'menu_title' will be the name of your menu item as displayed to the user.
I suggest you to compare the screen_ids of other records in the same table, to get your desired 'landing page'. For example, the screen_id '46' will take you to the 'My Info' page. Note that this menu item will redirect to the PIM module, because its screen_id is '75'.
The 'parent_id' will tell OrangeHRM which main menu item to fall under (become a child of).
I believe that 'level' refers to the user level this menu item will be visible to. You can find out more from the records in the 'ohrm_user_role' table.
Play around with 'order_hint' to get it to appear where you want it to. I found out that the greater its value, the more the menu will be positioned to the right.
If you intend to redirect the user to a page of your own within the OrangeHRM site, you will have to create your own module and make several other database edits.
Good Luck!
Upvotes: 0