Update card.php

This commit is contained in:
Frédéric FRANCE 2020-11-22 21:16:02 +01:00 committed by GitHub
parent 432adaa47f
commit 02e36c7694
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,7 +5,7 @@
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018-2019 Thibault FOUCART <support@ptibogxiv.net> * Copyright (C) 2018-2019 Thibault FOUCART <support@ptibogxiv.net>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -224,8 +224,7 @@ if ($action == 'add')
} }
} }
} }
if ($action == 'confirm_delete' && GETPOST("confirm") == "yes" && $user->rights->don->supprimer) if ($action == 'confirm_delete' && GETPOST("confirm") == "yes" && $user->rights->don->supprimer) {
{
$object->fetch($id); $object->fetch($id);
$result = $object->delete($user); $result = $object->delete($user);
if ($result > 0) { if ($result > 0) {
@ -236,42 +235,31 @@ if ($action == 'confirm_delete' && GETPOST("confirm") == "yes" && $user->rights-
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
if ($action == 'valid_promesse') if ($action == 'valid_promesse') {
{
$object->fetch($id); $object->fetch($id);
if ($object->valid_promesse($id, $user->id) >= 0) if ($object->valid_promesse($id, $user->id) >= 0) {
{
setEventMessages($langs->trans("DonationValidated", $object->ref), null); setEventMessages($langs->trans("DonationValidated", $object->ref), null);
$action = '';
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
exit;
} else { } else {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
if ($action == 'set_cancel') if ($action == 'set_cancel') {
{
$object->fetch($id); $object->fetch($id);
if ($object->set_cancel($id) >= 0) if ($object->set_cancel($id) >= 0) {
{ $action = '';
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
exit;
} else { } else {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
if ($action == 'set_paid') if ($action == 'set_paid') {
{
$object->fetch($id); $object->fetch($id);
if ($object->set_paid($id, $modepayment) >= 0) if ($object->set_paid($id, $modepayment) >= 0) {
{ $action = '';
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
exit;
} else { } else {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} elseif ($action == 'classin' && $user->rights->don->creer) } elseif ($action == 'classin' && $user->rights->don->creer) {
{
$object->fetch($id); $object->fetch($id);
$object->setProject($projectid); $object->setProject($projectid);
} }