$socid = GETPOST('socid', 'int'); $action = GETPOST('action', 'alpha'); // Security check $socid = 0; if ($user->societe_id) { $socid = $user->societe_id; } $result = restrictedArea($user, 'facture', $id, ''); $object = new Facture($db); $object->fetch($id); /******************************************************************************/ /* Actions */ /******************************************************************************/ if ($action == 'setnote_public' && $user->rights->facture->creer) { $object->fetch($id); $result = $object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES)); if ($result < 0) { dol_print_error($db, $object->error); } } else { if ($action == 'setnote' && $user->rights->facture->creer) { $object->fetch($id); $result = $object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES)); if ($result < 0) { dol_print_error($db, $object->error); } } } /******************************************************************************/ /* Affichage fiche */ /******************************************************************************/