dol_delete_file($file); $mesg = '<div class="ok">' . $langs->trans("FileWasRemoved") . '</div>'; } } /* * Create an order */ if ($action == 'create') { $fourn = new Fournisseur($db); $result = $fourn->fetch($socid); $db->begin(); $orderid = $fourn->create_commande($user); if ($orderid > 0) { $idc = $fourn->single_open_commande; if ($comclientid != '') { $fourn->updateFromCommandeClient($user, $idc, $comclientid); } $id = $orderid; $db->commit(); } else { $db->rollback(); $mesg = $fourn->error; } } /* * Add file in email form */ if ($_POST['addfile']) { require_once DOL_DOCUMENT_ROOT . "/lib/files.lib.php"; // Set tmp user directory TODO Use a dedicated directory for temp mails files $vardir = $conf->user->dir_output . "/" . $user->id;