[Vtigercrm-developers] non-role-based picklist editor
Adam Heinz
amh at metricwise.net
Tue Dec 20 11:13:20 PST 2011
I've spent some spare cycles looking into this problem in more detail. I
started playing around with Settings > Picklist Editor to see if I could
get it to work for uitype 16 and discovered the following:
(uitype 15)
mysql> desc vtiger_taskstatus;
+------------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------------+--------------+------+-----+---------+----------------+
| taskstatusid | int(19) | NO | PRI | NULL | auto_increment |
| taskstatus | varchar(200) | YES | | NULL | |
| presence | int(1) | NO | | 1 | |
| picklist_valueid | int(19) | NO | | 0 | |
+------------------+--------------+------+-----+---------+----------------+
(uitype 16)
mysql> desc vtiger_status;
+-------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------+------+-----+---------+----------------+
| statusid | int(19) | NO | PRI | NULL | auto_increment |
| status | varchar(200) | NO | | | |
| sortorderid | int(19) | NO | | 0 | |
| presence | int(1) | NO | | 1 | |
+-------------+--------------+------+-----+---------+----------------+
mysql> desc vtiger_picklist;
+------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+----------------+
| picklistid | int(19) | NO | PRI | NULL | auto_increment |
| name | varchar(200) | NO | UNI | NULL | |
+------------+--------------+------+-----+---------+----------------+
mysql> desc vtiger_role2picklist;
+-----------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+--------------+------+-----+---------+-------+
| roleid | varchar(255) | NO | PRI | NULL | |
| picklistvalueid | int(11) | NO | PRI | NULL | |
| picklistid | int(11) | NO | PRI | NULL | |
| sortid | int(11) | YES | | NULL | |
+-----------------+--------------+------+-----+---------+-------+
1. The picklists themselves do not know what uitype they are. I can use
SHOW COLUMNS to determine this at runtime, or I could add a column to
vtiger_picklist to remember this setting.
2. The visiblity/sorting information is found in multiple locations. I
think it might make life a little easier to create vtiger_role2picklist
entries for the H1/Organisation role (or other placeholder role) and use
those when uitype 16 is encountered.
3. Since we have picklistid in vtiger_role2picklist, couldn't we simply use
the picklist tableid primary key instead of manufacturing a globally
unique picklistvalueid?
4. Maybe vtiger_role2picklist should be used only for visibility and not
for sorting? It seems likely that sort order is non-deterministic for
roles that inherit other roles.
Anyway, looking for some feedback before I press on with this line of
investigation. Per Srihari's poll two weeks ago, I assume vtiger is
planning to do some development in this area? Don't want to step on any
toes or write code that will need to be rewritten for a future release.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20111220/7a007d43/attachment-0002.html
More information about the vtigercrm-developers
mailing list