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] ?>> if (count($productCombinations))
<td><input type="checkbox" name="select[<?php echo $prodstatic->id ?>]"></td> {
<td><?php echo $prodstatic->getNomUrl(1) ?></td> foreach ($productCombinations as $currcomb) {
<td> $prodstatic->fetch($currcomb->fk_product_child);
<?php ?>
<tr <?php echo $bc[!$var] ?>>
$productCombination2ValuePairs = $comb2val->fetchByFkCombination($currcomb->id); <td><input type="checkbox" name="select[<?php echo $prodstatic->id ?>]"></td>
$iMax = count($productCombination2ValuePairs); <td><?php echo $prodstatic->getNomUrl(1) ?></td>
<td>
for ($i = 0; $i < $iMax; $i++) { <?php
echo dol_htmlentities($productCombination2ValuePairs[$i]);
$productCombination2ValuePairs = $comb2val->fetchByFkCombination($currcomb->id);
if ($i !== ($iMax - 1)) { $iMax = count($productCombination2ValuePairs);
echo ', ';
} for ($i = 0; $i < $iMax; $i++) {
} ?> echo dol_htmlentities($productCombination2ValuePairs[$i]);
</td>
<td style="text-align: right"><?php echo ($currcomb->variation_price >= 0 ? '+' : '').price($currcomb->variation_price).($currcomb->variation_price_percentage ? ' %' : '') ?></td> if ($i !== ($iMax - 1)) {
<td style="text-align: right"><?php echo ($currcomb->variation_weight >= 0 ? '+' : '').price($currcomb->variation_weight).' '.measuring_units_string($prodstatic->weight_units, 'weight') ?></td> echo ', ';
<td style="text-align: center;"><?php echo $prodstatic->getLibStatut(2, 0) ?></td> }
<td style="text-align: center;"><?php echo $prodstatic->getLibStatut(2, 1) ?></td> } ?>
<td style="text-align: right"> </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: right"><?php echo ($currcomb->variation_price >= 0 ? '+' : '').price($currcomb->variation_price).($currcomb->variation_price_percentage ? ' %' : '') ?></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: right"><?php echo ($currcomb->variation_weight >= 0 ? '+' : '').price($currcomb->variation_weight).' '.measuring_units_string($prodstatic->weight_units, 'weight') ?></td>
</td> <td style="text-align: center;"><?php echo $prodstatic->getLibStatut(2, 0) ?></td>
</tr> <td style="text-align: center;"><?php echo $prodstatic->getLibStatut(2, 1) ?></td>
<?php $var = !$var; endforeach ?> <td style="text-align: right">
<a href="<?php echo dol_buildpath('/variants/combinations.php?id='.$id.'&action=edit&valueid='.$currcomb->id, 2) ?>"><?php echo img_edit() ?></a>
<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): ?>