Uniformize code

This commit is contained in:
Laurent Destailleur 2016-09-18 15:57:53 +02:00
parent 13c3db08e7
commit 537c6b0cc7
3 changed files with 25 additions and 24 deletions

View File

@ -185,6 +185,7 @@ if ($resql)
}
$db->free($resql);
}
else dol_print_error($db);
@ -267,10 +268,10 @@ print '<tr class="liste_titre">';
if (! empty($arrayfields['b.ref']['checked'])) print_liste_field_titre($arrayfields['b.ref']['label'],$_SERVER["PHP_SELF"],'b.ref','',$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['accountype']['checked'])) print_liste_field_titre($arrayfields['accountype']['label'],$_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['b.label']['checked'])) print_liste_field_titre($arrayfields['b.label']['label'],$_SERVER["PHP_SELF"],'b.label','',$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['b.number']['checked'])) print_liste_field_titre($arrayfields['b.number']['label'],$_SERVER["PHP_SELF"],'b.number','',$param,'',$sortfield,$sortorder);
print '<td align="center">'.$langs->trans("TransactionsToConciliate").'</td>';
print '<td align="center" width="70">'.$langs->trans("Status").'</td>';
print '<td align="right" width="100">'.$langs->trans("BankBalance").'</td>';
if (! empty($arrayfields['b.number']['checked'])) print_liste_field_titre($arrayfields['b.number']['label'],$_SERVER["PHP_SELF"],'b.number','',$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['toreconcile']['checked'])) print_liste_field_titre($arrayfields['toreconcile']['label'],$_SERVER["PHP_SELF"],'','',$param,'align="center"',$sortfield,$sortorder);
if (! empty($arrayfields['b.clos']['checked'])) print_liste_field_titre($arrayfields['b.clos']['label'],$_SERVER["PHP_SELF"],'b.clos','',$param,'align="center"',$sortfield,$sortorder);
if (! empty($arrayfields['balance']['checked'])) print_liste_field_titre($arrayfields['balance']['label'],$_SERVER["PHP_SELF"],'','',$param,'align="right"',$sortfield,$sortorder);
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{
@ -367,7 +368,7 @@ if (! empty($arrayfields['b.tms']['checked']))
// Statut
if (! empty($arrayfields['b.clos']['checked']))
{
print '<td class="liste_titre">';
print '<td class="liste_titre center">';
$array=array(
'opened'=>$langs->trans("Opened"),
'closed'=>$langs->trans("Closed")

View File

@ -383,14 +383,6 @@ if ($resql)
$moreforfilter='';
// If the user can view user other than himself
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('ProjectsWithThisUserAsContact'). ': ';
$includeonly='';
if (empty($user->rights->user->user->lire)) $includeonly=array($user->id);
$moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, $includeonly, '', 0, 0, 0, '', 0, '', 'maxwidth300');
$moreforfilter.='</div>';
// Filter on categories
if (! empty($conf->categorie->enabled))
{
@ -401,6 +393,14 @@ if ($resql)
$moreforfilter.='</div>';
}
// If the user can view user other than himself
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('ProjectsWithThisUserAsContact'). ': ';
$includeonly='';
if (empty($user->rights->user->user->lire)) $includeonly=array($user->id);
$moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, $includeonly, '', 0, 0, 0, '', 0, '', 'maxwidth300');
$moreforfilter.='</div>';
// If the user can view thirdparties other than his'
if ($user->rights->societe->client->voir || $socid)
{

View File

@ -537,6 +537,17 @@ if ($type == 'c' || $type == 'p')
$moreforfilter.='</div>';
}
}
if ($type == 'f')
{
if (! empty($conf->categorie->enabled))
{
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$formother->select_categories('supplier',$search_categ,'search_categ',1);
$moreforfilter.='</div>';
}
}
// If the user can view prospects other than his'
if ($user->rights->societe->client->voir || $socid)
@ -546,17 +557,6 @@ if ($user->rights->societe->client->voir || $socid)
$moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user, 0, 1, 'maxwidth300');
$moreforfilter.='</div>';
}
if ($type == 'f')
{
if (! empty($conf->categorie->enabled))
{
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$formother->select_categories('supplier',$search_categ,'search_categ',1);
$moreforfilter.='</div>';
}
}
if (! empty($moreforfilter))
{
print '<div class="liste_titre liste_titre_bydiv centpercent">';