Scrutinizer Auto-Fixes

This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
This commit is contained in:
Scrutinizer Auto-Fixer 2020-11-09 14:18:56 +00:00
parent 0f90cee597
commit f6e3f58fcb
14 changed files with 30 additions and 30 deletions

View File

@ -3918,7 +3918,7 @@ class Commande extends CommonOrder
if (!dol_strlen($modele)) { if (!dol_strlen($modele)) {
$modele = 'einstein'; $modele = 'einstein';
if (! empty($this->modelpdf)) { if (!empty($this->modelpdf)) {
$modele = $this->modelpdf; $modele = $this->modelpdf;
} elseif (!empty($conf->global->COMMANDE_ADDON_PDF)) { } elseif (!empty($conf->global->COMMANDE_ADDON_PDF)) {
$modele = $conf->global->COMMANDE_ADDON_PDF; $modele = $conf->global->COMMANDE_ADDON_PDF;

View File

@ -262,7 +262,7 @@ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sort
$topicmail = "Information"; $topicmail = "Information";
//$modelmail="subscription"; //$modelmail="subscription";
$objecttmp = new Account($db); $objecttmp = new Account($db);
$trackid='bank'.$object->id; $trackid = 'bank'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
if ($sall) if ($sall)

View File

@ -562,7 +562,7 @@ class FactureRec extends CommonInvoice
$this->note_private = $obj->note_private; $this->note_private = $obj->note_private;
$this->note_public = $obj->note_public; $this->note_public = $obj->note_public;
$this->user_author = $obj->fk_user_author; $this->user_author = $obj->fk_user_author;
$this->modelpdf = $obj->model_pdf; // deprecatd $this->modelpdf = $obj->model_pdf; // deprecatd
$this->model_pdf = $obj->model_pdf; $this->model_pdf = $obj->model_pdf;
$this->rang = $obj->rang; $this->rang = $obj->rang;
$this->special_code = $obj->special_code; $this->special_code = $obj->special_code;

View File

@ -627,7 +627,7 @@ class Facture extends CommonInvoice
$sql .= ", ".($this->remise_absolue > 0 ? $this->remise_absolue : 'NULL'); $sql .= ", ".($this->remise_absolue > 0 ? $this->remise_absolue : 'NULL');
$sql .= ", ".($this->remise_percent > 0 ? $this->remise_percent : 'NULL'); $sql .= ", ".($this->remise_percent > 0 ? $this->remise_percent : 'NULL');
$sql .= ", '".$this->db->idate($this->date)."'"; $sql .= ", '".$this->db->idate($this->date)."'";
$sql .= ", ".(empty($this->date_pointoftax) ? "null": "'".$this->db->idate($this->date_pointoftax)."'"); $sql .= ", ".(empty($this->date_pointoftax) ? "null" : "'".$this->db->idate($this->date_pointoftax)."'");
$sql .= ", ".($this->note_private ? "'".$this->db->escape($this->note_private)."'" : "null"); $sql .= ", ".($this->note_private ? "'".$this->db->escape($this->note_private)."'" : "null");
$sql .= ", ".($this->note_public ? "'".$this->db->escape($this->note_public)."'" : "null"); $sql .= ", ".($this->note_public ? "'".$this->db->escape($this->note_public)."'" : "null");
$sql .= ", ".($this->ref_client ? "'".$this->db->escape($this->ref_client)."'" : "null"); $sql .= ", ".($this->ref_client ? "'".$this->db->escape($this->ref_client)."'" : "null");
@ -1057,7 +1057,7 @@ class Facture extends CommonInvoice
$facture->note_public = $this->note_public; $facture->note_public = $this->note_public;
$facture->note_private = $this->note_private; $facture->note_private = $this->note_private;
$facture->ref_client = $this->ref_client; $facture->ref_client = $this->ref_client;
$facture->modelpdf = $this->modelpdf; // deprecated $facture->modelpdf = $this->modelpdf; // deprecated
$facture->model_pdf = $this->modelpdf; $facture->model_pdf = $this->modelpdf;
$facture->fk_project = $this->fk_project; $facture->fk_project = $this->fk_project;
$facture->cond_reglement_id = $this->cond_reglement_id; $facture->cond_reglement_id = $this->cond_reglement_id;
@ -4338,7 +4338,7 @@ class Facture extends CommonInvoice
$modele = 'crabe'; $modele = 'crabe';
$thisTypeConfName = 'FACTURE_ADDON_PDF_'.$this->type; $thisTypeConfName = 'FACTURE_ADDON_PDF_'.$this->type;
if (! empty($this->modelpdf)) { if (!empty($this->modelpdf)) {
$modele = $this->modelpdf; $modele = $this->modelpdf;
} elseif (!empty($conf->global->$thisTypeConfName)) { } elseif (!empty($conf->global->$thisTypeConfName)) {
$modele = $conf->global->$thisTypeConfName; $modele = $conf->global->$thisTypeConfName;

View File

@ -727,7 +727,7 @@ class Contrat extends CommonObject
$this->note_private = $obj->note_private; $this->note_private = $obj->note_private;
$this->note_public = $obj->note_public; $this->note_public = $obj->note_public;
$this->model_pdf = $obj->model_pdf; $this->model_pdf = $obj->model_pdf;
$this->modelpdf = $obj->model_pdf; // deprecated $this->modelpdf = $obj->model_pdf; // deprecated
$this->fk_projet = $obj->fk_project; // deprecated $this->fk_projet = $obj->fk_project; // deprecated
$this->fk_project = $obj->fk_project; $this->fk_project = $obj->fk_project;
@ -2419,7 +2419,7 @@ class Contrat extends CommonObject
if (!dol_strlen($modele)) { if (!dol_strlen($modele)) {
$modele = 'strato'; $modele = 'strato';
if (! empty($this->modelpdf)) { if (!empty($this->modelpdf)) {
$modele = $this->modelpdf; $modele = $this->modelpdf;
} elseif (!empty($conf->global->CONTRACT_ADDON_PDF)) { } elseif (!empty($conf->global->CONTRACT_ADDON_PDF)) {
$modele = $conf->global->CONTRACT_ADDON_PDF; $modele = $conf->global->CONTRACT_ADDON_PDF;

View File

@ -933,8 +933,8 @@ abstract class CommonInvoiceLine extends CommonObjectLine
*/ */
public $total_ttc; public $total_ttc;
public $date_start_fill; // If set to 1, when invoice is created from a template invoice, it will also auto set the field date_start at creation public $date_start_fill; // If set to 1, when invoice is created from a template invoice, it will also auto set the field date_start at creation
public $date_end_fill; // If set to 1, when invoice is created from a template invoice, it will also auto set the field date_end at creation public $date_end_fill; // If set to 1, when invoice is created from a template invoice, it will also auto set the field date_end at creation
/** /**
* List of cumulative options: * List of cumulative options:

View File

@ -628,7 +628,7 @@ class modProduct extends DolibarrModules
$this->import_label[$r] = "SuppliersPricesOfProductsOrServices"; // Translation key $this->import_label[$r] = "SuppliersPricesOfProductsOrServices"; // Translation key
$this->import_icon[$r] = $this->picto; $this->import_icon[$r] = $this->picto;
$this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon
$this->import_tables_array[$r] = array('sp'=>MAIN_DB_PREFIX.'product_fournisseur_price','extra'=>MAIN_DB_PREFIX.'product_fournisseur_price_extrafields'); $this->import_tables_array[$r] = array('sp'=>MAIN_DB_PREFIX.'product_fournisseur_price', 'extra'=>MAIN_DB_PREFIX.'product_fournisseur_price_extrafields');
$this->import_tables_creator_array[$r] = array('sp'=>'fk_user'); $this->import_tables_creator_array[$r] = array('sp'=>'fk_user');
$this->import_fields_array[$r] = array(//field order as per structure of table llx_product_fournisseur_price, without optional fields $this->import_fields_array[$r] = array(//field order as per structure of table llx_product_fournisseur_price, without optional fields
'sp.fk_product'=>"ProductOrService*", 'sp.fk_product'=>"ProductOrService*",
@ -670,13 +670,13 @@ class modProduct extends DolibarrModules
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) // This can fail when class is used on old database (during migration for example) if ($resql) // This can fail when class is used on old database (during migration for example)
{ {
while ($obj = $this->db->fetch_object($resql)) while ($obj = $this->db->fetch_object($resql))
{ {
$fieldname = 'extra.'.$obj->name; $fieldname = 'extra.'.$obj->name;
$fieldlabel = ucfirst($obj->label); $fieldlabel = ucfirst($obj->label);
$this->import_fields_array[$r][$fieldname] = $fieldlabel.($obj->fieldrequired ? '*' : ''); $this->import_fields_array[$r][$fieldname] = $fieldlabel.($obj->fieldrequired ? '*' : '');
$import_extrafield_sample[$fieldname] = $fieldlabel; $import_extrafield_sample[$fieldname] = $fieldlabel;
} }
} }
// End add extra fields // End add extra fields
$this->import_fieldshidden_array[$r] = array('extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'product_fournisseur_price'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) $this->import_fieldshidden_array[$r] = array('extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'product_fournisseur_price'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)

View File

@ -2495,7 +2495,7 @@ class Expedition extends CommonObject
if (!dol_strlen($modele)) { if (!dol_strlen($modele)) {
$modele = 'rouget'; $modele = 'rouget';
if (! empty($this->modelpdf)) { if (!empty($this->modelpdf)) {
$modele = $this->modelpdf; $modele = $this->modelpdf;
} elseif (!empty($conf->global->EXPEDITION_ADDON_PDF)) { } elseif (!empty($conf->global->EXPEDITION_ADDON_PDF)) {
$modele = $conf->global->EXPEDITION_ADDON_PDF; $modele = $conf->global->EXPEDITION_ADDON_PDF;

View File

@ -2207,7 +2207,7 @@ class ExpenseReport extends CommonObject
$langs->load("trips"); $langs->load("trips");
if (!dol_strlen($modele)) { if (!dol_strlen($modele)) {
if (! empty($this->modelpdf)) { if (!empty($this->modelpdf)) {
$modele = $this->modelpdf; $modele = $this->modelpdf;
} elseif (!empty($conf->global->EXPENSEREPORT_ADDON_PDF)) { } elseif (!empty($conf->global->EXPENSEREPORT_ADDON_PDF)) {
$modele = $conf->global->EXPENSEREPORT_ADDON_PDF; $modele = $conf->global->EXPENSEREPORT_ADDON_PDF;

View File

@ -689,7 +689,7 @@ class Fichinter extends CommonObject
if (!dol_strlen($modele)) { if (!dol_strlen($modele)) {
$modele = 'soleil'; $modele = 'soleil';
if (! empty($this->modelpdf)) { if (!empty($this->modelpdf)) {
$modele = $this->modelpdf; $modele = $this->modelpdf;
} elseif (!empty($conf->global->FICHEINTER_ADDON_PDF)) { } elseif (!empty($conf->global->FICHEINTER_ADDON_PDF)) {
$modele = $conf->global->FICHEINTER_ADDON_PDF; $modele = $conf->global->FICHEINTER_ADDON_PDF;

View File

@ -281,7 +281,7 @@ class FichinterRec extends Fichinter
$this->note_public = $obj->note_public; $this->note_public = $obj->note_public;
$this->user_author = $obj->fk_user_author; $this->user_author = $obj->fk_user_author;
$this->model_pdf = $obj->model_pdf; $this->model_pdf = $obj->model_pdf;
$this->modelpdf = $obj->model_pdf; // deprecated $this->modelpdf = $obj->model_pdf; // deprecated
$this->rang = $obj->rang; $this->rang = $obj->rang;
$this->special_code = $obj->special_code; $this->special_code = $obj->special_code;
$this->frequency = $obj->frequency; $this->frequency = $obj->frequency;

View File

@ -1900,7 +1900,7 @@ class Task extends CommonObject
if (!dol_strlen($modele)) { if (!dol_strlen($modele)) {
$modele = 'nodefault'; $modele = 'nodefault';
if (! empty($this->modelpdf)) { if (!empty($this->modelpdf)) {
$modele = $this->modelpdf; $modele = $this->modelpdf;
} elseif (!empty($conf->global->PROJECT_TASK_ADDON_PDF)) { } elseif (!empty($conf->global->PROJECT_TASK_ADDON_PDF)) {
$modele = $conf->global->PROJECT_TASK_ADDON_PDF; $modele = $conf->global->PROJECT_TASK_ADDON_PDF;

View File

@ -1660,7 +1660,7 @@ class Societe extends CommonObject
$this->note_private = $obj->note_private; $this->note_private = $obj->note_private;
$this->note_public = $obj->note_public; $this->note_public = $obj->note_public;
$this->model_pdf = $obj->model_pdf; $this->model_pdf = $obj->model_pdf;
$this->modelpdf = $obj->model_pdf; // deprecated $this->modelpdf = $obj->model_pdf; // deprecated
$this->default_lang = $obj->default_lang; $this->default_lang = $obj->default_lang;
$this->logo = $obj->logo; $this->logo = $obj->logo;
$this->logo_squarred = $obj->logo_squarred; $this->logo_squarred = $obj->logo_squarred;

View File

@ -949,15 +949,15 @@ class User extends CommonObject
$perms = $obj->perms; $perms = $obj->perms;
$subperms = $obj->subperms; $subperms = $obj->subperms;
if (! empty($perms)) { if (!empty($perms)) {
if (!isset($this->rights) || !is_object($this->rights)) { if (!isset($this->rights) || !is_object($this->rights)) {
$this->rights = new stdClass(); // For avoid error $this->rights = new stdClass(); // For avoid error
} }
if (! empty($module)) { if (!empty($module)) {
if (!isset($this->rights->$module) || !is_object($this->rights->$module)) { if (!isset($this->rights->$module) || !is_object($this->rights->$module)) {
$this->rights->$module = new stdClass(); $this->rights->$module = new stdClass();
} }
if (! empty($subperms)) { if (!empty($subperms)) {
if (!isset($this->rights->$module->$perms) || !is_object($this->rights->$module->$perms)) { if (!isset($this->rights->$module->$perms) || !is_object($this->rights->$module->$perms)) {
$this->rights->$module->$perms = new stdClass(); $this->rights->$module->$perms = new stdClass();
} }
@ -1015,15 +1015,15 @@ class User extends CommonObject
$perms = $obj->perms; $perms = $obj->perms;
$subperms = $obj->subperms; $subperms = $obj->subperms;
if (! empty($perms)) { if (!empty($perms)) {
if (!isset($this->rights) || !is_object($this->rights)) { if (!isset($this->rights) || !is_object($this->rights)) {
$this->rights = new stdClass(); // For avoid error $this->rights = new stdClass(); // For avoid error
} }
if (! empty($module)) { if (!empty($module)) {
if (!isset($this->rights->$module) || !is_object($this->rights->$module)) { if (!isset($this->rights->$module) || !is_object($this->rights->$module)) {
$this->rights->$module = new stdClass(); $this->rights->$module = new stdClass();
} }
if (! empty($subperms)) { if (!empty($subperms)) {
if (!isset($this->rights->$module->$perms) || !is_object($this->rights->$module->$perms)) { if (!isset($this->rights->$module->$perms) || !is_object($this->rights->$module->$perms)) {
$this->rights->$module->$perms = new stdClass(); $this->rights->$module->$perms = new stdClass();
} }