From 768c9de0644a5b96828160013d745132811c886a Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Fri, 20 Sep 2024 17:37:27 +0200 Subject: [PATCH 1/9] Qual create button to factorize services buttons in contrat/card.php (#31063) * Qual create button to factorize services buttons in contrat/card.php * Fix Ci * fix ci --------- Co-authored-by: Hystepik --- htdocs/contrat/card.php | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index e1369036dc1..a86661b5615 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -2257,31 +2257,29 @@ if ($action == 'create') { print dolGetButtonAction('', $langs->trans("Create"), 'default', $arrayofcreatebutton, '', true, $params); } + $arrayforbutaction = array(); if ($object->nbofservicesclosed > 0 || $object->nbofserviceswait > 0) { - if ($user->hasRight('contrat', 'activer')) { - unset($params['attr']['title']); - print dolGetButtonAction($langs->trans('ActivateAllContracts'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=activate&token='.newToken(), '', true, $params); - } else { - unset($params['attr']['title']); - print dolGetButtonAction($langs->trans('ActivateAllContracts'), '', 'default', '#', '', false, $params); - } + $arrayforbutaction[] = array( + 'url' => $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=activate&token='.newToken(), + 'label' => $langs->trans('ActivateAllContracts'), + 'lang' => 'bills', + 'perm' => $user->hasRight('contrat', 'activer'), + 'enabled' => true, + ); } if ($object->nbofservicesclosed < $nbofservices) { - if ($user->hasRight('contrat', 'desactiver')) { - unset($params['attr']['title']); - print dolGetButtonAction($langs->trans('CloseAllContracts'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=close&token='.newToken(), '', true, $params); - } else { - unset($params['attr']['title']); - print dolGetButtonAction($langs->trans('CloseAllContracts'), '', 'default', '#', '', false, $params); - } + $arrayforbutaction[] = array( + 'url' => $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=close&token='.newToken(), + 'label' => $langs->trans('CloseAllContracts'), + 'lang' => 'bills', + 'perm' => $user->hasRight('contrat', 'desactiver'), + 'enabled' => true, + ); + } - //if (! $numactive) - //{ - //} - //else - //{ - // print '
'.$langs->trans("Close").'
'; - //} + if (count($arrayforbutaction)) { + unset($params['attr']['title']); + print dolGetButtonAction('', $langs->trans("Services"), 'default', $arrayforbutaction, '', true, $params); } if (getDolGlobalString('CONTRACT_HIDE_CLOSED_SERVICES_BY_DEFAULT') && $object->nbofservicesclosed > 0) { From 8c14d2d20f524bff0fb31e2d47f708f9b03b9ccf Mon Sep 17 00:00:00 2001 From: William Mead Date: Fri, 20 Sep 2024 17:49:40 +0200 Subject: [PATCH 2/9] Fixed usage of null with select products method (#31066) --- htdocs/bom/tpl/objectline_create.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index 5d3e270e12a..b2bf4b25bca 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -137,9 +137,9 @@ if (isModEnabled("product") || isModEnabled("service")) { $statustoshow = -1; if (getDolGlobalString('ENTREPOT_EXTRA_STATUS')) { // hide products in closed warehouse, but show products for internal transfer - print $form->select_produits(GETPOSTINT('idprod'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, getDolGlobalInt('PRODUIT_LIMIT_SIZE'), $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500 widthcentpercentminusx', 0, 'warehouseopen,warehouseinternal', GETPOSTINT('combinations'), 1); + print $form->select_produits(GETPOSTINT('idprod'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, getDolGlobalInt('PRODUIT_LIMIT_SIZE'), 0, $statustoshow, 2, '', 1, array(), 0, '1', 0, 'maxwidth500 widthcentpercentminusx', 0, 'warehouseopen,warehouseinternal', GETPOSTINT('combinations'), 1); } else { - print $form->select_produits(GETPOSTINT('idprod'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, getDolGlobalInt('PRODUIT_LIMIT_SIZE'), $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500 widthcentpercentminusx', 0, '', GETPOSTINT('combinations'), 1); + print $form->select_produits(GETPOSTINT('idprod'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, getDolGlobalInt('PRODUIT_LIMIT_SIZE'), 0, $statustoshow, 2, '', 1, array(), 0, '1', 0, 'maxwidth500 widthcentpercentminusx', 0, '', GETPOSTINT('combinations'), 1); } $urltocreateproduct = DOL_URL_ROOT.'/product/card.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id); print ''; From 632d1832a9f2c2ce20cc79ad985080460d9a099b Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Fri, 20 Sep 2024 17:51:33 +0200 Subject: [PATCH 3/9] Fix bad request with no token in contrat/card.php (#31064) Co-authored-by: Hystepik --- htdocs/contrat/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index a86661b5615..31a1bbbc2ea 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1962,7 +1962,7 @@ if ($action == 'create') { $tmpactiontext = $langs->trans("Disable"); } if (($tmpaction == 'activateline' && $user->hasRight('contrat', 'activer')) || ($tmpaction == 'unactivateline' && $user->hasRight('contrat', 'desactiver'))) { - print ''; + print ''; print img_picto($tmpactiontext, $tmpactionpicto); print ''; } From 45c32ac9a6b81e9818fd0b98a2be0f16ebfbad60 Mon Sep 17 00:00:00 2001 From: lvessiller-opendsi Date: Fri, 20 Sep 2024 18:05:53 +0200 Subject: [PATCH 4/9] NEW payment term and mode on creating third-party (#31067) --- htdocs/societe/card.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index ba68a571944..8a8b5e8b0a8 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -358,6 +358,10 @@ if (empty($reshook)) { $object->code_client = GETPOSTISSET('customer_code') ? GETPOST('customer_code', 'alpha') : GETPOST('code_client', 'alpha'); $object->code_fournisseur = GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha'); $object->capital = GETPOST('capital', 'alphanohtml'); + if ($action == 'add') { + $object->cond_reglement_id = GETPOSTINT('cond_reglement_id'); + $object->mode_reglement_id = GETPOSTINT('mode_reglement_id'); + } $object->barcode = GETPOST('barcode', 'alphanohtml'); $object->tva_intra = GETPOST('tva_intra', 'alphanohtml'); @@ -1058,6 +1062,16 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); $object->capital = GETPOST('capital', 'alphanohtml'); + $paymentTermId = GETPOSTINT('cond_reglement_id'); // can be set by default values on create page and not already in get or post variables + if (empty($paymentTermId) && !GETPOSTISSET('cond_reglement_id')) { + $paymentTermId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID'); + } + $object->cond_reglement_id = $paymentTermId; + $paymentTypeId = GETPOSTINT('mode_reglement_id'); // can be set by default values on create page and not already in get or post variables + if (empty($paymentTypeId) && !GETPOSTISSET('mode_reglement_id')) { + $paymentTypeId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID'); + } + $object->mode_reglement_id = $paymentTypeId; $object->barcode = GETPOST('barcode', 'alphanohtml'); $object->idprof1 = GETPOST('idprof1', 'alphanohtml'); $object->idprof2 = GETPOST('idprof2', 'alphanohtml'); @@ -1822,6 +1836,20 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio print ''; } + // Payment terms of the settlement + print ''; + print ''.$form->editfieldkey('PaymentConditions', 'cond_reglement_id', '', $object, 0).''; + print ''; + print $form->getSelectConditionsPaiements($object->cond_reglement_id, 'cond_reglement_id', 1, 1, 1, '', $object->deposit_percent); + print ''; + + // Payment mode + print ''; + print ''.$form->editfieldkey('PaymentMode', 'mode_reglement_id', '', $object, 0).''; + print ''; + print $form->select_types_paiements($object->mode_reglement_id, 'mode_reglement_id', '', 0, 1, 1, 0, 1); + print ''; + // Incoterms if (isModEnabled('incoterm')) { print ''; From 9ecfe2609b79883325aa3dbce06b7983f75d3fde Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Fri, 20 Sep 2024 18:10:56 +0200 Subject: [PATCH 5/9] Fix add ip field by adding it in module builder recruitement candidature fields (#31060) Co-authored-by: Hystepik --- .../llx_recruitment_recruitmentcandidature-recruitment.sql | 2 +- htdocs/recruitment/class/recruitmentcandidature.class.php | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature-recruitment.sql b/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature-recruitment.sql index e52c599e012..8016e813d5d 100644 --- a/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature-recruitment.sql +++ b/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature-recruitment.sql @@ -41,6 +41,6 @@ CREATE TABLE llx_recruitment_recruitmentcandidature( email_msgid varchar(175), -- Do not use a too large value, it generates trouble with unique index email_date datetime, fk_recruitment_origin INTEGER NULL, - -- END MODULEBUILDER FIELDS ip varchar(250) --ip used to create record (for public submission page) + -- END MODULEBUILDER FIELDS ) ENGINE=innodb; diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php index 5de46df4c73..e217f3489ae 100644 --- a/htdocs/recruitment/class/recruitmentcandidature.class.php +++ b/htdocs/recruitment/class/recruitmentcandidature.class.php @@ -124,6 +124,7 @@ class RecruitmentCandidature extends CommonObject 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 1000, 'notnull' => -1, 'visible' => -2,), 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'position' => 1010, 'notnull' => -1, 'visible' => 0,), 'status' => array('type' => 'smallint', 'label' => 'Status', 'enabled' => 1, 'position' => 1000, 'notnull' => 1, 'visible' => 2, 'index' => 1, 'default' => '0', 'arrayofkeyval' => array('0' => 'Draft', '1' => 'Received', '3' => 'ContractProposed', '5' => 'ContractSigned', '8' => 'Refused', '9' => 'Canceled')), + "ip" => array("type" => "varchar(250)", "label" => "Ip", "enabled" => "1", 'position' => 700, 'notnull' => 0, "visible" => "0", "comment" => "ip used to create record (for public submission page)"), ); public $rowid; public $entity; @@ -146,12 +147,8 @@ class RecruitmentCandidature extends CommonObject public $import_key; public $model_pdf; public $status; - // END MODULEBUILDER PROPERTIES - - /** - * @var string IP address - */ public $ip; + // END MODULEBUILDER PROPERTIES /** * Constructor From 6ce09ce68d2d9279e68cc80dfded6ab7ba03bc30 Mon Sep 17 00:00:00 2001 From: Mohamed DAOUD Date: Fri, 20 Sep 2024 18:12:32 +0200 Subject: [PATCH 6/9] Add town and country as an optionnal column in Partnership list (#31057) * add town country partnership list * Update partnership_list.php * Update partnership_list.php --- htdocs/core/lib/functions.lib.php | 2 +- htdocs/partnership/partnership_list.php | 65 +++++++++++++++++++++---- 2 files changed, 57 insertions(+), 10 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 5d449de78eb..2792d60f7d3 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -12899,7 +12899,7 @@ function getElementProperties($elementType) $classfile = 'mailing'; $classname = 'Mailing'; $subelement = ''; - } elseif ($elementType == 'member') { + } elseif ($elementType == 'member' || $elementType == 'adherent') { $classpath = 'adherents/class'; $module = 'adherent'; $subelement = 'adherent'; diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index 372b8cf3b4a..47347792176 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -95,10 +95,19 @@ if ($managedfor != 'member' && $sortfield == 'd.datefin') { $sortfield = ''; } +// Add non object fields to fields for list +$non_object_fields = array( + 'town' => array('type' => 'varchar(128)', 'label' => 'Town', 'enabled' => 1, 'position' => 51, 'notnull' => 0, 'visible' => 1, 'alwayseditable' => 1, 'searchall' => 1,), + 'country' => array('type' => 'integer', 'label' => 'Country', 'enabled' => 1, 'position' => 51, 'notnull' => 0, 'visible' => 1, 'alwayseditable' => 1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'searchall' => 1,) +); + +// All fields in list +$all_fields_list = array_merge($object->fields, $non_object_fields); + // Default sort order (if not yet defined by previous GETPOST) if (!$sortfield) { - reset($object->fields); // Reset is required to avoid key() to return null. - $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition. + reset($all_fields_list); // Reset is required to avoid key() to return null. + $sortfield = "t.".key($all_fields_list); // Set here default search field. By default 1st field in definition. } if (!$sortorder) { $sortorder = "ASC"; @@ -107,7 +116,7 @@ if (!$sortorder) { // Initialize array of search criteria $search_all = GETPOST('search_all', 'alphanohtml'); $search = array(); -foreach ($object->fields as $key => $val) { +foreach ($all_fields_list as $key => $val) { if (GETPOST('search_'.$key, 'alpha') !== '') { $search[$key] = GETPOST('search_'.$key, 'alpha'); } @@ -124,7 +133,7 @@ if ($filter) { // List of fields to search into when doing a "search in all" $fieldstosearchall = array(); -foreach ($object->fields as $key => $val) { +foreach ($non_object_fields as $key => $val) { if (!empty($val['searchall'])) { $fieldstosearchall['t.'.$key] = $val['label']; } @@ -132,7 +141,7 @@ foreach ($object->fields as $key => $val) { // Definition of array of fields for columns $arrayfields = array(); -foreach ($object->fields as $key => $val) { +foreach ($all_fields_list as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { $visible = (int) dol_eval((string) $val['visible'], 1); @@ -150,6 +159,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +$all_fields_list = dol_sort_array($all_fields_list, 'position'); $permissiontoread = $user->hasRight('partnership', 'read'); $permissiontoadd = $user->hasRight('partnership', 'write'); @@ -197,7 +207,7 @@ if (empty($reshook)) { // Purge search criteria if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers - foreach ($object->fields as $key => $val) { + foreach ($all_fields_list as $key => $val) { $search[$key] = ''; if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { $search[$key.'_dtstart'] = ''; @@ -337,6 +347,8 @@ if (isset($extrafields->attributes[$object->table_element]['label']) && is_array if ($managedfor == 'member') { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."adherent as d on (d.rowid = t.fk_member)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."adherent_type as dty on (dty.rowid = d.fk_adherent_type)"; +} else { + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as d on (d.rowid = t.fk_soc)"; } // Add table from hooks $parameters = array(); @@ -387,6 +399,17 @@ foreach ($search as $key => $val) { } } } + if ($key == 'country' && $search[$key] != '') { + if ($managedfor == 'member') { + $sql .= " AND d.country = '".$db->escape($val)."'"; + } else { + $sql .= " AND d.fk_pays = '".$db->escape($val)."'"; + } + //$sql .= natural_search("d.fk_pays", $val); + } + if ($key == 'town' && $search[$key] != '') { + $sql .= natural_search("d.town", $val); + } } } if ($managedfor == 'member') { @@ -742,7 +765,7 @@ if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print $searchpicto; print ''; } -foreach ($object->fields as $key => $val) { +foreach ($all_fields_list as $key => $val) { $searchkey = empty($search[$key]) ? '' : $search[$key]; $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if ($key == 'status') { @@ -771,6 +794,8 @@ foreach ($object->fields as $key => $val) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; $formadmin = new FormAdmin($db); print $formadmin->select_language($search[$key], 'search_lang', 0, null, 1, 0, 0, 'minwidth100imp maxwidth125', 2); + } elseif ($key == 'country') { + print $form->select_country($search[$key], 'search_country', '', 0, 'minwidth100imp maxwidth100'); } else { print ''; } @@ -810,7 +835,7 @@ if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; $totalarray['nbfield']++; // For the column action } -foreach ($object->fields as $key => $val) { +foreach ($all_fields_list as $key => $val) { $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if ($key == 'status') { $cssforfield .= ($cssforfield ? ' ' : '').'center'; @@ -888,6 +913,12 @@ while ($i < $imaxinloop) { $object->thirdparty = $companyobj; } + if ($managedfor == 'member') { + if ($obj->fk_member > 0) { + $result = $adherent->fetch($obj->fk_member); + } + } + if ($mode == 'kanban') { if ($i == 0) { print ''; @@ -925,7 +956,7 @@ while ($i < $imaxinloop) { $totalarray['nbfield']++; } } - foreach ($object->fields as $key => $val) { + foreach ($all_fields_list as $key => $val) { $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; @@ -952,6 +983,22 @@ while ($i < $imaxinloop) { print '>'; if ($key == 'status') { print $object->getLibStatut(5); + } elseif ($key == 'country') { + if ($managedfor == 'member') { + if (!empty($adherent->country_code)) { + print $langs->trans("Country".$adherent->country_code); + } + } else { + if (!empty($object->thirdparty->country_code)) { + print $langs->trans("Country".$object->thirdparty->country_code); + } + } + } elseif ($key == 'town') { + if ($managedfor == 'member') { + print $adherent->town; + } else { + print $object->thirdparty->town; + } } elseif ($key == 'rowid') { print $object->showOutputField($val, $key, $object->id, ''); } else { From 038e1e8f05632c47706b4417e7f959079c37bf74 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 23 Sep 2024 00:26:10 +0200 Subject: [PATCH 7/9] Qual: Exclude lessc.class.php from phpstan (#31078) # Qual: Exclude lessc.class.php from phpstan 'lessc' is considered an external analysis and can be excluded from analysis (>400 less phpstan notices). --- phpstan.neon.dist | 1 + 1 file changed, 1 insertion(+) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 73437dd34af..dd2bd5784be 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -25,6 +25,7 @@ parameters: - htdocs/support/* analyse: - htdocs/includes/* + - htdocs/core/class/lessc.class.php checkAlwaysTrueCheckTypeFunctionCall: false checkAlwaysTrueInstanceof: false checkAlwaysTrueStrictComparison: false From 7b4c4d772c6a4a8f2a0084a969acbaa9973a15df Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 23 Sep 2024 00:37:30 +0200 Subject: [PATCH 8/9] Qual: Fix notices for FormSms, RssParser, ExpenseReportIk and related (#31086) * Qual: Fix Array of tabs typing hints # Qual: Fix Array of tabs typing hints Fixed same typing hints accross several files * Qual: Fix pdf.lib.php, project.lib.php and related files # Qual: Fix pdf.lib.php, project.lib.php and related files Fix most phan notices for pdf.lib.php and project.lib.php. And fixed some items in other files in the process * Qual: Fix notifications commande/card advtarget.tpl fichinter/card societe/card supplier_proposal/card * Qual: Fix notices for FormSms, RssParser, ExpenseReportIk and related # Qual: Fix notices for FormSms, RssParser, ExpenseReportIk and related Fix notices in the files for the classes above and other files to accomodate these changes/fixes --- dev/tools/fixcopyrightheader.php | 6 +- dev/tools/phan/baseline.txt | 94 ++++----- htdocs/admin/expensereport_ik.php | 25 ++- htdocs/comm/mailing/advtargetemailing.php | 5 + htdocs/commande/card.php | 14 +- .../sociales/class/chargesociales.class.php | 1 + .../core/class/commondocgenerator.class.php | 62 +++--- htdocs/core/class/commonobject.class.php | 196 +++++++++--------- htdocs/core/class/html.formcompany.class.php | 20 +- htdocs/core/class/html.formsms.class.php | 65 +++++- htdocs/core/class/rssparser.class.php | 88 +++++++- htdocs/core/lib/accounting.lib.php | 2 +- htdocs/core/lib/admin.lib.php | 12 +- htdocs/core/lib/agenda.lib.php | 7 +- htdocs/core/lib/categories.lib.php | 5 +- htdocs/core/lib/contact.lib.php | 3 +- htdocs/core/lib/contract.lib.php | 5 +- htdocs/core/lib/donation.lib.php | 5 +- htdocs/core/lib/ecm.lib.php | 9 +- htdocs/core/lib/emailing.lib.php | 3 +- htdocs/core/lib/expedition.lib.php | 2 +- htdocs/core/lib/expensereport.lib.php | 2 +- htdocs/core/lib/fichinter.lib.php | 4 +- htdocs/core/lib/fiscalyear.lib.php | 3 +- htdocs/core/lib/fourn.lib.php | 4 +- htdocs/core/lib/hrm.lib.php | 3 +- htdocs/core/lib/loan.lib.php | 2 +- htdocs/core/lib/multicurrency.lib.php | 5 +- htdocs/core/lib/openid_connect.lib.php | 3 +- htdocs/core/lib/order.lib.php | 5 +- htdocs/core/lib/pdf.lib.php | 159 +++++++------- htdocs/core/lib/prelevement.lib.php | 5 +- htdocs/core/lib/product.lib.php | 11 +- htdocs/core/lib/project.lib.php | 124 +++++++---- htdocs/core/lib/propal.lib.php | 7 +- htdocs/core/lib/reception.lib.php | 3 +- htdocs/core/lib/sendings.lib.php | 7 +- htdocs/core/lib/stock.lib.php | 3 +- htdocs/core/lib/supplier_proposal.lib.php | 3 +- htdocs/core/lib/tax.lib.php | 3 +- htdocs/core/lib/trip.lib.php | 3 +- htdocs/core/lib/usergroups.lib.php | 6 +- htdocs/core/lib/vat.lib.php | 3 +- .../project/doc/pdf_beluga.modules.php | 2 +- .../doc/pdf_eagle_proforma.modules.php | 2 + htdocs/core/tpl/advtarget.tpl.php | 17 +- htdocs/dav/dav.lib.php | 3 +- htdocs/expensereport/card.php | 12 +- .../class/expensereport_ik.class.php | 12 +- htdocs/fichinter/card-rec.php | 17 +- htdocs/fichinter/card.php | 12 +- htdocs/projet/activity/permonth.php | 10 +- htdocs/projet/card.php | 10 +- htdocs/projet/class/api_projects.class.php | 13 +- htdocs/projet/class/project.class.php | 94 +++++---- htdocs/projet/tasks/comment.php | 5 +- htdocs/projet/tasks/task.php | 4 +- htdocs/societe/card.php | 54 +++-- htdocs/supplier_proposal/card.php | 16 +- htdocs/variants/lib/variants.lib.php | 3 +- 60 files changed, 768 insertions(+), 515 deletions(-) diff --git a/dev/tools/fixcopyrightheader.php b/dev/tools/fixcopyrightheader.php index 36e964ca8fd..f6b076e82ee 100755 --- a/dev/tools/fixcopyrightheader.php +++ b/dev/tools/fixcopyrightheader.php @@ -138,7 +138,7 @@ function updateCopyrightNotice($filename, $fileType, $name, $email) // If the existing year is the same, no need to update } else { // Adjust tabs for proper alignment - print "Offset:".$nameStartToMailStartOffset."\n"; + // print "Offset:".$nameStartToMailStartOffset."\n"; $emailTabs = str_repeat("\t", (int) (max(0, ($nameStartToMailStartOffset + 4 - mb_strlen($name)) / 4))); // No match found, add a new line to the header @@ -162,8 +162,8 @@ function updateCopyrightNotice($filename, $fileType, $name, $email) } // Write the updated content back to the file - //file_put_contents($filename, $fileContent); - print $fileContent; + file_put_contents($filename, $fileContent); + // print $fileContent; return true; // Change detected } diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index 9fd618e9490..b5982d6a737 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -9,38 +9,38 @@ */ return [ // # Issue statistics: - // PhanPluginUnknownPropertyType : 1550+ occurrences - // PhanTypeMismatchArgumentProbablyReal : 890+ occurrences + // PhanPluginUnknownPropertyType : 1520+ occurrences // PhanUndeclaredProperty : 840+ occurrences - // PhanPossiblyUndeclaredGlobalVariable : 750+ occurrences - // PhanPluginUnknownArrayMethodReturnType : 480+ occurrences - // PhanUndeclaredGlobalVariable : 470+ occurrences - // PhanPluginUnknownArrayMethodParamType : 410+ occurrences - // PhanPossiblyUndeclaredVariable : 350+ occurrences - // PhanPluginUnknownObjectMethodCall : 330+ occurrences - // PhanPluginUnknownArrayFunctionReturnType : 220+ occurrences - // PhanTypeMismatchProperty : 210+ occurrences - // PhanPluginUnknownArrayFunctionParamType : 160+ occurrences + // PhanTypeMismatchArgumentProbablyReal : 780+ occurrences + // PhanPossiblyUndeclaredGlobalVariable : 730+ occurrences + // PhanPluginUnknownArrayMethodReturnType : 470+ occurrences + // PhanUndeclaredGlobalVariable : 440+ occurrences + // PhanPluginUnknownArrayMethodParamType : 400+ occurrences + // PhanPossiblyUndeclaredVariable : 330+ occurrences + // PhanPluginUnknownObjectMethodCall : 230+ occurrences + // PhanTypeMismatchProperty : 200+ occurrences + // PhanPluginUnknownArrayFunctionReturnType : 160+ occurrences + // PhanPluginUnknownArrayFunctionParamType : 150+ occurrences // PhanTypeMismatchArgumentNullableInternal : 110+ occurrences // PhanPluginUnknownArrayPropertyType : 80+ occurrences // PhanPluginUndeclaredVariableIsset : 70+ occurrences - // PhanPluginEmptyStatementIf : 60+ occurrences + // PhanPluginEmptyStatementIf : 55+ occurrences // PhanRedefineFunction : 55+ occurrences - // PhanTypeExpectedObjectPropAccess : 50+ occurrences // PhanTypeSuspiciousNonTraversableForeach : 50+ occurrences // PhanTypeMismatchDimFetch : 40+ occurrences + // PhanTypeExpectedObjectPropAccess : 25+ occurrences // PhanPossiblyNullTypeMismatchProperty : 15+ occurrences // PhanTypeComparisonFromArray : 15+ occurrences // PhanUndeclaredConstant : 15+ occurrences // PhanEmptyForeach : 10+ occurrences - // PhanPluginBothLiteralsBinaryOp : 10+ occurrences // PhanPluginConstantVariableNull : 10+ occurrences // PhanPluginDuplicateExpressionBinaryOp : 10+ occurrences // PhanPluginSuspiciousParamPosition : 10+ occurrences - // PhanTypeExpectedObjectPropAccessButGotNull : 9 occurrences // PhanUndeclaredMethod : 9 occurrences + // PhanPluginBothLiteralsBinaryOp : 8 occurrences // PhanPluginDuplicateArrayKey : 8 occurrences // PhanTypeMismatchDimFetchNullable : 7 occurrences + // PhanTypeExpectedObjectPropAccessButGotNull : 6 occurrences // PhanInvalidFQSENInClasslike : 2 occurrences // PhanParamTooMany : 2 occurrences // PhanAccessMethodProtected : 1 occurrence @@ -129,7 +129,6 @@ return [ 'htdocs/comm/propal/class/propalestats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], 'htdocs/comm/propal/list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/comm/propal/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/commande/card.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], 'htdocs/commande/class/api_orders.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/commande/class/commande.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'], 'htdocs/commande/class/commandestats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], @@ -291,7 +290,7 @@ return [ 'htdocs/core/class/canvas.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/ccountry.class.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], 'htdocs/core/class/cgenericdic.class.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], - 'htdocs/core/class/commondocgenerator.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanTypeSuspiciousNonTraversableForeach', 'PhanUndeclaredProperty'], + 'htdocs/core/class/commondocgenerator.class.php' => ['PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanTypeSuspiciousNonTraversableForeach', 'PhanUndeclaredProperty'], 'htdocs/core/class/commonhookactions.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayPropertyType'], 'htdocs/core/class/commoninvoice.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/core/class/commonobject.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeComparisonFromArray', 'PhanTypeMismatchDimFetch', 'PhanUndeclaredProperty'], @@ -333,7 +332,6 @@ return [ 'htdocs/core/class/html.formother.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/html.formprojet.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/class/html.formsetup.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayPropertyType'], - 'htdocs/core/class/html.formsms.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccessButGotNull'], 'htdocs/core/class/html.formticket.class.php' => ['PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/class/html.formwebsite.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/infobox.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], @@ -344,7 +342,7 @@ return [ 'htdocs/core/class/notify.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/openid.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/reddithandler.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType'], - 'htdocs/core/class/rssparser.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeExpectedObjectPropAccess'], + 'htdocs/core/class/rssparser.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/class/smtps.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchDimFetch'], 'htdocs/core/class/socialnetworkmanager.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/core/class/stats.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchDimFetch'], @@ -367,23 +365,18 @@ return [ 'htdocs/core/lib/ajax.lib.php' => ['PhanPluginUnknownArrayFunctionParamType'], 'htdocs/core/lib/asset.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/bank.lib.php' => ['PhanPluginEmptyStatementIf', 'PhanUndeclaredProperty'], - 'htdocs/core/lib/categories.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/company.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty'], - 'htdocs/core/lib/contact.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/contract.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/cron.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/customreports.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchDimFetch'], 'htdocs/core/lib/date.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/core/lib/doc.lib.php' => ['PhanPossiblyUndeclaredVariable'], - 'htdocs/core/lib/donation.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/ecm.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/core/lib/emailing.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/eventorganization.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/expedition.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/expensereport.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/fichinter.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall'], 'htdocs/core/lib/files.lib.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'], - 'htdocs/core/lib/fiscalyear.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/fourn.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/ftp.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/core/lib/functions.lib.php' => ['PhanPluginDuplicateArrayKey'], @@ -401,16 +394,15 @@ return [ 'htdocs/core/lib/loan.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/mailmanspip.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/memory.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/core/lib/multicurrency.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType'], + 'htdocs/core/lib/multicurrency.lib.php' => ['PhanPluginUnknownArrayFunctionParamType'], 'htdocs/core/lib/oauth.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/core/lib/openid_connect.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/order.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/payments.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/core/lib/pdf.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/core/lib/pdf.lib.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredProperty'], 'htdocs/core/lib/prelevement.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/price.lib.php' => ['PhanPluginSuspiciousParamPosition', 'PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/core/lib/product.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable'], - 'htdocs/core/lib/project.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/core/lib/project.lib.php' => ['PhanUndeclaredProperty'], 'htdocs/core/lib/propal.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall'], 'htdocs/core/lib/receiptprinter.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/reception.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], @@ -419,18 +411,16 @@ return [ 'htdocs/core/lib/salaries.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/security.lib.php' => ['PhanPluginUnknownArrayFunctionParamType'], 'htdocs/core/lib/security2.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable'], - 'htdocs/core/lib/sendings.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/core/lib/sendings.lib.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/lib/signature.lib.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/lib/socialnetwork.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/stock.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/supplier_proposal.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall'], 'htdocs/core/lib/takepos.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/core/lib/tax.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable'], + 'htdocs/core/lib/tax.lib.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/lib/ticket.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/treeview.lib.php' => ['PhanPluginUnknownArrayFunctionParamType'], - 'htdocs/core/lib/trip.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/core/lib/usergroups.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/lib/vat.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], + 'htdocs/core/lib/usergroups.lib.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/lib/website.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/core/lib/xcal.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'], 'htdocs/core/modules/DolibarrModules.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], @@ -530,7 +520,6 @@ return [ 'htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeSuspiciousNonTraversableForeach'], 'htdocs/core/modules/workstation/mod_workstation_advanced.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/search_page.php' => ['PhanEmptyForeach', 'PhanPluginBothLiteralsBinaryOp'], - 'htdocs/core/tpl/advtarget.tpl.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeExpectedObjectPropAccessButGotNull', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/ajaxrow.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/bloc_comment.tpl.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/card_presend.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], @@ -554,8 +543,8 @@ return [ 'htdocs/core/tpl/objectline_title.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/core/tpl/objectline_view.tpl.php' => ['PhanTypeExpectedObjectPropAccessButGotNull', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/core/tpl/onlinepaymentlinks.tpl.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/core/tpl/passwordforgotten.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], - 'htdocs/core/tpl/passwordreset.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], + 'htdocs/core/tpl/passwordforgotten.tpl.php' => ['PhanUndeclaredGlobalVariable'], + 'htdocs/core/tpl/passwordreset.tpl.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/resource_add.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/resource_view.tpl.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/triggers/dolibarrtriggers.class.php' => ['PhanPluginUnknownArrayPropertyType'], @@ -572,7 +561,6 @@ return [ 'htdocs/datapolicy/class/datapolicy.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'], 'htdocs/datapolicy/class/datapolicycron.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/datapolicy/lib/datapolicy.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/dav/dav.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/debugbar/class/DataCollector/DolConfigCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/debugbar/class/DataCollector/DolExceptionsCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/debugbar/class/DataCollector/DolMemoryCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'], @@ -634,10 +622,9 @@ return [ 'htdocs/expedition/note.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/expedition/shipment.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/expedition/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/expensereport/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/expensereport/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/expensereport/class/api_expensereports.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/expensereport/class/expensereport.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeExpectedObjectPropAccessButGotNull'], - 'htdocs/expensereport/class/expensereport_ik.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], + 'htdocs/expensereport/class/expensereport.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeExpectedObjectPropAccessButGotNull'], 'htdocs/expensereport/class/expensereportstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/expensereport/class/paymentexpensereport.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/expensereport/payment/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], @@ -648,8 +635,8 @@ return [ 'htdocs/expensereport/tpl/expensereport_linktofile.tpl.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/expensereport/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/externalsite/frames.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/fichinter/card-rec.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccessButGotNull', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/fichinter/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/fichinter/card-rec.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/fichinter/card.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/fichinter/class/api_interventions.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'], 'htdocs/fichinter/class/fichinter.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall'], 'htdocs/fichinter/class/fichinterrec.class.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], @@ -684,7 +671,7 @@ return [ 'htdocs/fourn/paiement/document.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/fourn/product/list.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/ftp/admin/ftpclient.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/ftp/index.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/ftp/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/holiday/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], 'htdocs/holiday/card_group.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], 'htdocs/holiday/class/holiday.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'], @@ -852,16 +839,15 @@ return [ 'htdocs/product/stock/tpl/stocktransfer.tpl.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/projet/activity/index.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccessButGotNull', 'PhanUndeclaredGlobalVariable'], 'htdocs/projet/activity/perday.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/projet/activity/permonth.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/projet/activity/perweek.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/projet/admin/project.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/projet/ajax/projects.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/projet/card.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], - 'htdocs/projet/class/api_projects.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/projet/class/api_projects.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall'], 'htdocs/projet/class/api_tasks.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/projet/class/project.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginSuspiciousParamPosition', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/projet/class/project.class.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/projet/class/projectstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'], - 'htdocs/projet/class/task.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/projet/class/task.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], 'htdocs/projet/class/taskstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], 'htdocs/projet/contact.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeComparisonFromArray', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/projet/element.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], @@ -968,7 +954,7 @@ return [ 'htdocs/societe/ajax/ajaxcompanies.php' => ['PhanUndeclaredProperty'], 'htdocs/societe/ajax/company.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/societe/canvas/actions_card_common.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanTypeSuspiciousNonTraversableForeach'], - 'htdocs/societe/card.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], + 'htdocs/societe/card.php' => ['PhanTypeMismatchProperty'], 'htdocs/societe/checkvat/checkVatPopup.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/societe/class/api_contacts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], 'htdocs/societe/class/api_thirdparties.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanTypeSuspiciousNonTraversableForeach', 'PhanUndeclaredProperty'], @@ -985,26 +971,23 @@ return [ 'htdocs/societe/website.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/stripe/admin/stripe.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/stripe/ajax/ajax.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/stripe/charge.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/stripe/class/actions_stripe.class.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginSuspiciousParamPosition', 'PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/stripe/class/actions_stripe.class.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginSuspiciousParamPosition', 'PhanPluginUnknownArrayMethodParamType', 'PhanUndeclaredProperty'], 'htdocs/stripe/class/stripe.class.php' => ['PhanPluginConstantVariableNull', 'PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/stripe/lib/stripe.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/stripe/payout.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/stripe/transaction.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/supplier_proposal/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], + 'htdocs/supplier_proposal/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/supplier_proposal/class/api_supplier_proposals.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'], 'htdocs/supplier_proposal/class/supplier_proposal.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/supplier_proposal/list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/support/inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanRedefineFunction'], 'htdocs/takepos/admin/orderprinters.php' => ['PhanTypeMismatchDimFetch'], - 'htdocs/takepos/admin/terminal.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/takepos/admin/terminal.php' => ['PhanPluginUnknownObjectMethodCall'], 'htdocs/takepos/ajax/ajax.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/takepos/floors.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/takepos/freezone.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/takepos/index.php' => ['PhanPluginUndeclaredVariableIsset'], 'htdocs/takepos/invoice.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/takepos/pay.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/takepos/pay.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/takepos/public/menu.php' => ['PhanUndeclaredProperty'], 'htdocs/takepos/split.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/theme/eldy/badges.inc.php' => ['PhanRedefineFunction'], @@ -1043,7 +1026,6 @@ return [ 'htdocs/variants/class/ProductAttribute.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/variants/class/ProductCombination.class.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/variants/combinations.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty'], - 'htdocs/variants/lib/variants.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/variants/tpl/productattributevalueline_edit.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/variants/tpl/productattributevalueline_view.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/viewimage.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanRedefineFunction'], diff --git a/htdocs/admin/expensereport_ik.php b/htdocs/admin/expensereport_ik.php index ea3305ab8dd..25bd89671b4 100644 --- a/htdocs/admin/expensereport_ik.php +++ b/htdocs/admin/expensereport_ik.php @@ -2,6 +2,7 @@ /* Copyright (C) 2012 Mikael Carlavan * Copyright (C) 2017 ATM Consulting * Copyright (C) 2017 Pierre-Henry Favre + * Copyright (C) 2024 MDW * * 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 @@ -144,6 +145,8 @@ foreach ($rangesbycateg as $fk_c_exp_tax_cat => $Tab) { $tranche = 1; foreach ($Tab['ranges'] as $k => $range) { + $ik = $range->ik; + '@phan-var-force ExpenseReportIk $ik'; if (isset($Tab['ranges'][$k + 1])) { $label = $langs->trans('expenseReportRangeFromTo', $range->range_ik, ($Tab['ranges'][$k + 1]->range_ik - 1)); } else { @@ -161,35 +164,35 @@ foreach ($rangesbycateg as $fk_c_exp_tax_cat => $Tab) { // Offset echo ''; - if ($action == 'edit' && $range->ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) { - echo ''; + if ($action == 'edit' && $ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) { + echo ''; } else { - echo $range->ik->ikoffset; + echo $ik->ikoffset; } echo ''; // Coef echo ''; - if ($action == 'edit' && $range->ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) { - echo ''; + if ($action == 'edit' && $ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) { + echo ''; } else { - echo($range->ik->id > 0 ? $range->ik->coef : $langs->trans('expenseReportCoefUndefined')); + echo($ik->id > 0 ? $ik->coef : $langs->trans('expenseReportCoefUndefined')); } echo ''; // Total for one - echo ''.$langs->trans('expenseReportPrintExample', price($range->ik->ikoffset + 5 * $range->ik->coef)).''; + echo ''.$langs->trans('expenseReportPrintExample', price($ik->ikoffset + 5 * $ik->coef)).''; // Action echo ''; if ($range->range_active == 1) { - if ($action == 'edit' && $range->ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) { + if ($action == 'edit' && $ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) { echo ''; echo ''; } else { - echo ''.img_edit().''; - if (!empty($range->ik->id)) { - echo ''.img_delete().''; + echo ''.img_edit().''; + if (!empty($ik->id)) { + echo ''.img_delete().''; } // TODO add delete link } diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php index f769b19ba90..e96bac0ec28 100644 --- a/htdocs/comm/mailing/advtargetemailing.php +++ b/htdocs/comm/mailing/advtargetemailing.php @@ -78,6 +78,7 @@ if (GETPOST('button_removefilter_x', 'alpha')) { $search_email = ''; } $array_query = array(); +'@phan-var-force array $array_query'; $object = new Mailing($db); $advTarget = new AdvanceTargetingMailing($db); @@ -465,6 +466,10 @@ if ($object->fetch($id) >= 0) { // Show email selectors if ($object->status == 0 && $user->hasRight('mailing', 'creer')) { + // @phan-assert FormAdvTargetEmailing $formadvtargetemaling + // @phan-assert AdvanceTargetingMailing $advTarget + + // @phan-assert arrayfetch($object->origin_id); @@ -1765,6 +1768,7 @@ if ($action == 'create' && $usercancreate) { $classname = ucfirst($subelement); $objectsrc = new $classname($db); + '@phan-var-force Commande|Propal|Contrat $objectsrc'; // Can possibly be other class but CommonObject is too general $objectsrc->fetch($originid); if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) { $objectsrc->fetch_lines(); @@ -1902,7 +1906,7 @@ if ($action == 'create' && $usercancreate) { } else { print ''; $filter = '((s.client:IN:1,2,3) AND (s.status:=:1))'; - print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, null, 0, 'minwidth175 maxwidth500 widthcentpercentminusxx'); + print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth175 maxwidth500 widthcentpercentminusxx'); // reload page to retrieve customer information if (!getDolGlobalString('RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED')) { print '