예제 #1
0
파일: note.php 프로젝트: nrjacker4/crm-php
if ($user->societe_id) {
    $socid = $user->societe_id;
}
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture');
$object = new FactureFournisseur($db);
$object->fetch($id, $ref);
/******************************************************************************/
/*                     Actions                                                */
/******************************************************************************/
if ($action == 'setnote_public' && $user->rights->fournisseur->facture->creer) {
    $result = $object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
    if ($result < 0) {
        dol_print_error($db, $object->error);
    }
} elseif ($action == 'setnote' && $user->rights->fournisseur->facture->creer) {
    $result = $object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES));
    if ($result < 0) {
        dol_print_error($db, $object->error);
    }
}
// Set label
if ($action == 'setlabel' && $user->rights->fournisseur->facture->creer) {
    $object->label = $_POST['label'];
    $result = $object->update($user);
    if ($result < 0) {
        dol_print_error($db);
    }
}
/*
 * View
*/
예제 #2
0
$langs->load("companies");
$id = GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'alpha');
// Security check
if ($user->societe_id) {
    $socid = $user->societe_id;
}
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture');
$object = new FactureFournisseur($db);
$object->fetch($id, $ref);
/******************************************************************************/
/*                     Actions                                                */
/******************************************************************************/
if ($action == 'setnote_public' && $user->rights->fournisseur->facture->creer) {
    $result = $object->update_note(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES), '_public');
    if ($result < 0) {
        dol_print_error($db, $object->error);
    }
} elseif ($action == 'setnote_private' && $user->rights->fournisseur->facture->creer) {
    $result = $object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES), '_private');
    if ($result < 0) {
        dol_print_error($db, $object->error);
    }
}
// Set label
if ($action == 'setlabel' && $user->rights->fournisseur->facture->creer) {
    $object->label = $_POST['label'];
    $result = $object->update($user);
    if ($result < 0) {
        dol_print_error($db);
예제 #3
0
	if ($res < 0)
	{
		$mesg='<div class="error">'.$fac->error.'</div>';
		$db->rollback();
	}
	else
	{
		$db->commit();
	}
}

if ($_POST["action"] == 'update' && $user->rights->fournisseur->facture->creer)
{
	$db->begin();

	$res=$fac->update_note($_POST["note"],$user);
	if ($res < 0)
	{
		$mesg='<div class="error">'.$fac->error.'</div>';
		$db->rollback();
	}
	else
	{
		$db->commit();
	}
}



/*
 * View