mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix better error message when possible refering objects list is empty.
This commit is contained in:
parent
68227d91d9
commit
4b854fb33d
|
|
@ -372,7 +372,6 @@ else
|
|||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
|
|||
else
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td colspan="3">'.$langs->trans("NoProposal").'</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td colspan="3" class="opacitymedium">'.$langs->trans("NoProposal").'</td></tr>';
|
||||
}
|
||||
print "</table><br>";
|
||||
|
||||
|
|
@ -277,7 +277,7 @@ if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_propos
|
|||
else
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td colspan="3">'.$langs->trans("NoProposal").'</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td colspan="3" class="opacitymedium">'.$langs->trans("NoProposal").'</td></tr>';
|
||||
}
|
||||
print "</table><br>";
|
||||
|
||||
|
|
@ -357,7 +357,7 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
|
|||
else
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td colspan="3">'.$langs->trans("NoOrder").'</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td colspan="3" class="opacitymedium">'.$langs->trans("NoOrder").'</td></tr>';
|
||||
}
|
||||
print "</table><br>";
|
||||
|
||||
|
|
@ -438,7 +438,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande
|
|||
else
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td colspan="3">'.$langs->trans("NoSupplierOrder").'</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td colspan="3" class="opacitymedium">'.$langs->trans("NoSupplierOrder").'</td></tr>';
|
||||
}
|
||||
print "</table><br>";
|
||||
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|||
}
|
||||
else
|
||||
{
|
||||
print '<tr '.$bc[$var].'><td colspan="3">'.$langs->trans("NoInvoice").'</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td colspan="3" class="opacitymedium">'.$langs->trans("NoInvoice").'</td></tr>';
|
||||
}
|
||||
print "</table><br>";
|
||||
$db->free($resql);
|
||||
|
|
@ -275,7 +275,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
|
|||
}
|
||||
else
|
||||
{
|
||||
print '<tr '.$bc[$var].'><td colspan="3">'.$langs->trans("NoInvoice").'</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td colspan="3" class="opacitymedium">'.$langs->trans("NoInvoice").'</td></tr>';
|
||||
}
|
||||
print "</table><br>";
|
||||
$db->free($resql);
|
||||
|
|
@ -387,7 +387,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|||
{
|
||||
$colspan=5;
|
||||
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++;
|
||||
print '<tr '.$bc[$var].'><td colspan="'.$colspan.'">'.$langs->trans("NoInvoice").'</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoInvoice").'</td></tr>';
|
||||
}
|
||||
print '</table><br>';
|
||||
$db->free($resql);
|
||||
|
|
@ -474,7 +474,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
|
|||
{
|
||||
$colspan=5;
|
||||
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++;
|
||||
print '<tr '.$bc[$var].'><td colspan="'.$colspan.'">'.$langs->trans("NoInvoice").'</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoInvoice").'</td></tr>';
|
||||
}
|
||||
print '</table><br>';
|
||||
}
|
||||
|
|
@ -842,7 +842,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|||
{
|
||||
$colspan=6;
|
||||
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++;
|
||||
print '<tr '.$bc[$var].'><td colspan="'.$colspan.'">'.$langs->trans("NoInvoice").'</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoInvoice").'</td></tr>';
|
||||
}
|
||||
print '</table><br>';
|
||||
$db->free($resql);
|
||||
|
|
@ -942,7 +942,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
|
|||
{
|
||||
$colspan=6;
|
||||
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++;
|
||||
print '<tr '.$bc[$var].'><td colspan="'.$colspan.'">'.$langs->trans("NoInvoice").'</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoInvoice").'</td></tr>';
|
||||
}
|
||||
print '</table><br>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -429,7 +429,7 @@ if (! empty($holiday->holiday))
|
|||
// Si il n'y a pas d'enregistrement suite à une recherche
|
||||
if($holiday_payes == '2')
|
||||
{
|
||||
print '<tr>';
|
||||
print '<tr '.$bc[false].'>';
|
||||
print '<td colspan="10" class="opacitymedium">'.$langs->trans('NoRecordFound').'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ DefaultLang=Language by default
|
|||
VATIsUsed=VAT is used
|
||||
VATIsNotUsed=VAT is not used
|
||||
CopyAddressFromSoc=Fill address with thirdparty address
|
||||
ThirdpartyNotCustomerNotSupplierSoNoRef=Thirdparty neither customer nor supplier, no available refering objects
|
||||
##### Local Taxes #####
|
||||
LocalTax1IsUsed=Use second tax
|
||||
LocalTax1IsUsedES= RE is used
|
||||
|
|
|
|||
|
|
@ -145,10 +145,11 @@ if ($object->client)
|
|||
if ($conf->propal->enabled && $user->rights->propal->lire) $elementTypeArray['propal']=$langs->transnoentitiesnoconv('Proposals');
|
||||
if ($conf->commande->enabled && $user->rights->commande->lire) $elementTypeArray['order']=$langs->transnoentitiesnoconv('Orders');
|
||||
if ($conf->facture->enabled && $user->rights->facture->lire) $elementTypeArray['invoice']=$langs->transnoentitiesnoconv('Invoices');
|
||||
if ($conf->ficheinter->enabled && $user->rights->ficheinter->lire) $elementTypeArray['fichinter']=$langs->transnoentitiesnoconv('Interventions');
|
||||
if ($conf->contrat->enabled && $user->rights->contrat->lire) $elementTypeArray['contract']=$langs->transnoentitiesnoconv('Contracts');
|
||||
}
|
||||
|
||||
if ($conf->ficheinter->enabled && $user->rights->ficheinter->lire) $elementTypeArray['fichinter']=$langs->transnoentitiesnoconv('Interventions');
|
||||
|
||||
if ($object->fournisseur)
|
||||
{
|
||||
print '<tr><td class="titlefield">';
|
||||
|
|
@ -318,8 +319,16 @@ if (!empty($sql_select))
|
|||
//print $sql;
|
||||
}
|
||||
|
||||
$disabled=0;
|
||||
$showempty=2;
|
||||
if (empty($elementTypeArray) && ! $object->client && ! $object->fournisseur)
|
||||
{
|
||||
$showempty=$langs->trans("ThirdpartyNotCustomerNotSupplierSoNoRef");
|
||||
$disabled=1;
|
||||
}
|
||||
|
||||
// Define type of elements
|
||||
$typeElementString = $form->selectarray("type_element", $elementTypeArray, GETPOST('type_element'), 2);
|
||||
$typeElementString = $form->selectarray("type_element", $elementTypeArray, GETPOST('type_element'), $showempty, 0, 0, '', 0, 0, $disabled);
|
||||
$button = '<input type="submit" class="button" name="button_third" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
$param="&sref=".$sref."&month=".$month."&year=".$year."&sprod_fulldescr=".$sprod_fulldescr."&socid=".$socid."&type_element=".$type_element;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user