コード例 #1
0
ファイル: note.php プロジェクト: nrjacker4/crm-php
$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_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);
コード例 #2
0
ファイル: note.php プロジェクト: remyyounes/dolibarr
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'fournisseur', $facid, 'facture_fourn', 'facture');

$fac = new FactureFournisseur($db);
$fac->fetch($_GET["facid"]);


/******************************************************************************/
/*                     Actions                                                */
/******************************************************************************/

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

	$res=$fac->update_note_public($_POST["note_public"],$user);
	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();