Uniformize code

This commit is contained in:
Laurent Destailleur 2017-03-12 17:10:32 +01:00
parent 7103d7921e
commit e8a1f0ba46

View File

@ -615,35 +615,48 @@ if (! empty($id) || ! empty($ref)) {
<th class="liste_titre" style="text-align: center;"><?php echo $langs->trans('OnBuy') ?></th> <th class="liste_titre" style="text-align: center;"><?php echo $langs->trans('OnBuy') ?></th>
<th class="liste_titre"></th> <th class="liste_titre"></th>
</tr> </tr>
<?php foreach ($productCombinations as $currcomb): <?php
$prodstatic->fetch($currcomb->fk_product_child); ?>
<tr <?php echo $bc[!$var] ?>>
<td><input type="checkbox" name="select[<?php echo $prodstatic->id ?>]"></td>
<td><?php echo $prodstatic->getNomUrl(1) ?></td>
<td>
<?php
$productCombination2ValuePairs = $comb2val->fetchByFkCombination($currcomb->id); if (count($productCombinations))
$iMax = count($productCombination2ValuePairs); {
foreach ($productCombinations as $currcomb) {
$prodstatic->fetch($currcomb->fk_product_child);
?>
<tr <?php echo $bc[!$var] ?>>
<td><input type="checkbox" name="select[<?php echo $prodstatic->id ?>]"></td>
<td><?php echo $prodstatic->getNomUrl(1) ?></td>
<td>
<?php
for ($i = 0; $i < $iMax; $i++) { $productCombination2ValuePairs = $comb2val->fetchByFkCombination($currcomb->id);
echo dol_htmlentities($productCombination2ValuePairs[$i]); $iMax = count($productCombination2ValuePairs);
if ($i !== ($iMax - 1)) { for ($i = 0; $i < $iMax; $i++) {
echo ', '; echo dol_htmlentities($productCombination2ValuePairs[$i]);
}
} ?> if ($i !== ($iMax - 1)) {
</td> echo ', ';
<td style="text-align: right"><?php echo ($currcomb->variation_price >= 0 ? '+' : '').price($currcomb->variation_price).($currcomb->variation_price_percentage ? ' %' : '') ?></td> }
<td style="text-align: right"><?php echo ($currcomb->variation_weight >= 0 ? '+' : '').price($currcomb->variation_weight).' '.measuring_units_string($prodstatic->weight_units, 'weight') ?></td> } ?>
<td style="text-align: center;"><?php echo $prodstatic->getLibStatut(2, 0) ?></td> </td>
<td style="text-align: center;"><?php echo $prodstatic->getLibStatut(2, 1) ?></td> <td style="text-align: right"><?php echo ($currcomb->variation_price >= 0 ? '+' : '').price($currcomb->variation_price).($currcomb->variation_price_percentage ? ' %' : '') ?></td>
<td style="text-align: right"> <td style="text-align: right"><?php echo ($currcomb->variation_weight >= 0 ? '+' : '').price($currcomb->variation_weight).' '.measuring_units_string($prodstatic->weight_units, 'weight') ?></td>
<a href="<?php echo dol_buildpath('/variants/combinations.php?id='.$id.'&action=edit&valueid='.$currcomb->id, 2) ?>"><?php echo img_edit() ?></a> <td style="text-align: center;"><?php echo $prodstatic->getLibStatut(2, 0) ?></td>
<a href="<?php echo dol_buildpath('/variants/combinations.php?id='.$id.'&action=delete&valueid='.$currcomb->id, 2) ?>"><?php echo img_delete() ?></a> <td style="text-align: center;"><?php echo $prodstatic->getLibStatut(2, 1) ?></td>
</td> <td style="text-align: right">
</tr> <a href="<?php echo dol_buildpath('/variants/combinations.php?id='.$id.'&action=edit&valueid='.$currcomb->id, 2) ?>"><?php echo img_edit() ?></a>
<?php $var = !$var; endforeach ?> <a href="<?php echo dol_buildpath('/variants/combinations.php?id='.$id.'&action=delete&valueid='.$currcomb->id, 2) ?>"><?php echo img_delete() ?></a>
</td>
</tr>
<?php
$var = !$var;
}
}
else
{
print '<tr><td colspan="8"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
}
?>
</table> </table>
<?php if ($productCombinations): ?> <?php if ($productCombinations): ?>