How to add new tab in orangehrm-3.1 - orangehrm

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

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');

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.

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!

Related

Write INSERT INTO VALUES(:P1_item)

I want to write down what value I have in the form, in another table, but it does not work out what is wrong ?? I did a dynamic action before the create button
INSERT INTO SEC_SEALING_STATUS (NAME_OBJ,SEALING)
VALUES (:P7_NAME_OBJ,'Ні');
When invoking PL/SQL in a dynamic action, you need to send the relevant values from your browser to the database using the 'Page items to submit' attribute.
In your case, you should see P7_NAME_OBJ listed in the attribute, otherwise the value will be null, or whatever it was last time session state was updated.
remove the dinamix action
set the button to 'submit page'
create a process pl/sql with your insert code.

How can i remove and rename items from "Sort by" in prestashop?

I am new to Prestashop and I am trying to remove from "Sort by" dropdown the default options: "Name, A to Z" and "Name, Z to A". Also i am trying to rename the option: "Relevance".
I tried to change these values from dashboard, but unfortunately i couldn't.
Does anyone know how can i fix it?
Thank you in advance.
Hi #opnash and welcome to SO,
Solution to Edit these entries
You can edit these via the International > Translations tab in your PrestaShop admin panel:
You can then select Themes translations, your theme, your language and hit Modify:
Then, you can either select Theme > Catalog in the sidebar or search for "Name, Z to A" (for instance):
Lastly, just edit the text in the text box and hit Save and Voilà!
Solution to Remove these entries
Now, to delete some of these, the process would be different, you could either:
Override the SortOrder() class (in PrestaShop\PrestaShop\Core\Product\Search) and filter the allowed criteria and also override the getDefaultSortOrders() in the SortOrderFactory class
-or-
Edit all the files where these Sort criteria are defined, example:
modules\ps_facetedsearch\src\Ps_FacetedsearchProductSearchProvider.php
Line 127: $this->module->getTranslator()->trans('Name, Z to A', array(), 'Shop.Theme.Catalog')
src\Adapter\BestSales\BestSalesProductSearchProvider.php
Line 102: $this->translator->trans('Name, Z to A', array(), 'Shop.Theme.Catalog')
src\Adapter\NewProducts\NewProductsProductSearchProvider.php
Line 113: $this->translator->trans('Name, Z to A', array(), 'Shop.Theme.Catalog')
src\Adapter\PricesDrop\PricesDropProductSearchProvider.php
Line 107: $this->translator->trans('Name, Z to A', array(), 'Shop.Theme.Catalog')
Please note that you can also configure the default sort criteria in your Admin Panel, via Shop Parameters > Product Settings:
I hope this helps!

New line button && submit button

In my TextInput I need to show a "New Line" key and also the "Done" key.
Currently I am only able to get one or the other. I can get the "New Line" key but setting <TextInput returnKeyType="none" multiline>, however I don't get the "Done" key anymore:
Is it posible to get both? I am testing on Android, I haven't tested on iOS yet.
Unfortunately, the short answer is no.
For the returnKeyType the documentation states can only one of the enum values...
returnKeyType?: enum('done', 'go', 'next', 'search', 'send', 'none', 'previous', 'default', 'emergency-call', 'google', 'join', 'route', 'yahoo')
Determines how the return key should look. On Android you can also use returnKeyLabel.
Cross platform
The following values work across platforms:
done
go
next
search
send
Android Only
The following values work on Android only:
none
previous
iOS Only
The following values work on iOS only:
default
emergency-call
google
join
route
yahoo

How to create Struts Drop down List?

I m new to struts.
I Want to add drop down in web page.That drop down should contain four values. The default and first value will be (Select).
I want to persist the selected value, when that form is opened again and while submitting, if user doesn't select any value from drop down (meaning the default value is present) I want to give an alert to the user and then not to allow a submit until till the user selects an option from the dropdown.
There is one action.java, form.java, javascript file and jsp file. In action.java, I m suppose to use ArrayList to hold different drop down values. How this can be done. please help me.
<s:select list="#{'':'Select', 'key1':'Value 1', 'key2':'Value 2'}" key="selectedValue"></s:select>
or you have a list object(id, value)
<s:select key="selectedValue" list="yourlists" headerKey="" headerValue="Select" listKey="id" listValue="value"/>
Firstly, you need to show your code here. If you are interested in tutorials then I'd suggest - VaanNila, a great place to learn struts framework. (Here is a link of select tag.)

dojo query for checkboxes

I want to get all my checked checkboxes from a form and i do like this(and it works)
var cbs = dojo.query('input:checked', 'f');
I wand to add another selector(class selector) to get all checked checkboxes from a form with a specified class. I tried this one but it doesn't work
var cbs = dojo.query('input:checked .xClass', 'f');
Try this dojo.query('input.xClass:checked', 'f');
Pseudo-selectors like :checked act like filters and should be put as suffixes of other selectors. You can select checkboxes with a specified class first using input.xClass, then append the :checked as the suffix.
What does the 'f' do in this case? I tried google for the parameters but couldn't find anything. – user1477388 Oct 11 '13 at 16:20
the second parameter of the query is the starting node for the query.
For instance, the query for < input > tags begins at "#{id:inputText1}" followed by the found nodes having the value of those found nodes, smited away with a null string.