|
|
|
@@ -89,13 +89,13 @@ else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Recuperation contact actuel
|
|
|
|
// Recuperation contact actuel
|
|
|
|
$result = $object->fetch($_GET["id"]);
|
|
|
|
$result = $object->fetch($_GET["id"]);
|
|
|
|
|
|
|
|
|
|
|
|
if ($result > 0)
|
|
|
|
if ($result > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Creation user
|
|
|
|
// Creation user
|
|
|
|
$nuser = new User($db);
|
|
|
|
$nuser = new User($db);
|
|
|
|
$result=$nuser->create_from_contact($object,$_POST["login"]);
|
|
|
|
$result=$nuser->create_from_contact($object,$_POST["login"]);
|
|
|
|
|
|
|
|
|
|
|
|
if ($result < 0)
|
|
|
|
if ($result < 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$msg=$nuser->error;
|
|
|
|
$msg=$nuser->error;
|
|
|
|
@@ -106,12 +106,16 @@ else
|
|
|
|
$msg=$object->error;
|
|
|
|
$msg=$object->error;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Creation contact
|
|
|
|
// Creation contact
|
|
|
|
if ($_POST["action"] == 'add' && $user->rights->societe->contact->creer)
|
|
|
|
if ($_POST["action"] == 'add' && $user->rights->societe->contact->creer)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
$error=0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$db->begin();
|
|
|
|
|
|
|
|
|
|
|
|
$object->socid = $_POST["socid"];
|
|
|
|
$object->socid = $_POST["socid"];
|
|
|
|
|
|
|
|
|
|
|
|
$object->name = $_POST["name"];
|
|
|
|
$object->name = $_POST["name"];
|
|
|
|
$object->firstname = $_POST["firstname"];
|
|
|
|
$object->firstname = $_POST["firstname"];
|
|
|
|
$object->civilite_id = $_POST["civilite_id"];
|
|
|
|
$object->civilite_id = $_POST["civilite_id"];
|
|
|
|
@@ -129,36 +133,48 @@ else
|
|
|
|
$object->jabberid = $_POST["jabberid"];
|
|
|
|
$object->jabberid = $_POST["jabberid"];
|
|
|
|
$object->priv = $_POST["priv"];
|
|
|
|
$object->priv = $_POST["priv"];
|
|
|
|
$object->note = $_POST["note"];
|
|
|
|
$object->note = $_POST["note"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Note: Correct date should be completed with location to have exact GM time of birth.
|
|
|
|
|
|
|
|
$object->birthday = dol_mktime(0,0,0,$_POST["birthdaymonth"],$_POST["birthdayday"],$_POST["birthdayyear"]);
|
|
|
|
|
|
|
|
$object->birthday_alert = $_POST["birthday_alert"];
|
|
|
|
|
|
|
|
|
|
|
|
if (! $_POST["name"])
|
|
|
|
if (! $_POST["name"])
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
$error++;
|
|
|
|
array_push($errors,$langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname").' / '.$langs->transnoentities("Label")));
|
|
|
|
array_push($errors,$langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname").' / '.$langs->transnoentities("Label")));
|
|
|
|
$_GET["action"] = $_POST["action"] = 'create';
|
|
|
|
$_GET["action"] = $_POST["action"] = 'create';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($_POST["name"])
|
|
|
|
if ($_POST["name"])
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$id = $object->create($user);
|
|
|
|
$id = $object->create($user);
|
|
|
|
if ($id > 0)
|
|
|
|
if ($id <= 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Header("Location: fiche.php?id=".$id);
|
|
|
|
$error++;
|
|
|
|
exit;
|
|
|
|
$errors=array($object->error);
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$errors=array($object->error);
|
|
|
|
|
|
|
|
$_GET["action"] = $_POST["action"] = 'create';
|
|
|
|
$_GET["action"] = $_POST["action"] = 'create';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (! $error && $id > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$db->commit();
|
|
|
|
|
|
|
|
Header("Location: fiche.php?id=".$id);
|
|
|
|
|
|
|
|
exit;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$db->rollback();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (GETPOST("action") == 'confirm_delete' && GETPOST("confirm") == 'yes' && $user->rights->societe->contact->supprimer)
|
|
|
|
if (GETPOST("action") == 'confirm_delete' && GETPOST("confirm") == 'yes' && $user->rights->societe->contact->supprimer)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$result=$object->fetch($_GET["id"]);
|
|
|
|
$result=$object->fetch($_GET["id"]);
|
|
|
|
|
|
|
|
|
|
|
|
$object->old_name = $_POST["old_name"];
|
|
|
|
$object->old_name = $_POST["old_name"];
|
|
|
|
$object->old_firstname = $_POST["old_firstname"];
|
|
|
|
$object->old_firstname = $_POST["old_firstname"];
|
|
|
|
|
|
|
|
|
|
|
|
$result = $object->delete();
|
|
|
|
$result = $object->delete();
|
|
|
|
if ($result > 0)
|
|
|
|
if ($result > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@@ -170,7 +186,7 @@ else
|
|
|
|
$mesg=$object->error;
|
|
|
|
$mesg=$object->error;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($_POST["action"] == 'update' && ! $_POST["cancel"] && $user->rights->societe->contact->creer)
|
|
|
|
if ($_POST["action"] == 'update' && ! $_POST["cancel"] && $user->rights->societe->contact->creer)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (empty($_POST["name"]))
|
|
|
|
if (empty($_POST["name"]))
|
|
|
|
@@ -179,28 +195,28 @@ else
|
|
|
|
$error++;
|
|
|
|
$error++;
|
|
|
|
$_GET["action"] = $_POST["action"] = 'edit';
|
|
|
|
$_GET["action"] = $_POST["action"] = 'edit';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (! sizeof($errors))
|
|
|
|
if (! sizeof($errors))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$object->fetch($_POST["contactid"]);
|
|
|
|
$object->fetch($_POST["contactid"]);
|
|
|
|
|
|
|
|
|
|
|
|
$object->oldcopy=dol_clone($object);
|
|
|
|
$object->oldcopy=dol_clone($object);
|
|
|
|
|
|
|
|
|
|
|
|
$object->old_name = $_POST["old_name"];
|
|
|
|
$object->old_name = $_POST["old_name"];
|
|
|
|
$object->old_firstname = $_POST["old_firstname"];
|
|
|
|
$object->old_firstname = $_POST["old_firstname"];
|
|
|
|
|
|
|
|
|
|
|
|
$object->socid = $_POST["socid"];
|
|
|
|
$object->socid = $_POST["socid"];
|
|
|
|
$object->name = $_POST["name"];
|
|
|
|
$object->name = $_POST["name"];
|
|
|
|
$object->firstname = $_POST["firstname"];
|
|
|
|
$object->firstname = $_POST["firstname"];
|
|
|
|
$object->civilite_id = $_POST["civilite_id"];
|
|
|
|
$object->civilite_id = $_POST["civilite_id"];
|
|
|
|
$object->poste = $_POST["poste"];
|
|
|
|
$object->poste = $_POST["poste"];
|
|
|
|
|
|
|
|
|
|
|
|
$object->address = $_POST["address"];
|
|
|
|
$object->address = $_POST["address"];
|
|
|
|
$object->cp = $_POST["cp"];
|
|
|
|
$object->cp = $_POST["cp"];
|
|
|
|
$object->ville = $_POST["ville"];
|
|
|
|
$object->ville = $_POST["ville"];
|
|
|
|
$object->fk_departement= $_POST["departement_id"];
|
|
|
|
$object->fk_departement= $_POST["departement_id"];
|
|
|
|
$object->fk_pays = $_POST["pays_id"];
|
|
|
|
$object->fk_pays = $_POST["pays_id"];
|
|
|
|
|
|
|
|
|
|
|
|
$object->email = $_POST["email"];
|
|
|
|
$object->email = $_POST["email"];
|
|
|
|
$object->phone_pro = $_POST["phone_pro"];
|
|
|
|
$object->phone_pro = $_POST["phone_pro"];
|
|
|
|
$object->phone_perso = $_POST["phone_perso"];
|
|
|
|
$object->phone_perso = $_POST["phone_perso"];
|
|
|
|
@@ -209,9 +225,9 @@ else
|
|
|
|
$object->jabberid = $_POST["jabberid"];
|
|
|
|
$object->jabberid = $_POST["jabberid"];
|
|
|
|
$object->priv = $_POST["priv"];
|
|
|
|
$object->priv = $_POST["priv"];
|
|
|
|
$object->note = $_POST["note"];
|
|
|
|
$object->note = $_POST["note"];
|
|
|
|
|
|
|
|
|
|
|
|
$result = $object->update($_POST["contactid"], $user);
|
|
|
|
$result = $object->update($_POST["contactid"], $user);
|
|
|
|
|
|
|
|
|
|
|
|
if ($result > 0)
|
|
|
|
if ($result > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$object->old_name='';
|
|
|
|
$object->old_name='';
|
|
|
|
@@ -248,25 +264,25 @@ if (! empty($canvas))
|
|
|
|
// -----------------------------------------
|
|
|
|
// -----------------------------------------
|
|
|
|
// When used with CANVAS
|
|
|
|
// When used with CANVAS
|
|
|
|
// -----------------------------------------
|
|
|
|
// -----------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
if (GETPOST("action") == 'create')
|
|
|
|
if (GETPOST("action") == 'create')
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Set action type
|
|
|
|
// Set action type
|
|
|
|
$objcanvas->setAction(GETPOST("action"));
|
|
|
|
$objcanvas->setAction(GETPOST("action"));
|
|
|
|
|
|
|
|
|
|
|
|
// Card header
|
|
|
|
// Card header
|
|
|
|
$title = $objcanvas->getTitle();
|
|
|
|
$title = $objcanvas->getTitle();
|
|
|
|
print_fiche_titre($title);
|
|
|
|
print_fiche_titre($title);
|
|
|
|
|
|
|
|
|
|
|
|
// Assign _POST data
|
|
|
|
// Assign _POST data
|
|
|
|
$objcanvas->assign_post();
|
|
|
|
$objcanvas->assign_post();
|
|
|
|
|
|
|
|
|
|
|
|
// Assign template values
|
|
|
|
// Assign template values
|
|
|
|
$objcanvas->assign_values();
|
|
|
|
$objcanvas->assign_values();
|
|
|
|
|
|
|
|
|
|
|
|
// Show errors
|
|
|
|
// Show errors
|
|
|
|
dol_htmloutput_errors($objcanvas->error,$objcanvas->errors);
|
|
|
|
dol_htmloutput_errors($objcanvas->error,$objcanvas->errors);
|
|
|
|
|
|
|
|
|
|
|
|
// Display canvas
|
|
|
|
// Display canvas
|
|
|
|
$objcanvas->display_canvas();
|
|
|
|
$objcanvas->display_canvas();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -275,26 +291,26 @@ if (! empty($canvas))
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Mode edition
|
|
|
|
* Mode edition
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
// Set action type
|
|
|
|
// Set action type
|
|
|
|
$objcanvas->setAction(GETPOST("action"));
|
|
|
|
$objcanvas->setAction(GETPOST("action"));
|
|
|
|
|
|
|
|
|
|
|
|
// Fetch object
|
|
|
|
// Fetch object
|
|
|
|
$result=$objcanvas->fetch($id);
|
|
|
|
$result=$objcanvas->fetch($id);
|
|
|
|
if ($result > 0)
|
|
|
|
if ($result > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Card header
|
|
|
|
// Card header
|
|
|
|
$objcanvas->showHead();
|
|
|
|
$objcanvas->showHead();
|
|
|
|
|
|
|
|
|
|
|
|
if ($_POST["name"])
|
|
|
|
if ($_POST["name"])
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Assign _POST data
|
|
|
|
// Assign _POST data
|
|
|
|
$objcanvas->assign_post();
|
|
|
|
$objcanvas->assign_post();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Assign values
|
|
|
|
// Assign values
|
|
|
|
$objcanvas->assign_values();
|
|
|
|
$objcanvas->assign_values();
|
|
|
|
|
|
|
|
|
|
|
|
// Display canvas
|
|
|
|
// Display canvas
|
|
|
|
$objcanvas->display_canvas();
|
|
|
|
$objcanvas->display_canvas();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -303,12 +319,12 @@ if (! empty($canvas))
|
|
|
|
dol_htmloutput_errors($objcanvas->error,$objcanvas->errors);
|
|
|
|
dol_htmloutput_errors($objcanvas->error,$objcanvas->errors);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (GETPOST("id") && GETPOST("action") != 'edit')
|
|
|
|
if (GETPOST("id") && GETPOST("action") != 'edit')
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Set action type
|
|
|
|
// Set action type
|
|
|
|
$objcanvas->setAction('view');
|
|
|
|
$objcanvas->setAction('view');
|
|
|
|
|
|
|
|
|
|
|
|
// Fetch object
|
|
|
|
// Fetch object
|
|
|
|
$result=$objcanvas->fetch($id);
|
|
|
|
$result=$objcanvas->fetch($id);
|
|
|
|
if ($result > 0)
|
|
|
|
if ($result > 0)
|
|
|
|
@@ -318,30 +334,30 @@ if (! empty($canvas))
|
|
|
|
|
|
|
|
|
|
|
|
// Assign values
|
|
|
|
// Assign values
|
|
|
|
$objcanvas->assign_values();
|
|
|
|
$objcanvas->assign_values();
|
|
|
|
|
|
|
|
|
|
|
|
//Show errors
|
|
|
|
//Show errors
|
|
|
|
dol_htmloutput_errors($objcanvas->error,$objcanvas->errors);
|
|
|
|
dol_htmloutput_errors($objcanvas->error,$objcanvas->errors);
|
|
|
|
|
|
|
|
|
|
|
|
// Display canvas
|
|
|
|
// Display canvas
|
|
|
|
$objcanvas->display_canvas();
|
|
|
|
$objcanvas->display_canvas();
|
|
|
|
|
|
|
|
|
|
|
|
print show_actions_todo($conf,$langs,$db,$objsoc,$objcanvas->control->object);
|
|
|
|
print show_actions_todo($conf,$langs,$db,$objsoc,$objcanvas->control->object);
|
|
|
|
|
|
|
|
|
|
|
|
print show_actions_done($conf,$langs,$db,$objsoc,$objcanvas->control->object);
|
|
|
|
print show_actions_done($conf,$langs,$db,$objsoc,$objcanvas->control->object);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
dol_htmloutput_errors($objcanvas->error,$objcanvas->errors);
|
|
|
|
dol_htmloutput_errors($objcanvas->error,$objcanvas->errors);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// -----------------------------------------
|
|
|
|
// -----------------------------------------
|
|
|
|
// When used in standard mode
|
|
|
|
// When used in standard mode
|
|
|
|
// -----------------------------------------
|
|
|
|
// -----------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Confirmation de la suppression du contact
|
|
|
|
* Confirmation de la suppression du contact
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@@ -353,29 +369,29 @@ else
|
|
|
|
if ($ret == 'html') print '<br>';
|
|
|
|
if ($ret == 'html') print '<br>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Onglets
|
|
|
|
* Onglets
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
if ($_GET["id"] > 0)
|
|
|
|
if (GETPOST("id") > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Si edition contact deja existant
|
|
|
|
// Si edition contact deja existant
|
|
|
|
$contact = new Contact($db);
|
|
|
|
$object = new Contact($db);
|
|
|
|
$return=$contact->fetch($_GET["id"], $user);
|
|
|
|
$return=$object->fetch(GETPOST("id"), $user);
|
|
|
|
if ($return <= 0)
|
|
|
|
if ($return <= 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
dol_print_error('',$contact->error);
|
|
|
|
dol_print_error('',$object->error);
|
|
|
|
$_GET["id"]=0;
|
|
|
|
$_GET["id"]=0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Affichage onglets
|
|
|
|
* Affichage onglets
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
$head = contact_prepare_head($contact);
|
|
|
|
$head = contact_prepare_head($object);
|
|
|
|
|
|
|
|
|
|
|
|
dol_fiche_head($head, 'card', $langs->trans("Contact"), 0, 'contact');
|
|
|
|
dol_fiche_head($head, 'card', $langs->trans("Contact"), 0, 'contact');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($user->rights->societe->contact->creer)
|
|
|
|
if ($user->rights->societe->contact->creer)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (GETPOST("action") == 'create')
|
|
|
|
if (GETPOST("action") == 'create')
|
|
|
|
@@ -384,7 +400,7 @@ else
|
|
|
|
* Fiche en mode creation
|
|
|
|
* Fiche en mode creation
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
$object->fk_departement = $_POST["departement_id"];
|
|
|
|
$object->fk_departement = $_POST["departement_id"];
|
|
|
|
|
|
|
|
|
|
|
|
// We set pays_id, pays_code and label for the selected country
|
|
|
|
// We set pays_id, pays_code and label for the selected country
|
|
|
|
$object->fk_pays=$_POST["pays_id"]?$_POST["pays_id"]:$mysoc->pays_id;
|
|
|
|
$object->fk_pays=$_POST["pays_id"]?$_POST["pays_id"]:$mysoc->pays_id;
|
|
|
|
if ($object->fk_pays)
|
|
|
|
if ($object->fk_pays)
|
|
|
|
@@ -404,12 +420,12 @@ else
|
|
|
|
$object->pays_code=$obj->code;
|
|
|
|
$object->pays_code=$obj->code;
|
|
|
|
$object->pays=$obj->libelle;
|
|
|
|
$object->pays=$obj->libelle;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
print_fiche_titre($langs->trans("AddContact"));
|
|
|
|
print_fiche_titre($langs->trans("AddContact"));
|
|
|
|
|
|
|
|
|
|
|
|
// Affiche les erreurs
|
|
|
|
// Affiche les erreurs
|
|
|
|
dol_htmloutput_errors($mesg,$errors);
|
|
|
|
dol_htmloutput_errors($mesg,$errors);
|
|
|
|
|
|
|
|
|
|
|
|
if ($conf->use_javascript_ajax)
|
|
|
|
if ($conf->use_javascript_ajax)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
print "\n".'<script type="text/javascript" language="javascript">';
|
|
|
|
print "\n".'<script type="text/javascript" language="javascript">';
|
|
|
|
@@ -421,17 +437,17 @@ else
|
|
|
|
})';
|
|
|
|
})';
|
|
|
|
print '</script>'."\n";
|
|
|
|
print '</script>'."\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
print '<br>';
|
|
|
|
print '<br>';
|
|
|
|
print '<form method="post" name="formsoc" action="'.$_SERVER["PHP_SELF"].'">';
|
|
|
|
print '<form method="post" name="formsoc" action="'.$_SERVER["PHP_SELF"].'">';
|
|
|
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
|
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
|
|
print '<input type="hidden" name="action" value="add">';
|
|
|
|
print '<input type="hidden" name="action" value="add">';
|
|
|
|
print '<table class="border" width="100%">';
|
|
|
|
print '<table class="border" width="100%">';
|
|
|
|
|
|
|
|
|
|
|
|
// Name
|
|
|
|
// Name
|
|
|
|
print '<tr><td width="15%" class="fieldrequired">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td><input name="name" type="text" size="30" maxlength="80" value="'.(isset($_POST["name"])?$_POST["name"]:$object->name).'"></td>';
|
|
|
|
print '<tr><td width="20%" class="fieldrequired">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td width="30%"><input name="name" type="text" size="30" maxlength="80" value="'.(isset($_POST["name"])?$_POST["name"]:$object->name).'"></td>';
|
|
|
|
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="25%"><input name="firstname" type="text" size="30" maxlength="80" value="'.(isset($_POST["firstname"])?$_POST["firstname"]:$object->firstname).'"></td></tr>';
|
|
|
|
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="30%"><input name="firstname" type="text" size="30" maxlength="80" value="'.(isset($_POST["firstname"])?$_POST["firstname"]:$object->firstname).'"></td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
// Company
|
|
|
|
// Company
|
|
|
|
if ($socid > 0)
|
|
|
|
if ($socid > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@@ -449,31 +465,31 @@ else
|
|
|
|
//print $langs->trans("ContactNotLinkedToCompany");
|
|
|
|
//print $langs->trans("ContactNotLinkedToCompany");
|
|
|
|
print '</td></tr>';
|
|
|
|
print '</td></tr>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Civility
|
|
|
|
// Civility
|
|
|
|
print '<tr><td width="15%">'.$langs->trans("UserTitle").'</td><td colspan="3">';
|
|
|
|
print '<tr><td width="15%">'.$langs->trans("UserTitle").'</td><td colspan="3">';
|
|
|
|
print $formcompany->select_civilite(isset($_POST["civilite_id"])?$_POST["civilite_id"]:$object->civilite_id);
|
|
|
|
print $formcompany->select_civilite(isset($_POST["civilite_id"])?$_POST["civilite_id"]:$object->civilite_id);
|
|
|
|
print '</td></tr>';
|
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
print '<tr><td>'.$langs->trans("PostOrFunction").'</td><td colspan="3"><input name="poste" type="text" size="50" maxlength="80" value="'.(isset($_POST["poste"])?$_POST["poste"]:$object->poste).'"></td>';
|
|
|
|
print '<tr><td>'.$langs->trans("PostOrFunction").'</td><td colspan="3"><input name="poste" type="text" size="50" maxlength="80" value="'.(isset($_POST["poste"])?$_POST["poste"]:$object->poste).'"></td>';
|
|
|
|
|
|
|
|
|
|
|
|
// Address
|
|
|
|
// Address
|
|
|
|
if (($objsoc->typent_code == 'TE_PRIVATE') && dol_strlen(trim($object->address)) == 0) $object->address = $objsoc->address; // Predefined with third party
|
|
|
|
if (($objsoc->typent_code == 'TE_PRIVATE') && dol_strlen(trim($object->address)) == 0) $object->address = $objsoc->address; // Predefined with third party
|
|
|
|
print '<tr><td>'.$langs->trans("Address").'</td><td colspan="3"><textarea class="flat" name="address" cols="70">'.(isset($_POST["address"])?$_POST["address"]:$object->address).'</textarea></td>';
|
|
|
|
print '<tr><td>'.$langs->trans("Address").'</td><td colspan="3"><textarea class="flat" name="address" cols="70">'.(isset($_POST["address"])?$_POST["address"]:$object->address).'</textarea></td>';
|
|
|
|
|
|
|
|
|
|
|
|
// Zip / Town
|
|
|
|
// Zip / Town
|
|
|
|
if (($objsoc->typent_code == 'TE_PRIVATE') && dol_strlen(trim($object->cp)) == 0) $object->cp = $objsoc->cp; // Predefined with third party
|
|
|
|
if (($objsoc->typent_code == 'TE_PRIVATE') && dol_strlen(trim($object->cp)) == 0) $object->cp = $objsoc->cp; // Predefined with third party
|
|
|
|
if (($objsoc->typent_code == 'TE_PRIVATE') && dol_strlen(trim($object->ville)) == 0) $object->ville = $objsoc->ville; // Predefined with third party
|
|
|
|
if (($objsoc->typent_code == 'TE_PRIVATE') && dol_strlen(trim($object->ville)) == 0) $object->ville = $objsoc->ville; // Predefined with third party
|
|
|
|
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td colspan="3"><input name="cp" type="text" size="6" maxlength="80" value="'.(isset($_POST["cp"])?$_POST["cp"]:$object->cp).'"> ';
|
|
|
|
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td colspan="3"><input name="cp" type="text" size="6" maxlength="80" value="'.(isset($_POST["cp"])?$_POST["cp"]:$object->cp).'"> ';
|
|
|
|
print '<input name="ville" type="text" size="20" value="'.(isset($_POST["ville"])?$_POST["ville"]:$object->ville).'" maxlength="80"></td></tr>';
|
|
|
|
print '<input name="ville" type="text" size="20" value="'.(isset($_POST["ville"])?$_POST["ville"]:$object->ville).'" maxlength="80"></td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
// Country
|
|
|
|
// Country
|
|
|
|
if (dol_strlen(trim($object->fk_pays)) == 0) $object->fk_pays = $objsoc->pays_id; // Predefined with third party
|
|
|
|
if (dol_strlen(trim($object->fk_pays)) == 0) $object->fk_pays = $objsoc->pays_id; // Predefined with third party
|
|
|
|
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">';
|
|
|
|
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">';
|
|
|
|
$form->select_pays((isset($_POST["pays_id"])?$_POST["pays_id"]:$object->fk_pays),'pays_id');
|
|
|
|
$form->select_pays((isset($_POST["pays_id"])?$_POST["pays_id"]:$object->fk_pays),'pays_id');
|
|
|
|
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
|
|
|
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
|
|
|
print '</td></tr>';
|
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
// State
|
|
|
|
// State
|
|
|
|
print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">';
|
|
|
|
print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">';
|
|
|
|
if ($object->fk_pays)
|
|
|
|
if ($object->fk_pays)
|
|
|
|
@@ -485,35 +501,69 @@ else
|
|
|
|
print $countrynotdefined;
|
|
|
|
print $countrynotdefined;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
print '</td></tr>';
|
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
// Phone / Fax
|
|
|
|
// Phone / Fax
|
|
|
|
if (($objsoc->typent_code == 'TE_PRIVATE') && dol_strlen(trim($object->phone_pro)) == 0) $object->phone_pro = $objsoc->tel; // Predefined with third party
|
|
|
|
if (($objsoc->typent_code == 'TE_PRIVATE') && dol_strlen(trim($object->phone_pro)) == 0) $object->phone_pro = $objsoc->tel; // Predefined with third party
|
|
|
|
print '<tr><td>'.$langs->trans("PhonePro").'</td><td><input name="phone_pro" type="text" size="18" maxlength="80" value="'.(isset($_POST["phone_pro"])?$_POST["phone_pro"]:$object->phone_pro).'"></td>';
|
|
|
|
print '<tr><td>'.$langs->trans("PhonePro").'</td><td><input name="phone_pro" type="text" size="18" maxlength="80" value="'.(isset($_POST["phone_pro"])?$_POST["phone_pro"]:$object->phone_pro).'"></td>';
|
|
|
|
print '<td>'.$langs->trans("PhonePerso").'</td><td><input name="phone_perso" type="text" size="18" maxlength="80" value="'.(isset($_POST["phone_perso"])?$_POST["phone_perso"]:$object->phone_perso).'"></td></tr>';
|
|
|
|
print '<td>'.$langs->trans("PhonePerso").'</td><td><input name="phone_perso" type="text" size="18" maxlength="80" value="'.(isset($_POST["phone_perso"])?$_POST["phone_perso"]:$object->phone_perso).'"></td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
if (($objsoc->typent_code == 'TE_PRIVATE') && dol_strlen(trim($object->fax)) == 0) $object->fax = $objsoc->fax; // Predefined with third party
|
|
|
|
if (($objsoc->typent_code == 'TE_PRIVATE') && dol_strlen(trim($object->fax)) == 0) $object->fax = $objsoc->fax; // Predefined with third party
|
|
|
|
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input name="phone_mobile" type="text" size="18" maxlength="80" value="'.(isset($_POST["phone_mobile"])?$_POST["phone_mobile"]:$object->phone_mobile).'"></td>';
|
|
|
|
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input name="phone_mobile" type="text" size="18" maxlength="80" value="'.(isset($_POST["phone_mobile"])?$_POST["phone_mobile"]:$object->phone_mobile).'"></td>';
|
|
|
|
print '<td>'.$langs->trans("Fax").'</td><td><input name="fax" type="text" size="18" maxlength="80" value="'.(isset($_POST["fax"])?$_POST["fax"]:$object->fax).'"></td></tr>';
|
|
|
|
print '<td>'.$langs->trans("Fax").'</td><td><input name="fax" type="text" size="18" maxlength="80" value="'.(isset($_POST["fax"])?$_POST["fax"]:$object->fax).'"></td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
// EMail
|
|
|
|
// EMail
|
|
|
|
if (($objsoc->typent_code == 'TE_PRIVATE') && dol_strlen(trim($object->email)) == 0) $object->email = $objsoc->email; // Predefined with third party
|
|
|
|
if (($objsoc->typent_code == 'TE_PRIVATE') && dol_strlen(trim($object->email)) == 0) $object->email = $objsoc->email; // Predefined with third party
|
|
|
|
print '<tr><td>'.$langs->trans("Email").'</td><td colspan="3"><input name="email" type="text" size="50" maxlength="80" value="'.(isset($_POST["email"])?$_POST["email"]:$object->email).'"></td></tr>';
|
|
|
|
print '<tr><td>'.$langs->trans("Email").'</td><td colspan="3"><input name="email" type="text" size="50" maxlength="80" value="'.(isset($_POST["email"])?$_POST["email"]:$object->email).'"></td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
// Jabberid
|
|
|
|
// Jabberid
|
|
|
|
print '<tr><td>Jabberid</td><td colspan="3"><input name="jabberid" type="text" size="50" maxlength="80" value="'.(isset($_POST["jabberid"])?$_POST["jabberid"]:$object->jabberid).'"></td></tr>';
|
|
|
|
print '<tr><td>Jabberid</td><td colspan="3"><input name="jabberid" type="text" size="50" maxlength="80" value="'.(isset($_POST["jabberid"])?$_POST["jabberid"]:$object->jabberid).'"></td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
// Visibility
|
|
|
|
// Visibility
|
|
|
|
print '<tr><td>'.$langs->trans("ContactVisibility").'</td><td colspan="3">';
|
|
|
|
print '<tr><td>'.$langs->trans("ContactVisibility").'</td><td colspan="3">';
|
|
|
|
$selectarray=array('0'=>$langs->trans("ContactPublic"),'1'=>$langs->trans("ContactPrivate"));
|
|
|
|
$selectarray=array('0'=>$langs->trans("ContactPublic"),'1'=>$langs->trans("ContactPrivate"));
|
|
|
|
print $form->selectarray('priv',$selectarray,(isset($_POST["priv"])?$_POST["priv"]:$object->priv),0);
|
|
|
|
print $form->selectarray('priv',$selectarray,(isset($_POST["priv"])?$_POST["priv"]:$object->priv),0);
|
|
|
|
print '</td></tr>';
|
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
// Note
|
|
|
|
// Note
|
|
|
|
print '<tr><td valign="top">'.$langs->trans("Note").'</td><td colspan="3" valign="top"><textarea name="note" cols="70" rows="'.ROWS_3.'">'.(isset($_POST["note"])?$_POST["note"]:$object->note).'</textarea></td></tr>';
|
|
|
|
print '<tr><td valign="top">'.$langs->trans("Note").'</td><td colspan="3" valign="top"><textarea name="note" cols="70" rows="'.ROWS_3.'">'.(isset($_POST["note"])?$_POST["note"]:$object->note).'</textarea></td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
print '<tr><td align="center" colspan="4"><input type="submit" class="button" value="'.$langs->trans("Add").'"></td></tr>';
|
|
|
|
print "</table><br>";
|
|
|
|
print "</table><br>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add personnal information
|
|
|
|
|
|
|
|
print_fiche_titre('<div class="comboperso">'.$langs->trans("PersonalInformations").'</div>','','');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print '<table class="border" width="100%">';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Date To Birth
|
|
|
|
|
|
|
|
print '<tr><td width="20%">'.$langs->trans("DateToBirth").'</td><td width="30%">';
|
|
|
|
|
|
|
|
$html=new Form($db);
|
|
|
|
|
|
|
|
if ($object->birthday)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
print $html->select_date($object->birthday,'birthday',0,0,0,"perso");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
print $html->select_date('','birthday',0,0,1,"perso");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
print '</td>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print '<td colspan="2">'.$langs->trans("Alert").': ';
|
|
|
|
|
|
|
|
if ($object->birthday_alert)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
print '<input type="checkbox" name="birthday_alert" checked></td>';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
print '<input type="checkbox" name="birthday_alert"></td>';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
print '</tr>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print "</table><br>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print '<center><input type="submit" class="button" value="'.$langs->trans("Add").'"></center>';
|
|
|
|
|
|
|
|
|
|
|
|
print "</form>";
|
|
|
|
print "</form>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
elseif (GETPOST("action") == 'edit' && GETPOST("id"))
|
|
|
|
elseif (GETPOST("action") == 'edit' && GETPOST("id"))
|
|
|
|
@@ -521,7 +571,7 @@ else
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Fiche en mode edition
|
|
|
|
* Fiche en mode edition
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
// We set pays_id, and pays_code label of the chosen country
|
|
|
|
// We set pays_id, and pays_code label of the chosen country
|
|
|
|
if (isset($_POST["pays_id"]) || $object->fk_pays)
|
|
|
|
if (isset($_POST["pays_id"]) || $object->fk_pays)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@@ -538,22 +588,22 @@ else
|
|
|
|
$object->pays_code=$obj->code;
|
|
|
|
$object->pays_code=$obj->code;
|
|
|
|
$object->pays=$langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle;
|
|
|
|
$object->pays=$langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Affiche les erreurs
|
|
|
|
// Affiche les erreurs
|
|
|
|
dol_htmloutput_errors($mesg,$errors);
|
|
|
|
dol_htmloutput_errors($mesg,$errors);
|
|
|
|
|
|
|
|
|
|
|
|
if ($conf->use_javascript_ajax)
|
|
|
|
if ($conf->use_javascript_ajax)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
print "\n".'<script type="text/javascript" language="javascript">';
|
|
|
|
print '<script type="text/javascript" language="javascript">';
|
|
|
|
print 'jQuery(document).ready(function () {
|
|
|
|
print 'jQuery(document).ready(function () {
|
|
|
|
jQuery("#selectpays_id").change(function() {
|
|
|
|
jQuery("#selectpays_id").change(function() {
|
|
|
|
document.formsoc.action.value="edit";
|
|
|
|
document.formsoc.action.value="edit";
|
|
|
|
document.formsoc.submit();
|
|
|
|
document.formsoc.submit();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
})';
|
|
|
|
})';
|
|
|
|
print '</script>'."\n";
|
|
|
|
print '</script>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?id='.GETPOST("id").'" name="formsoc">';
|
|
|
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?id='.GETPOST("id").'" name="formsoc">';
|
|
|
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
|
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
|
|
print '<input type="hidden" name="id" value="'.GETPOST("id").'">';
|
|
|
|
print '<input type="hidden" name="id" value="'.GETPOST("id").'">';
|
|
|
|
@@ -562,55 +612,55 @@ else
|
|
|
|
print '<input type="hidden" name="old_name" value="'.$object->name.'">';
|
|
|
|
print '<input type="hidden" name="old_name" value="'.$object->name.'">';
|
|
|
|
print '<input type="hidden" name="old_firstname" value="'.$object->firstname.'">';
|
|
|
|
print '<input type="hidden" name="old_firstname" value="'.$object->firstname.'">';
|
|
|
|
print '<table class="border" width="100%">';
|
|
|
|
print '<table class="border" width="100%">';
|
|
|
|
|
|
|
|
|
|
|
|
// Ref
|
|
|
|
// Ref
|
|
|
|
print '<tr><td>'.$langs->trans("Ref").'</td><td colspan="3">';
|
|
|
|
print '<tr><td>'.$langs->trans("Ref").'</td><td colspan="3">';
|
|
|
|
print $object->ref;
|
|
|
|
print $object->ref;
|
|
|
|
print '</td></tr>';
|
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
// Name
|
|
|
|
// Name
|
|
|
|
print '<tr><td class="fieldrequired">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td><input name="name" type="text" size="20" maxlength="80" value="'.(isset($_POST["name"])?$_POST["name"]:$object->name).'"></td>';
|
|
|
|
print '<tr><td width="20%" class="fieldrequired">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td width="30%"><input name="name" type="text" size="20" maxlength="80" value="'.(isset($_POST["name"])?$_POST["name"]:$object->name).'"></td>';
|
|
|
|
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="25%"><input name="firstname" type="text" size="20" maxlength="80" value="'.(isset($_POST["firstname"])?$_POST["firstname"]:$object->firstname).'"></td></tr>';
|
|
|
|
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="30%"><input name="firstname" type="text" size="20" maxlength="80" value="'.(isset($_POST["firstname"])?$_POST["firstname"]:$object->firstname).'"></td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
// Company
|
|
|
|
// Company
|
|
|
|
print '<tr><td width="20%">'.$langs->trans("Company").'</td>';
|
|
|
|
print '<tr><td>'.$langs->trans("Company").'</td>';
|
|
|
|
print '<td colspan="3">';
|
|
|
|
print '<td colspan="3">';
|
|
|
|
print $form->select_societes(isset($_POST["socid"])?$_POST["socid"]:($object->socid?$object->socid:-1),'socid','',1);
|
|
|
|
print $form->select_societes(isset($_POST["socid"])?$_POST["socid"]:($object->socid?$object->socid:-1),'socid','',1);
|
|
|
|
print '</td>';
|
|
|
|
print '</td>';
|
|
|
|
print '</tr>';
|
|
|
|
print '</tr>';
|
|
|
|
|
|
|
|
|
|
|
|
// Civility
|
|
|
|
// Civility
|
|
|
|
print '<tr><td>'.$langs->trans("UserTitle").'</td><td colspan="3">';
|
|
|
|
print '<tr><td>'.$langs->trans("UserTitle").'</td><td colspan="3">';
|
|
|
|
print $formcompany->select_civilite(isset($_POST["civilite_id"])?$_POST["civilite_id"]:$object->civilite_id);
|
|
|
|
print $formcompany->select_civilite(isset($_POST["civilite_id"])?$_POST["civilite_id"]:$object->civilite_id);
|
|
|
|
print '</td></tr>';
|
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
print '<tr><td>'.$langs->trans("PostOrFunction" ).'</td><td colspan="3"><input name="poste" type="text" size="50" maxlength="80" value="'.(isset($_POST["poste"])?$_POST["poste"]:$object->poste).'"></td></tr>';
|
|
|
|
print '<tr><td>'.$langs->trans("PostOrFunction" ).'</td><td colspan="3"><input name="poste" type="text" size="50" maxlength="80" value="'.(isset($_POST["poste"])?$_POST["poste"]:$object->poste).'"></td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
// Address
|
|
|
|
// Address
|
|
|
|
print '<tr><td>'.$langs->trans("Address").'</td><td colspan="3"><textarea class="flat" name="address" cols="70">'.(isset($_POST["address"])?$_POST["address"]:$object->address).'</textarea></td>';
|
|
|
|
print '<tr><td>'.$langs->trans("Address").'</td><td colspan="3"><textarea class="flat" name="address" cols="70">'.(isset($_POST["address"])?$_POST["address"]:$object->address).'</textarea></td>';
|
|
|
|
|
|
|
|
|
|
|
|
// Zip / Town
|
|
|
|
// Zip / Town
|
|
|
|
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td colspan="3"><input name="cp" type="text" size="6" maxlength="80" value="'.(isset($_POST["cp"])?$_POST["cp"]:$object->cp).'"> ';
|
|
|
|
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td colspan="3"><input name="cp" type="text" size="6" maxlength="80" value="'.(isset($_POST["cp"])?$_POST["cp"]:$object->cp).'"> ';
|
|
|
|
print '<input name="ville" type="text" size="20" value="'.(isset($_POST["ville"])?$_POST["ville"]:$object->ville).'" maxlength="80"></td></tr>';
|
|
|
|
print '<input name="ville" type="text" size="20" value="'.(isset($_POST["ville"])?$_POST["ville"]:$object->ville).'" maxlength="80"></td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
// Country
|
|
|
|
// Country
|
|
|
|
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">';
|
|
|
|
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">';
|
|
|
|
$form->select_pays(isset($_POST["pays_id"])?$_POST["pays_id"]:$object->fk_pays,'pays_id');
|
|
|
|
$form->select_pays(isset($_POST["pays_id"])?$_POST["pays_id"]:$object->fk_pays,'pays_id');
|
|
|
|
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
|
|
|
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
|
|
|
print '</td></tr>';
|
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
// Department
|
|
|
|
// Department
|
|
|
|
print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">';
|
|
|
|
print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">';
|
|
|
|
$formcompany->select_departement($object->fk_departement,$object->pays_code);
|
|
|
|
$formcompany->select_departement($object->fk_departement,$object->pays_code);
|
|
|
|
print '</td></tr>';
|
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
// Phone
|
|
|
|
// Phone
|
|
|
|
print '<tr><td>'.$langs->trans("PhonePro").'</td><td><input name="phone_pro" type="text" size="18" maxlength="80" value="'.(isset($_POST["phone_pro"])?$_POST["phone_pro"]:$object->phone_pro).'"></td>';
|
|
|
|
print '<tr><td>'.$langs->trans("PhonePro").'</td><td><input name="phone_pro" type="text" size="18" maxlength="80" value="'.(isset($_POST["phone_pro"])?$_POST["phone_pro"]:$object->phone_pro).'"></td>';
|
|
|
|
print '<td>'.$langs->trans("PhonePerso").'</td><td><input name="phone_perso" type="text" size="18" maxlength="80" value="'.(isset($_POST["phone_perso"])?$_POST["phone_perso"]:$object->phone_perso).'"></td></tr>';
|
|
|
|
print '<td>'.$langs->trans("PhonePerso").'</td><td><input name="phone_perso" type="text" size="18" maxlength="80" value="'.(isset($_POST["phone_perso"])?$_POST["phone_perso"]:$object->phone_perso).'"></td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input name="phone_mobile" type="text" size="18" maxlength="80" value="'.(isset($_POST["phone_mobile"])?$_POST["phone_mobile"]:$object->phone_mobile).'"></td>';
|
|
|
|
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input name="phone_mobile" type="text" size="18" maxlength="80" value="'.(isset($_POST["phone_mobile"])?$_POST["phone_mobile"]:$object->phone_mobile).'"></td>';
|
|
|
|
print '<td>'.$langs->trans("Fax").'</td><td><input name="fax" type="text" size="18" maxlength="80" value="'.(isset($_POST["fax"])?$_POST["fax"]:$object->fax).'"></td></tr>';
|
|
|
|
print '<td>'.$langs->trans("Fax").'</td><td><input name="fax" type="text" size="18" maxlength="80" value="'.(isset($_POST["fax"])?$_POST["fax"]:$object->fax).'"></td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
// EMail
|
|
|
|
// EMail
|
|
|
|
print '<tr><td>'.$langs->trans("EMail").'</td><td><input name="email" type="text" size="40" maxlength="80" value="'.(isset($_POST["email"])?$_POST["email"]:$object->email).'"></td>';
|
|
|
|
print '<tr><td>'.$langs->trans("EMail").'</td><td><input name="email" type="text" size="40" maxlength="80" value="'.(isset($_POST["email"])?$_POST["email"]:$object->email).'"></td>';
|
|
|
|
if ($conf->mailing->enabled)
|
|
|
|
if ($conf->mailing->enabled)
|
|
|
|
@@ -624,51 +674,51 @@ else
|
|
|
|
print '<td colspan="2"> </td>';
|
|
|
|
print '<td colspan="2"> </td>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
print '</tr>';
|
|
|
|
print '</tr>';
|
|
|
|
|
|
|
|
|
|
|
|
// Jabberid
|
|
|
|
// Jabberid
|
|
|
|
print '<tr><td>Jabberid</td><td colspan="3"><input name="jabberid" type="text" size="40" maxlength="80" value="'.(isset($_POST["jabberid"])?$_POST["jabberid"]:$object->jabberid).'"></td></tr>';
|
|
|
|
print '<tr><td>Jabberid</td><td colspan="3"><input name="jabberid" type="text" size="40" maxlength="80" value="'.(isset($_POST["jabberid"])?$_POST["jabberid"]:$object->jabberid).'"></td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
// Visibility
|
|
|
|
// Visibility
|
|
|
|
print '<tr><td>'.$langs->trans("ContactVisibility").'</td><td colspan="3">';
|
|
|
|
print '<tr><td>'.$langs->trans("ContactVisibility").'</td><td colspan="3">';
|
|
|
|
$selectarray=array('0'=>$langs->trans("ContactPublic"),'1'=>$langs->trans("ContactPrivate"));
|
|
|
|
$selectarray=array('0'=>$langs->trans("ContactPublic"),'1'=>$langs->trans("ContactPrivate"));
|
|
|
|
print $form->selectarray('priv',$selectarray,$object->priv,0);
|
|
|
|
print $form->selectarray('priv',$selectarray,$object->priv,0);
|
|
|
|
print '</td></tr>';
|
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
print '<tr><td valign="top">'.$langs->trans("Note").'</td><td colspan="3">';
|
|
|
|
print '<tr><td valign="top">'.$langs->trans("Note").'</td><td colspan="3">';
|
|
|
|
print '<textarea name="note" cols="70" rows="'.ROWS_3.'">';
|
|
|
|
print '<textarea name="note" cols="70" rows="'.ROWS_3.'">';
|
|
|
|
print isset($_POST["note"])?$_POST["note"]:$object->note;
|
|
|
|
print isset($_POST["note"])?$_POST["note"]:$object->note;
|
|
|
|
print '</textarea></td></tr>';
|
|
|
|
print '</textarea></td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
$object->load_ref_elements();
|
|
|
|
$object->load_ref_elements();
|
|
|
|
|
|
|
|
|
|
|
|
if ($conf->commande->enabled)
|
|
|
|
if ($conf->commande->enabled)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
print '<tr><td>'.$langs->trans("ContactForOrders").'</td><td colspan="3">';
|
|
|
|
print '<tr><td>'.$langs->trans("ContactForOrders").'</td><td colspan="3">';
|
|
|
|
print $object->ref_commande?$object->ref_commande:$langs->trans("NoContactForAnyOrder");
|
|
|
|
print $object->ref_commande?$object->ref_commande:$langs->trans("NoContactForAnyOrder");
|
|
|
|
print '</td></tr>';
|
|
|
|
print '</td></tr>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($conf->propal->enabled)
|
|
|
|
if ($conf->propal->enabled)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
print '<tr><td>'.$langs->trans("ContactForProposals").'</td><td colspan="3">';
|
|
|
|
print '<tr><td>'.$langs->trans("ContactForProposals").'</td><td colspan="3">';
|
|
|
|
print $object->ref_propal?$object->ref_propal:$langs->trans("NoContactForAnyProposal");
|
|
|
|
print $object->ref_propal?$object->ref_propal:$langs->trans("NoContactForAnyProposal");
|
|
|
|
print '</td></tr>';
|
|
|
|
print '</td></tr>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($conf->contrat->enabled)
|
|
|
|
if ($conf->contrat->enabled)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
print '<tr><td>'.$langs->trans("ContactForContracts").'</td><td colspan="3">';
|
|
|
|
print '<tr><td>'.$langs->trans("ContactForContracts").'</td><td colspan="3">';
|
|
|
|
print $object->ref_contrat?$object->ref_contrat:$langs->trans("NoContactForAnyContract");
|
|
|
|
print $object->ref_contrat?$object->ref_contrat:$langs->trans("NoContactForAnyContract");
|
|
|
|
print '</td></tr>';
|
|
|
|
print '</td></tr>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($conf->facture->enabled)
|
|
|
|
if ($conf->facture->enabled)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
print '<tr><td>'.$langs->trans("ContactForInvoices").'</td><td colspan="3">';
|
|
|
|
print '<tr><td>'.$langs->trans("ContactForInvoices").'</td><td colspan="3">';
|
|
|
|
print $object->ref_facturation?$object->ref_facturation:$langs->trans("NoContactForAnyInvoice");
|
|
|
|
print $object->ref_facturation?$object->ref_facturation:$langs->trans("NoContactForAnyInvoice");
|
|
|
|
print '</td></tr>';
|
|
|
|
print '</td></tr>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Login Dolibarr
|
|
|
|
// Login Dolibarr
|
|
|
|
print '<tr><td>'.$langs->trans("DolibarrLogin").'</td><td colspan="3">';
|
|
|
|
print '<tr><td>'.$langs->trans("DolibarrLogin").'</td><td colspan="3">';
|
|
|
|
if ($object->user_id)
|
|
|
|
if ($object->user_id)
|
|
|
|
@@ -679,22 +729,23 @@ else
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else print $langs->trans("NoDolibarrAccess");
|
|
|
|
else print $langs->trans("NoDolibarrAccess");
|
|
|
|
print '</td></tr>';
|
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
print '<tr><td colspan="4" align="center">';
|
|
|
|
print '</table><br>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print '<center>';
|
|
|
|
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
|
|
|
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
|
|
|
print ' ';
|
|
|
|
print ' ';
|
|
|
|
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
|
|
|
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
|
|
|
print '</td></tr>';
|
|
|
|
print '</center>';
|
|
|
|
print '</table>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print "</form>";
|
|
|
|
print "</form>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (GETPOST("id") && GETPOST("action") != 'edit')
|
|
|
|
if (GETPOST("id") && GETPOST("action") != 'edit')
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$objsoc = new Societe($db);
|
|
|
|
$objsoc = new Societe($db);
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Fiche en mode visualisation
|
|
|
|
* Fiche en mode visualisation
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@@ -703,29 +754,29 @@ else
|
|
|
|
$langs->load("errors");
|
|
|
|
$langs->load("errors");
|
|
|
|
print '<div class="error">'.$langs->trans($msg).'</div>';
|
|
|
|
print '<div class="error">'.$langs->trans($msg).'</div>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($_GET["action"] == 'create_user')
|
|
|
|
if ($_GET["action"] == 'create_user')
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$login=strtolower(substr(dol_string_unaccent($object->prenom), 0, 4)) . strtolower(substr(dol_string_unaccent($object->nom), 0, 4));
|
|
|
|
$login=strtolower(substr(dol_string_unaccent($object->prenom), 0, 4)) . strtolower(substr(dol_string_unaccent($object->nom), 0, 4));
|
|
|
|
|
|
|
|
|
|
|
|
// Create a form array
|
|
|
|
// Create a form array
|
|
|
|
$formquestion=array(array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login));
|
|
|
|
$formquestion=array(array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login));
|
|
|
|
|
|
|
|
|
|
|
|
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("CreateDolibarrLogin"),$langs->trans("ConfirmCreateContact"),"confirm_create_user",$formquestion);
|
|
|
|
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("CreateDolibarrLogin"),$langs->trans("ConfirmCreateContact"),"confirm_create_user",$formquestion);
|
|
|
|
if ($ret == 'html') print '<br>';
|
|
|
|
if ($ret == 'html') print '<br>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
print '<table class="border" width="100%">';
|
|
|
|
print '<table class="border" width="100%">';
|
|
|
|
|
|
|
|
|
|
|
|
// Ref
|
|
|
|
// Ref
|
|
|
|
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
|
|
|
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
|
|
|
print $form->showrefnav($object,'id');
|
|
|
|
print $form->showrefnav($object,'id');
|
|
|
|
print '</td></tr>';
|
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
// Name
|
|
|
|
// Name
|
|
|
|
print '<tr><td width="20%">'.$langs->trans("Lastname").'</td><td width="30%">'.$object->name.'</td>';
|
|
|
|
print '<tr><td width="20%">'.$langs->trans("Lastname").'</td><td width="30%">'.$object->name.'</td>';
|
|
|
|
print '<td width="25%">'.$langs->trans("Firstname").'</td><td width="25%">'.$object->firstname.'</td></tr>';
|
|
|
|
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="30%">'.$object->firstname.'</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
// Company
|
|
|
|
// Company
|
|
|
|
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="3">';
|
|
|
|
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="3">';
|
|
|
|
if ($object->socid > 0)
|
|
|
|
if ($object->socid > 0)
|
|
|
|
@@ -738,40 +789,40 @@ else
|
|
|
|
print $langs->trans("ContactNotLinkedToCompany");
|
|
|
|
print $langs->trans("ContactNotLinkedToCompany");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
print '</td></tr>';
|
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
// Civility
|
|
|
|
// Civility
|
|
|
|
print '<tr><td width="15%">'.$langs->trans("UserTitle").'</td><td colspan="3">';
|
|
|
|
print '<tr><td width="15%">'.$langs->trans("UserTitle").'</td><td colspan="3">';
|
|
|
|
print $object->getCivilityLabel();
|
|
|
|
print $object->getCivilityLabel();
|
|
|
|
print '</td></tr>';
|
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
print '<tr><td>'.$langs->trans("PostOrFunction" ).'</td><td colspan="3">'.$object->poste.'</td>';
|
|
|
|
print '<tr><td>'.$langs->trans("PostOrFunction" ).'</td><td colspan="3">'.$object->poste.'</td>';
|
|
|
|
|
|
|
|
|
|
|
|
// Address
|
|
|
|
// Address
|
|
|
|
print '<tr><td>'.$langs->trans("Address").'</td><td colspan="3">'.nl2br($object->address).'</td></tr>';
|
|
|
|
print '<tr><td>'.$langs->trans("Address").'</td><td colspan="3">'.nl2br($object->address).'</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
// Zip Town
|
|
|
|
// Zip Town
|
|
|
|
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td colspan="3">';
|
|
|
|
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td colspan="3">';
|
|
|
|
print $object->cp;
|
|
|
|
print $object->cp;
|
|
|
|
if ($object->cp) print ' ';
|
|
|
|
if ($object->cp) print ' ';
|
|
|
|
print $object->ville.'</td></tr>';
|
|
|
|
print $object->ville.'</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
// Country
|
|
|
|
// Country
|
|
|
|
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">';
|
|
|
|
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">';
|
|
|
|
$img=picto_from_langcode($object->pays_code);
|
|
|
|
$img=picto_from_langcode($object->pays_code);
|
|
|
|
if ($img) print $img.' ';
|
|
|
|
if ($img) print $img.' ';
|
|
|
|
print $object->pays;
|
|
|
|
print $object->pays;
|
|
|
|
print '</td></tr>';
|
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
// Department
|
|
|
|
// Department
|
|
|
|
print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">'.$object->departement.'</td>';
|
|
|
|
print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">'.$object->departement.'</td>';
|
|
|
|
|
|
|
|
|
|
|
|
// Phone
|
|
|
|
// Phone
|
|
|
|
print '<tr><td>'.$langs->trans("PhonePro").'</td><td>'.dol_print_phone($object->phone_pro,$object->pays_code,$object->id,$object->socid,'AC_TEL').'</td>';
|
|
|
|
print '<tr><td>'.$langs->trans("PhonePro").'</td><td>'.dol_print_phone($object->phone_pro,$object->pays_code,$object->id,$object->socid,'AC_TEL').'</td>';
|
|
|
|
print '<td>'.$langs->trans("PhonePerso").'</td><td>'.dol_print_phone($object->phone_perso,$object->pays_code,$object->id,$object->socid,'AC_TEL').'</td></tr>';
|
|
|
|
print '<td>'.$langs->trans("PhonePerso").'</td><td>'.dol_print_phone($object->phone_perso,$object->pays_code,$object->id,$object->socid,'AC_TEL').'</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td>'.dol_print_phone($object->phone_mobile,$object->pays_code,$object->id,$object->socid,'AC_TEL').'</td>';
|
|
|
|
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td>'.dol_print_phone($object->phone_mobile,$object->pays_code,$object->id,$object->socid,'AC_TEL').'</td>';
|
|
|
|
print '<td>'.$langs->trans("Fax").'</td><td>'.dol_print_phone($object->fax,$object->pays_code,$object->id,$object->socid,'AC_FAX').'</td></tr>';
|
|
|
|
print '<td>'.$langs->trans("Fax").'</td><td>'.dol_print_phone($object->fax,$object->pays_code,$object->id,$object->socid,'AC_FAX').'</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
// Email
|
|
|
|
// Email
|
|
|
|
print '<tr><td>'.$langs->trans("EMail").'</td><td>'.dol_print_email($object->email,$object->id,$object->socid,'AC_EMAIL').'</td>';
|
|
|
|
print '<tr><td>'.$langs->trans("EMail").'</td><td>'.dol_print_email($object->email,$object->id,$object->socid,'AC_EMAIL').'</td>';
|
|
|
|
if ($conf->mailing->enabled)
|
|
|
|
if ($conf->mailing->enabled)
|
|
|
|
@@ -785,48 +836,48 @@ else
|
|
|
|
print '<td colspan="2"> </td>';
|
|
|
|
print '<td colspan="2"> </td>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
print '</tr>';
|
|
|
|
print '</tr>';
|
|
|
|
|
|
|
|
|
|
|
|
// Jabberid
|
|
|
|
// Jabberid
|
|
|
|
print '<tr><td>Jabberid</td><td colspan="3">'.$object->jabberid.'</td></tr>';
|
|
|
|
print '<tr><td>Jabberid</td><td colspan="3">'.$object->jabberid.'</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
print '<tr><td>'.$langs->trans("ContactVisibility").'</td><td colspan="3">';
|
|
|
|
print '<tr><td>'.$langs->trans("ContactVisibility").'</td><td colspan="3">';
|
|
|
|
print $object->LibPubPriv($object->priv);
|
|
|
|
print $object->LibPubPriv($object->priv);
|
|
|
|
print '</td></tr>';
|
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
print '<tr><td valign="top">'.$langs->trans("Note").'</td><td colspan="3">';
|
|
|
|
print '<tr><td valign="top">'.$langs->trans("Note").'</td><td colspan="3">';
|
|
|
|
print nl2br($object->note);
|
|
|
|
print nl2br($object->note);
|
|
|
|
print '</td></tr>';
|
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
$object->load_ref_elements();
|
|
|
|
$object->load_ref_elements();
|
|
|
|
|
|
|
|
|
|
|
|
if ($conf->commande->enabled)
|
|
|
|
if ($conf->commande->enabled)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
print '<tr><td>'.$langs->trans("ContactForOrders").'</td><td colspan="3">';
|
|
|
|
print '<tr><td>'.$langs->trans("ContactForOrders").'</td><td colspan="3">';
|
|
|
|
print $object->ref_commande?$object->ref_commande:$langs->trans("NoContactForAnyOrder");
|
|
|
|
print $object->ref_commande?$object->ref_commande:$langs->trans("NoContactForAnyOrder");
|
|
|
|
print '</td></tr>';
|
|
|
|
print '</td></tr>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($conf->propal->enabled)
|
|
|
|
if ($conf->propal->enabled)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
print '<tr><td>'.$langs->trans("ContactForProposals").'</td><td colspan="3">';
|
|
|
|
print '<tr><td>'.$langs->trans("ContactForProposals").'</td><td colspan="3">';
|
|
|
|
print $object->ref_propal?$object->ref_propal:$langs->trans("NoContactForAnyProposal");
|
|
|
|
print $object->ref_propal?$object->ref_propal:$langs->trans("NoContactForAnyProposal");
|
|
|
|
print '</td></tr>';
|
|
|
|
print '</td></tr>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($conf->contrat->enabled)
|
|
|
|
if ($conf->contrat->enabled)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
print '<tr><td>'.$langs->trans("ContactForContracts").'</td><td colspan="3">';
|
|
|
|
print '<tr><td>'.$langs->trans("ContactForContracts").'</td><td colspan="3">';
|
|
|
|
print $object->ref_contrat?$object->ref_contrat:$langs->trans("NoContactForAnyContract");
|
|
|
|
print $object->ref_contrat?$object->ref_contrat:$langs->trans("NoContactForAnyContract");
|
|
|
|
print '</td></tr>';
|
|
|
|
print '</td></tr>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($conf->facture->enabled)
|
|
|
|
if ($conf->facture->enabled)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
print '<tr><td>'.$langs->trans("ContactForInvoices").'</td><td colspan="3">';
|
|
|
|
print '<tr><td>'.$langs->trans("ContactForInvoices").'</td><td colspan="3">';
|
|
|
|
print $object->ref_facturation?$object->ref_facturation:$langs->trans("NoContactForAnyInvoice");
|
|
|
|
print $object->ref_facturation?$object->ref_facturation:$langs->trans("NoContactForAnyInvoice");
|
|
|
|
print '</td></tr>';
|
|
|
|
print '</td></tr>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
print '<tr><td>'.$langs->trans("DolibarrLogin").'</td><td colspan="3">';
|
|
|
|
print '<tr><td>'.$langs->trans("DolibarrLogin").'</td><td colspan="3">';
|
|
|
|
if ($object->user_id)
|
|
|
|
if ($object->user_id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@@ -836,36 +887,36 @@ else
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else print $langs->trans("NoDolibarrAccess");
|
|
|
|
else print $langs->trans("NoDolibarrAccess");
|
|
|
|
print '</td></tr>';
|
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
print "</table>";
|
|
|
|
print "</table>";
|
|
|
|
|
|
|
|
|
|
|
|
print "</div>";
|
|
|
|
print "</div>";
|
|
|
|
|
|
|
|
|
|
|
|
// Barre d'actions
|
|
|
|
// Barre d'actions
|
|
|
|
if (! $user->societe_id)
|
|
|
|
if (! $user->societe_id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
print '<div class="tabsAction">';
|
|
|
|
print '<div class="tabsAction">';
|
|
|
|
|
|
|
|
|
|
|
|
if ($user->rights->societe->contact->creer)
|
|
|
|
if ($user->rights->societe->contact->creer)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
print '<a class="butAction" href="fiche.php?id='.$object->id.'&action=edit">'.$langs->trans('Modify').'</a>';
|
|
|
|
print '<a class="butAction" href="fiche.php?id='.$object->id.'&action=edit">'.$langs->trans('Modify').'</a>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (! $object->user_id && $user->rights->user->user->creer)
|
|
|
|
if (! $object->user_id && $user->rights->user->user->creer)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
print '<a class="butAction" href="fiche.php?id='.$object->id.'&action=create_user">'.$langs->trans("CreateDolibarrLogin").'</a>';
|
|
|
|
print '<a class="butAction" href="fiche.php?id='.$object->id.'&action=create_user">'.$langs->trans("CreateDolibarrLogin").'</a>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($user->rights->societe->contact->supprimer)
|
|
|
|
if ($user->rights->societe->contact->supprimer)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
print '<a class="butActionDelete" href="fiche.php?id='.$object->id.'&action=delete">'.$langs->trans('Delete').'</a>';
|
|
|
|
print '<a class="butActionDelete" href="fiche.php?id='.$object->id.'&action=delete">'.$langs->trans('Delete').'</a>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
print "</div><br>";
|
|
|
|
print "</div><br>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
print show_actions_todo($conf,$langs,$db,$objsoc,$object);
|
|
|
|
print show_actions_todo($conf,$langs,$db,$objsoc,$object);
|
|
|
|
|
|
|
|
|
|
|
|
print show_actions_done($conf,$langs,$db,$objsoc,$object);
|
|
|
|
print show_actions_done($conf,$langs,$db,$objsoc,$object);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|