salesagility / SuiteCRM

SuiteCRM - Open source CRM for the world
https://www.suitecrm.com
GNU Affero General Public License v3.0
4.5k stars 2.09k forks source link

No type in HTML on cells in Subpanels (decimal, file, varchar, etc.) #8165

Open aureh12 opened 5 years ago

aureh12 commented 5 years ago

Issue

HTML code that build subpanels does not give a type for each cell of the rows. Because of that, we cannot do anything for the display of the data. For example, we can not use CSS to Align Text Right the numbers in subpanels. (types: int: decimal, float, etc.)

Expected Behavior

It should be like in Listview, each TD cell in the table has a type. In Opportunities list, we can see that the cell for name has a type NAME and the cell for probability has a type INT. <td align="left" valign="top" type="name" field="name" class=" "><b><a href="index.php?module=Opportunities&amp;offset=1&amp;stamp=1572592592045537500&amp;return_module=Opportunities&amp;action=DetailView&amp;record=10d0dedd-6355-a12a-4718-566e925e1d15"> Lamp v2</a></b></td> and <td align="left" valign="top" type="int" field="probability" class="hidden-xs hidden-sm "> 100</td>

Actual Behavior

The HML code for subpanels cells is very simple: <td style="display: table-cell;">Test opportunity</td>

Possible Fix

  1. Maybe we can modify the file ListViewSubpanel.php

add $coltypes[$field_name]=$fieldType; before $tmpField = SugarFieldHandler::getSugarField($fieldType, true);

and

add $this->smartyTemplate->assign('COLTYPES', $coltypes); before $this->smartyTemplate->assign('ROWS', $widget_contents);

  1. Then get the field type in the SubPanelDynamic.tpl

replace <td>{$cell}</td> by <td type="{$COLTYPES.$colHeader}">{$cell}</td>

The result will be : <td type="enum" style="display: table-cell;">Products</td>

Steps to Reproduce

Context

Your Environment

pgorod commented 4 years ago

@Abuelodelanada this is similar to the PR you made recently...

Abuelodelanada commented 4 years ago

Hi @pgorod

Yes it's similar to #8148 Do you know if it's going to be merged?

pgorod commented 4 years ago

Not for this release, I am afraid. It's been too delayed by the problems with the installer, we just need to get it out the door asap...