vTigress CookBook Recipe #1- PickBlocks

PickBlocks give the user an ability to show/hide module blocks based on a Picklist Value in a module CreateView and EditView.

Code & Database changes

1. Table vtiger_blocks must be altered with additional column called pickblock
ALTER TABLE vtiger_blocks ADD pickblock VARCHAR(100);
2. salesEditView.tpl, CreateView.tpl, InventoryCreateView.tpl, InventoryEditView.tpl have changes

after foreach

before closing foreach
3. {include file=’Inventory/pickblocks.tpl’} at the end of salesEditView.tpl, CreateView.tpl, InventoryCreateView.tpl, InventoryEditView.tpl
4. The records in vtiger_blocks which represent the pickblocks have to have the id of the pickfield stored in it.
5. EditView.php, calling script line, either from modules/Vtiger, modules/ must have the following Smarty Variable assignment
6. In the same file the function getPickBlocks must be defined.
7. Create a picklist field in the module where the feature is desired using Layout Editor or Layout DZiner.
8. Populate the picklist values as desired for the module context
9. Create the blocks, one block per picklist value, and must be named after the picklist values EXACTLY.
10. Set the pickblock column value for the pickblocks created in mySQL

Click here to see the code for Smarty/templates/pickblocks.tpl

Click here to see the code for PHP

Check www.vtigress.com for the latest release of vtDZiner.
Use Promo Code vtDZinerWP and avail a discount of 5% on the sale price of vtDZiner

Leave a Reply

Your email address will not be published. Required fields are marked *