Works on contact canvas in relation to the thirdparty canvas module
This commit is contained in:
parent
44119719b8
commit
13c8aedb99
@ -332,19 +332,20 @@ if (! empty($canvas))
|
||||
print '<div class="error">'.$langs->trans($msg).'</div>';
|
||||
}
|
||||
|
||||
// Fetch object
|
||||
$result=$objcanvas->fetch($id);
|
||||
|
||||
if ($_GET["action"] == 'create_user')
|
||||
{
|
||||
$login=strtolower(substr($object->prenom, 0, 4)) . strtolower(substr($object->nom, 0, 4));
|
||||
$login=strtolower(substr($objcanvas->control->object->prenom, 0, 4)) . strtolower(substr($objcanvas->control->object->nom, 0, 4));
|
||||
|
||||
// Create a form array
|
||||
$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=".$id,$langs->trans("CreateDolibarrLogin"),$langs->trans("ConfirmCreateContact"),"confirm_create_user",$formquestion);
|
||||
if ($ret == 'html') print '<br>';
|
||||
}
|
||||
|
||||
// Fetch object
|
||||
$result=$objcanvas->fetch($id);
|
||||
if ($result > 0)
|
||||
{
|
||||
// Card header
|
||||
@ -365,25 +366,25 @@ if (! empty($canvas))
|
||||
|
||||
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='.$id.'&action=edit&canvas='.$canvas.'">'.$langs->trans('Modify').'</a>';
|
||||
}
|
||||
|
||||
if (! $object->user_id && $user->rights->user->user->creer)
|
||||
if (! $objcanvas->control->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='.$id.'&action=create_user&canvas='.$canvas.'">'.$langs->trans("CreateDolibarrLogin").'</a>';
|
||||
}
|
||||
|
||||
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='.$id.'&action=delete&canvas='.$canvas.'">'.$langs->trans('Delete').'</a>';
|
||||
}
|
||||
|
||||
print "</div><br>";
|
||||
}
|
||||
|
||||
print show_actions_todo($conf,$langs,$db,$objsoc,$object);
|
||||
print show_actions_todo($conf,$langs,$db,$objsoc,$objcanvas->control->object);
|
||||
|
||||
print show_actions_done($conf,$langs,$db,$objsoc,$object);
|
||||
print show_actions_done($conf,$langs,$db,$objsoc,$objcanvas->control->object);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user