mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Qual: Fix new UndeclaredGlobalVariable notices & enable (#30963)
* Qual: 🛟 Fix typing
Qual: Fix typing
Fix some typing currently failing ci in develop.
* Fix typing for grabimages
* Qual: Fix new UndeclaredGlobalVariable notices & enable
# Qual: Fix new UndeclaredGlobalVariable notices & enable
This fixes several new notices regarding 'undeclared globals' which
mostly correspond to missing initialisations in views and some real
bugs where the variable name was incorrect.
Some less obvious cases are unsolved and ignored (adherents/list,
and fourn/commande/card).
This is in preparation of fixing the notices in the other files
where the baseline was already set to ignore them where most just
need a phan-var-force declaration which will help with verifying
type compatibity and object member verifications
This commit is contained in:
parent
115627a054
commit
9a9e851494
|
|
@ -51,6 +51,7 @@ return [
|
|||
'htdocs/accountancy/class/accountancycategory.class.php' => ['PhanPluginUnknownArrayPropertyType'],
|
||||
'htdocs/accountancy/class/accountancyexport.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/adherents/canvas/actions_adherentcard_common.class.php' => [/* Traverses Adherent as array, ignore */ 'PhanTypeSuspiciousNonTraversableForeach'],
|
||||
'htdocs/adherents/list.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/admin/agenda_extsites.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/admin/agenda_other.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/admin/agenda_reminder.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
|
|
@ -60,7 +61,6 @@ return [
|
|||
'htdocs/admin/bom.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable'],
|
||||
'htdocs/admin/chequereceipts.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/admin/company.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
|
||||
'htdocs/admin/contract.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
|
||||
'htdocs/admin/delais.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchDimFetch'],
|
||||
'htdocs/admin/delivery.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
|
||||
'htdocs/admin/dict.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanRedefineFunction', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
|
|
@ -73,7 +73,6 @@ return [
|
|||
'htdocs/admin/fckeditor.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/admin/fichinter.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
|
||||
'htdocs/admin/geoipmaxmind.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/admin/holiday.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
|
||||
'htdocs/admin/ihm.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/admin/invoice.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/admin/invoice_situation.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
|
|
@ -400,7 +399,6 @@ return [
|
|||
'htdocs/core/class/fiscalyear.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable'],
|
||||
'htdocs/core/class/hookmanager.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/class/html.formaccounting.class.php' => ['PhanPossiblyUndeclaredVariable'],
|
||||
'htdocs/core/class/html.formadmin.class.php' => ['PhanPluginUnknownArrayMethodParamType'],
|
||||
'htdocs/core/class/html.formbarcode.class.php' => ['PhanPluginUnknownArrayMethodParamType'],
|
||||
'htdocs/core/class/html.formcategory.class.php' => ['PhanPluginUnknownArrayMethodParamType'],
|
||||
'htdocs/core/class/html.formcompany.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
|
||||
|
|
@ -744,7 +742,7 @@ return [
|
|||
'htdocs/fourn/class/fournisseur.facture-rec.class.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'],
|
||||
'htdocs/fourn/class/fournisseur.product.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/fourn/class/paiementfourn.class.php' => ['PhanEmptyForeach', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/fourn/commande/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/fourn/commande/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/fourn/commande/contact.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/fourn/commande/dispatch.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccessButGotNull', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/fourn/commande/document.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
|
|
@ -1127,7 +1125,6 @@ return [
|
|||
'htdocs/variants/class/ProductCombination.class.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/variants/combinations.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/variants/lib/variants.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
|
||||
'htdocs/variants/list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/variants/tpl/productattributevalueline_edit.tpl.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/variants/tpl/productattributevalueline_view.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/viewimage.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanRedefineFunction'],
|
||||
|
|
|
|||
|
|
@ -424,7 +424,7 @@ return [
|
|||
'PhanTypePossiblyInvalidDimOffset', // a lot of false positive, in most cases, we want to keep the code as it is
|
||||
// 'PhanPluginUnknownArrayFunctionReturnType', // a lot of false positive, in most cases, we want to keep the code as it is
|
||||
|
||||
'PhanPluginWhitespaceTab', // Dolibarr used tabs
|
||||
'PhanPluginWhitespaceTab', // Dolibarr uses tabs
|
||||
'PhanPluginCanUsePHP71Void', // Dolibarr is maintaining 7.0 compatibility
|
||||
'PhanPluginShortArray', // Dolibarr uses array()
|
||||
'PhanPluginShortArrayList', // Dolibarr uses array()
|
||||
|
|
@ -436,7 +436,7 @@ return [
|
|||
|
||||
'PhanPluginNonBoolBranch', // Not essential - 31240+ occurrences
|
||||
'PhanPluginNumericalComparison', // Not essential - 19870+ occurrences
|
||||
'PhanTypeMismatchArgument', // Not essential - 12300+ occurrences
|
||||
'PhanTypeMismatchArgument', // Also reported by phpstan < lvl6 - 12300+ occurrences
|
||||
'PhanPluginNonBoolInLogicalArith', // Not essential - 11040+ occurrences
|
||||
'PhanPluginConstantVariableScalar', // Not essential - 5180+ occurrences
|
||||
'PhanPluginDuplicateAdjacentStatement',
|
||||
|
|
@ -448,7 +448,7 @@ return [
|
|||
|
||||
// 'PhanPluginUnknownArrayMethodParamType', // Too many troubles to manage. Is enabled in config_extended only.
|
||||
// 'PhanPluginUnknownArrayMethodReturnType', // Too many troubles to manage. Is enabled in config_extended only.
|
||||
'PhanUndeclaredGlobalVariable', // Too many false positives on .tpl.php files. Is enabled into config_extended only.
|
||||
// 'PhanUndeclaredGlobalVariable', // Helps identify variables that are not set/defined - add '@phan-var-force TYPE $varname' in tpl or includes to help type the variable
|
||||
// 'PhanPluginUnknownObjectMethodCall', // False positive for some class. Is enabled in config_extended only.
|
||||
],
|
||||
// You can put relative paths to internal stubs in this config option.
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ $error = 0;
|
|||
if ($action == 'updateMask') {
|
||||
$maskconst = GETPOST('maskconstcontract', 'aZ09');
|
||||
$maskvalue = GETPOST('maskcontract', 'alpha');
|
||||
$res = 0;
|
||||
if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
|
||||
$res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
|
@ -103,8 +104,8 @@ if ($action == 'updateMask') {
|
|||
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=contract&file=SPECIMEN.pdf");
|
||||
return;
|
||||
} else {
|
||||
setEventMessages($obj->error, $obj->errors, 'errors');
|
||||
dol_syslog($obj->error, LOG_ERR);
|
||||
setEventMessages($module->error, $module->errors, 'errors');
|
||||
dol_syslog($module->error, LOG_ERR);
|
||||
}
|
||||
} else {
|
||||
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
|||
if ($action == 'updateMask') {
|
||||
$maskconst = GETPOST('maskconstholiday', 'aZ09');
|
||||
$maskvalue = GETPOST('maskholiday', 'alpha');
|
||||
$res = 0;
|
||||
if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
|
||||
$res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
|
@ -102,8 +103,8 @@ if ($action == 'updateMask') {
|
|||
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=holiday&file=SPECIMEN.pdf");
|
||||
return;
|
||||
} else {
|
||||
setEventMessages($obj->error, $obj->errors, 'errors');
|
||||
dol_syslog($obj->error, LOG_ERR);
|
||||
setEventMessages($module->error, $module->errors, 'errors');
|
||||
dol_syslog($module->error, LOG_ERR);
|
||||
}
|
||||
} else {
|
||||
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.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
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -78,7 +79,7 @@ if ($action == 'builddoc' && $permissiontoread) {
|
|||
$outputlangs->charset_output = $sav_charset_output;
|
||||
} else {
|
||||
$outputlangs->charset_output = $sav_charset_output;
|
||||
dol_print_error($db, $obj->error);
|
||||
dol_print_error($db, $rap->error);
|
||||
}
|
||||
|
||||
$year = GETPOSTINT("reyear");
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* 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
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -55,19 +56,19 @@ class FormAdmin
|
|||
/**
|
||||
* Return html select list with available languages (key='en_US', value='United States' for example)
|
||||
*
|
||||
* @param string|array $selected Language pre-selected. Can be an array if $multiselect is 1.
|
||||
* @param string|string[] $selected Language pre-selected. Can be an array if $multiselect is 1.
|
||||
* @param string $htmlname Name of HTML select
|
||||
* @param int $showauto Show 'auto' choice
|
||||
* @param array $filter Array of keys to exclude in list (opposite of $onlykeys)
|
||||
* @param int|string $showempty '1'=Add empty value or 'string to show'
|
||||
* @param int $showwarning Show a warning if language is not complete
|
||||
* @param int $disabled Disable edit of select
|
||||
* @param int<0,1> $showauto Show 'auto' choice
|
||||
* @param string[] $filter Array of keys to exclude in list (opposite of $onlykeys)
|
||||
* @param int<1,1>|string $showempty '1'=Add empty value or 'string to show'
|
||||
* @param int<0,1> $showwarning Show a warning if language is not complete
|
||||
* @param int<0,1> $disabled Disable edit of select
|
||||
* @param string $morecss Add more css styles
|
||||
* @param int $showcode 1=Add language code into label at beginning, 2=Add language code into label at end
|
||||
* @param int $forcecombo Force to use combo box (so no ajax beautify effect)
|
||||
* @param int $multiselect Make the combo a multiselect
|
||||
* @param array $onlykeys Array of language keys to restrict list with the following keys (opposite of $filter). Example array('fr', 'es', ...)
|
||||
* @param int $mainlangonly 1=Show only main languages ('fr_FR' no' fr_BE', 'es_ES' not 'es_MX', ...)
|
||||
* @param int<0,2> $showcode 1=Add language code into label at beginning, 2=Add language code into label at end
|
||||
* @param int<0,1> $forcecombo Force to use combo box (so no ajax beautify effect)
|
||||
* @param int<0,1> $multiselect Make the combo a multiselect
|
||||
* @param string[] $onlykeys Array of language keys to restrict list with the following keys (opposite of $filter). Example array('fr', 'es', ...)
|
||||
* @param int<0,1> $mainlangonly 1=Show only main languages ('fr_FR' no' fr_BE', 'es_ES' not 'es_MX', ...)
|
||||
* @return string Return HTML select string with list of languages
|
||||
*/
|
||||
public function select_language($selected = '', $htmlname = 'lang_id', $showauto = 0, $filter = array(), $showempty = '', $showwarning = 0, $disabled = 0, $morecss = '', $showcode = 0, $forcecombo = 0, $multiselect = 0, $onlykeys = array(), $mainlangonly = 0)
|
||||
|
|
@ -183,7 +184,7 @@ class FormAdmin
|
|||
*
|
||||
* @param string $selected Preselected menu value
|
||||
* @param string $htmlname Name of html select
|
||||
* @param array $dirmenuarray Array of directories to scan
|
||||
* @param string[] $dirmenuarray Array of directories to scan
|
||||
* @param string $moreattrib More attributes on html select tag
|
||||
* @return integer|void
|
||||
*/
|
||||
|
|
@ -500,9 +501,9 @@ class FormAdmin
|
|||
/**
|
||||
* Function to show the combo select to chose a type of field (varchar, int, email, ...)
|
||||
*
|
||||
* @param string $htmlname Name of HTML select component
|
||||
* @param string $type Type preselected
|
||||
* @param array $typewecanchangeinto Array of possible switch combination from 1 type to another one. This will grey not possible combinations.
|
||||
* @param string $htmlname Name of HTML select component
|
||||
* @param string $type Type preselected
|
||||
* @param string[] $typewecanchangeinto Array of possible switch combination from 1 type to another one. This will grey not possible combinations.
|
||||
* @return string The combo HTML select component
|
||||
*/
|
||||
public function selectTypeOfFields($htmlname, $type, $typewecanchangeinto = array())
|
||||
|
|
|
|||
|
|
@ -2538,7 +2538,7 @@ function colorLighten($hex, $percent)
|
|||
* @param string $hex color in hex
|
||||
* @param float|false $alpha 0 to 1 to add alpha channel
|
||||
* @param bool $returnArray true=return an array instead, false=return string
|
||||
* @return string|array String or array
|
||||
* @return string|array{r:int,g:int,b:int,a?:float} String or array
|
||||
*/
|
||||
function colorHexToRgb($hex, $alpha = false, $returnArray = false)
|
||||
{
|
||||
|
|
@ -2569,7 +2569,7 @@ function colorHexToRgb($hex, $alpha = false, $returnArray = false)
|
|||
* @param string $hex Color in hex
|
||||
* @param float|false $alpha 0 to 1 to add alpha channel
|
||||
* @param bool $returnArray true=return an array instead, false=return string
|
||||
* @return string|array String or array
|
||||
* @return array{h:float,l:float,s:float,a:int|float}|string HSLA as string or array
|
||||
*/
|
||||
function colorHexToHsl($hex, $alpha = false, $returnArray = false)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1919,10 +1919,10 @@ class CommandeFournisseur extends CommonOrder
|
|||
* @param int $type Type of line (0=product, 1=service)
|
||||
* @param int $info_bits More information
|
||||
* @param int $notrigger Disable triggers
|
||||
* @param int $date_start Date start of service
|
||||
* @param int $date_end Date end of service
|
||||
* @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 $date_start Date start of service
|
||||
* @param ?int $date_end Date end of service
|
||||
* @param array<string,null|int|float|string> $array_options extrafields array
|
||||
* @param ?int $fk_unit Code of the unit to use. Null to use the default one
|
||||
* @param int|string $pu_ht_devise Amount in currency
|
||||
* @param string $origin 'order', ...
|
||||
* @param int $origin_id Id of origin object
|
||||
|
|
|
|||
|
|
@ -628,7 +628,7 @@ if (empty($reshook)) {
|
|||
($price_base_type == 'TTC' ? $pu : 0),
|
||||
$type,
|
||||
$tva_npr,
|
||||
'',
|
||||
0,
|
||||
$date_start,
|
||||
$date_end,
|
||||
$array_options,
|
||||
|
|
@ -671,6 +671,7 @@ if (empty($reshook)) {
|
|||
|
||||
if (GETPOST('price_ht') != '' || GETPOST('multicurrency_price_ht') != '') {
|
||||
$pu_ht = price2num($price_ht, 'MU'); // $pu_ht must be rounded according to settings
|
||||
$pu_ttc = '';
|
||||
} else {
|
||||
$pu_ttc = price2num(GETPOST('price_ttc'), 'MU');
|
||||
$pu_ht = price2num((float) $pu_ttc / (1 + ((float) $tva_tx / 100)), 'MU'); // $pu_ht must be rounded according to settings
|
||||
|
|
@ -678,7 +679,7 @@ if (empty($reshook)) {
|
|||
$price_base_type = 'HT';
|
||||
$pu_ht_devise = price2num($price_ht_devise, 'CU');
|
||||
|
||||
$result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, $ref_supplier, $remise_percent, $price_base_type, $pu_ttc, $type, '', '', $date_start, $date_end, $array_options, $fk_unit, $pu_ht_devise);
|
||||
$result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, $ref_supplier, $remise_percent, $price_base_type, $pu_ttc, $type, 0, 0, $date_start, $date_end, $array_options, $fk_unit, $pu_ht_devise);
|
||||
}
|
||||
|
||||
//print "xx".$tva_tx; exit;
|
||||
|
|
@ -1123,6 +1124,7 @@ if (empty($reshook)) {
|
|||
|
||||
// Action clone object
|
||||
if ($action == 'confirm_clone' && $confirm == 'yes' && $usercancreate) {
|
||||
// @phan-suppress-next-line PhanPluginBothLiteralsBinaryOp
|
||||
if (1 == 0 && !GETPOST('clone_content') && !GETPOST('clone_receivers')) {
|
||||
setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors');
|
||||
} else {
|
||||
|
|
@ -1398,8 +1400,8 @@ if (empty($reshook)) {
|
|||
'HT',
|
||||
0,
|
||||
$lines[$i]->product_type,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
0,
|
||||
null,
|
||||
null,
|
||||
$array_option,
|
||||
|
|
@ -1529,6 +1531,8 @@ if ($action == 'create') {
|
|||
$currency_code = $conf->currency;
|
||||
|
||||
$societe = '';
|
||||
$objectsrc = null;
|
||||
|
||||
if ($socid > 0) {
|
||||
$societe = new Societe($db);
|
||||
$societe->fetch($socid);
|
||||
|
|
@ -1575,6 +1579,7 @@ if ($action == 'create') {
|
|||
|
||||
$projectid = (!empty($objectsrc->fk_project) ? $objectsrc->fk_project : '');
|
||||
$ref_client = (!empty($objectsrc->ref_client) ? $objectsrc->ref_client : '');
|
||||
$fk_account = 0;
|
||||
if ($origin == "commande") {
|
||||
$cond_reglement_id = 0;
|
||||
$mode_reglement_id = 0;
|
||||
|
|
@ -1658,7 +1663,7 @@ if ($action == 'create') {
|
|||
print '<input type="hidden" name="originmulticurrency_tx" value="'.$currency_tx.'">';
|
||||
}
|
||||
|
||||
print dol_get_fiche_head('');
|
||||
print dol_get_fiche_head(array());
|
||||
|
||||
// Call Hook tabContentCreateSupplierOrder
|
||||
$parameters = array();
|
||||
|
|
@ -1679,7 +1684,7 @@ if ($action == 'create') {
|
|||
print '<input type="hidden" name="socid" value="'.$societe->id.'">';
|
||||
} else {
|
||||
$filter = '((s.fournisseur:=:1) AND (s.status:=:1))';
|
||||
print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company((empty($socid) ? '' : $socid), 'socid', $filter, 'SelectThirdParty', 1, 0, null, 0, 'minwidth175 maxwidth500 widthcentpercentminusxx');
|
||||
print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company((empty($socid) ? '' : $socid), 'socid', $filter, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth175 maxwidth500 widthcentpercentminusxx');
|
||||
// reload page to retrieve customer information
|
||||
if (!getDolGlobalString('RELOAD_PAGE_ON_SUPPLIER_CHANGE_DISABLED')) {
|
||||
print '<script>
|
||||
|
|
@ -1701,7 +1706,7 @@ if ($action == 'create') {
|
|||
// Discounts for third party
|
||||
print '<tr><td>'.$langs->trans('Discounts').'</td><td>';
|
||||
|
||||
$absolute_discount = $societe->getAvailableDiscounts('', '', 0, 1);
|
||||
$absolute_discount = $societe->getAvailableDiscounts(null, '', 0, 1);
|
||||
|
||||
$thirdparty = $societe;
|
||||
$discount_type = 1;
|
||||
|
|
@ -2118,8 +2123,8 @@ if ($action == 'create') {
|
|||
$filtercreditnote = "fk_invoice_supplier_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS PAID)%')";
|
||||
}
|
||||
|
||||
$absolute_discount = $societe->getAvailableDiscounts('', $filterabsolutediscount, 0, 1);
|
||||
$absolute_creditnote = $societe->getAvailableDiscounts('', $filtercreditnote, 0, 1);
|
||||
$absolute_discount = $societe->getAvailableDiscounts(null, $filterabsolutediscount, 0, 1);
|
||||
$absolute_creditnote = $societe->getAvailableDiscounts(null, $filtercreditnote, 0, 1);
|
||||
$absolute_discount = price2num($absolute_discount, 'MT');
|
||||
$absolute_creditnote = price2num($absolute_creditnote, 'MT');
|
||||
|
||||
|
|
@ -2707,7 +2712,7 @@ if ($action == 'create') {
|
|||
$somethingshown = $formfile->numoffiles;
|
||||
|
||||
// Show links to link elements
|
||||
$linktoelem = $form->showLinkToObjectBlock($object, null, array('supplier_order', 'order_supplier'));
|
||||
$linktoelem = $form->showLinkToObjectBlock($object, array(), array('supplier_order', 'order_supplier'));
|
||||
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
||||
|
||||
print '</div><div class="fichehalfright">';
|
||||
|
|
@ -2768,15 +2773,16 @@ if ($action == 'create') {
|
|||
$ws_key = $object->thirdparty->webservices_key;
|
||||
$ws_user = GETPOST('ws_user', 'alpha');
|
||||
$ws_password = GETPOST('ws_password', 'alpha');
|
||||
$error_occurred = false;
|
||||
|
||||
// NS and Authentication parameters
|
||||
$ws_ns = 'http://www.dolibarr.org/ns/';
|
||||
$ws_authentication = array(
|
||||
'dolibarrkey' => $ws_key,
|
||||
'sourceapplication' => 'DolibarrWebServiceClient',
|
||||
'login' => $ws_user,
|
||||
'password' => $ws_password,
|
||||
'entity' => ''
|
||||
'dolibarrkey' => $ws_key,
|
||||
'sourceapplication' => 'DolibarrWebServiceClient',
|
||||
'login' => $ws_user,
|
||||
'password' => $ws_password,
|
||||
'entity' => ''
|
||||
);
|
||||
|
||||
print load_fiche_titre($langs->trans('CreateRemoteOrder'), '');
|
||||
|
|
@ -2870,7 +2876,7 @@ if ($action == 'create') {
|
|||
// Check the result code
|
||||
$status_code = $result_product["result"]["result_code"];
|
||||
if (empty($status_code)) { //No result, check error str
|
||||
setEventMessages($langs->trans("Error")." SOAP '".$soapclient_order->error_str."'", null, 'errors');
|
||||
setEventMessages($langs->trans("Error")." SOAP '".$soapclient_product->error_str."'", null, 'errors');
|
||||
} elseif ($status_code != "OK") { //Something went wrong
|
||||
if ($status_code == "NOT_FOUND") {
|
||||
setEventMessages($line_id.$langs->trans("SupplierMissingRef")." '".$ref_supplier."'", null, 'warnings');
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2023 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -101,6 +102,8 @@ if (!empty($user->socid)) {
|
|||
$socid = $user->socid;
|
||||
}
|
||||
|
||||
$usercancreate = false;
|
||||
|
||||
$isdraft = (($object->status == FactureFournisseur::STATUS_DRAFT) ? 1 : 0);
|
||||
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture', 'fk_soc', 'rowid', $isdraft);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2023 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -70,6 +71,8 @@ if (!$sortorder) {
|
|||
$sortorder = 'DESC,DESC';
|
||||
}
|
||||
|
||||
$usercancreate = false;
|
||||
|
||||
// Initialize a technical objects
|
||||
$object = new FactureFournisseur($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ $leftmenuwidth = 240;
|
|||
@phan-var-force string $toolTipFontColor
|
||||
@phan-var-force int<0,1> $useboldtitle
|
||||
@phan-var-force int $userborderontable
|
||||
@phan-var-force array{h:int,l:int,s:int,a:int} $colortextlinkHsla
|
||||
';
|
||||
|
||||
?>
|
||||
|
|
@ -313,7 +314,7 @@ div.tabBar input, div.tabBar input.flat, div.tabBar textarea, div.tabBar textare
|
|||
background-color: #f8f8fa;
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -416,9 +416,11 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
|
|||
if ($optioncss != '') {
|
||||
$param .= '&optioncss='.urlencode($optioncss);
|
||||
}
|
||||
/*
|
||||
if ($groupby != '') {
|
||||
$param .= '&groupby='.urlencode($groupby);
|
||||
}
|
||||
*/
|
||||
foreach ($search as $key => $val) {
|
||||
if (is_array($search[$key])) {
|
||||
foreach ($search[$key] as $skey) {
|
||||
|
|
@ -564,7 +566,7 @@ foreach ($object->fields as $key => $val) {
|
|||
} elseif ($key == 'lang') {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||
$formadmin = new FormAdmin($db);
|
||||
print $formadmin->select_language((isset($search[$key]) ? $search[$key] : ''), 'search_lang', 0, null, 1, 0, 0, 'minwidth100imp maxwidth125', 2);
|
||||
print $formadmin->select_language((isset($search[$key]) ? $search[$key] : ''), 'search_lang', 0, array(), 1, 0, 0, 'minwidth100imp maxwidth125', 2);
|
||||
} else {
|
||||
print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user