forked from Wavyzz/dolibarr
clean indent in variants directory
This commit is contained in:
@@ -186,7 +186,7 @@
|
||||
<!-- Check indent are done with spaces and with correct number -->
|
||||
<!-- Disabled as this does not support tab -->
|
||||
<!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> -->
|
||||
<!-- TODO Enable this
|
||||
|
||||
<arg name="tab-width" value="4"/>
|
||||
<rule ref="Generic.WhiteSpace.ScopeIndent">
|
||||
<properties>
|
||||
@@ -194,7 +194,7 @@
|
||||
<property name="tabIndent" value="true"/>
|
||||
</properties>
|
||||
</rule>
|
||||
-->
|
||||
|
||||
|
||||
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace.Indent" />
|
||||
|
||||
|
||||
@@ -144,54 +144,50 @@ if ($action == 'edit') {
|
||||
}
|
||||
|
||||
|
||||
if ($action != 'edit')
|
||||
{
|
||||
if ($action != 'edit') {
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
}
|
||||
?>
|
||||
<table class="border" style="width: 100%">
|
||||
<tr>
|
||||
<td class="titlefield fieldrequired"><?php echo $langs->trans('Ref') ?></td>
|
||||
<td>
|
||||
<?php if ($action == 'edit') {
|
||||
print '<table class="border" style="width: 100%">';
|
||||
print '<tr>';
|
||||
print '<td class="titlefield fieldrequired">'.$langs->trans('Ref').'</td>';
|
||||
print '<td>';
|
||||
if ($action == 'edit') {
|
||||
print '<input type="text" name="ref" value="'.$object->ref.'">';
|
||||
} else {
|
||||
print dol_htmlentities($object->ref);
|
||||
} ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fieldrequired"><?php echo $langs->trans('Label') ?></td>
|
||||
<td>
|
||||
<?php if ($action == 'edit') {
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '<tr>';
|
||||
print '<td class="fieldrequired">'.$langs->trans('Label').'</td>';
|
||||
print '<td>';
|
||||
if ($action == 'edit') {
|
||||
print '<input type="text" name="label" value="'.$object->label.'">';
|
||||
} else {
|
||||
print dol_htmlentities($object->label);
|
||||
} ?>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
</table>
|
||||
print '</table>';
|
||||
|
||||
<?php
|
||||
|
||||
if ($action != 'edit')
|
||||
{
|
||||
if ($action != 'edit') {
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
if ($action == 'edit') { ?>
|
||||
<div style="text-align: center;">
|
||||
<div class="inline-block divButAction">
|
||||
<input type="submit" class="button" value="<?php echo $langs->trans('Save') ?>">
|
||||
|
||||
<input type="submit" class="button" name="cancel" value="<?php echo $langs->trans('Cancel') ?>">
|
||||
</div>
|
||||
</div></form>
|
||||
<?php } else {
|
||||
if ($action == 'edit') {
|
||||
print '<div style="text-align: center;">';
|
||||
print '<div class="inline-block divButAction">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans('Save').'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans('Cancel').'">';
|
||||
print '</div>';
|
||||
print '</div></form>';
|
||||
} else {
|
||||
if ($action == 'delete') {
|
||||
$form = new Form($db);
|
||||
|
||||
@@ -241,20 +237,19 @@ print $form->formconfirm(
|
||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||
print '<input type="hidden" name="valueid" value="'.$valueid.'">';
|
||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
} ?>
|
||||
}
|
||||
|
||||
<table class="liste">
|
||||
<tr class="liste_titre">
|
||||
<th class="liste_titre titlefield"><?php echo $langs->trans('Ref') ?></th>
|
||||
<th class="liste_titre"><?php echo $langs->trans('Value') ?></th>
|
||||
<th class="liste_titre"></th>
|
||||
</tr>
|
||||
print '<table class="liste">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<th class="liste_titre titlefield">'.$langs->trans('Ref').'</th>';
|
||||
print '<th class="liste_titre">'.$langs->trans('Value').'</th>';
|
||||
print '<th class="liste_titre"></th>';
|
||||
print '</tr>';
|
||||
|
||||
<?php
|
||||
foreach ($objectval->fetchAllByProductAttribute($object->id) as $attrval) {
|
||||
print '<tr class="oddeven">';
|
||||
if ($action == 'edit_value' && ($valueid == $attrval->id)) {
|
||||
?>
|
||||
<tr class="oddeven">
|
||||
<?php if ($action == 'edit_value' && ($valueid == $attrval->id)): ?>
|
||||
<td><input type="text" name="ref" value="<?php echo $attrval->ref ?>"></td>
|
||||
<td><input type="text" name="value" value="<?php echo $attrval->value ?>"></td>
|
||||
<td class="right">
|
||||
@@ -262,31 +257,30 @@ print $form->formconfirm(
|
||||
|
||||
<input type="submit" name="cancel" value="<?php echo $langs->trans('Cancel') ?>" class="button">
|
||||
</td>
|
||||
<?php else: ?>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<td><?php echo dol_htmlentities($attrval->ref) ?></td>
|
||||
<td><?php echo dol_htmlentities($attrval->value) ?></td>
|
||||
<td class="right">
|
||||
<a href="card.php?id=<?php echo $object->id ?>&action=edit_value&valueid=<?php echo $attrval->id ?>"><?php echo img_edit() ?></a>
|
||||
<a href="card.php?id=<?php echo $object->id ?>&action=delete_value&valueid=<?php echo $attrval->id ?>"><?php echo img_delete() ?></a>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
print '</tr>';
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
<?php if ($action == 'edit_value'): ?>
|
||||
</form>
|
||||
<?php endif ?>
|
||||
if ($action == 'edit_value') {
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
<div class="tabsAction">
|
||||
<div class="inline-block divButAction">
|
||||
<a href="create_val.php?id=<?php echo $object->id ?>" class="butAction"><?php echo $langs->trans('Create') ?></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
print '<div class="tabsAction">';
|
||||
print '<div class="inline-block divButAction">';
|
||||
print '<a href="create_val.php?id='.$object->id.'" class="butAction">'.$langs->trans('Create').'</a>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
// End of page
|
||||
|
||||
@@ -501,21 +501,17 @@ if (! empty($id) || ! empty($ref))
|
||||
|
||||
print dol_fiche_head();
|
||||
|
||||
?>
|
||||
|
||||
<table class="border" style="width: 100%">
|
||||
<?php if ($action == 'add') { ?>
|
||||
<!-- Variant -->
|
||||
<tr>
|
||||
<td class="titlefieldcreate fieldrequired"><label for="attribute"><?php echo $langs->trans('ProductAttribute') ?></label></td>
|
||||
<td>
|
||||
<?php
|
||||
if (is_array($prodattr_all))
|
||||
{
|
||||
print '<table class="border" style="width: 100%">';
|
||||
if ($action == 'add') {
|
||||
print "<!-- Variant -->\n";
|
||||
print '<tr>';
|
||||
print '<td class="titlefieldcreate fieldrequired"><label for="attribute">'.$langs->trans('ProductAttribute').'</label></td>';
|
||||
print '<td>';
|
||||
if (is_array($prodattr_all)) {
|
||||
print '<select class="flat minwidth100" id="attribute" name="attribute">';
|
||||
print '<option value="-1"> </option>';
|
||||
foreach ($prodattr_all as $attr)
|
||||
{
|
||||
foreach ($prodattr_all as $attr) {
|
||||
//print '<option value="'.$attr->id.'"'.($attr->id == GETPOST('attribute', 'int') ? ' selected="selected"' : '').'>'.$attr->label.'</option>';
|
||||
print '<option value="'.$attr->id.'">'.$attr->label.'</option>';
|
||||
}
|
||||
@@ -555,11 +551,10 @@ if (! empty($id) || ! empty($ref))
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td></td><td>
|
||||
<?php echo $listofvariantselected; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
<?php echo $listofvariantselected;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
if (is_array($productCombination2ValuePairs1)) {
|
||||
@@ -758,32 +753,30 @@ if (! empty($id) || ! empty($ref))
|
||||
foreach ($productCombinations as $currcomb)
|
||||
{
|
||||
$prodstatic->fetch($currcomb->fk_product_child);
|
||||
?>
|
||||
<tr class="oddeven">
|
||||
<td><?php echo $prodstatic->getNomUrl(1) ?></td>
|
||||
<td>
|
||||
<?php
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$prodstatic->getNomUrl(1).'</td>';
|
||||
print '<td>';
|
||||
|
||||
$productCombination2ValuePairs = $comb2val->fetchByFkCombination($currcomb->id);
|
||||
$iMax = count($productCombination2ValuePairs);
|
||||
|
||||
for ($i = 0; $i < $iMax; $i++) {
|
||||
echo dol_htmlentities($productCombination2ValuePairs[$i]);
|
||||
|
||||
if ($i !== ($iMax - 1)) {
|
||||
echo ', ';
|
||||
}
|
||||
} ?>
|
||||
</td>
|
||||
<td class="right"><?php echo ($currcomb->variation_price >= 0 ? '+' : '').price($currcomb->variation_price).($currcomb->variation_price_percentage ? ' %' : '') ?></td>
|
||||
<?php if ($object->isProduct()) print '<td class="right">'.($currcomb->variation_weight >= 0 ? '+' : '').price($currcomb->variation_weight).' '.measuringUnitString(0, 'weight', $prodstatic->weight_units).'</td>'; ?>
|
||||
<td class="center"><?php echo $prodstatic->getLibStatut(2, 0) ?></td>
|
||||
<td class="center"><?php echo $prodstatic->getLibStatut(2, 1) ?></td>
|
||||
<td class="right">
|
||||
<a class="paddingleft paddingright" href="<?php echo dol_buildpath('/variants/combinations.php?id='.$id.'&action=edit&valueid='.$currcomb->id, 2) ?>"><?php echo img_edit() ?></a>
|
||||
<a class="paddingleft paddingright" href="<?php echo dol_buildpath('/variants/combinations.php?id='.$id.'&action=delete&valueid='.$currcomb->id, 2) ?>"><?php echo img_delete() ?></a>
|
||||
</td>
|
||||
<?php
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="right">'.($currcomb->variation_price >= 0 ? '+' : '').price($currcomb->variation_price).($currcomb->variation_price_percentage ? ' %' : '').'</td>';
|
||||
if ($object->isProduct()) {
|
||||
print '<td class="right">'.($currcomb->variation_weight >= 0 ? '+' : '').price($currcomb->variation_weight).' '.measuringUnitString(0, 'weight', $prodstatic->weight_units).'</td>';
|
||||
}
|
||||
print '<td class="center">'.$prodstatic->getLibStatut(2, 0).'</td>';
|
||||
print '<td class="center">'.$prodstatic->getLibStatut(2, 1).'</td>';
|
||||
print '<td class="right">';
|
||||
print '<a class="paddingleft paddingright" href="'.dol_buildpath('/variants/combinations.php?id='.$id.'&action=edit&valueid='.$currcomb->id, 2).'">'.img_edit().'</a>';
|
||||
print '<a class="paddingleft paddingright" href="'.dol_buildpath('/variants/combinations.php?id='.$id.'&action=delete&valueid='.$currcomb->id, 2).'">'.img_delete().'</a>';
|
||||
print '</td>';
|
||||
print '<td class="nowrap center">';
|
||||
if ($productCombinations || $massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
{
|
||||
@@ -792,21 +785,15 @@ if (! empty($id) || ! empty($ref))
|
||||
print '<input id="cb'.$prodstatic->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$prodstatic->id.'"'.($selected?' checked="checked"':'').'>';
|
||||
}
|
||||
print '</td>';
|
||||
?>
|
||||
</tr>
|
||||
<?php
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td colspan="8"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -118,34 +118,29 @@ $forcereloadpage=empty($conf->global->MAIN_FORCE_RELOAD_PAGE)?0:1;
|
||||
<th class="liste_titre right"><?php print $langs->trans('NbProducts') ?></th>
|
||||
<th class="liste_titre" colspan="2"></th>
|
||||
</tr>
|
||||
<?php foreach ($variants as $key => $attribute): ?>
|
||||
<tr id="row-<?php echo $attribute->id ?>" class="drag drop oddeven">
|
||||
<td><a href="card.php?id=<?php echo $attribute->id ?>"><?php echo dol_htmlentities($attribute->ref) ?></a></td>
|
||||
<td><a href="card.php?id=<?php echo $attribute->id ?>"><?php echo dol_htmlentities($attribute->label) ?></a></td>
|
||||
<td class="right"><?php echo $attribute->countChildValues() ?></td>
|
||||
<td class="right"><?php echo $attribute->countChildProducts() ?></td>
|
||||
<td class="right">
|
||||
<a href="card.php?id=<?php echo $attribute->id ?>&action=edit"><?php echo img_edit() ?></a>
|
||||
<a href="card.php?id=<?php echo $attribute->id ?>&action=delete"><?php echo img_delete() ?></a>
|
||||
</td>
|
||||
<td class="center linecolmove tdlineupdown">
|
||||
<?php if ($key > 0): ?>
|
||||
<a class="lineupdown"
|
||||
href="<?php echo $_SERVER['PHP_SELF'] ?>?action=up&rowid=<?php echo $attribute->id ?>"><?php echo img_up('default', 0, 'imgupforline'); ?></a>
|
||||
<?php endif ?>
|
||||
<?php if ($key < count($variants)-1): ?>
|
||||
<a class="lineupdown"
|
||||
href="<?php echo $_SERVER['PHP_SELF'] ?>?action=down&rowid=<?php echo $attribute->id ?>"><?php echo img_down('default', 0, 'imgdownforline'); ?></a>
|
||||
<?php endif ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
endforeach
|
||||
?>
|
||||
foreach ($variants as $key => $attribute) {
|
||||
print '<tr id="row-'.$attribute->id.'" class="drag drop oddeven">';
|
||||
print '<td><a href="card.php?id='.$attribute->id.'">'.dol_htmlentities($attribute->ref).'</a></td>';
|
||||
print '<td><a href="card.php?id='.$attribute->id.'">'.dol_htmlentities($attribute->label).'</a></td>';
|
||||
print '<td class="right">'.$attribute->countChildValues().'</td>';
|
||||
print '<td class="right">'.$attribute->countChildProducts().'</td>';
|
||||
print '<td class="right">';
|
||||
print '<a href="card.php?id='.$attribute->id.'&action=edit">'.img_edit().'</a>';
|
||||
print '<a href="card.php?id='.$attribute->id.'&action=delete">'.img_delete().'</a>';
|
||||
print '</td>';
|
||||
print '<td class="center linecolmove tdlineupdown">';
|
||||
if ($key > 0) {
|
||||
print '<a class="lineupdown" href="'.$_SERVER['PHP_SELF'].'?action=up&rowid='.$attribute->id.'">'.img_up('default', 0, 'imgupforline').'</a>';
|
||||
}
|
||||
if ($key < count($variants)-1) {
|
||||
print '<a class="lineupdown" href="'.$_SERVER['PHP_SELF'].'?action=down&rowid='.$attribute->id.'">'.img_down('default', 0, 'imgdownforline').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
</table>
|
||||
|
||||
<?php
|
||||
print '</table>';
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
|
||||
@@ -297,9 +297,9 @@ function getSupplierInvoice($authentication, $id = '', $ref = '', $ref_ext = '')
|
||||
'close_code'=>$invoice->close_code,
|
||||
'close_note'=>$invoice->close_note,
|
||||
|
||||
'lines' => $linesresp
|
||||
'lines' => $linesresp,
|
||||
// 'lines' => array('0'=>array('id'=>222,'type'=>1),
|
||||
// '1'=>array('id'=>333,'type'=>1))
|
||||
// '1'=>array('id'=>333,'type'=>1)),
|
||||
|
||||
));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user