Fix phpcs

This commit is contained in:
Laurent Destailleur 2023-12-04 10:25:02 +01:00
parent fa594ab779
commit 085f6e26f3
5 changed files with 53 additions and 53 deletions

View File

@ -25,7 +25,7 @@
$sapi_type = php_sapi_name();
$script_file = basename(__FILE__);
$path=dirname(__FILE__).'/';
$path = dirname(__FILE__).'/';
// Test if batch mode
if (substr($sapi_type, 0, 3) == 'cgi') {
@ -34,8 +34,8 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
}
// Global variables
$version='1.7';
$error=0;
$version = '1.7';
$error = 0;
// -------------------- START OF YOUR CODE HERE --------------------
@ -48,8 +48,8 @@ $langs->load("main"); // To load language file for default language
@set_time_limit(0);
// Load user and its permissions
$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
if (! $result > 0) {
$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;
}
@ -74,20 +74,20 @@ $obj->note_public = 'A public comment';
$obj->note_private = 'A private comment';
$obj->cond_reglement_id = 1;
$line1=new FactureLigne($db);
$line1->tva_tx=10.0;
$line1->remise_percent=0;
$line1->qty=1;
$line1->total_ht=100;
$line1->total_tva=10;
$line1->total_ttc=110;
$obj->lines[]=$line1;
$line1 = new FactureLigne($db);
$line1->tva_tx = 10.0;
$line1->remise_percent = 0;
$line1->qty = 1;
$line1->total_ht = 100;
$line1->total_tva = 10;
$line1->total_ttc = 110;
$obj->lines[] = $line1;
// Create invoice
$idobject=$obj->create($user);
$idobject = $obj->create($user);
if ($idobject > 0) {
// Change status to validated
$result=$obj->validate($user);
$result = $obj->validate($user);
if ($result > 0) {
print "OK Object created with id ".$idobject."\n";
} else {
@ -102,7 +102,7 @@ if ($idobject > 0) {
// -------------------- END OF YOUR CODE --------------------
if (! $error) {
if (!$error) {
$db->commit();
print '--- end ok'."\n";
} else {

View File

@ -25,7 +25,7 @@
$sapi_type = php_sapi_name();
$script_file = basename(__FILE__);
$path=dirname(__FILE__).'/';
$path = dirname(__FILE__).'/';
// Test if batch mode
if (substr($sapi_type, 0, 3) == 'cgi') {
@ -34,8 +34,8 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
}
// Global variables
$version='1.11';
$error=0;
$version = '1.11';
$error = 0;
// -------------------- START OF YOUR CODE HERE --------------------
@ -48,8 +48,8 @@ $langs->load("main"); // To load language file for default language
@set_time_limit(0);
// Load user and its permissions
$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
if (! $result > 0) {
$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;
}
@ -75,17 +75,17 @@ $com->note_private = 'A private comment';
$com->source = 1;
$com->remise_percent = 0;
$orderline1=new OrderLine($db);
$orderline1->tva_tx=10.0;
$orderline1->remise_percent=0;
$orderline1->qty=1;
$com->lines[]=$orderline1;
$orderline1 = new OrderLine($db);
$orderline1->tva_tx = 10.0;
$orderline1->remise_percent = 0;
$orderline1->qty = 1;
$com->lines[] = $orderline1;
// Create order
$idobject=$com->create($user);
$idobject = $com->create($user);
if ($idobject > 0) {
// Change status to validated
$result=$com->valid($user);
$result = $com->valid($user);
if ($result > 0) {
print "OK Object created with id ".$idobject."\n";
} else {
@ -100,7 +100,7 @@ if ($idobject > 0) {
// -------------------- END OF YOUR CODE --------------------
if (! $error) {
if (!$error) {
$db->commit();
print '--- end ok'."\n";
} else {

View File

@ -25,7 +25,7 @@
$sapi_type = php_sapi_name();
$script_file = basename(__FILE__);
$path=dirname(__FILE__).'/';
$path = dirname(__FILE__).'/';
// Test if batch mode
if (substr($sapi_type, 0, 3) == 'cgi') {
@ -34,8 +34,8 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
}
// Global variables
$version='1.10';
$error=0;
$version = '1.10';
$error = 0;
// -------------------- START OF YOUR CODE HERE --------------------
@ -48,8 +48,8 @@ $langs->load("main"); // To load language file for default language
@set_time_limit(0);
// Load user and its permissions
$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
if (! $result > 0) {
$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;
}
@ -65,7 +65,7 @@ $db->begin();
require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php";
// Create instance of object
$myproduct=new Product($db);
$myproduct = new Product($db);
// Definition of product instance properties
$myproduct->ref = '1234';
@ -91,7 +91,7 @@ if ($idobject > 0) {
// -------------------- END OF YOUR CODE --------------------
if (! $error) {
if (!$error) {
$db->commit();
print '--- end ok'."\n";
} else {

View File

@ -25,7 +25,7 @@
$sapi_type = php_sapi_name();
$script_file = basename(__FILE__);
$path=dirname(__FILE__).'/';
$path = dirname(__FILE__).'/';
// Test if batch mode
if (substr($sapi_type, 0, 3) == 'cgi') {
@ -34,8 +34,8 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
}
// Global variables
$version='1.7';
$error=0;
$version = '1.7';
$error = 0;
// -------------------- START OF YOUR CODE HERE --------------------
@ -48,8 +48,8 @@ $langs->load("main"); // To load language file for default language
@set_time_limit(0);
// Load user and its permissions
$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
if (! $result > 0) {
$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;
}
@ -71,10 +71,10 @@ $obj->login = 'ABCDEF';
$obj->nom = 'ABCDEF';
// Create user
$idobject=$obj->create($user);
$idobject = $obj->create($user);
if ($idobject > 0) {
// Change status to validated
$result=$obj->setStatut(1);
$result = $obj->setStatut(1);
if ($result > 0) {
print "OK Object created with id ".$idobject."\n";
} else {
@ -82,7 +82,7 @@ if ($idobject > 0) {
dol_print_error($db, $obj->error);
}
} elseif ($obj->error == 'ErrorLoginAlreadyExists') {
print "User with login ".$obj->login." already exists\n";
print "User with login ".$obj->login." already exists\n";
} else {
$error++;
dol_print_error($db, $obj->error);
@ -91,7 +91,7 @@ if ($idobject > 0) {
// -------------------- END OF YOUR CODE --------------------
if (! $error) {
if (!$error) {
$db->commit();
print '--- end ok'."\n";
} else {

View File

@ -25,7 +25,7 @@
$sapi_type = php_sapi_name();
$script_file = basename(__FILE__);
$path=dirname(__FILE__).'/';
$path = dirname(__FILE__).'/';
// Test if batch mode
if (substr($sapi_type, 0, 3) == 'cgi') {
@ -34,8 +34,8 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
}
// Global variables
$version='1.7';
$error=0;
$version = '1.7';
$error = 0;
// -------------------- START OF YOUR CODE HERE --------------------
@ -48,8 +48,8 @@ $langs->load("main"); // To load language file for default language
@set_time_limit(0);
// Load user and its permissions
$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
if (! $result > 0) {
$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;
}
@ -57,7 +57,7 @@ $user->getrights();
print "***** ".$script_file." (".$version.") *****\n";
if (! isset($argv[1])) { // Check parameters
if (!isset($argv[1])) { // Check parameters
print "Usage: ".$script_file." id_thirdparty ...\n";
exit;
}
@ -72,9 +72,9 @@ require_once DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php";
// Create contract object
$obj = new Contrat($db);
$obj->socid=$argv[1];
$obj->socid = $argv[1];
$listofcontractsforcompany=$obj->getListOfContracts('all');
$listofcontractsforcompany = $obj->getListOfContracts('all');
print $listofcontractsforcompany;