Skip to content

Commit

Permalink
Fix: Hide if supplier module is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jan 26, 2011
1 parent e40cef2 commit 3e27fb9
Showing 1 changed file with 43 additions and 40 deletions.
83 changes: 43 additions & 40 deletions htdocs/societe/soc.php
Expand Up @@ -1103,49 +1103,52 @@
print '</td></tr>';

// Supplier
print '<tr>';
print '<td><span class="fieldrequired">'.$langs->trans('Supplier').'</span></td><td>';
print $form->selectyesno("fournisseur",$soc->fournisseur,1);
print '</td>';
print '<td>'.$langs->trans('SupplierCode').'</td><td>';

print '<table class="nobordernopadding"><tr><td>';
if ((!$soc->code_fournisseur || $soc->code_fournisseur == -1) && $modCodeFournisseur->code_auto)
if ($conf->fournisseur->enabled)
{
$tmpcode=$soc->code_fournisseur;
if (empty($tmpcode) && $modCodeFournisseur->code_auto) $tmpcode=$modCodeFournisseur->getNextValue($soc,1);
print '<input type="text" name="code_fournisseur" size="16" value="'.$tmpcode.'" maxlength="15">';
}
else if ($soc->codefournisseur_modifiable())
{
print '<input type="text" name="code_fournisseur" size="16" value="'.$soc->code_fournisseur.'" maxlength="15">';
}
else
{
print $soc->code_fournisseur;
print '<input type="hidden" name="code_fournisseur" value="'.$soc->code_fournisseur.'">';
}
print '</td><td>';
$s=$modCodeFournisseur->getToolTip($langs,$soc,1);
print $form->textwithpicto('',$s,1);
print '</td></tr></table>';
print '<tr>';
print '<td><span class="fieldrequired">'.$langs->trans('Supplier').'</span></td><td>';
print $form->selectyesno("fournisseur",$soc->fournisseur,1);
print '</td>';
print '<td>'.$langs->trans('SupplierCode').'</td><td>';

print '<table class="nobordernopadding"><tr><td>';
if ((!$soc->code_fournisseur || $soc->code_fournisseur == -1) && $modCodeFournisseur->code_auto)
{
$tmpcode=$soc->code_fournisseur;
if (empty($tmpcode) && $modCodeFournisseur->code_auto) $tmpcode=$modCodeFournisseur->getNextValue($soc,1);
print '<input type="text" name="code_fournisseur" size="16" value="'.$tmpcode.'" maxlength="15">';
}
else if ($soc->codefournisseur_modifiable())
{
print '<input type="text" name="code_fournisseur" size="16" value="'.$soc->code_fournisseur.'" maxlength="15">';
}
else
{
print $soc->code_fournisseur;
print '<input type="hidden" name="code_fournisseur" value="'.$soc->code_fournisseur.'">';
}
print '</td><td>';
$s=$modCodeFournisseur->getToolTip($langs,$soc,1);
print $form->textwithpicto('',$s,1);
print '</td></tr></table>';

print '</td></tr>';
print '</td></tr>';

// Category
if ($soc->fournisseur)
{
$load = $soc->LoadSupplierCateg();
if ( $load == 0)
{
if (sizeof($soc->SupplierCategories) > 0)
{
print '<tr>';
print '<td>'.$langs->trans('SupplierCategory').'</td><td colspan="3">';
print $form->selectarray("fournisseur_categorie",$soc->SupplierCategories,'',1);
print '</td></tr>';
}
}
// Category
if ($conf->categorie->enabled && $soc->fournisseur)
{
$load = $soc->LoadSupplierCateg();
if ( $load == 0)
{
if (sizeof($soc->SupplierCategories) > 0)
{
print '<tr>';
print '<td>'.$langs->trans('SupplierCategory').'</td><td colspan="3">';
print $form->selectarray("fournisseur_categorie",$soc->SupplierCategories,'',1);
print '</td></tr>';
}
}
}
}

if ($conf->global->MAIN_MODULE_BARCODE)
Expand Down

0 comments on commit 3e27fb9

Please sign in to comment.