Example #1
0
 */
/*
REM: Rules on permissions to see thirdparties
Internal or External user + No permission to see customers => See nothing
Internal user socid=0 + Permission to see ALL customers    => See all thirdparties
Internal user socid=0 + No permission to see ALL customers => See only thirdparties linked to user that are sale representative
External user socid=x + Permission to see ALL customers    => Can see only himself
External user socid=x + No permission to see ALL customers => Can see only himself
*/
$form = new Form($db);
$formother = new FormOther($db);
$companystatic = new Societe($db);
$formcompany = new FormCompany($db);
$prospectstatic = new Client($db);
$prospectstatic->client = 2;
$prospectstatic->loadCacheOfProspStatus();
$help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
llxHeader('', $langs->trans("ThirdParty"), $help_url);
$title = $langs->trans("ListOfThirdParties");
if ($type == 'c' && (empty($search_type) || $search_type == '1,3')) {
    $title = $langs->trans("ListOfCustomers");
}
if ($type == 'p' && (empty($search_type) || $search_type == '2,3')) {
    $title = $langs->trans("ListOfProspects");
}
if ($type == 'f' && (empty($search_type) || $search_type == '4')) {
    $title = $langs->trans("ListOfSuppliers");
}
// If both parameters are set, search for everything BETWEEN them
if ($search_level_from != '' && $search_level_to != '') {
    // Ensure that these parameters are numbers