FIX Maxi debug v16

This commit is contained in:
Laurent Destailleur 2022-08-12 15:54:50 +02:00
parent 75fa3cf643
commit 059d0073ff
38 changed files with 105 additions and 99 deletions

View File

@ -1813,7 +1813,7 @@ class Adherent extends CommonObject
if (!$error) {
// Create payment line for invoice
$paiement_id = $paiement->create($user);
if (!$paiement_id > 0) {
if (!($paiement_id > 0)) {
$this->error = $paiement->error;
$this->errors = $paiement->errors;
$error++;

View File

@ -66,7 +66,7 @@ if (preg_match('/set_(.*)/', $action, $reg)) {
$value = (GETPOST($code) ? GETPOST($code) : 1);
$res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity);
if (!$res > 0) {
if (!($res > 0)) {
$error++;
$errors[] = $db->lasterror();
}
@ -86,7 +86,7 @@ if (preg_match('/set_(.*)/', $action, $reg)) {
$code = $reg[1];
$res = dolibarr_del_const($db, $code, $conf->entity);
if (!$res > 0) {
if (!($res > 0)) {
$error++;
$errors[] = $db->lasterror();
}

View File

@ -142,7 +142,7 @@ if ($action == 'updateMask') {
$value = GETPOST('activate_hideClosedServiceByDefault', 'alpha');
$res3 = dolibarr_set_const($db, "CONTRACT_HIDE_CLOSED_SERVICES_BY_DEFAULT", $value, 'chaine', 0, '', $conf->entity);
if (!$res1 > 0 || !$res2 > 0 || !$res3 > 0) {
if (!($res1 > 0) || !($res2 > 0) || !($res3 > 0)) {
$error++;
}

View File

@ -59,12 +59,12 @@ if ($action == 'set') {
if (!$error) {
$res1 = dolibarr_set_const($db, "GEOIP_VERSION", GETPOST('geoipversion', 'aZ09'), 'chaine', 0, '', $conf->entity);
if (!$res1 > 0) {
if (!($res1 > 0)) {
$error++;
}
$res2 = dolibarr_set_const($db, "GEOIPMAXMIND_COUNTRY_DATAFILE", $gimcdf, 'chaine', 0, '', $conf->entity);
if (!$res2 > 0) {
if (!($res2 > 0)) {
$error++;
}

View File

@ -141,7 +141,7 @@ if ($action == 'updateMask') {
$draft = GETPOST('HOLIDAY_DRAFT_WATERMARK', 'alpha');
$res2 = dolibarr_set_const($db, "HOLIDAY_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
if (!$res1 > 0 || !$res2 > 0) {
if (!($res1 > 0) || !($res2 > 0)) {
$error++;
}

View File

@ -77,7 +77,7 @@ if ($action == 'setconst' && $user->admin) {
$constnote = dol_escape_htmltag($setupconst['note']);
$result = dolibarr_set_const($db, $constname, $constvalue, $consttype, 0, $constnote, $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
}
@ -96,7 +96,7 @@ if ($action == 'setvalue' && $user->admin) {
$db->begin();
$result = dolibarr_set_const($db, $varname, $value, 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}

View File

@ -78,9 +78,10 @@ if ($action == 'updateMask') {
$maskconststocktransfer = GETPOST('maskconststocktransfer', 'alpha');
$maskstocktransfer = GETPOST('maskStockTransfer', 'alpha');
if ($maskconststocktransfer) $res = dolibarr_set_const($db, $maskconststocktransfer, $maskstocktransfer, 'chaine', 0, '', $conf->entity);
if (!$res > 0) $error++;
if ($maskconststocktransfer) {
$res = dolibarr_set_const($db, $maskconststocktransfer, $maskstocktransfer, 'chaine', 0, '', $conf->entity);
if ($res <= 0) $error++;
}
if (!$error) {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');

View File

@ -357,7 +357,7 @@ if (GETPOST('save') && !$cancel && !empty($user->rights->banque->modifier)) {
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors');
}
if (!$bankaccountid > 0) {
if (!($bankaccountid > 0)) {
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount")), null, 'errors');
}

View File

@ -192,7 +192,7 @@ if ($action == 'add' && $user->rights->tax->charges->creer) {
} elseif (!$dateperiod) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Period")), null, 'errors');
$action = 'create';
} elseif (!$actioncode > 0) {
} elseif (!($actioncode > 0)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Type")), null, 'errors');
$action = 'create';
} elseif (empty($amount)) {

View File

@ -375,7 +375,7 @@ if (empty($reshook)) {
$newfile = $dir.'/'.dol_sanitizeFileName($_FILES['photo']['name']);
$result = dol_move_uploaded_file($_FILES['photo']['tmp_name'], $newfile, 1);
if (!$result > 0) {
if (!($result > 0)) {
$errors[] = "ErrorFailedToSaveFile";
} else {
$object->photo = dol_sanitizeFileName($_FILES['photo']['name']);

View File

@ -77,7 +77,7 @@ if (!isset($mode) || $mode != 'noajax') { // For ajax call
$ecmdir = new EcmDirectory($db);
if ($section > 0) {
$result = $ecmdir->fetch($section);
if (!$result > 0) {
if (!($result > 0)) {
//dol_print_error($db,$ecmdir->error);
//exit;
}
@ -90,7 +90,7 @@ if (!isset($mode) || $mode != 'noajax') { // For ajax call
$relativepath = '';
if ($section > 0) {
$result = $ecmdir->fetch($section);
if (!$result > 0) {
if (!($result > 0)) {
dol_print_error($db, $ecmdir->error);
exit;
}

View File

@ -1805,7 +1805,7 @@ class FormFile
}
}
if (!$found > 0 || !is_object($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) {
if ($found <= 0 || !is_object($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) {
continue; // We do not show orphelins files
}

View File

@ -63,7 +63,7 @@ if ($action == 'setvalue' && $user->admin) {
$result = dolibarr_set_const($db, $sub, GETPOST($sub), 'chaine', 0, '', $conf->entity);
$sub = "DATAPOLICIESREFUSE_".$l;
$result = dolibarr_set_const($db, $sub, GETPOST($sub), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
if (!$error) {

View File

@ -111,7 +111,7 @@ if ($action == 'add_payment') {
if (!$error) {
$result = $payment->addPaymentToBank($user, 'payment_donation', '(DonationPayment)', GETPOST('accountid', 'int'), '', '');
if (!$result > 0) {
if (!($result > 0)) {
$errmsg = $payment->error;
setEventMessages($errmsg, null, 'errors');
$error++;

View File

@ -85,7 +85,7 @@ if (!$sortfield) {
$ecmdir = new EcmDirectory($db);
if (!empty($section)) {
$result = $ecmdir->fetch($section);
if (!$result > 0) {
if (!($result > 0)) {
dol_print_error($db, $ecmdir->error);
exit;
}

View File

@ -76,7 +76,7 @@ if (!$urlfile) {
// Load ecm object
$ecmdir = new EcmDirectory($db);
$result = $ecmdir->fetch(GETPOST("section", 'alpha'));
if (!$result > 0) {
if (!($result > 0)) {
dol_print_error($db, $ecmdir->error);
exit;
}

View File

@ -80,7 +80,7 @@ if (!$urlfile) {
// Load ecm object
$ecmdir = new EcmDirectory($db);
$result = $ecmdir->fetch(GETPOST("section", 'alpha'));
if (!$result > 0) {
if (!($result > 0)) {
dol_print_error($db, $ecmdir->error);
exit;
}

View File

@ -64,7 +64,7 @@ if (!$sortfield) {
$ecmdir = new EcmDirectory($db);
if ($section > 0) {
$result = $ecmdir->fetch($section);
if (!$result > 0) {
if (!($result > 0)) {
dol_print_error($db, $ecmdir->error);
exit;
}

View File

@ -74,7 +74,7 @@ if ($module == 'invoice_supplier' && $sortfield == "fullname") {
$ecmdir = new EcmDirectory($db);
if ($section) {
$result = $ecmdir->fetch($section);
if (!$result > 0) {
if (!($result > 0)) {
dol_print_error($db, $ecmdir->error);
exit;
}

View File

@ -78,7 +78,7 @@ if (!$sortfield) {
$ecmdir = new EcmDirectory($db);
if (!empty($section)) {
$result = $ecmdir->fetch($section);
if (!$result > 0) {
if (!($result > 0)) {
dol_print_error($db, $ecmdir->error);
exit;
}

View File

@ -134,7 +134,7 @@ if ($action == 'add_payment') {
$payment->fetch($paymentid);
if ($expensereport->total_ttc - $payment->amount == 0) {
$result = $expensereport->setPaid($expensereport->id, $user);
if (!$result > 0) {
if (!($result > 0)) {
setEventMessages($payment->error, $payment->errors, 'errors');
$error++;
}

View File

@ -92,8 +92,8 @@ if ($socid > 0) {
print '<td>&nbsp;</td>';
print '</tr>';
if (!$num > 0) {
print '<tr><td colspan="7">'.$langs->trans("NoInvoice").'</td></tr>';
if ($num <= 0) {
print '<tr><td colspan="7"><span class="opacitymedium">'.$langs->trans("NoInvoice").'</span></td></tr>';
}
$solde = 0;

View File

@ -100,7 +100,7 @@ if (GETPOST("sendit") && !empty($conf->global->MAIN_UPLOAD_DOC)) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$result = $ecmdir->fetch(GETPOST("section", 'int'));
if (!$result > 0) {
if (!($result > 0)) {
dol_print_error($db, $ecmdir->error);
exit;
}

View File

@ -220,7 +220,7 @@ class Loan extends CommonObject
}
// Check parameters
if (!$newcapital > 0 || empty($this->datestart) || empty($this->dateend)) {
if (!($newcapital > 0) || empty($this->datestart) || empty($this->dateend)) {
$this->error = "ErrorBadParameter";
return -2;
}

View File

@ -167,7 +167,7 @@ if ($action == 'add_payment') {
if (!$error) {
$result = $payment->addPaymentToBank($user, $chid, 'payment_loan', '(LoanPayment)', $payment->fk_bank, '', '');
if (!$result > 0) {
if (!($result > 0)) {
setEventMessages($payment->error, $payment->errors, 'errors');
$error++;
}

View File

@ -99,7 +99,7 @@ $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) {
if (!($result > 0)) {
dol_print_error('', $user->error); exit;
}
$user->getrights();

View File

@ -122,7 +122,7 @@ $arrayfields = array(
'm.batch'=>array('label'=>"BatchNumberShort", 'checked'=>1, 'position'=>8, 'enabled'=>(!empty($conf->productbatch->enabled))),
'pl.eatby'=>array('label'=>"EatByDate", 'checked'=>0, 'position'=>9, 'enabled'=>(!empty($conf->productbatch->enabled))),
'pl.sellby'=>array('label'=>"SellByDate", 'checked'=>0, 'position'=>10, 'enabled'=>(!empty($conf->productbatch->enabled))),
'e.ref'=>array('label'=>"Warehouse", 'checked'=>1, 'position'=>100, 'enabled'=>(!$id > 0)), // If we are on specific warehouse, we hide it
'e.ref'=>array('label'=>"Warehouse", 'checked'=>1, 'position'=>100, 'enabled'=>(!($id > 0))), // If we are on specific warehouse, we hide it
'm.fk_user_author'=>array('label'=>"Author", 'checked'=>0, 'position'=>120),
'm.inventorycode'=>array('label'=>"InventoryCodeShort", 'checked'=>1, 'position'=>130),
'm.label'=>array('label'=>"MovementLabel", 'checked'=>1, 'position'=>140),

View File

@ -43,64 +43,64 @@ if ($action == 'setvalue' && $user->admin) {
$db->begin();
//$result=dolibarr_set_const($db, "PAYBOX_IBS_DEVISE", GETPOST("PAYBOX_IBS_DEVISE"),'chaine',0,'',$conf->entity);
$result = dolibarr_set_const($db, "PAYBOX_CGI_URL_V1", GETPOST('PAYBOX_CGI_URL_V1', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "PAYBOX_CGI_URL_V2", GETPOST('PAYBOX_CGI_URL_V2', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "PAYBOX_IBS_SITE", GETPOST('PAYBOX_IBS_SITE', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "PAYBOX_IBS_RANG", GETPOST('PAYBOX_IBS_RANG', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "PAYBOX_PBX_IDENTIFIANT", GETPOST('PAYBOX_PBX_IDENTIFIANT', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "ONLINE_PAYMENT_CREDITOR", GETPOST('ONLINE_PAYMENT_CREDITOR', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS", GETPOST('PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS', 'int'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "ONLINE_PAYMENT_CSS_URL", GETPOST('ONLINE_PAYMENT_CSS_URL', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_FORM", GETPOST('ONLINE_PAYMENT_MESSAGE_FORM', 'restricthtml'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_OK", GETPOST('ONLINE_PAYMENT_MESSAGE_OK', 'restricthtml'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_KO", GETPOST('ONLINE_PAYMENT_MESSAGE_KO', 'restricthtml'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "ONLINE_PAYMENT_SENDEMAIL", GETPOST('ONLINE_PAYMENT_SENDEMAIL', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
// Payment token for URL
$result = dolibarr_set_const($db, "PAYMENT_SECURITY_TOKEN", GETPOST('PAYMENT_SECURITY_TOKEN', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "PAYMENT_SECURITY_TOKEN_UNIQUE", GETPOST('PAYMENT_SECURITY_TOKEN_UNIQUE', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "PAYBOX_HMAC_KEY", dol_encode(GETPOST('PAYBOX_HMAC_KEY', 'alpha')), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}

View File

@ -45,65 +45,65 @@ if ($action == 'setvalue' && $user->admin) {
$db->begin();
$result = dolibarr_set_const($db, "PAYPAL_API_USER", GETPOST('PAYPAL_API_USER', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "PAYPAL_API_PASSWORD", GETPOST('PAYPAL_API_PASSWORD', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "PAYPAL_API_SIGNATURE", GETPOST('PAYPAL_API_SIGNATURE', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "PAYPAL_SSLVERSION", GETPOST('PAYPAL_SSLVERSION', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "ONLINE_PAYMENT_CREDITOR", GETPOST('ONLINE_PAYMENT_CREDITOR', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS", GETPOST('PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS', 'int'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "PAYPAL_API_INTEGRAL_OR_PAYPALONLY", GETPOST('PAYPAL_API_INTEGRAL_OR_PAYPALONLY', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "ONLINE_PAYMENT_CSS_URL", GETPOST('ONLINE_PAYMENT_CSS_URL', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "PAYPAL_ADD_PAYMENT_URL", GETPOST('PAYPAL_ADD_PAYMENT_URL', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_FORM", GETPOST('ONLINE_PAYMENT_MESSAGE_FORM', 'restricthtml'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_OK", GETPOST('ONLINE_PAYMENT_MESSAGE_OK', 'restricthtml'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_KO", GETPOST('ONLINE_PAYMENT_MESSAGE_KO', 'restricthtml'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "ONLINE_PAYMENT_SENDEMAIL", GETPOST('ONLINE_PAYMENT_SENDEMAIL', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
// Payment token for URL
$result = dolibarr_set_const($db, "PAYMENT_SECURITY_TOKEN", GETPOST('PAYMENT_SECURITY_TOKEN', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
if (empty($conf->use_javascript_ajax)) {
$result = dolibarr_set_const($db, "PAYMENT_SECURITY_TOKEN_UNIQUE", GETPOST('PAYMENT_SECURITY_TOKEN_UNIQUE', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
}

View File

@ -70,7 +70,7 @@ if ($action == 'setconst' && $user->admin) {
foreach ($_POST['setupdriver'] as $setupconst) {
//print '<pre>'.print_r($setupconst, true).'</pre>';
$result = dolibarr_set_const($db, $setupconst['varname'], $setupconst['value'], 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
}
@ -89,7 +89,7 @@ if ($action == 'setvalue' && $user->admin) {
$db->begin();
$result = dolibarr_set_const($db, $varname, $value, 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}

View File

@ -36,6 +36,9 @@ if (!$user->admin || (empty($conf->productbatch->enabled)))
$action = GETPOST('action', 'alpha');
$value = GETPOST('value', 'alpha');
$error = 0;
/*
* Actions
*/
@ -46,9 +49,10 @@ if ($action == 'updateMaskLot') {
$maskconstbatch = GETPOST('maskconstLot', 'alpha');
$maskbatch = GETPOST('maskLot', 'alpha');
if ($maskconstbatch) $res = dolibarr_set_const($db, $maskconstbatch, $maskbatch, 'chaine', 0, '', $conf->entity);
if (!$res > 0) $error++;
if ($maskconstbatch) {
$res = dolibarr_set_const($db, $maskconstbatch, $maskbatch, 'chaine', 0, '', $conf->entity);
if ($res <= 0) $error++;
}
if (!$error) {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
@ -59,9 +63,10 @@ if ($action == 'updateMaskLot') {
$maskconstbatch = GETPOST('maskconstSN', 'alpha');
$maskbatch = GETPOST('maskSN', 'alpha');
if ($maskconstbatch) $res = dolibarr_set_const($db, $maskconstbatch, $maskbatch, 'chaine', 0, '', $conf->entity);
if (!$res > 0) $error++;
if ($maskconstbatch) {
$res = dolibarr_set_const($db, $maskconstbatch, $maskbatch, 'chaine', 0, '', $conf->entity);
if ($res <= 0) $error++;
}
if (!$error) {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');

View File

@ -109,7 +109,7 @@ $arrayfields = array(
'm.batch'=>array('label'=>$langs->trans("BatchNumberShort"), 'checked'=>1, 'enabled'=>(!empty($conf->productbatch->enabled))),
'pl.eatby'=>array('label'=>$langs->trans("EatByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(!empty($conf->productbatch->enabled))),
'pl.sellby'=>array('label'=>$langs->trans("SellByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(!empty($conf->productbatch->enabled))),
'e.ref'=>array('label'=>$langs->trans("Warehouse"), 'checked'=>1, 'enabled'=>(!$id > 0)), // If we are on specific warehouse, we hide it
'e.ref'=>array('label'=>$langs->trans("Warehouse"), 'checked'=>1, 'enabled'=>(!($id > 0))), // If we are on specific warehouse, we hide it
'm.fk_user_author'=>array('label'=>$langs->trans("Author"), 'checked'=>0),
'm.inventorycode'=>array('label'=>$langs->trans("InventoryCodeShort"), 'checked'=>1),
'm.label'=>array('label'=>$langs->trans("MovementLabel"), 'checked'=>1),

View File

@ -128,7 +128,7 @@ $arrayfields = array(
'm.batch'=>array('label'=>"BatchNumberShort", 'checked'=>1, 'position'=>8, 'enabled'=>(!empty($conf->productbatch->enabled))),
'pl.eatby'=>array('label'=>"EatByDate", 'checked'=>0, 'position'=>9, 'enabled'=>(!empty($conf->productbatch->enabled))),
'pl.sellby'=>array('label'=>"SellByDate", 'checked'=>0, 'position'=>10, 'enabled'=>(!empty($conf->productbatch->enabled))),
'e.ref'=>array('label'=>"Warehouse", 'checked'=>1, 'position'=>100, 'enabled'=>(!$id > 0)), // If we are on specific warehouse, we hide it
'e.ref'=>array('label'=>"Warehouse", 'checked'=>1, 'position'=>100, 'enabled'=>(!($id > 0))), // If we are on specific warehouse, we hide it
'm.fk_user_author'=>array('label'=>"Author", 'checked'=>0, 'position'=>120),
'm.inventorycode'=>array('label'=>"InventoryCodeShort", 'checked'=>1, 'position'=>130),
'm.label'=>array('label'=>"MovementLabel", 'checked'=>1, 'position'=>140),

View File

@ -647,7 +647,7 @@ if (empty($reshook)) {
$newfile = $dir.'/'.dol_sanitizeFileName($_FILES['photo']['name']);
$result = dol_move_uploaded_file($_FILES['photo']['tmp_name'], $newfile, 1);
if (!$result > 0) {
if (!($result > 0)) {
$errors[] = "ErrorFailedToSaveFile";
} else {
// Create thumbs
@ -813,7 +813,7 @@ if (empty($reshook)) {
$newfile = $dir.'/'.dol_sanitizeFileName($_FILES['photo']['name']);
$result = dol_move_uploaded_file($_FILES['photo']['tmp_name'], $newfile, 1);
if (!$result > 0) {
if (!($result > 0)) {
$errors[] = "ErrorFailedToSaveFile";
} else {
// Create thumbs
@ -1143,7 +1143,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$newfile = $dir.'/'.dol_sanitizeFileName($_FILES['photo']['name']);
$result = dol_move_uploaded_file($_FILES['photo']['tmp_name'], $newfile, 1);
if (!$result > 0) {
if (!($result > 0)) {
$errors[] = "ErrorFailedToSaveFile";
} else {
// Create thumbs

View File

@ -2289,7 +2289,7 @@ class Societe extends CommonObject
$desc = trim($desc);
// Check parameters
if (!$remise > 0) {
if (!($remise > 0)) {
$this->error = $langs->trans("ErrorWrongValueForParameter", "1");
return -1;
}

View File

@ -56,72 +56,72 @@ if ($action == 'setvalue' && $user->admin) {
if (empty($conf->stripeconnect->enabled)) {
$result = dolibarr_set_const($db, "STRIPE_TEST_PUBLISHABLE_KEY", GETPOST('STRIPE_TEST_PUBLISHABLE_KEY', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "STRIPE_TEST_SECRET_KEY", GETPOST('STRIPE_TEST_SECRET_KEY', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "STRIPE_TEST_WEBHOOK_ID", GETPOST('STRIPE_TEST_WEBHOOK_ID', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "STRIPE_TEST_WEBHOOK_KEY", GETPOST('STRIPE_TEST_WEBHOOK_KEY', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "STRIPE_LIVE_PUBLISHABLE_KEY", GETPOST('STRIPE_LIVE_PUBLISHABLE_KEY', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "STRIPE_LIVE_SECRET_KEY", GETPOST('STRIPE_LIVE_SECRET_KEY', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "STRIPE_LIVE_WEBHOOK_ID", GETPOST('STRIPE_LIVE_WEBHOOK_ID', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "STRIPE_LIVE_WEBHOOK_KEY", GETPOST('STRIPE_LIVE_WEBHOOK_KEY', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
}
$result = dolibarr_set_const($db, "ONLINE_PAYMENT_CREDITOR", GETPOST('ONLINE_PAYMENT_CREDITOR', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "STRIPE_BANK_ACCOUNT_FOR_PAYMENTS", GETPOST('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS', 'int'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "STRIPE_USER_ACCOUNT_FOR_ACTIONS", GETPOST('STRIPE_USER_ACCOUNT_FOR_ACTIONS', 'int'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS", GETPOST('STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS', 'int'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "ONLINE_PAYMENT_CSS_URL", GETPOST('ONLINE_PAYMENT_CSS_URL', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_FORM", GETPOST('ONLINE_PAYMENT_MESSAGE_FORM', 'restricthtml'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_OK", GETPOST('ONLINE_PAYMENT_MESSAGE_OK', 'restricthtml'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_KO", GETPOST('ONLINE_PAYMENT_MESSAGE_KO', 'restricthtml'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
$result = dolibarr_set_const($db, "ONLINE_PAYMENT_SENDEMAIL", GETPOST('ONLINE_PAYMENT_SENDEMAIL'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
// Stock decrement
@ -131,12 +131,12 @@ if ($action == 'setvalue' && $user->admin) {
// Payment token for URL
$result = dolibarr_set_const($db, "PAYMENT_SECURITY_TOKEN", GETPOST('PAYMENT_SECURITY_TOKEN', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
if (empty($conf->use_javascript_ajax)) {
$result = dolibarr_set_const($db, "PAYMENT_SECURITY_TOKEN_UNIQUE", GETPOST('PAYMENT_SECURITY_TOKEN_UNIQUE', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
}

View File

@ -120,7 +120,7 @@ if (empty($reshook)) {
if (!$error) {
$result = dol_set_user_param($db, $conf, $object, $tabparam);
if (!$result > 0) {
if (!($result > 0)) {
$error++;
}
}

View File

@ -572,7 +572,7 @@ if (empty($reshook)) {
$newfile = $dir.'/'.dol_sanitizeFileName($_FILES['photo']['name']);
$result = dol_move_uploaded_file($_FILES['photo']['tmp_name'], $newfile, 1, 0, $_FILES['photo']['error']);
if (!$result > 0) {
if (!($result > 0)) {
setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors');
} else {
// Create thumbs