[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Dolibarr-dev] Troubles with menus

From: Philippe Berthet
Subject: Re: [Dolibarr-dev] Troubles with menus
Date: Fri, 25 Jan 2013 11:24:59 +0100

Hi Regis,
Thanks for your reply, I finally understand how it works!  I was confused by the meaning of the 'fk_menu'=>'fk_mainmenu=xxx declaration, but it's clear to me now and works like a charm.


On Fri, Jan 25, 2013 at 8:43 AM, Régis Houssin <address@hidden> wrote:

you can look at this file to see how to manage add menu "top" and "left" from an external module.


look this part :

// Main menu entries
$this->menus = array();            // List of menus to add

Le 25/01/13 08:32, Philippe Berthet a écrit :
Hi All,

First of all I want to congratulate the team for the work done here. I've spend time trying to find an open source ERP with a real community, struggling with openERP, Tryton, weberp & al before finally founding Dolibarr : A real open source software, not too big, not too small, easy to enter into code, well structured, with a clever module base system and with a real documentation to start without being lost immediately.
Thanks for the work guys, Dolibarr Rocks!

Now the hard part :
I've written a module to synchronize contacts between Dolibarr and a Gmail account, so Dolibarr contacts can be easily viewed and managed from a smartphone, but I am a little confuse with the menu system. My module need to insert a new entry on the highest level of the third party left  menu. Finally, I'm using the printLeftBlock() hook, checking that ($_SESSION["mainmenu"]=='companies')  to do it.
Unfortunately, this hook is called after the print of the search forms, bookmarks, and help, so my menu is a little bit lost at the bottom... Is this the good way to do this? If yes, Do you think it is possible to move this hook call just aftter the "$menuleft->showmenu();" in, or maybe better to call it twice : Once at the place it is now and once after the showmenu(), but with different values set in $parameters array ?
I've check the sources in 3.3; this will not hurt any base module, but of course I don'k know if this hook is used by external module...

BTW, do you think this module could be candidate to Dolistore? Did I have to ask if it has any interest to end users on the forum before submitting it? You can find a full description of it here : (sorry, only in French for now)

I've also written a module based on canvas and extrafields to manage products creation and presentation, allowing different fields to be displayed based on the category selected for the product. 
Again, I got troubles on menu system : Canvas mechanism need to be called with 'address@hidden'  in $_GET when creating a new product, so menu entry for product->new need to by modified... The only way I found was to hard sql update url column in llx_menu table for titre="NewProduct" in my module activation, but this is not a very clean solution : It requires to use the Auguria menu system only, and the module need to be reactivated if the menu system is changed. 
Is there an other way to manage this?, if not, could I propose a patch with a solution to this?

Sorry for this long post and thanks in advance for your answers.

Philippe Berthet

Dolibarr-dev mailing list

Régis Houssin
Cidex 1130
34, route de Gigny
71240 MARNAY
VoIP: +33 1 83 62 40 03
GSM: +33 6 33 02 07 97
Email: address@hidden

Dolibarr developer: address@hidden
Web Portal:
SaaS offers:
Development platform:

Philippe Berthet

reply via email to

[Prev in Thread] Current Thread [Next in Thread]