diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php
index 588ce2b01ff..742378a2db3 100644
--- a/htdocs/contact/card.php
+++ b/htdocs/contact/card.php
@@ -201,12 +201,12 @@ if (empty($reshook))
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
- if ($ret < 0)
+ if ($ret < 0)
{
$error++;
$action = 'create';
}
-
+
if (! GETPOST("lastname"))
{
$error++; $errors[]=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname").' / '.$langs->transnoentities("Label"));
@@ -1105,18 +1105,14 @@ else
{
if ($user->rights->societe->contact->creer)
{
- print ''.$langs->trans('Modify').'';
+ print ''.$langs->trans('Modify').'';
}
if (! $object->user_id && $user->rights->user->user->creer)
{
- print ''.$langs->trans("CreateDolibarrLogin").'';
+ print ''.$langs->trans("CreateDolibarrLogin").'';
}
- if ($user->rights->societe->contact->supprimer)
- {
- print ''.$langs->trans('Delete').'';
- }
// Activer
if ($object->statut == 0 && $user->rights->societe->contact->creer)
{
@@ -1126,6 +1122,12 @@ else
if ($object->statut == 1 && $user->rights->societe->contact->creer)
{
print ''.$langs->trans("DisableUser").'';
+ }
+
+ // Delete
+ if ($user->rights->societe->contact->supprimer)
+ {
+ print ''.$langs->trans('Delete').'';
}
}
diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php
index 2241a1e67f1..9a5ab3b0f07 100644
--- a/htdocs/contact/document.php
+++ b/htdocs/contact/document.php
@@ -80,8 +80,9 @@ llxHeader("",$langs->trans("Contact"), $helpurl);
if ($object->id)
{
$head = contact_prepare_head($object);
+ $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
- dol_fiche_head($head, 'documents', $langs->trans("Contact"), 0, 'contact');
+ dol_fiche_head($head, 'documents', $title, 0, 'contact');
// Construit liste des fichiers
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index d05e727d699..860475c5596 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -311,7 +311,7 @@ if (empty($reshook))
$result = $object->setValid($user);
if ($result <= 0)
{
- setEventMessage($object->error, 'errors');
+ setEventMessages($object->error, $object->errors, 'errors');
}
}
@@ -320,7 +320,7 @@ if (empty($reshook))
$result = $object->setClose($user);
if ($result <= 0)
{
- setEventMessage($object->error, 'errors');
+ setEventMessages($object->error, $object->errors, 'errors');
}
}
@@ -329,7 +329,7 @@ if (empty($reshook))
$result = $object->setValid($user);
if ($result <= 0)
{
- setEventMessage($object->error, 'errors');
+ setEventMessages($object->error, $object->errors, 'errors');
}
}
@@ -339,14 +339,14 @@ if (empty($reshook))
$result=$object->delete($user);
if ($result > 0)
{
- header("Location: index.php");
+ setEventMessage($langs->trans("RecordDeleted"), 'info');
+ header("Location: index.php");
exit;
}
else
{
dol_syslog($object->error,LOG_DEBUG);
- setEventMessage($object->error,'errors');
- setEventMessage($object->errors,'errors');
+ setEventMessages($object->error, $object->errors, 'errors');
}
}
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index a5ae027d2b7..157fd26829c 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -515,7 +515,7 @@ class Project extends CommonObject
// Set fk_projet into elements to null
$listoftables=array(
'facture'=>'fk_projet','propal'=>'fk_projet','commande'=>'fk_projet','facture_fourn'=>'fk_projet','commande_fournisseur'=>'fk_projet',
- 'expensereport_det'=>'fk_projet','contrat'=>'fk_projet','fichinter'=>'fk_projet','don'=>'fk_project'
+ 'expensereport_det'=>'fk_projet','contrat'=>'fk_projet','fichinter'=>'fk_projet','don'=>'fk_projet'
);
foreach($listoftables as $key => $value)
{