mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-05 17:18:13 +01:00
Add html dom element and fix class
This commit is contained in:
@@ -52,7 +52,7 @@ foreach($linkedObjectBlock as $key => $objectlink)
|
||||
$trclass=($var?'pair':'impair');
|
||||
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
|
||||
?>
|
||||
<tr class="<?php echo $trclass; ?>" data-element="<?php echo $objectlink->element; ?>" data-elementid="<?php echo $objectlink->id; ?>" >
|
||||
<tr class="<?php echo $trclass; ?>" data-element="<?php echo $objectlink->element; ?>" data-id="<?php echo $objectlink->id; ?>" >
|
||||
<td class="linkedcol-element" ><?php echo $langs->trans("Proposal"); ?></td>
|
||||
<td class="linkedcol-name" ><?php echo $objectlink->getNomUrl(1); ?></td>
|
||||
<td class="linkedcol-ref" ><?php echo $objectlink->ref_client; ?></td>
|
||||
|
||||
@@ -47,7 +47,7 @@ foreach($linkedObjectBlock as $key => $objectlink)
|
||||
$trclass=($var?'pair':'impair');
|
||||
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
|
||||
?>
|
||||
<tr class="<?php echo $trclass; ?>" data-element="<?php echo $objectlink->element; ?>" data-elementid="<?php echo $objectlink->id; ?>" >
|
||||
<tr class="<?php echo $trclass; ?>" data-element="<?php echo $objectlink->element; ?>" data-id="<?php echo $objectlink->id; ?>" >
|
||||
<td class="linkedcol-element" ><?php echo $langs->trans("CustomerOrder"); ?></td>
|
||||
<td class="linkedcol-name" ><?php echo $objectlink->getNomUrl(1); ?></td>
|
||||
<td class="linkedcol-ref" align="center"><?php echo $objectlink->ref_client; ?></td>
|
||||
|
||||
@@ -47,7 +47,7 @@ foreach($linkedObjectBlock as $key => $objectlink)
|
||||
$trclass=($var?'pair':'impair');
|
||||
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
|
||||
?>
|
||||
<tr class="<?php echo $trclass; ?>" data-element="<?php echo $objectlink->element; ?>" data-elementid="<?php echo $objectlink->id; ?>" >
|
||||
<tr class="<?php echo $trclass; ?>" data-element="<?php echo $objectlink->element; ?>" data-id="<?php echo $objectlink->id; ?>" >
|
||||
<td class="linkedcol-element" ><?php echo $langs->trans("CustomerInvoice"); ?></td>
|
||||
<td class="linkedcol-name" ><?php echo $objectlink->getNomUrl(1); ?></td>
|
||||
<td class="linkedcol-ref" align="center"><?php echo $objectlink->ref_client; ?></td>
|
||||
|
||||
@@ -5847,21 +5847,27 @@ abstract class CommonObject
|
||||
else
|
||||
{
|
||||
$csstyle='';
|
||||
$class=(!empty($extrafields->attribute_hidden[$key]) ? 'class="hideobject" ' : '');
|
||||
$class=(!empty($extrafields->attribute_hidden[$key]) ? 'hideobject ' : '');
|
||||
if (is_array($params) && count($params)>0) {
|
||||
if (array_key_exists('style',$params)) {
|
||||
$csstyle=$params['style'];
|
||||
}
|
||||
}
|
||||
|
||||
// add html5 elements
|
||||
$domData = ' data-element="extrafield"';
|
||||
$domData .= ' data-targetelement="'.$this->element.'"';
|
||||
$domData .= ' data-targetid="'.$this->id.'"';
|
||||
|
||||
$html_id = !empty($this->id) ? 'extrarow-'.$this->element.'_'.$key.'_'.$this->id : '';
|
||||
|
||||
$out .= '<tr id="'.$html_id.'" '.$csstyle.' class="'.$class.$this->element.'_extras_'.$key.'" '.$domData.' >';
|
||||
|
||||
if ( !empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && ($e % 2) == 0)
|
||||
{
|
||||
$out .= '<tr '.$class.$csstyle.' class="'.$this->element.'_extras_'.$key.'">';
|
||||
$colspan='0';
|
||||
}
|
||||
else
|
||||
{
|
||||
$out .= '<tr '.$class.$csstyle.' class="'.$this->element.'_extras_'.$key.'">';
|
||||
}
|
||||
|
||||
// Convert date into timestamp format (value in memory must be a timestamp)
|
||||
if (in_array($extrafields->attribute_type[$key],array('date','datetime')))
|
||||
{
|
||||
|
||||
@@ -56,10 +56,17 @@ if (empty($senderissupplier)) $senderissupplier=0;
|
||||
if (empty($inputalsopricewithtax)) $inputalsopricewithtax=0;
|
||||
if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0;
|
||||
|
||||
// add html5 elements
|
||||
$domData = ' data-element="'.$line->element.'"';
|
||||
$domData .= ' data-id="'.$line->id.'"';
|
||||
$domData .= ' data-qty="'.$line->qty.'"';
|
||||
$domData .= ' data-product_type="'.$line->product_type.'"';
|
||||
|
||||
|
||||
?>
|
||||
<?php $coldisplay=0; ?>
|
||||
<!-- BEGIN PHP TEMPLATE objectline_view.tpl.php -->
|
||||
<tr <?php echo 'id="row-'.$line->id.'" '.$bcdd[$var]; ?>>
|
||||
<tr <?php echo 'id="row-'.$line->id.'" '.$bcdd[$var]; echo $domData; ?> >
|
||||
<?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
|
||||
<td class="linecolnum" align="center"><?php $coldisplay++; ?><?php echo ($i+1); ?></td>
|
||||
<?php } ?>
|
||||
|
||||
Reference in New Issue
Block a user