diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 54a00f048318ffa5df2eb3468895690e3a6f6407..191ac35a3d1d3aed7da63818a46a5c50eb9f2548 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -34,8 +34,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $langs->load("members"); -$rowid = GETPOST('rowid','int'); -$action = GETPOST('action','alpha'); +$rowid = GETPOST('rowid','int'); +$action = GETPOST('action','alpha'); +$cancel = GETPOST('cancel','alpha'); $search_lastname = GETPOST('search_lastname','alpha'); $search_login = GETPOST('search_login','alpha'); @@ -85,7 +86,7 @@ $hookmanager->initHooks(array('membertypecard','globalcard')); */ if ($action == 'add' && $user->rights->adherent->configurer) { - if ($_POST["button"] != $langs->trans("Cancel")) + if (! $cancel) { $object = new AdherentType($db); @@ -123,7 +124,7 @@ if ($action == 'add' && $user->rights->adherent->configurer) if ($action == 'update' && $user->rights->adherent->configurer) { - if ($_POST["button"] != $langs->trans("Cancel")) + if (! $cancel) { $object = new AdherentType($db); $object->id = $rowid; @@ -152,14 +153,6 @@ if ($action == 'delete' && $user->rights->adherent->configurer) exit; } -if ($action == 'commentaire' && $user->rights->adherent->configurer) -{ - $don = new Don($db); - $don->fetch($rowid); - $don->update_note(dol_html_entity_decode(GETPOST('commentaire'), ENT_QUOTES)); -} - - /* * View */ @@ -291,7 +284,7 @@ if ($action == 'create') print '<div class="center">'; print '<input type="submit" name="button" class="button" value="'.$langs->trans("Add").'">'; print ' '; - print '<input type="submit" name="button" class="button" value="'.$langs->trans("Cancel").'">'; + print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'" onclick="history.go(-1)" />'; print '</div>'; print "</form>\n";