if (! $commande->fetch($_GET['id'],$_GET['ref']) > 0) { dol_print_error($db); } /* * Actions */ if ($_POST["action"] == 'update' && $user->rights->commande->creer) { $db->begin(); $resPrivateNote=$commande->update_note($_POST["note"]); $resPublicNote=$commande->update_note_public($_POST["note_public"]); if ($resPrivateNote < 0 || $resPublicNote < 0) { $mesg='<div class="error">'.$commande->error.'</div>'; $db->rollback(); } else { $db->commit(); } } /*
// Security check $socid = 0; if ($user->societe_id) { $socid = $user->societe_id; } $result = restrictedArea($user, 'commande', $id, ''); $object = new Commande($db); if (!$object->fetch($id, $ref) > 0) { dol_print_error($db); } /* * Actions */ if ($action == 'setnote_public' && $user->rights->commande->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->commande->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); } } } /* * View */