Add description of id prof if country is same than user's

This commit is contained in:
Laurent Destailleur 2008-08-29 21:15:34 +00:00
parent 2d27a946a0
commit c58e507b78
4 changed files with 208 additions and 163 deletions

View File

@ -85,6 +85,7 @@ BackToLoginPage=Back to login page
AuthenticationDoesNotAllowSendNewPassword=Authentication mode is <b>%s</b>.<br>In this mode, Dolibarr can't know nor change your password.<br>Contact your system administrator if you want to change your password. AuthenticationDoesNotAllowSendNewPassword=Authentication mode is <b>%s</b>.<br>In this mode, Dolibarr can't know nor change your password.<br>Contact your system administrator if you want to change your password.
EnableGDLibraryDesc=Install or enable GD library with your PHP for use this option. 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) EnablePhpAVModuleDesc=You need to install a module compatible with your anti-virus. (Clamav : php4-clamavlib ou php5-clamavlib)
ProfIdShortDesc=<b>Prof Id %s</b> is an information depending on third party country.<br>For example, for country <b>%s</b>, it's code <b>%s</b>.
##### Webcal ##### ##### Webcal #####
LoginWebcal=Login for Webcalendar LoginWebcal=Login for Webcalendar
ErrorWebcalLoginNotDefined=The Webcalendar login associated to your Dolibarr login <b>%s</b> is not defined. ErrorWebcalLoginNotDefined=The Webcalendar login associated to your Dolibarr login <b>%s</b> is not defined.

View File

@ -48,31 +48,43 @@ Town=Ville
Web=Web Web=Web
Birthday=Anniversaire Birthday=Anniversaire
VATIsUsed=Utilise la TVA VATIsUsed=Utilise la TVA
##### Professionnal ID #####= ##### Professionnal ID #####
ProfId1=ID professionnel 1 ProfId1Short=Id prof. 1
ProfId2=ID professionnel 2 ProfId2Short=Id prof. 2
ProfId3=ID professionnel 3 ProfId3Short=Id prof. 3
ProfId4=ID professionnel #4 ProfId4Short=Id prof. 4
ProfId1AU= ProfId1=Id professionnel 1
ProfId2AU= ProfId2=Id professionnel 2
ProfId3AU= ProfId3=Id professionnel 3
ProfId4AU= ProfId4=Id professionnel 4
ProfId1BE=N° professionnel ProfId1AU=Id prof. 1 (ABN)
ProfId2AU=-
ProfId3AU=-
ProfId4AU=-
ProfId1BE=Id prof. 1 (N° professionnel)
ProfId2BE=- ProfId2BE=-
ProfId3BE=- ProfId3BE=-
ProfId4BE= ProfId4BE=-
ProfId1FR=SIREN ProfId1CH=-
ProfId2FR=SIRET ProfId2CH=-
ProfId3FR=NAF (Ex APE) ProfId3CH=Numéro fédéral
ProfId4FR= ProfId4CH=Num registre du commerce
ProfId1GB=Numéro d'enregistrement ProfId1FR=Id prof. 1 (SIREN)
ProfId2GB= ProfId2FR=Id prof. 2 (SIRET)
ProfId3GB= ProfId3FR=Id prof. 3 (NAF, ex APE)
ProfId4GB= ProfId4FR=Id prof. 4 (RCS/RM)
ProfId1PT= ProfId1GB=Id prof. 1 (Registration Number)
ProfId2PT=Numéro de sécurité sociale ProfId2GB=-
ProfId3PT=Numéro d'enregistrement commercial ProfId3GB=Id prof. 3 (SIC)
ProfId4PT= 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 VATIntra=Numéro de TVA
VATIntraShort=Num TVA VATIntraShort=Num TVA
VATIntraVeryShort=N° TVA VATIntraVeryShort=N° TVA

View File

@ -85,6 +85,7 @@ BackToLoginPage=Retour page de connexion
AuthenticationDoesNotAllowSendNewPassword=Le mode d'authentification de Dolibarr est configuré à "<b>%s</b>".<br>Dans ce mode, Dolibarr n'a pas la possibilité de connaitre ni modifier votre mot de passe.<br>Contacter votre administrateur pour connaitre les modalités de changement. AuthenticationDoesNotAllowSendNewPassword=Le mode d'authentification de Dolibarr est configuré à "<b>%s</b>".<br>Dans ce mode, Dolibarr n'a pas la possibilité de connaitre ni modifier votre mot de passe.<br>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. 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) EnablePhpAVModuleDesc=Vous devez installer un module PHP compatible avec votre anti-virus. (Clamav : php4-clamavlib ou php5-clamavlib)
ProfIdShortDesc=<b>Id prof. %s</b> est une information qui dépend du pays du tiers.<br>Par exemple, pour le pays <b>%s</b>, il s'agit du code <b>%s</b>.
##### Webcal ##### ##### Webcal #####
LoginWebcal=Login Webcalendar LoginWebcal=Login Webcalendar
ErrorWebcalLoginNotDefined=Le login Webcalendar associé à votre login Dolibarr <b>%s</b> n'est pas défini. ErrorWebcalLoginNotDefined=Le login Webcalendar associé à votre login Dolibarr <b>%s</b> n'est pas défini.

View File

@ -19,11 +19,11 @@
*/ */
/** /**
\file htdocs/societe.php * \file htdocs/societe.php
\ingroup societe * \ingroup societe
\brief Page des societes * \brief Page des societes
\version $Id$ * \version $Id$
*/ */
require_once("./pre.inc.php"); require_once("./pre.inc.php");
include_once(DOL_DOCUMENT_ROOT."/contact.class.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"]; $sortfield = isset($_GET["sortfield"])?$_GET["sortfield"]:$_POST["sortfield"];
$sortorder = isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"]; $sortorder = isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"];
$page=isset($_GET["page"])?$_GET["page"]:$_POST["page"]; $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 (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="nom"; if (! $sortfield) $sortfield="nom";
@ -109,12 +113,18 @@ if ($mode == 'search')
llxHeader(); 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"])) if (isset($_POST["button_removefilter_x"]))
{ {
$socname=""; $socname="";
$search_nom=""; $search_nom="";
$search_ville=""; $search_ville="";
$search_idprof1='';
$search_idprof2='';
$search_idprof3='';
$search_idprof4='';
} }
if ($socname) if ($socname)
@ -135,7 +145,7 @@ if ($_GET['delsoc']) print '<div class="warning">'.$langs->trans("CompanyDeleted
Utilisateur interne socid=0 + Pas de droits voir tous clients => Ne voit que les sociétés liées comme commercial 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 + Droits voir tous clients => Ne voit que lui meme
Utilisateur externe socid=x + Pas de 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"); $title=$langs->trans("ListOfThirdParties");
$sql = "SELECT s.rowid, s.nom, s.ville, ".$db->pdate("s.datec")." as datec, ".$db->pdate("s.datea")." as datea"; $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)."%'"; $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 // Count total nb of records
@ -211,47 +221,65 @@ if ($result)
$num = $db->num_rows($result); $num = $db->num_rows($result);
$i = 0; $i = 0;
$params = "&amp;socname=$socname"; $params = "&amp;socname=".$socname."&amp;search_nom=".$search_nom."&amp;search_ville=".$search_ville;
$params.= '&amp;search_idprof1='.$search_idprof1;
$params.= '&amp;search_idprof2='.$search_idprof2;
$params.= '&amp;search_idprof3='.$search_idprof3;
$params.= '&amp;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);
$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);
}
}
print '<form method="post" action="societe.php" name="formfilter">';
// Lignes des titres // Lignes des titres
print '<table class="liste" width="100%">'; print '<table class="liste" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
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("Company"),"societe.php","s.nom","",$params,"",$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("Town"),"societe.php","s.ville","",$params,'',$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($form->textwithhelp($langs->trans("ProfId1Short"),$textprofid[1],1,0),"societe.php","s.siren","",$params,'',$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($form->textwithhelp($langs->trans("ProfId2Short"),$textprofid[2],1,0),"societe.php","s.siret","",$params,'',$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($form->textwithhelp($langs->trans("ProfId3Short"),$textprofid[3],1,0),"societe.php","s.ape","",$params,'',$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_liste_field_titre($form->textwithhelp($langs->trans("ProfId4Short"),$textprofid[4],1,0),"societe.php","s.idprof4","",$params,'',$sortfield,$sortorder);
print '<td class="liste_titre" colspan="2" align="center">&nbsp;</td>'; print '<td class="liste_titre" colspan="2" align="center">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
// Lignes des champs de filtre // Lignes des champs de filtre
print '<form method="post" action="societe.php" name="formfilter">'; print '<tr class="liste_titre">';
print '<td class="liste_titre">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<tr class="liste_titre">';
print '<td class="liste_titre" valign="right">';
print '<input class="flat" type="text" name="search_nom" value="'.$search_nom.'">'; print '<input class="flat" type="text" name="search_nom" value="'.$search_nom.'">';
print '</td><td class="liste_titre" valign="right">'; print '</td><td class="liste_titre">';
print '<input class="flat" size="10" type="text" name="search_ville" value="'.$search_ville.'">'; print '<input class="flat" size="10" type="text" name="search_ville" value="'.$search_ville.'">';
print '</td>'; print '</td>';
// IdProf1 // IdProf1
print '<td class="liste_titre" valign="right">'; print '<td class="liste_titre">';
print '<input class="flat" size="8" type="text" name="search_idprof1" value="'.$_POST["search_idprof1"].'">'; print '<input class="flat" size="8" type="text" name="search_idprof1" value="'.$search_idprof1.'">';
print '</td>'; print '</td>';
// IdProf2 // IdProf2
print '<td class="liste_titre" valign="right">'; print '<td class="liste_titre">';
print '<input class="flat" size="8" type="text" name="search_idprof2" value="'.$_POST["search_idprof2"].'">'; print '<input class="flat" size="8" type="text" name="search_idprof2" value="'.$search_idprof2.'">';
print '</td>'; print '</td>';
// IdProf3 // IdProf3
print '<td class="liste_titre" valign="right">'; print '<td class="liste_titre">';
print '<input class="flat" size="8" type="text" name="search_idprof3" value="'.$_POST["search_idprof3"].'">'; print '<input class="flat" size="8" type="text" name="search_idprof3" value="'.$search_idprof3.'">';
print '</td>'; print '</td>';
// IdProf4 // IdProf4
print '<td class="liste_titre" valign="right">'; print '<td class="liste_titre">';
print '<input class="flat" size="8" type="text" name="search_idprof4" value="'.$_POST["search_idprof4"].'">'; print '<input class="flat" size="8" type="text" name="search_idprof4" value="'.$search_idprof4.'">';
print '</td>'; print '</td>';
print '<td class="liste_titre" colspan="2" align="right">'; print '<td class="liste_titre" colspan="2" align="right">';
print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'">'; print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'">';
@ -259,7 +287,6 @@ if ($result)
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/searchclear.png" alt="'.$langs->trans("RemoveFilter").'">'; print '<input type="image" class="liste_titre" name="button_removefilter" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/searchclear.png" alt="'.$langs->trans("RemoveFilter").'">';
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
print '</form>';
$var=True; $var=True;
@ -303,8 +330,12 @@ if ($result)
$i++; $i++;
} }
print "</table>";
$db->free(); $db->free();
print "</table>";
print '</form>';
} }
else else
{ {