diff --git a/ChangeLog b/ChangeLog
index e2325cf8433..f21ab790c3a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,7 @@ For users:
- New: Add bank account on payment list of invoice card.
- New: Cloning project allow to clones task, notes, files, contacts.
- New: Enhance default style.
+- New: Can edit and resiliate member status from list.
For developers:
- New: A module can overwrite templates parts.
diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php
index cd15b82eb42..c729a455388 100644
--- a/htdocs/adherents/fiche.php
+++ b/htdocs/adherents/fiche.php
@@ -43,6 +43,7 @@ $langs->load("users");
$action=GETPOST('action','alpha');
+$backtopage=GETPOST('backtopage','alpha');
$confirm=GETPOST('confirm','alpha');
$rowid=GETPOST('rowid','int');
$typeid=GETPOST('typeid','int');
@@ -331,6 +332,12 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer)
$rowid=$object->id;
$action='';
+
+ if (! empty($backtopage))
+ {
+ header("Location: ".$backtopage);
+ exit;
+ }
}
else
{
@@ -505,8 +512,16 @@ if ($user->rights->adherent->supprimer && $action == 'confirm_delete' && $confir
$result=$object->delete($rowid);
if ($result > 0)
{
- Header("Location: liste.php");
- exit;
+ if (! empty($backtopage))
+ {
+ header("Location: ".$backtopage);
+ exit;
+ }
+ else
+ {
+ Header("Location: liste.php");
+ exit;
+ }
}
else
{
@@ -548,37 +563,45 @@ if ($user->rights->adherent->creer && $action == 'confirm_valid' && $confirm ==
}
}
-if ($user->rights->adherent->supprimer && $action == 'confirm_resign' && $confirm == 'yes')
+if ($user->rights->adherent->supprimer && $action == 'confirm_resign')
{
- $adht = new AdherentType($db);
- $adht->fetch($object->typeid);
+ if ($confirm == 'yes')
+ {
+ $adht = new AdherentType($db);
+ $adht->fetch($object->typeid);
- $result=$object->resiliate($user);
+ $result=$object->resiliate($user);
- if ($result >= 0 && ! count($object->errors))
- {
- if ($object->email && $_POST["send_mail"])
- {
- $result=$object->send_an_email($adht->getMailOnResiliate(),$conf->global->ADHERENT_MAIL_RESIL_SUBJECT,array(),array(),array(),"","",0,-1);
- }
- if ($result < 0)
- {
- $errmsg.=$object->error;
- }
+ if ($result >= 0 && ! count($object->errors))
+ {
+ if ($object->email && $_POST["send_mail"])
+ {
+ $result=$object->send_an_email($adht->getMailOnResiliate(),$conf->global->ADHERENT_MAIL_RESIL_SUBJECT,array(),array(),array(),"","",0,-1);
+ }
+ if ($result < 0)
+ {
+ $errmsg.=$object->error;
+ }
- // supprime l'utilisateur des divers abonnements ..
- if ($object->del_to_abo() < 0)
- {
- // error
- $errmsg.=$langs->trans("FaildToRemoveFromMailmanList").': '.$object->error."
\n";
- }
- }
- else
- {
- if ($object->error) $errmsg=$object->error;
- else $errmsgs=$object->errors;
- $action='';
- }
+ // supprime l'utilisateur des divers abonnements ..
+ if ($object->del_to_abo() < 0)
+ {
+ // error
+ $errmsg.=$langs->trans("FaildToRemoveFromMailmanList").': '.$object->error."
\n";
+ }
+ }
+ else
+ {
+ if ($object->error) $errmsg=$object->error;
+ else $errmsgs=$object->errors;
+ $action='';
+ }
+ }
+ if (! empty($backtopage) && ! $errmsg)
+ {
+ header("Location: ".$backtopage);
+ exit;
+ }
}
if ($user->rights->adherent->supprimer && $action == 'confirm_del_spip' && $confirm == 'yes')
@@ -819,8 +842,8 @@ if ($action == 'edit')
$res=$object->fetch($rowid);
if ($res < 0) { dol_print_error($db,$object->error); exit; }
- //$res=$object->fetch_optionals($object->id,$extralabels);
- //if ($res < 0) { dol_print_error($db); exit; }
+ $res=$object->fetch_optionals($object->id,$extralabels);
+ if ($res < 0) { dol_print_error($db); exit; }
$adht = new AdherentType($db);
$adht->fetch($object->typeid);
@@ -874,6 +897,7 @@ if ($action == 'edit')
print '';
print '';
print '';
+ print '';
print '
| '; if ($user->rights->adherent->creer) { - print "rowid&action=edit&return=liste.php\">".img_edit().""; + print "rowid."&action=edit&backtopage=1\">".img_edit().""; } print ' '; - if ($user->rights->adherent->supprimer) + if ($user->rights->adherent->supprimer && $objp->statut == -1) { - print "rowid&action=resign&return=liste.php\">".img_picto($langs->trans("Resiliate"),'disable.png').""; + print "rowid."&action=delete&backtopage=1\">".img_picto($langs->trans("Delete"),'disable.png').""; + } + if ($user->rights->adherent->supprimer && $objp->statut == 1) + { + print "rowid."&action=resign&backtopage=1\">".img_picto($langs->trans("Resiliate"),'disable.png').""; } print " | "; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index cbf6a1b7bf6..a9d215da757 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2207,7 +2207,7 @@ class Form $more.=$input['value']; $more.=''."\n"; } - array_push($inputarray,$input['name']); + if ($input['type'] != 'hidden') array_push($inputarray,$input['name']); } } $more.='