2
0
forked from Wavyzz/dolibarr

Merge pull request #28877 from mdeweerd/PhanTypeMismatchDefault

Fix & enable PhanTypeMismatchDefault
This commit is contained in:
Laurent Destailleur
2024-03-15 15:44:30 +01:00
committed by GitHub
10 changed files with 49 additions and 51 deletions

View File

@@ -446,7 +446,7 @@ return [
'PhanRedefinedClassReference', 'PhanRedefinedClassReference',
// 'PhanPluginNoCommentOnClass', // 'PhanPluginNoCommentOnClass',
// 'PhanPluginNotFullyQualifiedGlobalConstant', // 'PhanPluginNotFullyQualifiedGlobalConstant',
'PhanTypeMismatchDefault', // 'PhanTypeMismatchDefault',
// 'PhanPluginPHPDocHashComment', // 'PhanPluginPHPDocHashComment',
'PhanPluginShortArrayList', 'PhanPluginShortArrayList',
'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownArrayPropertyType',

View File

@@ -13880,9 +13880,9 @@ function GETPOSTDATE($prefix, $hourTime = '', $gm = 'auto')
* request. * request.
* *
* @param string $prefix Prefix used to build the date selector (for instance using Form::selectDate) * @param string $prefix Prefix used to build the date selector (for instance using Form::selectDate)
* @param int $timestamp If null, the timestamp will be created from request data * @param ?int $timestamp If null, the timestamp will be created from request data
* @param bool $hourTime If timestamp is null, will be passed to GETPOSTDATE to construct the timestamp * @param string $hourTime If timestamp is null, will be passed to GETPOSTDATE to construct the timestamp
* @param bool $gm If timestamp is null, will be passed to GETPOSTDATE to construct the timestamp * @param string $gm If timestamp is null, will be passed to GETPOSTDATE to construct the timestamp
* @return string Portion of URL with query parameters for the specified date * @return string Portion of URL with query parameters for the specified date
*/ */
function buildParamDate($prefix, $timestamp = null, $hourTime = '', $gm = 'auto') function buildParamDate($prefix, $timestamp = null, $hourTime = '', $gm = 'auto')

View File

@@ -639,7 +639,7 @@ function print_start_menu_entry($idsel, $classname, $showmode)
* @param string $idsel Id sel * @param string $idsel Id sel
* @param string $classname Class name * @param string $classname Class name
* @param string $atarget Target * @param string $atarget Target
* @param array{rowid:string,fk_menu:string,langs:string,enabled:int<0,2>,type:string,fk_mainmenu:string,fk_leftmenu:string,url:string,titre:string,perms:string,target:string,mainmenu:string,leftmenu:string,position:int,level?:int,prefix:string} $menuval All the $menuval array * @param array{}|array{rowid:string,fk_menu:string,langs:string,enabled:int<0,2>,type:string,fk_mainmenu:string,fk_leftmenu:string,url:string,titre:string,perms:string,target:string,mainmenu:string,leftmenu:string,position:int,level?:int,prefix:string} $menuval All the $menuval array
* @return void * @return void
*/ */
function print_text_menu_entry($text, $showmode, $url, $id, $idsel, $classname, $atarget, $menuval = array()) function print_text_menu_entry($text, $showmode, $url, $id, $idsel, $classname, $atarget, $menuval = array())

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr> * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -135,7 +136,7 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders
* @param CommandeFournisseur $object Object * @param CommandeFournisseur $object Object
* @return string Value if OK, 0 if KO * @return string Value if OK, 0 if KO
*/ */
public function getNextValue($objsoc = '', $object = '') public function getNextValue($objsoc, $object)
{ {
global $db, $conf; global $db, $conf;

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr> * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -126,7 +127,7 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders
* @param CommandeFournisseur $object Object * @param CommandeFournisseur $object Object
* @return string|0 Value if OK, 0 if KO * @return string|0 Value if OK, 0 if KO
*/ */
public function getNextValue($objsoc = '', $object = '') public function getNextValue($objsoc, $object)
{ {
global $db, $conf; global $db, $conf;

View File

@@ -656,8 +656,6 @@ class ExpenseReport extends CommonObject
*/ */
public function fetch($id, $ref = '') public function fetch($id, $ref = '')
{ {
global $conf;
$sql = "SELECT d.rowid, d.entity, d.ref, d.note_public, d.note_private,"; // DEFAULT $sql = "SELECT d.rowid, d.entity, d.ref, d.note_public, d.note_private,"; // DEFAULT
$sql .= " d.detail_refuse, d.detail_cancel, d.fk_user_refuse, d.fk_user_cancel,"; // ACTIONS $sql .= " d.detail_refuse, d.detail_cancel, d.fk_user_refuse, d.fk_user_cancel,"; // ACTIONS
$sql .= " d.date_refuse, d.date_cancel,"; // ACTIONS $sql .= " d.date_refuse, d.date_cancel,"; // ACTIONS
@@ -885,6 +883,8 @@ class ExpenseReport extends CommonObject
$sql .= " WHERE f.rowid = ".((int) $id); $sql .= " WHERE f.rowid = ".((int) $id);
$sql .= " AND f.entity = ".$conf->entity; $sql .= " AND f.entity = ".$conf->entity;
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) { if ($resql) {
if ($this->db->num_rows($resql)) { if ($this->db->num_rows($resql)) {
@@ -920,7 +920,7 @@ class ExpenseReport extends CommonObject
*/ */
public function initAsSpecimen() public function initAsSpecimen()
{ {
global $user, $langs, $conf; global $user, $langs;
$now = dol_now(); $now = dol_now();
@@ -983,10 +983,10 @@ class ExpenseReport extends CommonObject
* @param User $user User * @param User $user User
* @return int Return integer <0 if KO, >0 if OK * @return int Return integer <0 if KO, >0 if OK
*/ */
public function fetch_line_by_project($projectid, $user = '') public function fetch_line_by_project($projectid, $user)
{ {
// phpcs:enable // phpcs:enable
global $conf, $db, $langs; global $langs;
$langs->load('trips'); $langs->load('trips');
@@ -1086,8 +1086,6 @@ class ExpenseReport extends CommonObject
public function fetch_lines() public function fetch_lines()
{ {
// phpcs:enable // phpcs:enable
global $conf;
$this->lines = array(); $this->lines = array();
$sql = ' SELECT de.rowid, de.comments, de.qty, de.value_unit, de.date, de.rang,'; $sql = ' SELECT de.rowid, de.comments, de.qty, de.value_unit, de.date, de.rang,';
@@ -1792,7 +1790,7 @@ class ExpenseReport extends CommonObject
*/ */
public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1) public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1)
{ {
global $langs, $conf, $hookmanager; global $langs, $hookmanager;
$result = ''; $result = '';
@@ -1906,7 +1904,7 @@ class ExpenseReport extends CommonObject
* @param float $qty Qty * @param float $qty Qty
* @param double $up Unit price (price with tax) * @param double $up Unit price (price with tax)
* @param int $fk_c_type_fees Type payment * @param int $fk_c_type_fees Type payment
* @param string $vatrate Vat rate (Can be '10' or '10 (ABC)') * @param int<-1,0>|string $vatrate Vat rate (Can be '10' or '10 (ABC)')
* @param string $date Date * @param string $date Date
* @param string $comments Description * @param string $comments Description
* @param int $fk_project Project id * @param int $fk_project Project id
@@ -1917,7 +1915,7 @@ class ExpenseReport extends CommonObject
*/ */
public function addline($qty = 0, $up = 0, $fk_c_type_fees = 0, $vatrate = 0, $date = '', $comments = '', $fk_project = 0, $fk_c_exp_tax_cat = 0, $type = 0, $fk_ecm_files = 0) public function addline($qty = 0, $up = 0, $fk_c_type_fees = 0, $vatrate = 0, $date = '', $comments = '', $fk_project = 0, $fk_c_exp_tax_cat = 0, $type = 0, $fk_ecm_files = 0)
{ {
global $conf, $langs, $mysoc; global $langs, $mysoc;
dol_syslog(get_class($this)."::addline qty=$qty, up=$up, fk_c_type_fees=$fk_c_type_fees, vatrate=$vatrate, date=$date, fk_project=$fk_project, type=$type, comments=$comments", LOG_DEBUG); dol_syslog(get_class($this)."::addline qty=$qty, up=$up, fk_c_type_fees=$fk_c_type_fees, vatrate=$vatrate, date=$date, fk_project=$fk_project, type=$type, comments=$comments", LOG_DEBUG);
@@ -2029,7 +2027,7 @@ class ExpenseReport extends CommonObject
*/ */
public function checkRules($type = 0, $seller = '') public function checkRules($type = 0, $seller = '')
{ {
global $user, $conf, $db, $langs, $mysoc; global $conf, $db, $langs, $mysoc;
$langs->load('trips'); $langs->load('trips');
@@ -2105,7 +2103,7 @@ class ExpenseReport extends CommonObject
*/ */
public function applyOffset($type = 0, $seller = '') public function applyOffset($type = 0, $seller = '')
{ {
global $conf, $mysoc; global $mysoc;
if (!getDolGlobalString('MAIN_USE_EXPENSE_IK')) { if (!getDolGlobalString('MAIN_USE_EXPENSE_IK')) {
return false; return false;
@@ -2327,10 +2325,10 @@ class ExpenseReport extends CommonObject
/** /**
* deleteline * deleteline
* *
* @param int $rowid Row id * @param int $rowid Row id
* @param User $fuser User * @param User|string $fuser User
* @param int $notrigger 1=No trigger * @param int<0,1> $notrigger 1=No trigger
* @return int Return integer <0 if KO, >0 if OK * @return int<0,1> Return integer <0 if KO, >0 if OK
*/ */
public function deleteLine($rowid, $fuser = '', $notrigger = 0) public function deleteLine($rowid, $fuser = '', $notrigger = 0)
{ {
@@ -2473,8 +2471,6 @@ class ExpenseReport extends CommonObject
*/ */
public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
{ {
global $conf;
$outputlangs->load("trips"); $outputlangs->load("trips");
if (!dol_strlen($modele)) { if (!dol_strlen($modele)) {
@@ -2530,7 +2526,7 @@ class ExpenseReport extends CommonObject
*/ */
public function loadStateBoard() public function loadStateBoard()
{ {
global $conf, $user; global $user;
$this->nb = array(); $this->nb = array();
@@ -3040,7 +3036,7 @@ class ExpenseReportLine extends CommonObjectLine
*/ */
public function insert($notrigger = 0, $fromaddline = false) public function insert($notrigger = 0, $fromaddline = false)
{ {
global $user, $conf; global $user;
$error = 0; $error = 0;
@@ -3182,7 +3178,7 @@ class ExpenseReportLine extends CommonObjectLine
*/ */
public function update(User $user) public function update(User $user)
{ {
global $langs, $conf; global $langs;
$error = 0; $error = 0;

View File

@@ -1929,7 +1929,7 @@ class CommandeFournisseur extends CommonOrder
* @param int $date_end Date end of service * @param int $date_end Date end of service
* @param array $array_options extrafields array * @param array $array_options extrafields array
* @param int|null $fk_unit Code of the unit to use. Null to use the default one * @param int|null $fk_unit Code of the unit to use. Null to use the default one
* @param string $pu_ht_devise Amount in currency * @param int|string $pu_ht_devise Amount in currency
* @param string $origin 'order', ... * @param string $origin 'order', ...
* @param int $origin_id Id of origin object * @param int $origin_id Id of origin object
* @param int $rang Rank * @param int $rang Rank
@@ -2880,13 +2880,13 @@ class CommandeFournisseur extends CommonOrder
* *
* @param int $rowid ID de la ligne de facture * @param int $rowid ID de la ligne de facture
* @param string $desc Line description * @param string $desc Line description
* @param float $pu Unit price * @param int|float $pu Unit price
* @param float $qty Quantity * @param int|float $qty Quantity
* @param float $remise_percent Percent discount on line * @param int|float $remise_percent Percent discount on line
* @param float $txtva VAT rate * @param int|float $txtva VAT rate
* @param float $txlocaltax1 Localtax1 tax * @param int|float $txlocaltax1 Localtax1 tax
* @param float $txlocaltax2 Localtax2 tax * @param int|float $txlocaltax2 Localtax2 tax
* @param float $price_base_type Type of price base * @param string $price_base_type Type of price base
* @param int $info_bits Miscellaneous information * @param int $info_bits Miscellaneous information
* @param int $type Type of line (0=product, 1=service) * @param int $type Type of line (0=product, 1=service)
* @param int $notrigger Disable triggers * @param int $notrigger Disable triggers
@@ -2894,11 +2894,11 @@ class CommandeFournisseur extends CommonOrder
* @param integer $date_end Date end of service * @param integer $date_end Date end of service
* @param array $array_options Extrafields array * @param array $array_options Extrafields array
* @param int|null $fk_unit Code of the unit to use. Null to use the default one * @param int|null $fk_unit Code of the unit to use. Null to use the default one
* @param float $pu_ht_devise Unit price in currency * @param int|float $pu_ht_devise Unit price in currency
* @param string $ref_supplier Supplier ref * @param string $ref_supplier Supplier ref
* @return int Return integer < 0 if error, > 0 if ok * @return int Return integer < 0 if error, > 0 if ok
*/ */
public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $price_base_type = 'HT', $info_bits = 0, $type = 0, $notrigger = 0, $date_start = '', $date_end = '', $array_options = [], $fk_unit = null, $pu_ht_devise = 0, $ref_supplier = '') public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $price_base_type = 'HT', $info_bits = 0, $type = 0, $notrigger = 0, $date_start = 0, $date_end = 0, $array_options = [], $fk_unit = null, $pu_ht_devise = 0, $ref_supplier = '')
{ {
global $mysoc, $conf, $langs; global $mysoc, $conf, $langs;
dol_syslog(get_class($this)."::updateline $rowid, $desc, $pu, $qty, $remise_percent, $txtva, $price_base_type, $info_bits, $type, $fk_unit"); dol_syslog(get_class($this)."::updateline $rowid, $desc, $pu, $qty, $remise_percent, $txtva, $price_base_type, $info_bits, $type, $fk_unit");
@@ -3243,8 +3243,8 @@ class CommandeFournisseur extends CommonOrder
/** /**
* Load indicators for dashboard (this->nbtodo and this->nbtodolate) * Load indicators for dashboard (this->nbtodo and this->nbtodolate)
* *
* @param User $user Object user * @param User $user Object user
* @param int $mode "opened", "awaiting" for orders awaiting reception * @param string $mode "opened", "awaiting" for orders awaiting reception
* @return WorkboardResponse|int Return integer <0 if KO, WorkboardResponse if OK * @return WorkboardResponse|int Return integer <0 if KO, WorkboardResponse if OK
*/ */
public function load_board($user, $mode = 'opened') public function load_board($user, $mode = 'opened')

View File

@@ -2065,7 +2065,7 @@ class FactureFournisseur extends CommonInvoice
* @param int $fk_remise_except Id discount used * @param int $fk_remise_except Id discount used
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
*/ */
public function addline($desc, $pu, $txtva, $txlocaltax1, $txlocaltax2, $qty, $fk_product = 0, $remise_percent = 0, $date_start = '', $date_end = '', $fk_code_ventilation = 0, $info_bits = '', $price_base_type = 'HT', $type = 0, $rang = -1, $notrigger = 0, $array_options = [], $fk_unit = null, $origin_id = 0, $pu_devise = 0, $ref_supplier = '', $special_code = '', $fk_parent_line = 0, $fk_remise_except = 0) public function addline($desc, $pu, $txtva, $txlocaltax1, $txlocaltax2, $qty, $fk_product = 0, $remise_percent = 0, $date_start = 0, $date_end = 0, $fk_code_ventilation = 0, $info_bits = 0, $price_base_type = 'HT', $type = 0, $rang = -1, $notrigger = 0, $array_options = [], $fk_unit = null, $origin_id = 0, $pu_devise = 0, $ref_supplier = '', $special_code = '', $fk_parent_line = 0, $fk_remise_except = 0)
{ {
global $langs, $mysoc, $conf; global $langs, $mysoc, $conf;

View File

@@ -1971,7 +1971,7 @@ class Product extends CommonObject
// Add new price // Add new price
$sql = "INSERT INTO ".$this->db->prefix()."product_price(price_level,date_price, fk_product, fk_user_author, price_label, price, price_ttc, price_base_type,tosell, tva_tx, default_vat_code, recuperableonly,"; $sql = "INSERT INTO ".$this->db->prefix()."product_price(price_level,date_price, fk_product, fk_user_author, price_label, price, price_ttc, price_base_type,tosell, tva_tx, default_vat_code, recuperableonly,";
$sql .= " localtax1_tx, localtax2_tx, localtax1_type, localtax2_type, price_min,price_min_ttc,price_by_qty,entity,fk_price_expression) "; $sql .= " localtax1_tx, localtax2_tx, localtax1_type, localtax2_type, price_min,price_min_ttc,price_by_qty,entity,fk_price_expression) ";
$sql .= " VALUES(".($level ? ((int) $level) : 1).", '".$this->db->idate($now)."', ".((int) $this->id).", ".((int) $user->id).", ".(empty($this->price_label)?"null":"'".$this->db->escape($this->price_label)."'").", ".((float) price2num($this->price)).", ".((float) price2num($this->price_ttc)).",'".$this->db->escape($this->price_base_type)."',".((int) $this->status).", ".((float) price2num($this->tva_tx)).", ".($this->default_vat_code ? ("'".$this->db->escape($this->default_vat_code)."'") : "null").", ".((int) $this->tva_npr).","; $sql .= " VALUES(".($level ? ((int) $level) : 1).", '".$this->db->idate($now)."', ".((int) $this->id).", ".((int) $user->id).", ".(empty($this->price_label) ? "null" : "'".$this->db->escape($this->price_label)."'").", ".((float) price2num($this->price)).", ".((float) price2num($this->price_ttc)).",'".$this->db->escape($this->price_base_type)."',".((int) $this->status).", ".((float) price2num($this->tva_tx)).", ".($this->default_vat_code ? ("'".$this->db->escape($this->default_vat_code)."'") : "null").", ".((int) $this->tva_npr).",";
$sql .= " ".price2num($this->localtax1_tx).", ".price2num($this->localtax2_tx).", '".$this->db->escape($this->localtax1_type)."', '".$this->db->escape($this->localtax2_type)."', ".price2num($this->price_min).", ".price2num($this->price_min_ttc).", ".price2num($this->price_by_qty).", ".((int) $conf->entity).",".($this->fk_price_expression > 0 ? ((int) $this->fk_price_expression) : 'null'); $sql .= " ".price2num($this->localtax1_tx).", ".price2num($this->localtax2_tx).", '".$this->db->escape($this->localtax1_type)."', '".$this->db->escape($this->localtax2_type)."', ".price2num($this->price_min).", ".price2num($this->price_min_ttc).", ".price2num($this->price_by_qty).", ".((int) $conf->entity).",".($this->fk_price_expression > 0 ? ((int) $this->fk_price_expression) : 'null');
$sql .= ")"; $sql .= ")";
@@ -2308,7 +2308,7 @@ class Product extends CommonObject
* @param double $newprice New price * @param double $newprice New price
* @param string $newpricebase HT or TTC * @param string $newpricebase HT or TTC
* @param User $user Object user that make change * @param User $user Object user that make change
* @param double $newvat New VAT Rate (For example 8.5. Should not be a string) * @param ?double $newvat New VAT Rate (For example 8.5. Should not be a string)
* @param double $newminprice New price min * @param double $newminprice New price min
* @param int $level 0=standard, >0 = level if multilevel prices * @param int $level 0=standard, >0 = level if multilevel prices
* @param int $newnpr 0=Standard vat rate, 1=Special vat rate for French NPR VAT * @param int $newnpr 0=Standard vat rate, 1=Special vat rate for French NPR VAT
@@ -2320,7 +2320,7 @@ class Product extends CommonObject
* @param int $notrigger Disable triggers * @param int $notrigger Disable triggers
* @return int Return integer <0 if KO, >0 if OK * @return int Return integer <0 if KO, >0 if OK
*/ */
public function updatePrice($newprice, $newpricebase, $user, $newvat = '', $newminprice = 0, $level = 0, $newnpr = 0, $newpbq = 0, $ignore_autogen = 0, $localtaxes_array = array(), $newdefaultvatcode = '', $price_label = '', $notrigger = 0) public function updatePrice($newprice, $newpricebase, $user, $newvat = null, $newminprice = 0, $level = 0, $newnpr = 0, $newpbq = 0, $ignore_autogen = 0, $localtaxes_array = array(), $newdefaultvatcode = '', $price_label = '', $notrigger = 0)
{ {
global $conf, $langs; global $conf, $langs;
@@ -2342,7 +2342,7 @@ class Product extends CommonObject
} }
// Check parameters // Check parameters
if ($newvat == '') { if ($newvat === null || $newvat == '') { // Maintain '' for backwards compatibility
$newvat = $this->tva_tx; $newvat = $this->tva_tx;
} }

View File

@@ -934,9 +934,9 @@ class Task extends CommonObjectLine
* @param string $filteronproj Filter on project ref or label * @param string $filteronproj Filter on project ref or label
* @param string $filteronprojstatus Filter on project status ('-1'=no filter, '0,1'=Draft+Validated only) * @param string $filteronprojstatus Filter on project status ('-1'=no filter, '0,1'=Draft+Validated only)
* @param string $morewherefilter Add more filter into where SQL request (must start with ' AND ...') * @param string $morewherefilter Add more filter into where SQL request (must start with ' AND ...')
* @param string $filteronprojuser Filter on user that is a contact of project * @param int $filteronprojuser Filter on user that is a contact of project
* @param string $filterontaskuser Filter on user assigned to task * @param int $filterontaskuser Filter on user assigned to task
* @param Extrafields $extrafields Show additional column from project or task * @param ?Extrafields $extrafields Show additional column from project or task
* @param int $includebilltime Calculate also the time to bill and billed * @param int $includebilltime Calculate also the time to bill and billed
* @param array $search_array_options Array of search filters. Not Used yet. * @param array $search_array_options Array of search filters. Not Used yet.
* @param int $loadextras Fetch all Extrafields on each project and task * @param int $loadextras Fetch all Extrafields on each project and task
@@ -945,9 +945,9 @@ class Task extends CommonObjectLine
* @param string $sortorder Sort order * @param string $sortorder Sort order
* @return array|string Array of tasks * @return array|string Array of tasks
*/ */
public function getTasksArray($usert = null, $userp = null, $projectid = 0, $socid = 0, $mode = 0, $filteronproj = '', $filteronprojstatus = '-1', $morewherefilter = '', $filteronprojuser = 0, $filterontaskuser = 0, $extrafields = array(), $includebilltime = 0, $search_array_options = array(), $loadextras = 0, $loadRoleMode = 1, $sortfield = '', $sortorder = '') public function getTasksArray($usert = null, $userp = null, $projectid = 0, $socid = 0, $mode = 0, $filteronproj = '', $filteronprojstatus = '-1', $morewherefilter = '', $filteronprojuser = 0, $filterontaskuser = 0, $extrafields = null, $includebilltime = 0, $search_array_options = array(), $loadextras = 0, $loadRoleMode = 1, $sortfield = '', $sortorder = '')
{ {
global $conf, $hookmanager; global $hookmanager;
$tasks = array(); $tasks = array();
@@ -1054,7 +1054,7 @@ class Task extends CommonObjectLine
if ($filteronproj) { if ($filteronproj) {
$sql .= natural_search(array("p.ref", "p.title"), $filteronproj); $sql .= natural_search(array("p.ref", "p.title"), $filteronproj);
} }
if ($filteronprojstatus && $filteronprojstatus != '-1') { if ($filteronprojstatus && (int) $filteronprojstatus != '-1') {
$sql .= " AND p.fk_statut IN (".$this->db->sanitize($filteronprojstatus).")"; $sql .= " AND p.fk_statut IN (".$this->db->sanitize($filteronprojstatus).")";
} }
if ($morewherefilter) { if ($morewherefilter) {