forked from Wavyzz/dolibarr
Fix: Corrections diverses sur gestrion du contact. Plus de perte des infos saisies si champ nom non renseign.
Trad: Traduction civilit
This commit is contained in:
@@ -77,21 +77,21 @@ if ($contact->socid > 0)
|
||||
$objsoc = new Societe($db);
|
||||
$objsoc->fetch($contact->socid);
|
||||
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->nom_url.'</td></tr>';
|
||||
print '<tr><td width="15%">'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->nom_url.'</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="3">';
|
||||
print '<tr><td width="15%">'.$langs->trans("Company").'</td><td colspan="3">';
|
||||
print $langs->trans("ContactNotLinkedToCompany");
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td colspan="3">';
|
||||
print $contact->civilite_id;
|
||||
print $form->civilite_name($contact->civilite_id);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td width="15%">'.$langs->trans("Lastname").'</td><td width="35%">'.$contact->name.'</td>';
|
||||
print '<td width="15%">'.$langs->trans("Firstname").'</td><td width="35%">'.$contact->firstname.'</td></tr>';
|
||||
print '<tr><td width="15%">'.$langs->trans("Lastname").'</td><td>'.$contact->name.'</td>';
|
||||
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="25%">'.$contact->firstname.'</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
@@ -80,14 +80,8 @@ if ($_POST["action"] == 'add')
|
||||
array_push($error,$langs->trans("ErrorFieldRequired",$langs->trans("Lastname")));
|
||||
$_GET["action"]="create";
|
||||
}
|
||||
/*
|
||||
if (! $_POST["firstname"])
|
||||
{
|
||||
array_push($error,$langs->trans("ErrorFieldRequired",$langs->trans("Firstname")));
|
||||
$_GET["action"]="create";
|
||||
}
|
||||
*/
|
||||
if ($_POST["name"] && $_POST["firstname"])
|
||||
|
||||
if ($_POST["name"])
|
||||
{
|
||||
$id = $contact->create($user);
|
||||
if ($id > 0)
|
||||
|
||||
@@ -109,21 +109,21 @@ if ($_GET["action"] == 'edit')
|
||||
$objsoc = new Societe($db);
|
||||
$objsoc->fetch($contact->socid);
|
||||
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->nom_url.'</td>';
|
||||
print '<tr><td width="15%">'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->nom_url.'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="3">';
|
||||
print '<tr><td width="15%">'.$langs->trans("Company").'</td><td colspan="3">';
|
||||
print $langs->trans("ContactNotLinkedToCompany");
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td colspan="3">';
|
||||
print $contact->civilite_id;
|
||||
print $form->civilite_name($contact->civilite_id);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td width="15%">'.$langs->trans("Lastname").'</td><td width="35%">'.$contact->nom.'</td>';
|
||||
print '<td width="15%">'.$langs->trans("Firstname").'</td><td width="35%">'.$contact->prenom.'</td>';
|
||||
print '<tr><td width="15%">'.$langs->trans("Lastname").'</td><td>'.$contact->nom.'</td>';
|
||||
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="25%">'.$contact->prenom.'</td>';
|
||||
|
||||
|
||||
print '<tr><td>'.$langs->trans("Birthday").'</td><td>';
|
||||
@@ -164,22 +164,22 @@ else
|
||||
$objsoc = new Societe($db);
|
||||
$objsoc->fetch($contact->socid);
|
||||
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->nom_url.'</td></tr>';
|
||||
print '<tr><td width="15%">'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->nom_url.'</td></tr>';
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="3">';
|
||||
print '<tr><td width="15%">'.$langs->trans("Company").'</td><td colspan="3">';
|
||||
print $langs->trans("ContactNotLinkedToCompany");
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td colspan="3">';
|
||||
print $contact->civilite_id;
|
||||
print $form->civilite_name($contact->civilite_id);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td width="15%">'.$langs->trans("Lastname").'</td><td width="35%">'.$contact->name.'</td>';
|
||||
print '<td width="15%">'.$langs->trans("Firstname").'</td><td width="35%">'.$contact->firstname.'</td></tr>';
|
||||
print '<tr><td width="15%">'.$langs->trans("Lastname").'</td><td>'.$contact->name.'</td>';
|
||||
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="25%">'.$contact->firstname.'</td></tr>';
|
||||
|
||||
if ($contact->birthday && $contact->birthday > 0) {
|
||||
print '<tr><td>'.$langs->trans("Birthdate").'</td><td colspan="3">'.dolibarr_print_date($contact->birthday);
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
*
|
||||
* $Id$
|
||||
* $Source$
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -47,7 +46,6 @@ $v->setPhoneNumber($contact->phone_perso, "PREF;HOME;VOICE");
|
||||
|
||||
if ($contact->birthday) $v->setBirthday($contact->birthday);
|
||||
|
||||
// TODO finir le support des adresses dans les contacts
|
||||
$v->setAddress("", "", $contact->address, $contact->ville, "", $contact->cp, $contact->pays);
|
||||
|
||||
$v->setEmail($contact->email);
|
||||
@@ -59,15 +57,18 @@ $v->setEmail($contact->email);
|
||||
$db->close();
|
||||
|
||||
|
||||
// Renvoi VCard au navigateur
|
||||
// Renvoi la VCard au navigateur
|
||||
|
||||
$output = $v->getVCard();
|
||||
|
||||
$filename = sanitize_string(ereg_replace('^%20','',$v->getFileName()));
|
||||
Header("Content-Disposition: attachment; filename=$filename");
|
||||
$filename =trim(urldecode($v->getFileName())); // "Nom prenom.vcf"
|
||||
$filenameurlencoded = sanitize_string(urlencode($filename));
|
||||
//$filename = sanitize_string($filename);
|
||||
|
||||
Header("Content-Disposition: attachment; filename=\"$filename\"");
|
||||
Header("Content-Length: ".strlen($output));
|
||||
Header("Connection: close");
|
||||
Header("Content-Type: text/x-vCard; name=$filename");
|
||||
Header("Content-Type: text/x-vCard; name=\"$filename\"");
|
||||
|
||||
print $output;
|
||||
|
||||
|
||||
@@ -827,99 +827,30 @@ class Form
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Retourne la liste d<>roulante des civilite actives
|
||||
* \param selected civilite pr<70>-s<>lectionn<6E>e
|
||||
*/
|
||||
|
||||
function select_civilite($selected='')
|
||||
{
|
||||
global $conf,$langs;
|
||||
$langs->load("dict");
|
||||
|
||||
$sql = "SELECT rowid, code, civilite, active FROM ".MAIN_DB_PREFIX."c_civilite";
|
||||
$sql .= " WHERE active = 1";
|
||||
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
print '<select class="flat" name="civilite_id">';
|
||||
print '<option value=""> </option>';
|
||||
$num = $this->db->num_rows();
|
||||
$i = 0;
|
||||
if ($num)
|
||||
{
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object();
|
||||
if ($selected == $obj->code)
|
||||
{
|
||||
print '<option value="'.$obj->code.'" selected="true">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<option value="'.$obj->code.'">';
|
||||
}
|
||||
// Si traduction existe, on l'utilise, sinon on prend le libell<6C> par d<>faut
|
||||
print ($langs->trans($obj->code)!=$obj->code?$langs->trans($obj->code):($obj->civilite!='-'?$obj->civilite:''));
|
||||
print '</option>';
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print '</select>';
|
||||
}
|
||||
else {
|
||||
dolibarr_print_error($this->db);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Retourne la liste d<>roulante des formes juridiques tous pays confondus ou pour un pays donn<6E>.
|
||||
* \remarks Dans le cas d'une liste tous pays confondu, on affiche une rupture sur le pays
|
||||
* \param selected Code forme juridique a pr<70>s<EFBFBD>lectionn<6E>
|
||||
* \param pays_code 0=liste tous pays confondus, sinon code du pays <20> afficher
|
||||
*/
|
||||
|
||||
function select_forme_juridique($selected='',$pays_code=0)
|
||||
{
|
||||
global $conf,$langs;
|
||||
$langs->load("dict");
|
||||
|
||||
// On recherche les formes juridiques actives des pays actifs
|
||||
$sql = "SELECT f.rowid, f.code as code , f.libelle as nom, f.active, p.libelle as libelle_pays, p.code as code_pays";
|
||||
$sql .= " FROM llx_c_forme_juridique as f, llx_c_pays as p";
|
||||
$sql .= " WHERE f.fk_pays=p.rowid";
|
||||
$sql .= " AND f.active = 1 AND p.active = 1";
|
||||
if ($pays_code) $sql .= " AND p.code = '".$pays_code."'";
|
||||
$sql .= " ORDER BY p.code, f.code";
|
||||
|
||||
$result=$this->db->query($sql);
|
||||
if ($result)
|
||||
/**
|
||||
* \brief Retourne la liste d<>roulante des civilite actives
|
||||
* \param selected civilite pr<70>-s<>lectionn<6E>e
|
||||
*/
|
||||
function select_civilite($selected='')
|
||||
{
|
||||
print '<select class="flat" name="forme_juridique_code">';
|
||||
if ($pays_code) print '<option value="0"> </option>';
|
||||
$num = $this->db->num_rows($result);
|
||||
$i = 0;
|
||||
if ($num)
|
||||
{
|
||||
$pays='';
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object($result);
|
||||
if ($obj->code == 0) {
|
||||
print '<option value="0"> </option>';
|
||||
}
|
||||
else {
|
||||
if (! $pays || $pays != $obj->libelle_pays) {
|
||||
// Affiche la rupture si on est en mode liste multipays
|
||||
if (! $pays_code && $obj->code_pays) {
|
||||
print '<option value="0">----- '.$obj->libelle_pays." -----</option>\n";
|
||||
$pays=$obj->libelle_pays;
|
||||
}
|
||||
}
|
||||
global $conf,$langs;
|
||||
$langs->load("dict");
|
||||
|
||||
if ($selected > 0 && $selected == $obj->code)
|
||||
$sql = "SELECT rowid, code, civilite, active FROM ".MAIN_DB_PREFIX."c_civilite";
|
||||
$sql .= " WHERE active = 1";
|
||||
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
print '<select class="flat" name="civilite_id">';
|
||||
print '<option value=""> </option>';
|
||||
$num = $this->db->num_rows();
|
||||
$i = 0;
|
||||
if ($num)
|
||||
{
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object();
|
||||
if ($selected == $obj->code)
|
||||
{
|
||||
print '<option value="'.$obj->code.'" selected="true">';
|
||||
}
|
||||
@@ -928,25 +859,106 @@ class Form
|
||||
print '<option value="'.$obj->code.'">';
|
||||
}
|
||||
// Si traduction existe, on l'utilise, sinon on prend le libell<6C> par d<>faut
|
||||
print $obj->code . ' - ' .($langs->trans($obj->code)!=$obj->code?$langs->trans($obj->code):($obj->nom!='-'?$obj->nom:''));
|
||||
print ($langs->trans("Civility".$obj->code)!="Civility".$obj->code ? $langs->trans("Civility".$obj->code) : ($obj->civilite!='-'?$obj->civilite:''));
|
||||
print '</option>';
|
||||
$i++;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
print '</select>';
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($this->db);
|
||||
}
|
||||
print '</select>';
|
||||
}
|
||||
else {
|
||||
dolibarr_print_error($this->db);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Retourne le nom traduit de la forme juridique
|
||||
* \param code Code de la forme juridique
|
||||
* \return string Nom traduit du pays
|
||||
*/
|
||||
/**
|
||||
* \brief Retourne le nom traduit de la civilit<EFBFBD>
|
||||
* \param code Code de la civilit<EFBFBD>
|
||||
* \return string Nom traduit de la civilit<69>
|
||||
*/
|
||||
function civilite_name($code)
|
||||
{
|
||||
global $langs;
|
||||
$langs->load("dict");
|
||||
return $langs->trans("Civility".$code)!="Civility".$code ? $langs->trans("Civility".$code) : $code;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Retourne la liste d<>roulante des formes juridiques tous pays confondus ou pour un pays donn<6E>.
|
||||
* \remarks Dans le cas d'une liste tous pays confondu, on affiche une rupture sur le pays
|
||||
* \param selected Code forme juridique a pr<70>s<EFBFBD>lectionn
|
||||
* \param pays_code 0=liste tous pays confondus, sinon code du pays <20> afficher
|
||||
*/
|
||||
function select_forme_juridique($selected='',$pays_code=0)
|
||||
{
|
||||
global $conf,$langs;
|
||||
$langs->load("dict");
|
||||
|
||||
// On recherche les formes juridiques actives des pays actifs
|
||||
$sql = "SELECT f.rowid, f.code as code , f.libelle as nom, f.active, p.libelle as libelle_pays, p.code as code_pays";
|
||||
$sql .= " FROM llx_c_forme_juridique as f, llx_c_pays as p";
|
||||
$sql .= " WHERE f.fk_pays=p.rowid";
|
||||
$sql .= " AND f.active = 1 AND p.active = 1";
|
||||
if ($pays_code) $sql .= " AND p.code = '".$pays_code."'";
|
||||
$sql .= " ORDER BY p.code, f.code";
|
||||
|
||||
$result=$this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
print '<select class="flat" name="forme_juridique_code">';
|
||||
if ($pays_code) print '<option value="0"> </option>';
|
||||
$num = $this->db->num_rows($result);
|
||||
$i = 0;
|
||||
if ($num)
|
||||
{
|
||||
$pays='';
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object($result);
|
||||
if ($obj->code == 0) {
|
||||
print '<option value="0"> </option>';
|
||||
}
|
||||
else {
|
||||
if (! $pays || $pays != $obj->libelle_pays) {
|
||||
// Affiche la rupture si on est en mode liste multipays
|
||||
if (! $pays_code && $obj->code_pays) {
|
||||
print '<option value="0">----- '.$obj->libelle_pays." -----</option>\n";
|
||||
$pays=$obj->libelle_pays;
|
||||
}
|
||||
}
|
||||
|
||||
if ($selected > 0 && $selected == $obj->code)
|
||||
{
|
||||
print '<option value="'.$obj->code.'" selected="true">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<option value="'.$obj->code.'">';
|
||||
}
|
||||
// Si traduction existe, on l'utilise, sinon on prend le libell<6C> par d<>faut
|
||||
print $obj->code . ' - ' .($langs->trans($obj->code)!=$obj->code?$langs->trans($obj->code):($obj->nom!='-'?$obj->nom:''));
|
||||
print '</option>';
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print '</select>';
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($this->db);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Retourne le nom traduit de la forme juridique
|
||||
* \param code Code de la forme juridique
|
||||
* \return string Nom traduit du pays
|
||||
*/
|
||||
function forme_juridique_name($code)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
@@ -30,6 +30,7 @@ Fax=Fax
|
||||
Zip=Zip Code
|
||||
Town=Town
|
||||
Web=Web
|
||||
##### Professionnal ID #####
|
||||
ProfId1=Professional ID 1
|
||||
ProfId2=Professional ID 2
|
||||
ProfId3=Professional ID 3
|
||||
|
||||
@@ -23,3 +23,8 @@ CountryCI=C
|
||||
CountrySN=Senegal
|
||||
CountryAR=Argentina
|
||||
CountryCM=Cameroun
|
||||
##### Civilities #####
|
||||
CivilityMME=Madam
|
||||
CivilityMR=Mister
|
||||
CivilityMLE=Miss
|
||||
CivilityMTRE=Ma<4D>tre
|
||||
|
||||
@@ -70,5 +70,5 @@ MailingNeedCommand=For securities reason, sending an emailing can only be perfor
|
||||
TargetsReset=Clear list
|
||||
ToClearAllRecipientsClickHere=To clear recipients' list for this emailing, click here
|
||||
ToAddRecipientsChooseHere=To add recipients, choose in those lists
|
||||
NbOfEMailingsReceived=Nb of mass emailings received
|
||||
NbOfEMailingsReceived=Mass emailings received
|
||||
IdRecord=ID record
|
||||
@@ -30,6 +30,7 @@ Fax=Fax
|
||||
Zip=Code postal
|
||||
Town=Ville
|
||||
Web=Web
|
||||
##### Professionnal ID #####
|
||||
ProfId1=ID professionnel 1
|
||||
ProfId2=ID professionnel 2
|
||||
ProfId3=ID professionnel 3
|
||||
|
||||
@@ -23,3 +23,8 @@ CountryCI=C
|
||||
CountrySN=S<>n<EFBFBD>gal
|
||||
CountryAR=Argentine
|
||||
CountryCM=Cameroun
|
||||
##### Civilities #####
|
||||
CivilityMME=Madame
|
||||
CivilityMR=Monsieur
|
||||
CivilityMLE=Mademoiselle
|
||||
CivilityMTRE=Ma<4D>tre
|
||||
|
||||
@@ -70,5 +70,5 @@ MailingNeedCommand=Pour des raisons de s
|
||||
TargetsReset=Vider liste
|
||||
ToClearAllRecipientsClickHere=Pour effacer la liste des destinataires de ce mailing, cliquer ici
|
||||
ToAddRecipientsChooseHere=Pour ajouter des destinataires, choisir dans les listes ci-dessous
|
||||
NbOfEMailingsReceived=Mailings de masse re<72>us
|
||||
NbOfEMailingsReceived=Mailings de masse re<72>us
|
||||
IdRecord=ID enregistrement
|
||||
Reference in New Issue
Block a user