Skip to content
Snippets Groups Projects
Commit ef575166 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

FIX #6651

parent 932d3aab
No related branches found
No related tags found
No related merge requests found
......@@ -84,7 +84,7 @@ $day=GETPOST("day","int");
$month=GETPOST("month","int");
$year=GETPOST("year","int");
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
......@@ -242,6 +242,7 @@ $sql.= " typent.code as typent_code,";
$sql.= " state.code_departement as state_code, state.nom as state_name,";
$sql.= ' p.rowid, p.note_private, p.total_ht, p.tva as total_vat, p.total as total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,';
$sql.= ' p.datec as date_creation, p.tms as date_update,';
$sql.= " pr.rowid as project_id, pr.ref as project_ref,";
if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,";
$sql.= ' u.login';
// Add fields from extrafields
......@@ -259,6 +260,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
if ($sall || $search_product_category > 0) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'propaldet as pd ON p.rowid=pd.fk_propal';
if ($search_product_category > 0) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON p.fk_user_author = u.rowid';
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet as pr ON pr.rowid = p.fk_projet";
// We'll need this table joined to the select in order to filter by sale
if ($search_sale > 0 || (! $user->rights->societe->client->voir && ! $socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
if ($search_user > 0)
......@@ -377,6 +379,7 @@ if ($resql)
if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht;
if ($search_login) $param.='&search_login='.$search_login;
if ($search_town) $param.='&search_town='.$search_town;
if ($search_zip) $param.='&search_zip='.$search_zip;
if ($socid > 0) $param.='&socid='.$socid;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
// Add $param from extra fields
......@@ -532,7 +535,7 @@ if ($resql)
$moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
$moreforfilter.='</div>';
}
// If the user can view prospects other than his'
// If the user can view products
if ($conf->categorie->enabled && ($user->rights->produit->lire || $user->rights->service->lire))
{
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
......@@ -1001,7 +1004,6 @@ if ($resql)
else print '<td></td>';
}
print '</tr>';
}
$db->free($resql);
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment