示例#1
0
$commande = new Commande($db);
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();
	}
}


示例#2
0
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
 */
llxHeader('', $langs->trans('Order'), 'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes');
$form = new Form($db);
if ($id > 0 || !empty($ref)) {
    $soc = new Societe($db);
    $soc->fetch($object->socid);
    $head = commande_prepare_head($object);
    dol_fiche_head($head, 'note', $langs->trans("CustomerOrder"), 0, 'order');