Fix signature delete
This commit is contained in:
parent
79136ade8a
commit
c71fe009df
@ -84,7 +84,7 @@ if ($action == 'validate' && $user->rights->deplacement->creer) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->deplacement->supprimer) {
|
} elseif ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->deplacement->supprimer) {
|
||||||
$result = $object->delete($id);
|
$result = $object->delete($user);
|
||||||
if ($result >= 0) {
|
if ($result >= 0) {
|
||||||
header("Location: index.php");
|
header("Location: index.php");
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
use Stripe\ApiOperations\Delete;
|
||||||
|
|
||||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2009-2012 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2009-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
@ -310,13 +312,15 @@ class Deplacement extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Delete record
|
* Delete record
|
||||||
*
|
*
|
||||||
* @param int $id Id of record to delete
|
* @param User $user USer that Delete
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function delete($id)
|
public function delete($user)
|
||||||
{
|
{
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
|
$id = $this->id;
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."deplacement WHERE rowid = ".((int) $id);
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."deplacement WHERE rowid = ".((int) $id);
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user