dolibarr-dev
[Top][All Lists]
Advanced

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

[Dolibarr-dev] Dictionary definition in module descriptor


From: Remy Younes
Subject: [Dolibarr-dev] Dictionary definition in module descriptor
Date: Mon, 17 Oct 2011 21:57:43 -0400

Hello everyone, 
I noticed that modules can now add dictionaries by setting  $this->dictionnaries = array(); in the module descriptor (in 3.2 dev, maybe earlier but I wasn't aware).
This is a nice feature, however I can't figure out how to define the input type for each field. 
I see that this is hardcoded in dict.php in the fieldList method
for example, for country selection we have: 

 if ($fieldlist[$field] == 'pays') {
            if (in_array('region_id',$fieldlist)) { print '<td>&nbsp;</td>'; continue; } // For region page, we do not show the country input
            print '<td>';
            $html->select_pays($obj->pays,'pays');
            print '</td>';
     }

It would be nice to be able to define our own fields' types as well
Maybe the use of hooks or triggers would be appropriate.

Let me know if i'm missing something. Otherwise, I have some code that I wrote under dol v2.9 that I could share. 

reply via email to

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