Skip to content
Snippets Groups Projects
Commit 9f52b9e8 authored by Phf's avatar Phf
Browse files

FIX : #2901

parent 81b66559
No related branches found
No related tags found
No related merge requests found
......@@ -554,7 +554,15 @@ if (! empty($id) && $action != 'edit')
if ($user->rights->don->supprimer)
{
print '<div class="inline-block divButAction"><a class="butActionDelete" href="card.php?rowid='.$don->id.'&action=delete">'.$langs->trans("Delete")."</a></div>";
if ($don->statut == -1 || $don->statut == 0)
{
print '<div class="inline-block divButAction"><a class="butActionDelete" href="card.php?rowid='.$don->id.'&action=delete">'.$langs->trans("Delete")."</a></div>";
}
else
{
print '<div class="inline-block divButAction"><a class="butActionDelete butActionRefused" href="#">'.$langs->trans("Delete")."</a></div>";
}
}
else
{
......
......@@ -449,10 +449,11 @@ class Don extends CommonObject
*/
function delete($rowid)
{
global $user;
$this->db->begin();
$sql = "DELETE FROM ".MAIN_DB_PREFIX."don WHERE rowid = $rowid AND fk_statut = 0;";
$sql = "DELETE FROM ".MAIN_DB_PREFIX."don WHERE rowid = $rowid AND fk_statut = 0 OR fk_statut = -1";
$resql=$this->db->query($sql);
if ($resql)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment