Exemplo n.º 1
0
// Security check
$socid=0;
if ($user->societe_id) $socid=$user->societe_id;
$result=restrictedArea($user,'commande',$id);


/*
 * Actions
 */

// Categorisation dans projet
if ($_POST['action'] == 'classin')
{
	$commande = new Commande($db);
	$commande->fetch($_GET['id']);
	$commande->setProject($_POST['projectid']);
}

if ($_POST["action"] == 'confirm_cloture' && $_POST["confirm"] == 'yes')
{
	$commande = new Commande($db);
	$commande->fetch($_GET["id"]);
	$result = $commande->cloture($user);
}

// Positionne ref commande client
if ($_POST['action'] == 'setrefcustomer' && $user->rights->commande->creer)
{
	$commande = new Commande($db);
	$commande->fetch($_GET['id']);
	$commande->set_ref_client($user, $_POST['ref_customer']);
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'alpha');
// Security check
$socid = 0;
if (!empty($user->societe_id)) {
    $socid = $user->societe_id;
}
$result = restrictedArea($user, 'commande', $id);
/*
 * Actions
 */
// Categorisation dans projet
if ($action == 'classin') {
    $commande = new Commande($db);
    $commande->fetch($id);
    $commande->setProject(GETPOST('projectid', 'int'));
}
if ($action == 'confirm_cloture' && GETPOST('confirm', 'alpha') == 'yes') {
    $commande = new Commande($db);
    $commande->fetch($id);
    $result = $commande->cloture($user);
}
// Positionne ref commande client
if ($action == 'setrefcustomer' && $user->rights->commande->creer) {
    $commande = new Commande($db);
    $commande->fetch($id);
    $commande->set_ref_client($user, GETPOST('ref_customer', 'alpha'));
}
if ($action == 'setdatedelivery' && $user->rights->commande->creer) {
    //print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year'];
    $datelivraison = dol_mktime(0, 0, 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int'));