Merge pull request #8850 from grandoc/new_branch_24_05_2018

clean and update code
This commit is contained in:
Laurent Destailleur 2018-05-25 10:45:39 +02:00 committed by GitHub
commit 973384604e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 28 deletions

View File

@ -37,8 +37,8 @@ if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn
if (! $user->rights->societe->lire) accessforbidden();
$langs->load("commercial");
$langs->load("propal");
// Load traductions files requiredby by page
$langs->loadLangs(array("commercial", "propal"));
$action=GETPOST('action', 'alpha');
$bid=GETPOST('bid', 'int');
@ -161,7 +161,6 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
print '<tr class="liste_titre">';
print '<th colspan="3">'.$langs->trans("ProposalsDraft").($num?' <span class="badge">'.$num.'</span>':'').'</th></tr>';
$var=true;
if ($num > 0)
{
$i = 0;
@ -243,7 +242,6 @@ if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_propos
print '<tr class="liste_titre">';
print '<th colspan="3">'.$langs->trans("SupplierProposalsDraft").($num?' <span class="badge">'.$num.'</span>':'').'</th></tr>';
$var=true;
if ($num > 0)
{
$i = 0;
@ -274,13 +272,11 @@ if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_propos
}
if ($total>0)
{
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td colspan="2" align="right">'.price($total)."</td></tr>";
}
}
else
{
print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("NoProposal").'</td></tr>';
}
print "</table></div><br>";
@ -323,7 +319,6 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
print '<tr class="liste_titre">';
print '<th colspan="3">'.$langs->trans("DraftOrders").($num?' <span class="badge">'.$num.'</span>':'').'</th></tr>';
$var = true;
if ($num > 0)
{
$i = 0;
@ -411,7 +406,6 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande
print '<tr class="liste_titre">';
print '<th colspan="3">'.$langs->trans("DraftSuppliersOrders").($num?' <span class="badge">'.$num.'</span>':'').'</th></tr>';
$var = true;
if ($num > 0)
{
$i = 0;
@ -528,7 +522,6 @@ if (! empty($conf->societe->enabled) && $user->rights->societe->lire)
print '</tr>';
$i++;
}
$db->free($resql);

View File

@ -88,8 +88,6 @@ if ($resql)
$i = 0;
if ($num > 0 )
{
$var=true;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("ProspectsByStatus").'</td></tr>';
@ -126,8 +124,6 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
$resql=$db->query($sql);
if ($resql)
{
$var=true;
$total=0;
$num = $db->num_rows($resql);
$i = 0;
@ -197,8 +193,6 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
$i = 0;
if ($num > 0)
{
$var=true;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("ProposalsOpened").'</td></tr>';
@ -223,7 +217,8 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
$i++;
$total += $obj->price;
}
if ($total>0) {
if ($total>0)
{
print '<tr class="liste_total"><td colspan="3" align="right">'.$langs->trans("Total")."</td><td align=\"right\">".price($total)."</td></tr>";
}
print "</table><br>";
@ -255,8 +250,6 @@ if ($resql)
$i = 0;
if ($num > 0 )
{
$var=true;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("ProspectToContact").'</td></tr>';

View File

@ -42,8 +42,8 @@ if ($user->societe_id > 0)
if (! $user->rights->facture->creer)
accessforbidden();
$langs->load("companies");
$langs->load("orders");
// Load traductions files requiredby by page
$langs->loadLangs(array("companies", "orders"));
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');
@ -155,14 +155,10 @@ if ($resql)
print "</tr>\n";
$var=true;
while ($i < min($num,$limit))
{
$obj = $db->fetch_object($resql);
print '<tr class="oddeven">';
print '<td>';

View File

@ -39,9 +39,8 @@ if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
$langs->load('orders');
$langs->load('deliveries');
$langs->load('companies');
// Load traductions files requiredby by page
$langs->loadLangs(array("orders", "deliveries", "companies"));
if (! $user->rights->facture->creer)
accessforbidden();
@ -655,7 +654,7 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
print '</form>';
print '<form name="orders2invoice" action="orderstoinvoice.php" method="GET">';
$var=true;
$generic_commande = new Commande($db);
while ($i < $num)