Fix status "Supplier" not always visible.
This commit is contained in:
parent
f93f5bd6e0
commit
50df452b9e
@ -122,6 +122,7 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode
|
|||||||
if (! empty($conf->propal->enabled)) $menuqualified++;
|
if (! empty($conf->propal->enabled)) $menuqualified++;
|
||||||
if (! empty($conf->commande->enabled)) $menuqualified++;
|
if (! empty($conf->commande->enabled)) $menuqualified++;
|
||||||
if (! empty($conf->supplier_order->enabled)) $menuqualified++;
|
if (! empty($conf->supplier_order->enabled)) $menuqualified++;
|
||||||
|
if (! empty($conf->supplier_proposal->enabled)) $menuqualified++;
|
||||||
if (! empty($conf->contrat->enabled)) $menuqualified++;
|
if (! empty($conf->contrat->enabled)) $menuqualified++;
|
||||||
if (! empty($conf->ficheinter->enabled)) $menuqualified++;
|
if (! empty($conf->ficheinter->enabled)) $menuqualified++;
|
||||||
$tmpentry=array(
|
$tmpentry=array(
|
||||||
@ -660,11 +661,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Suppliers
|
// Suppliers
|
||||||
if (! empty($conf->societe->enabled) && ! empty($conf->fournisseur->enabled))
|
if (! empty($conf->societe->enabled) && (! empty($conf->fournisseur->enabled) || ! empty($conf->supplier_proposal->enabled)))
|
||||||
{
|
{
|
||||||
$langs->load("suppliers");
|
$langs->load("suppliers");
|
||||||
$newmenu->add("/societe/list.php?type=f&leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 1, $user->rights->fournisseur->lire, '', $mainmenu, 'suppliers');
|
$newmenu->add("/societe/list.php?type=f&leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 1, ($user->rights->fournisseur->lire || $user->rights->supplier_proposal->lire), '', $mainmenu, 'suppliers');
|
||||||
$newmenu->add("/societe/card.php?leftmenu=suppliers&action=create&type=f",$langs->trans("MenuNewSupplier"), 2, $user->rights->societe->creer && $user->rights->fournisseur->lire);
|
$newmenu->add("/societe/card.php?leftmenu=suppliers&action=create&type=f",$langs->trans("MenuNewSupplier"), 2, $user->rights->societe->creer && ($user->rights->fournisseur->lire || $user->rights->supplier_proposal->lire));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Contacts
|
// Contacts
|
||||||
|
|||||||
@ -485,11 +485,6 @@ if (empty($reshook))
|
|||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessages('', $langs->trans("ErrorBadUrl",$object->url), 'errors');
|
setEventMessages('', $langs->trans("ErrorBadUrl",$object->url), 'errors');
|
||||||
}
|
}
|
||||||
if ($object->fournisseur && ! $conf->fournisseur->enabled)
|
|
||||||
{
|
|
||||||
$langs->load("errors");
|
|
||||||
setEventMessages('', $langs->trans("ErrorSupplierModuleNotEnabled"), 'errors');
|
|
||||||
}
|
|
||||||
if (! empty($object->webservices_url)) {
|
if (! empty($object->webservices_url)) {
|
||||||
//Check if has transport, without any the soap client will give error
|
//Check if has transport, without any the soap client will give error
|
||||||
if (strpos($object->webservices_url, "http") === false)
|
if (strpos($object->webservices_url, "http") === false)
|
||||||
@ -1166,7 +1161,8 @@ else
|
|||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
if (! empty($conf->fournisseur->enabled) && ! empty($user->rights->fournisseur->lire))
|
if ((! empty($conf->fournisseur->enabled) && ! empty($user->rights->fournisseur->lire))
|
||||||
|
|| (! empty($conf->supplier_proposal->enabled) && ! empty($user->rights->supplier_proposal->lire)))
|
||||||
{
|
{
|
||||||
// Supplier
|
// Supplier
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
@ -1175,7 +1171,14 @@ else
|
|||||||
if (! empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)) $default=1;
|
if (! empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)) $default=1;
|
||||||
print $form->selectyesno("fournisseur", (GETPOST('fournisseur','int')!=''?GETPOST('fournisseur','int'):(GETPOST("type",'alpha') == '' ? $default : $object->fournisseur)), 1, 0, (GETPOST("type",'alpha') == '' ? 1 : 0));
|
print $form->selectyesno("fournisseur", (GETPOST('fournisseur','int')!=''?GETPOST('fournisseur','int'):(GETPOST("type",'alpha') == '' ? $default : $object->fournisseur)), 1, 0, (GETPOST("type",'alpha') == '' ? 1 : 0));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>'.fieldLabel('SupplierCode','supplier_code').'</td><td>';
|
print '<td>';
|
||||||
|
if (! empty($conf->fournisseur->enabled) && ! empty($user->rights->fournisseur->lire))
|
||||||
|
{
|
||||||
|
print fieldLabel('SupplierCode','supplier_code');
|
||||||
|
}
|
||||||
|
print '</td><td>';
|
||||||
|
if (! empty($conf->fournisseur->enabled) && ! empty($user->rights->fournisseur->lire))
|
||||||
|
{
|
||||||
print '<table class="nobordernopadding"><tr><td>';
|
print '<table class="nobordernopadding"><tr><td>';
|
||||||
$tmpcode=$object->code_fournisseur;
|
$tmpcode=$object->code_fournisseur;
|
||||||
if (empty($tmpcode) && ! empty($modCodeFournisseur->code_auto)) $tmpcode=$modCodeFournisseur->getNextValue($object,1);
|
if (empty($tmpcode) && ! empty($modCodeFournisseur->code_auto)) $tmpcode=$modCodeFournisseur->getNextValue($object,1);
|
||||||
@ -1184,6 +1187,7 @@ else
|
|||||||
$s=$modCodeFournisseur->getToolTip($langs,$object,1);
|
$s=$modCodeFournisseur->getToolTip($langs,$object,1);
|
||||||
print $form->textwithpicto('',$s,1);
|
print $form->textwithpicto('',$s,1);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1721,14 +1725,21 @@ else
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Supplier
|
// Supplier
|
||||||
if (! empty($conf->fournisseur->enabled) && ! empty($user->rights->fournisseur->lire))
|
if ((! empty($conf->fournisseur->enabled) && ! empty($user->rights->fournisseur->lire))
|
||||||
|
|| (! empty($conf->supplier_proposal->enabled) && ! empty($user->rights->supplier_proposal->lire)))
|
||||||
{
|
{
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.fieldLabel('Supplier','fournisseur',1).'</td><td class="maxwidthonsmartphone">';
|
print '<td>'.fieldLabel('Supplier','fournisseur',1).'</td><td class="maxwidthonsmartphone">';
|
||||||
print $form->selectyesno("fournisseur",$object->fournisseur,1);
|
print $form->selectyesno("fournisseur",$object->fournisseur,1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>'.fieldLabel('SupplierCode','supplier_code').'</td><td>';
|
print '<td>';
|
||||||
|
if (! empty($conf->fournisseur->enabled) && ! empty($user->rights->fournisseur->lire))
|
||||||
|
{
|
||||||
|
print fieldLabel('SupplierCode','supplier_code');
|
||||||
|
}
|
||||||
|
print '</td><td>';
|
||||||
|
if (! empty($conf->fournisseur->enabled) && ! empty($user->rights->fournisseur->lire))
|
||||||
|
{
|
||||||
print '<table class="nobordernopadding"><tr><td>';
|
print '<table class="nobordernopadding"><tr><td>';
|
||||||
if ((!$object->code_fournisseur || $object->code_fournisseur == -1) && $modCodeFournisseur->code_auto)
|
if ((!$object->code_fournisseur || $object->code_fournisseur == -1) && $modCodeFournisseur->code_auto)
|
||||||
{
|
{
|
||||||
@ -1750,7 +1761,7 @@ else
|
|||||||
$s=$modCodeFournisseur->getToolTip($langs,$object,1);
|
$s=$modCodeFournisseur->getToolTip($langs,$object,1);
|
||||||
print $form->textwithpicto('',$s,1);
|
print $form->textwithpicto('',$s,1);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2129,7 +2140,7 @@ else
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Supplier
|
// Supplier
|
||||||
if (! empty($conf->fournisseur->enabled))
|
if (! empty($conf->fournisseur->enabled) || ! empty($conf->supplier_proposal->enabled))
|
||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->trans('Supplier').'</td><td>';
|
print '<tr><td>'.$langs->trans('Supplier').'</td><td>';
|
||||||
print yn($object->fournisseur);
|
print yn($object->fournisseur);
|
||||||
|
|||||||
@ -1203,7 +1203,7 @@ while ($i < min($num, $limit))
|
|||||||
$companystatic->name_alias='';
|
$companystatic->name_alias='';
|
||||||
$s.=$companystatic->getNomUrl(0,'prospect',0,1);
|
$s.=$companystatic->getNomUrl(0,'prospect',0,1);
|
||||||
}
|
}
|
||||||
if (! empty($conf->fournisseur->enabled) && $obj->fournisseur)
|
if ((! empty($conf->fournisseur->enabled) || ! empty($conf->supplier_proposal->enabled)) && $obj->fournisseur)
|
||||||
{
|
{
|
||||||
if ($s) $s.=" / ";
|
if ($s) $s.=" / ";
|
||||||
$companystatic->name=$langs->trans("Supplier");
|
$companystatic->name=$langs->trans("Supplier");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user