Skip to content

Commit

Permalink
fix(DetailView) Related panes dont work if related list is present, f…
Browse files Browse the repository at this point in the history
…ixes #187
  • Loading branch information
joebordes committed Oct 8, 2017
1 parent bd89078 commit 7ae65a0
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions modules/Vtiger/DetailView.php
Expand Up @@ -86,7 +86,16 @@
$singlepane_view = GlobalVariable::getVariable('Application_Single_Pane_View', 0, $currentModule);
$singlepane_view = empty($singlepane_view) ? 'false' : 'true';
$smarty->assign('SinglePane_View', $singlepane_view);
$smarty->assign('HASRELATEDPANES', 'false');
$bmapname = $currentModule.'RelatedPanes';
$cbMapid = GlobalVariable::getVariable('BusinessMapping_'.$bmapname, cbMap::getMapIdByName($bmapname));
if ($cbMapid) {
$cbMap = cbMap::getMapByID($cbMapid);
$rltabs = $cbMap->RelatedPanes($focus->id);
$smarty->assign('RLTabs', $rltabs['panes']);
$smarty->assign('HASRELATEDPANES', 'true');
} else {
$smarty->assign('HASRELATEDPANES', 'false');
}
if ($singlepane_view == 'true' or $isPresentRelatedListBlock) {
$related_array = getRelatedLists($currentModule, $focus);
$smarty->assign("RELATEDLISTS", $related_array);
Expand All @@ -99,14 +108,6 @@
$smarty->assign("SELECTEDHEADERS", $open_related_modules);
} else {
$smarty->assign('RELATEDLISTS', array());
$bmapname = $currentModule.'RelatedPanes';
$cbMapid = GlobalVariable::getVariable('BusinessMapping_'.$bmapname, cbMap::getMapIdByName($bmapname));
if ($cbMapid) {
$cbMap = cbMap::getMapByID($cbMapid);
$rltabs = $cbMap->RelatedPanes($focus->id);
$smarty->assign('RLTabs', $rltabs['panes']);
$smarty->assign('HASRELATEDPANES', 'true');
}
}

if (isPermitted($currentModule, 'CreateView', $record) == 'yes') {
Expand Down

0 comments on commit 7ae65a0

Please sign in to comment.