diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index 6e60c308144..65660b5fc02 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -181,6 +181,16 @@ class ActionsContactCardCommon if ($action == 'view') { + if ($_GET["action"] == 'create_user') + { + $login=strtolower(substr($this->object->prenom, 0, 4)) . strtolower(substr($this->object->nom, 0, 4)); + + // Create a form array + $formquestion=array(array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login)); + + $this->tpl['action_create_user'] = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$this->object->id,$langs->trans("CreateDolibarrLogin"),$langs->trans("ConfirmCreateContact"),"confirm_create_user",$formquestion); + } + $this->tpl['showrefnav'] = $form->showrefnav($this->object,'id'); if ($this->object->socid > 0) diff --git a/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php b/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php index 8c1c10a81fa..70ad78c5581 100644 --- a/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php +++ b/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php @@ -21,6 +21,7 @@ +control->tpl['action_create_user']) echo $this->control->tpl['action_create_user']; ?> control->tpl['action_delete']) echo $this->control->tpl['action_delete']; ?>