Adding a main menu item

Have a question? Welcome here!
User avatar
jjeffman
Posts: 91
Joined: Thu Dec 08, 2011 1:05 pm
Location: Porto Alegre, Brazil

Adding a main menu item

Postby jjeffman » Wed Feb 24, 2016 1:47 pm

Hello Artem,

I would like to create some customized reports based on user choices.

I have already found out how to add a main menu item, but I am still not able to show the new menu item only to users who belong to a defined global group.

I also need to learn how to keep the main menu visible and show the report on the same portion of the screen used by eTraxis for other items.

Can you please give me some directions on this matter ?

Thank you very much.
Best regards.

Jayme Jeffman

User avatar
Artem
eTraxis Support
Posts: 227
Joined: Mon Sep 15, 2008 2:51 am
Location: Auckland, New Zealand
Contact:

Re: Adding a main menu item

Postby Artem » Sat Feb 27, 2016 11:59 pm

Hello Jayme,

The menu is generated in the "xml2html" function (see the "engine/xml.php" file). This is where you can add more menu items.
Best regards,
Artem

User avatar
jjeffman
Posts: 91
Joined: Thu Dec 08, 2011 1:05 pm
Location: Porto Alegre, Brazil

Re: Adding a main menu item

Postby jjeffman » Thu Mar 03, 2016 2:45 pm

Ok Artem.

I have already created the "Reports" main menu item.

How can I show it only to certain user group ?
Best regards.

Jayme Jeffman

User avatar
Artem
eTraxis Support
Posts: 227
Joined: Mon Sep 15, 2008 2:51 am
Location: Auckland, New Zealand
Contact:

Re: Adding a main menu item

Postby Artem » Thu Mar 03, 2016 8:20 pm

Hello Jayme,

I would create a dedicated SQL query to determine whether the user belongs to the group (let's name it "sql/accounts/ismember.sql"):

Code: Select all

select count(*)
from tbl_membership
where account_id = %1 and group_id = %2
Then I would add the following block of code in the "xml2html" function:

Code: Select all

$group_id = ...; // get the ID of required group
$is_member = dal_query('accounts/ismember.sql', $_SESSION[VAR_USERID], $group_id);

if ($is_member->fetch(0) != 0)
{
    $menu .= '<menuitem url="...">Reports</menuitem>';
}
Best regards,
Artem

User avatar
jjeffman
Posts: 91
Joined: Thu Dec 08, 2011 1:05 pm
Location: Porto Alegre, Brazil

Re: Adding a main menu item

Postby jjeffman » Tue Mar 08, 2016 4:01 pm

Tahnk you very much Artem.

Well, I have succeeded on showing the menu item. Now I need to show the ./reports/index.php keeping the same eTraxis design and I am not familiar with breadcrumbs tags.

I would like to place some html forms elements such as checkboxes, textboxes and buttons and a region to show the result set returned by the user choice. I do not know how to make that using the eTraxis way.
Best regards.

Jayme Jeffman

User avatar
Artem
eTraxis Support
Posts: 227
Joined: Mon Sep 15, 2008 2:51 am
Location: Auckland, New Zealand
Contact:

Re: Adding a main menu item

Postby Artem » Tue Mar 08, 2016 7:36 pm

Sorry, Jayme, but I can't help you with it - it's too much to explain and hardly managable over forum. You will need to familiarize yourself with appropriate code base.

The only couple of notes I can make are following:

1. eTraxis 3.x uses XML to generate resulted HTML pages. Check appropriate XSLT files if needed.

2. New eTraxis 4.x wll not use XML approach - it will be a little bit different design. Also, the new version is built using Symfony framework featured with Doctrine as ORM and Twig as template engine. So, while new eTraxis uses same database schema and provides the same functionality, internally (code-wise) it's a completely different system remastered from scratch.
Best regards,
Artem

User avatar
jjeffman
Posts: 91
Joined: Thu Dec 08, 2011 1:05 pm
Location: Porto Alegre, Brazil

Re: Adding a main menu item

Postby jjeffman » Wed Mar 09, 2016 8:44 pm

Ok Artem.

I will try to discover the way your pages are built.

Thank you very much.
Best regards.

Jayme Jeffman


Who is online

Users browsing this forum: No registered users and 1 guest