The purpose of this mapping is to define additional panes or tabs on a modules' detail view. The additional panes work exactly as the "More Information" pane with a drop down menu that contains the different blocks contained in the pane.
A pane can contain any combination of 4 types of blocks:
The accepted format is:
<map>
<originmodule>
<originname>Accounts</originname>
</originmodule>
<panes>
<pane>
<label></label>
<sequence></sequence>
<defaultMoreInformation></defaultMoreInformation> special marker to get default application more information, if present the blocks sections is ignored
<blocks>
<block>
<label></label>
<sequence></sequence>
<type></type> RelatedList | Widget | CodeWithHeader | CodeWithoutHeader
<loadfrom></loadfrom> related list label or id | file to load | widget reference
<loadphp></loadphp>
<handler_path></handler_path>
<handler_class></handler_class>
<handler></handler>
</block>
</blocks>
</pane>
.....
</panes>
</map>
As with other business mappings the name of the record is what triggers the functionality. In this case the name must be {Module}RelatedPanes, for example, AccountsRelatedPanes
If loadfrom is Widget then the directives handler_path, handler_class and handler, if given, will be used to construct the Detail View Widget reference object.
If loadphp is given the file indicated as the value will be executed inside the context of the pane being loaded. This is where you will create additional Smarty variables and context for your code.
<map>
<originmodule>
<originname>Accounts</originname>
</originmodule>
<panes>
<pane>
<label>Comercial</label>
<sequence>2</sequence>
<blocks>
<block>
<label></label>
<sequence>0</sequence>
<type>RelatedList</type>
<loadfrom>Invoice</loadfrom>
</block>
<block>
<label></label>
<sequence>1</sequence>
<type>RelatedList</type>
<loadfrom>Contacts</loadfrom>
</block>
</blocks>
</pane>
<pane>
<label>Marketing</label>
<sequence>1</sequence>
<blocks>
<block>
<label></label>
<sequence>2</sequence>
<type>RelatedList</type>
<loadfrom>Campaigns</loadfrom>
</block>
<block>
<label></label>
<sequence>1</sequence>
<type>RelatedList</type>
<loadfrom>Potentials</loadfrom>
</block>
</blocks>
</pane>
<pane>
<label>More Information</label>
<sequence>3</sequence>
<defaultMoreInformation>1</defaultMoreInformation>
</pane>
</panes>
</map>
This mapping will add two tabs and the default "More Information" tab. In the first tab you will find the Campaigns and Potentials related lists. In the second tab you will find the Contacts and Invoice related lists.
<map>
<originmodule>
<originname>Accounts</originname>
</originmodule>
<panes>
<pane>
<label>pane1</label>
<sequence>2</sequence>
<blocks>
<block>
<label>blk0</label>
<sequence>0</sequence>
<type>RelatedList</type>
<loadfrom>Invoice</loadfrom>
</block>
<block>
<label>DetailViewBlockCommentWidget</label>
<sequence>2</sequence>
<type>Widget</type>
<loadfrom>block://ModComments:modules/ModComments/ModComments.php</loadfrom>
</block>
<block>
<label>blk1</label>
<sequence>1</sequence>
<type>RelatedList</type>
<loadfrom>Contacts</loadfrom>
</block>
</blocks>
</pane>
<pane>
<label>pane2</label>
<sequence>1</sequence>
<blocks>
<block>
<label>blk4</label>
<sequence>2</sequence>
<type>CodeWithoutHeader</type>
<loadfrom>Smarty/templates/modules/Potentials/ProcessWorkflow_edit.tpl</loadfrom>
</block>
<block>
<label>blk3</label>
<sequence>1</sequence>
<type>CodeWithHeader</type>
<loadfrom>Smarty/templates/modules/Potentials/ProcessWorkflow_detail.tpl</loadfrom>
</block>
</blocks>
</pane>
</panes>
</map>
This business map adds two tabs. The first one contains two special code blocks which you can see in this documentation page. The second tab contains two related lists and the typical Comments block.
Note that there is no "More Information" tab in this example.
Next | Chapter 16: Import.