2
0
forked from Wavyzz/dolibarr

code syntax

This commit is contained in:
Frédéric FRANCE
2021-01-14 15:09:08 +01:00
parent 43161be711
commit b1a1cd4be6
83 changed files with 14010 additions and 13774 deletions

View File

@@ -29,8 +29,8 @@ $path=dirname(__FILE__).'/';
// Test if batch mode
if (substr($sapi_type, 0, 3) == 'cgi') {
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
exit;
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
exit;
}
// Global variables
@@ -49,7 +49,10 @@ $langs->load("main"); // To load language file for default language
// Load user and its permissions
$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
if (! $result > 0) { dol_print_error('', $user->error); exit; }
if (! $result > 0) {
dol_print_error('', $user->error);
exit;
}
$user->getrights();
@@ -80,12 +83,12 @@ $com->lines[]=$orderline1;
// Create order
$idobject=$com->create($user);
if ($idobject > 0)
{
if ($idobject > 0) {
// Change status to validated
$result=$com->valid($user);
if ($result > 0) print "OK Object created with id ".$idobject."\n";
else {
if ($result > 0) {
print "OK Object created with id ".$idobject."\n";
} else {
$error++;
dol_print_error($db, $com->error);
}
@@ -97,8 +100,7 @@ if ($idobject > 0)
// -------------------- END OF YOUR CODE --------------------
if (! $error)
{
if (! $error) {
$db->commit();
print '--- end ok'."\n";
} else {