Add "cancel" button on contact creation.

This commit is contained in:
Laurent Destailleur 2011-03-20 22:22:26 +00:00
parent 29bfeabcee
commit 4ea973ee42

View File

@ -125,8 +125,15 @@ else
} }
} }
// Creation contact // Cancel
if ($_POST["action"] == 'add' && $user->rights->societe->contact->creer) if (GETPOST("cancel") && GETPOST('backtopage'))
{
header("Location: ".GETPOST('backtopage'));
exit;
}
// Add contact
if (GETPOST("action") == 'add' && $user->rights->societe->contact->creer)
{ {
$error=0; $error=0;
@ -467,8 +474,7 @@ else
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 '<input type="hidden" name="backtopage" value="'.GETPOST("backtopage").'">'; print '<input type="hidden" name="backtopage" value="'.GETPOST('backtopage').'">';
print '<input type="hidden" name="action" value="add">';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Name // Name
@ -592,7 +598,14 @@ else
print "</table><br>"; print "</table><br>";
print '<center><input type="submit" class="button" value="'.$langs->trans("Add").'"></center>'; print '<center>';
print '<input type="submit" class="button" name="add" value="'.$langs->trans("Add").'">';
if (GETPOST('backtopage'))
{
print ' &nbsp; &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
}
print '</center>';
print "</form>"; print "</form>";
} }