$result = restrictedArea($user, 'propale', $id, 'propal'); /******************************************************************************/ /* Actions */ /******************************************************************************/ if ($_POST["action"] == 'update_public' && $user->rights->propale->creer) { $propal = new Propal($db); $propal->fetch($_GET["id"]); $db->begin(); $res=$propal->update_note_public($_POST["note_public"],$user); if ($res < 0) { $mesg='<div class="error">'.$propal->error.'</div>'; $db->rollback(); } else { $db->commit(); } } if ($_POST['action'] == 'update' && $user->rights->propale->creer) { $propal = new Propal($db); $propal->fetch($_GET["id"]);
$langs->load('bills'); $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'alpha'); // Security check if ($user->societe_id) { $socid = $user->societe_id; } $result = restrictedArea($user, 'propale', $id, 'propal'); $object = new Propal($db); /******************************************************************************/ /* Actions */ /******************************************************************************/ if ($action == 'setnote_public' && $user->rights->propale->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->propale->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 */ /******************************************************************************/