diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index 2f7f3e27765..feebe6554f7 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -85,6 +85,7 @@ BackToLoginPage=Back to login page AuthenticationDoesNotAllowSendNewPassword=Authentication mode is %s.
In this mode, Dolibarr can't know nor change your password.
Contact your system administrator if you want to change your password. EnableGDLibraryDesc=Install or enable GD library with your PHP for use this option. EnablePhpAVModuleDesc=You need to install a module compatible with your anti-virus. (Clamav : php4-clamavlib ou php5-clamavlib) +ProfIdShortDesc=Prof Id %s is an information depending on third party country.
For example, for country %s, it's code %s. ##### Webcal ##### LoginWebcal=Login for Webcalendar ErrorWebcalLoginNotDefined=The Webcalendar login associated to your Dolibarr login %s is not defined. diff --git a/htdocs/langs/fr_BE/companies.lang b/htdocs/langs/fr_BE/companies.lang index 8736889c34b..53de95edc3b 100644 --- a/htdocs/langs/fr_BE/companies.lang +++ b/htdocs/langs/fr_BE/companies.lang @@ -48,31 +48,43 @@ Town=Ville Web=Web Birthday=Anniversaire VATIsUsed=Utilise la TVA -##### Professionnal ID #####= -ProfId1=ID professionnel 1 -ProfId2=ID professionnel 2 -ProfId3=ID professionnel 3 -ProfId4=ID professionnel #4 -ProfId1AU= -ProfId2AU= -ProfId3AU= -ProfId4AU= -ProfId1BE=N° professionnel +##### Professionnal ID ##### +ProfId1Short=Id prof. 1 +ProfId2Short=Id prof. 2 +ProfId3Short=Id prof. 3 +ProfId4Short=Id prof. 4 +ProfId1=Id professionnel 1 +ProfId2=Id professionnel 2 +ProfId3=Id professionnel 3 +ProfId4=Id professionnel 4 +ProfId1AU=Id prof. 1 (ABN) +ProfId2AU=- +ProfId3AU=- +ProfId4AU=- +ProfId1BE=Id prof. 1 (N° professionnel) ProfId2BE=- ProfId3BE=- -ProfId4BE= -ProfId1FR=SIREN -ProfId2FR=SIRET -ProfId3FR=NAF (Ex APE) -ProfId4FR= -ProfId1GB=Numéro d'enregistrement -ProfId2GB= -ProfId3GB= -ProfId4GB= -ProfId1PT= -ProfId2PT=Numéro de sécurité sociale -ProfId3PT=Numéro d'enregistrement commercial -ProfId4PT= +ProfId4BE=- +ProfId1CH=- +ProfId2CH=- +ProfId3CH=Numéro fédéral +ProfId4CH=Num registre du commerce +ProfId1FR=Id prof. 1 (SIREN) +ProfId2FR=Id prof. 2 (SIRET) +ProfId3FR=Id prof. 3 (NAF, ex APE) +ProfId4FR=Id prof. 4 (RCS/RM) +ProfId1GB=Id prof. 1 (Registration Number) +ProfId2GB=- +ProfId3GB=Id prof. 3 (SIC) +ProfId4GB=- +ProfId1PT=Id prof. 1 (NIPC) +ProfId2PT=Id prof. 2 (Num sécurité social) +ProfId3PT=Id prof. 3 (Num enreg. commercial) +ProfId4PT=Id prof. 4 (Conservatory) +ProfId1TN=Id prof. 1 (RC) +ProfId2TN=Id prof. 2 (Matricule fiscale) +ProfId3TN=Id prof. 3 (Code en douane) +ProfId4TN=Id prof. 4 (RIB) VATIntra=Numéro de TVA VATIntraShort=Num TVA VATIntraVeryShort=N° TVA diff --git a/htdocs/langs/fr_FR/other.lang b/htdocs/langs/fr_FR/other.lang index 284a7416612..81848c80e19 100644 --- a/htdocs/langs/fr_FR/other.lang +++ b/htdocs/langs/fr_FR/other.lang @@ -85,6 +85,7 @@ BackToLoginPage=Retour page de connexion AuthenticationDoesNotAllowSendNewPassword=Le mode d'authentification de Dolibarr est configuré à "%s".
Dans ce mode, Dolibarr n'a pas la possibilité de connaitre ni modifier votre mot de passe.
Contacter votre administrateur pour connaitre les modalités de changement. EnableGDLibraryDesc=Vous devez activer ou installer la librairie GD avec votre PHP pour pouvoir activer cette option. EnablePhpAVModuleDesc=Vous devez installer un module PHP compatible avec votre anti-virus. (Clamav : php4-clamavlib ou php5-clamavlib) +ProfIdShortDesc=Id prof. %s est une information qui dépend du pays du tiers.
Par exemple, pour le pays %s, il s'agit du code %s. ##### Webcal ##### LoginWebcal=Login Webcalendar ErrorWebcalLoginNotDefined=Le login Webcalendar associé à votre login Dolibarr %s n'est pas défini. diff --git a/htdocs/societe.php b/htdocs/societe.php index bec91ebabb5..0e063ac548b 100644 --- a/htdocs/societe.php +++ b/htdocs/societe.php @@ -19,12 +19,12 @@ */ /** - \file htdocs/societe.php - \ingroup societe - \brief Page des societes - \version $Id$ -*/ - + * \file htdocs/societe.php + * \ingroup societe + * \brief Page des societes + * \version $Id$ + */ + require_once("./pre.inc.php"); include_once(DOL_DOCUMENT_ROOT."/contact.class.php"); @@ -42,6 +42,10 @@ $socname=isset($_GET["socname"])?$_GET["socname"]:$_POST["socname"]; $sortfield = isset($_GET["sortfield"])?$_GET["sortfield"]:$_POST["sortfield"]; $sortorder = isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"]; $page=isset($_GET["page"])?$_GET["page"]:$_POST["page"]; +$search_idprof1=$_REQUEST['search_idprof1']; +$search_idprof2=$_REQUEST['search_idprof2']; +$search_idprof3=$_REQUEST['search_idprof3']; +$search_idprof4=$_REQUEST['search_idprof4']; if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="nom"; @@ -57,49 +61,49 @@ $pagenext = $page + 1; * Actions * */ - + // Recherche $mode=isset($_GET["mode"])?$_GET["mode"]:$_POST["mode"]; $modesearch=isset($_GET["mode-search"])?$_GET["mode-search"]:$_POST["mode-search"]; if ($mode == 'search') { - $_POST["search_nom"]=$socname; + $_POST["search_nom"]=$socname; - $sql = "SELECT s.rowid"; - if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= " WHERE ("; - $sql.= "s.nom like '%".addslashes($socname)."%'"; + $sql = "SELECT s.rowid"; + if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; + if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= " WHERE ("; + $sql.= "s.nom like '%".addslashes($socname)."%'"; $sql.= " OR s.code_client LIKE '%".addslashes($socname)."%'"; $sql.= " OR s.email like '%".addslashes($socname)."%'"; $sql.= " OR s.url like '%".addslashes($socname)."%'"; - $sql.= ")"; - if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + $sql.= ")"; + if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if (! $user->rights->societe->lire || ! $user->rights->fournisseur->lire) { if (! $user->rights->fournisseur->lire) $sql.=" AND s.fourn != 1"; } - - $result=$db->query($sql); - if ($result) - { - if ($db->num_rows($result) == 1) - { - $obj = $db->fetch_object($result); - $socid = $obj->rowid; - header("Location: ".DOL_URL_ROOT."/soc.php?socid=".$socid); - exit; - } - $db->free($result); - } - // Sécurité accès client - if ($user->societe_id > 0) - { - $action = ''; - $socid = $user->societe_id; - } + + $result=$db->query($sql); + if ($result) + { + if ($db->num_rows($result) == 1) + { + $obj = $db->fetch_object($result); + $socid = $obj->rowid; + header("Location: ".DOL_URL_ROOT."/soc.php?socid=".$socid); + exit; + } + $db->free($result); + } + // Sécurité accès client + if ($user->societe_id > 0) + { + $action = ''; + $socid = $user->societe_id; + } } @@ -109,17 +113,23 @@ if ($mode == 'search') llxHeader(); -// As-t-on cliqué sur purge des criètres de recherche +$form=new Form($db); + +// Do we click on purge search criteria ? if (isset($_POST["button_removefilter_x"])) { - $socname=""; - $search_nom=""; - $search_ville=""; + $socname=""; + $search_nom=""; + $search_ville=""; + $search_idprof1=''; + $search_idprof2=''; + $search_idprof3=''; + $search_idprof4=''; } if ($socname) { - $search_nom=$socname; + $search_nom=$socname; } // Affiche la confirmation de suppression d'un tiers @@ -129,13 +139,13 @@ if ($_GET['delsoc']) print '
'.$langs->trans("CompanyDeleted * Mode Liste */ /* - REM: Regle sur droits "Voir tous les clients" - REM: Exemple, voir la page societe.php dans le mode liste. - Utilisateur interne socid=0 + Droits voir tous clients => Voit toute société - Utilisateur interne socid=0 + Pas de droits voir tous clients => Ne voit que les sociétés liées comme commercial - Utilisateur externe socid=x + Droits voir tous clients => Ne voit que lui meme - Utilisateur externe socid=x + Pas de droits voir tous clients => Ne voit que lui meme -*/ + REM: Regle sur droits "Voir tous les clients" + REM: Exemple, voir la page societe.php dans le mode liste. + Utilisateur interne socid=0 + Droits voir tous clients => Voit toute société + Utilisateur interne socid=0 + Pas de droits voir tous clients => Ne voit que les sociétés liées comme commercial + Utilisateur externe socid=x + Droits voir tous clients => Ne voit que lui meme + Utilisateur externe socid=x + Pas de droits voir tous clients => Ne voit que lui meme + */ $title=$langs->trans("ListOfThirdParties"); $sql = "SELECT s.rowid, s.nom, s.ville, ".$db->pdate("s.datec")." as datec, ".$db->pdate("s.datea")." as datea"; @@ -178,21 +188,21 @@ if ($search_ville) { $sql .= " AND s.ville LIKE '%".addslashes($search_ville)."%'"; } -if ($_POST["search_idprof1"]) +if ($search_idprof1) { - $sql .= " AND s.siren LIKE '%".$_POST["search_idprof1"]."%'"; + $sql .= " AND s.siren LIKE '%".addslashes($search_idprof1)."%'"; } -if ($_POST["search_idprof2"]) +if ($search_idprof2) { - $sql .= " AND s.siret LIKE '%".$_POST["search_idprof2"]."%'"; + $sql .= " AND s.siret LIKE '%".addslashes($search_idprof2)."%'"; } -if ($_POST["search_idprof3"]) +if ($search_idprof3) { - $sql .= " AND s.ape LIKE '%".$_POST["search_idprof3"]."%'"; + $sql .= " AND s.ape LIKE '%".addslashes($search_idprof3)."%'"; } -if ($_POST["search_idprof4"]) +if ($search_idprof4) { - $sql .= " AND s.idprof4 LIKE '%".$_POST["search_idprof4"]."%'"; + $sql .= " AND s.idprof4 LIKE '%".addslashes($search_idprof4)."%'"; } // Count total nb of records @@ -208,107 +218,128 @@ $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $ $result = $db->query($sql); if ($result) { - $num = $db->num_rows($result); - $i = 0; + $num = $db->num_rows($result); + $i = 0; - $params = "&socname=$socname"; + $params = "&socname=".$socname."&search_nom=".$search_nom."&search_ville=".$search_ville; + $params.= '&search_idprof1='.$search_idprof1; + $params.= '&search_idprof2='.$search_idprof2; + $params.= '&search_idprof3='.$search_idprof3; + $params.= '&search_idprof4='.$search_idprof4; + + print_barre_liste($title, $page, "societe.php",$params,$sortfield,$sortorder,'',$num,$nbtotalofrecords); - print_barre_liste($title, $page, "societe.php",$params,$sortfield,$sortorder,'',$num,$nbtotalofrecords); - - // Lignes des titres - print ''; - print ''; - print_liste_field_titre($langs->trans("Company"),"societe.php","s.nom", $params,"&search_nom=$search_nom&search_ville=$search_ville","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Town"),"societe.php","s.ville",$params,"&search_nom=$search_nom&search_ville=$search_ville",'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ProfId1Short"),"societe.php","s.siren",$params,"&search_nom=$search_nom&search_ville=$search_ville",'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ProfId2Short"),"societe.php","s.siret",$params,"&search_nom=$search_nom&search_ville=$search_ville",'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ProfId3Short"),"societe.php","s.ape",$params,"&search_nom=$search_nom&search_ville=$search_ville",'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ProfId4Short"),"societe.php","s.idprof4",$params,"&search_nom=$search_nom&search_ville=$search_ville",'',$sortfield,$sortorder); - print ''; - print "\n"; + $langs->load("other"); + $textprofid=array(); + foreach(array(1,2,3,4) as $key) + { + $label=$langs->transnoentities("ProfId".$key.$mysoc->pays_code); + $textprofid[$key]=''; + if ($label != "ProfId".$key.$mysoc->pays_code) + { // Get only text between () + if (eregi('\((.*)\)',$label,$reg)) $label=$reg[1]; + $textprofid[$key]=$langs->trans("ProfIdShortDesc",$key,$mysoc->pays_code,$label); + } + } - // Lignes des champs de filtre - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + + // Lignes des titres + print '
 
'; - print ''; - print ''; - print ''; - print '
'; + print ''; + print_liste_field_titre($langs->trans("Company"),"societe.php","s.nom","",$params,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Town"),"societe.php","s.ville","",$params,'',$sortfield,$sortorder); + print_liste_field_titre($form->textwithhelp($langs->trans("ProfId1Short"),$textprofid[1],1,0),"societe.php","s.siren","",$params,'',$sortfield,$sortorder); + print_liste_field_titre($form->textwithhelp($langs->trans("ProfId2Short"),$textprofid[2],1,0),"societe.php","s.siret","",$params,'',$sortfield,$sortorder); + print_liste_field_titre($form->textwithhelp($langs->trans("ProfId3Short"),$textprofid[3],1,0),"societe.php","s.ape","",$params,'',$sortfield,$sortorder); + print_liste_field_titre($form->textwithhelp($langs->trans("ProfId4Short"),$textprofid[4],1,0),"societe.php","s.idprof4","",$params,'',$sortfield,$sortorder); + print ''; + print "\n"; + + // Lignes des champs de filtre + print ''; + print ''; // IdProf1 - print ''; - // IdProf2 - print ''; - // IdProf3 - print ''; - // IdProf4 - print ''; - print ''; - print "\n"; - print ''; + print ''; + // IdProf2 + print ''; + // IdProf3 + print ''; + // IdProf4 + print ''; + print ''; + print "\n"; - $var=True; + $var=True; - while ($i < min($num,$conf->liste_limit)) - { - $obj = $db->fetch_object(); - $var=!$var; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print '\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print ''."\n"; - $i++; - } + } - print "
 
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print '  '; - print ''; - print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '  '; + print ''; + print '
"; - print "rowid."\">"; - print img_object($langs->trans("ShowCompany"),"company"); - print " rowid."\">".$obj->nom."".$obj->ville."".$obj->idprof1."".$obj->idprof2."".$obj->idprof3."".$obj->idprof4."'; - if ($obj->client==1) + while ($i < min($num,$conf->liste_limit)) { + $obj = $db->fetch_object(); + $var=!$var; + print "
"; + print "rowid."\">"; + print img_object($langs->trans("ShowCompany"),"company"); + print " rowid."\">".$obj->nom."".$obj->ville."".$obj->idprof1."".$obj->idprof2."".$obj->idprof3."".$obj->idprof4."'; + if ($obj->client==1) + { print "rowid."\">".$langs->trans("Customer")."\n"; - } - elseif ($obj->client==2) - { + } + elseif ($obj->client==2) + { print "rowid."\">".$langs->trans("Prospect")."\n"; - } - else - { + } + else + { print " "; - } - print ""; - if ($obj->fournisseur) - { + } + print ""; + if ($obj->fournisseur) + { print ''.$langs->trans("Supplier").''; - } - else - { + } + else + { print " "; - } - - print '
"; - $db->free(); + print ''."\n"; + $i++; + } + + $db->free(); + + print ""; + + print ''; + } else { - dolibarr_print_error($db); + dolibarr_print_error($db); } $db->close();