User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
en:devel:add_editdetail_block [2016/09/10 02:01]
127.0.0.1 external edit
en:devel:add_editdetail_block [2019/08/28 10:51] (current)
joebordes
Line 5: Line 5:
 To use this strategy you simply have to create a template with the same label as the block followed by //_edit// or //_detail// inside the module'​s template directory. To use this strategy you simply have to create a template with the same label as the block followed by //_edit// or //_detail// inside the module'​s template directory.
  
-Inside that file you will be able to use all the variables and functionality of Smarty and a new //$FIELDS// variable which contains the values of the fields of the record being shown/​edited.+Inside that fileyou will be able to use all the variables and functionality of Smarty and a new //$FIELDS// variable which contains the values of the fields of the record being shown/​edited.
  
 No additional functionality is given. You, as a programmer, must create the code to do any magic you need inside this block. No additional functionality is given. You, as a programmer, must create the code to do any magic you need inside this block.
Line 11: Line 11:
 If you need to add a new block this can be done easily both in the layout editor and by using vtlib API. If you need to add a new block this can be done easily both in the layout editor and by using vtlib API.
  
-Next I am going to walk through a simple example by creating a new block called **Process Workflow** which will show an image to move to next phase of a given business process if it is possible in //Detail View// and a status message in //Edit View//.+NextI am going to walk through a simple example by creating a new block called **Process Workflow** which will show an image to move to next phase of a given business process if it is possible in //Detail View// and a status message in //Edit View//.
  
 To create the block we use this vtlib code: To create the block we use this vtlib code:
Line 23: Line 23:
 $modname = '​Potentials';​ $modname = '​Potentials';​
 $module = Vtiger_Module::​getInstance($modname);​ $module = Vtiger_Module::​getInstance($modname);​
-if($module) {+if ($module) {
  $block = new Vtiger_Block();​  $block = new Vtiger_Block();​
  $block->​label = '​ProcessWorkflow';​  $block->​label = '​ProcessWorkflow';​
- $block->​sequence = 2; 
  $block->​sequence = 2;  $block->​sequence = 2;
  $module->​addBlock($block);​  $module->​addBlock($block);​