Fix scrutinizer bugs

This commit is contained in:
Laurent Destailleur 2021-08-31 20:31:05 +02:00
parent f257d4372a
commit 19f0db23df
7 changed files with 11 additions and 12 deletions

View File

@ -265,7 +265,7 @@ if ($action == 'update') {
$_SESSION["mainmenu"] = ""; // The menu manager may have changed
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup".'&mode='.$mode.(GETPOSTISSET('page_y', 'int') ? '&page_y='.GETPOST('page_y', 'int') : ''));
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup".'&mode='.$mode.(GETPOSTISSET('page_y') ? '&page_y='.GETPOST('page_y', 'int') : ''));
exit;
}

View File

@ -100,7 +100,7 @@ class RejetPrelevement
$facs = $this->getListInvoices(1);
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php';
$lipre = new LignePrelevement($this->db, $user);
$lipre = new LignePrelevement($this->db);
$lipre->fetch($id);
$this->db->begin();

View File

@ -46,13 +46,12 @@ class Validate
/**
* Constructor
* Constructor
*
* @param DoliDB $db Database handler
* @param Translate $outputLang output lang for error
* @return null
* @param DoliDB $db Database handler
* @param Translate $outputLang Output lang for error
*/
public function __construct($db, $outputLang = false)
public function __construct($db, $outputLang = null)
{
global $langs;

View File

@ -63,7 +63,7 @@ class modFckeditor extends DolibarrModules
$this->config_page_url = array("fckeditor.php");
// Dependencies
$this->disabled = (in_array(constant('JS_CKEDITOR'), array('disabled', 'disabled/')) ? 1 : 0); // A condition to disable module (used for native debian packages)
$this->disabled = in_array(constant('JS_CKEDITOR'), array('disabled', 'disabled/'));
$this->depends = array();
$this->requiredby = array('modWebsites');

View File

@ -81,7 +81,7 @@ foreach ($object->fields as $key => $val) {
} elseif ($val['type'] == 'price') {
$value = GETPOSTISSET($key) ? price2num(GETPOST($key)) : price2num($object->$key);
} elseif ($key == 'lang') {
$value = GETPOSTISSET($key, 'aZ09') ? GETPOST($key, 'aZ09') : $object->lang;
$value = GETPOSTISSET($key) ? GETPOST($key, 'aZ09') : $object->lang;
} else {
$value = GETPOSTISSET($key) ? GETPOST($key, 'alpha') : $object->$key;
}

View File

@ -120,7 +120,7 @@ if (empty($reshook)) {
// Upadate / add for lang
if (($action == 'update' || $action == 'add') && !empty($permissiontoadd)) {
$object->lang = GETPOSTISSET('langkm', 'aZ09')?GETPOST('langkm', 'aZ09'):$object->lang;
$object->lang = (GETPOSTISSET('langkm') ? GETPOST('langkm', 'aZ09') : $object->lang);
}
// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen

View File

@ -370,12 +370,12 @@ class Mos extends DolibarrApi
$qtytoprocess = $value["qty"];
if (isset($value["fk_warehouse"])) { // If there is a warehouse to set
if (!($value["fk_warehouse"] > 0)) { // If there is no warehouse set.
throw new RestException(500, "Field fk_warehouse must be > 0 in ".$arrayname);
$error++;
throw new RestException(500, "Field fk_warehouse must be > 0 in ".$arrayname);
}
if ($tmpproduct->status_batch) {
throw new RestException(500, "Product ".$tmpproduct->ref."must be in batch");
$error++;
throw new RestException(500, "Product ".$tmpproduct->ref."must be in batch");
}
}
$idstockmove = 0;