So I’m trying to follow this thread (I’m a noob at this stuff) I gather I need to:
- create a custom view.detail.php file in /custom/modules/my_module/view.detail.php
- In my case if Line of Business is HVAC I want to hide the 3rd tab, id=“tab2”
- I have to extend ViewDetail and then use the above JS to hide the tab by changing the class to “hidden”
Am I understanding it correctly or is it more complicated? (I can’t seem to get it to work)
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
require_once("include/MVC/View/views/view.detail.php");
class bldg_Other_OppsViewDetail extends ViewDetail
{
if($this->bean->line_of_business_c =='HVAC'){
public function display(){
$js= '';
//JS to hide the panel
$js = <<<EOQ
<script type="text/javascript">
// Theme Suite7 & SuiteR
$("#detailpanel_2").addClass('hidden');
// Theme SuiteP
$("a[href=#top-panel-0]").parents('.panel-default').addClass('hidden');
// Hide the tab - common to all themes
$("a#tab2").parent().addClass('hidden');
</script>
EOQ;
parent::display();
echo $js; //echo the script.
}
}
}