diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php
index bbe9979891a..dfecc6f2af0 100644
--- a/htdocs/contact/canvas/actions_contactcard_common.class.php
+++ b/htdocs/contact/canvas/actions_contactcard_common.class.php
@@ -265,6 +265,8 @@ class ActionsContactCardCommon
{
global $conf, $user, $langs;
+ $errors='';
+
// Creation utilisateur depuis contact
if (GETPOST("action") == 'confirm_create_user' && GETPOST("confirm") == 'yes' && $user->rights->user->user->creer)
{
@@ -279,13 +281,15 @@ class ActionsContactCardCommon
if ($result < 0)
{
- $msg=$nuser->error;
+ $errors=$nuser->error;
}
}
else
{
- $msg=$object->error;
+ $errors=$this->object->error;
}
+
+ return $errors;
}
// Creation contact
@@ -313,6 +317,8 @@ class ActionsContactCardCommon
$_GET["action"] = $_POST["action"] = 'create';
}
}
+
+ return $errors;
}
if (GETPOST("action") == 'confirm_delete' && GETPOST("confirm") == 'yes' && $user->rights->societe->contact->supprimer)
@@ -330,8 +336,10 @@ class ActionsContactCardCommon
}
else
{
- $mesg=$this->object->error;
+ $errors=$this->object->error;
}
+
+ return $errors;
}
if ($_POST["action"] == 'update' && ! $_POST["cancel"] && $user->rights->societe->contact->creer)
@@ -360,9 +368,11 @@ class ActionsContactCardCommon
}
else
{
- $mesg=$this->object->error;
+ $errors=$this->object->error;
}
}
+
+ return $errors;
}
}
diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php
index f93ae6c8a64..ef061259f19 100644
--- a/htdocs/contact/fiche.php
+++ b/htdocs/contact/fiche.php
@@ -80,7 +80,7 @@ if (! empty($canvas))
// -----------------------------------------
// Load data control
- $objcanvas->doActions($id);
+ $msg = $objcanvas->doActions($id);
}
else
{
@@ -249,6 +249,18 @@ if (! empty($canvas))
// When used with CANVAS
// -----------------------------------------
+ /*
+ * Confirmation de la suppression du contact
+ */
+ if ($user->rights->societe->contact->supprimer)
+ {
+ if ($_GET["action"] == 'delete')
+ {
+ $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"],$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete",'',0,1);
+ if ($ret == 'html') print '
';
+ }
+ }
+
if ($user->rights->societe->contact->creer)
{
if (GETPOST("action") == 'create')
@@ -313,6 +325,23 @@ if (! empty($canvas))
{
// Set action type
$objcanvas->setAction('view');
+
+ if ($msg)
+ {
+ $langs->load("errors");
+ print '