$id = GETPOST('id', 'int'); $action = GETPOST('action', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); if ($user->societe_id) { $socid = $user->societe_id; } // TODO ajouter regle pour restreindre acces paiement //$result = restrictedArea($user, 'facture', $id,''); $object = new Paiement($db); /* * Actions */ if ($action == 'setnote' && $user->rights->facture->paiement) { $db->begin(); $object->fetch($id); $result = $object->update_note(GETPOST('note')); if ($result > 0) { $db->commit(); $action = ''; } else { setEventMessage($object->error, 'errors'); $db->rollback(); } } if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->facture->paiement) { $db->begin(); $object->fetch($id); $result = $object->delete(); if ($result > 0) { $db->commit(); header("Location: list.php");
//$result = restrictedArea($user, 'facture', $id,''); $mesg=''; /* * Actions */ if ($action == 'setnote' && $user->rights->facture->paiement) { $db->begin(); $paiement = new Paiement($db); $paiement->fetch($id); $result = $paiement->update_note(GETPOST('note')); if ($result > 0) { $db->commit(); $action=''; } else { $mesg='<div class="error">'.$paiement->error.'</div>'; $db->rollback(); } } if ($action == 'confirm_delete' && GETPOST('confirm') == 'yes' && $user->rights->facture->paiement) { $db->begin();