Example #1
0
$result = restrictedArea($user, 'projet', $id);



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

if ($_POST["action"] == 'update_public' && $user->rights->projet->creer)
{
	$project = new Project($db);
	$project->fetch($_GET['id']);

	$db->begin();

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

if ($_POST['action'] == 'update_private' && $user->rights->projet->creer)
{
	$project = new Project($db);
	$project->fetch($_GET['id']);
Example #2
0
if ($user->societe_id > 0) $socid=$user->societe_id;
$result = restrictedArea($user, 'projet', $id);



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

if ($action == 'update_public' && $user->rights->projet->creer)
{
	$project->fetch($_GET['id']);

	$db->begin();

	$res=$project->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
	if ($res < 0)
	{
		$mesg='<div class="error">'.$project->error.'</div>';
		$db->rollback();
	}
	else
	{
		$db->commit();
	}
}

if ($action == 'update_private' && $user->rights->projet->creer)
{
	$project->fetch($_GET['id']);