Qual: Fix phan notices (*card) (#33450)
This commit is contained in:
parent
83a0faaf41
commit
2cd6459d10
32 changed files with 120 additions and 134 deletions
|
|
@ -9,16 +9,16 @@
|
|||
*/
|
||||
return [
|
||||
// # Issue statistics:
|
||||
// PhanTypeMismatchArgument : 490+ occurrences
|
||||
// PhanUndeclaredProperty : 460+ occurrences
|
||||
// PhanTypeMismatchArgumentNullable : 170+ occurrences
|
||||
// PhanTypeMismatchProperty : 130+ occurrences
|
||||
// PhanTypeMismatchArgument : 440+ occurrences
|
||||
// PhanTypeMismatchArgumentNullable : 160+ occurrences
|
||||
// PhanTypeMismatchProperty : 110+ occurrences
|
||||
// PhanUndeclaredGlobalVariable : 100+ occurrences
|
||||
// PhanTypeExpectedObjectPropAccess : 20+ occurrences
|
||||
// PhanTypeInvalidDimOffset : 20+ occurrences
|
||||
// PhanTypeMismatchArgumentProbablyReal : 15+ occurrences
|
||||
// PhanTypeMismatchDimFetch : 15+ occurrences
|
||||
// PhanUndeclaredConstant : 15+ occurrences
|
||||
// PhanTypeMismatchArgumentProbablyReal : 10+ occurrences
|
||||
// PhanUndeclaredMethod : 9 occurrences
|
||||
// PhanPossiblyUndeclaredGlobalVariable : 8 occurrences
|
||||
// PhanTypeMismatchArgumentNullableInternal : 7 occurrences
|
||||
|
|
@ -38,10 +38,8 @@ return [
|
|||
// Currently, file_suppressions and directory_suppressions are the only supported suppressions
|
||||
'file_suppressions' => [
|
||||
'htdocs/accountancy/admin/account.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/accountancy/admin/card.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/accountancy/admin/categories.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/accountancy/admin/categories_list.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/accountancy/admin/fiscalyear_card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/accountancy/admin/productaccount.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/accountancy/admin/subaccount.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/accountancy/class/accountancycategory.class.php' => ['PhanTypeMismatchArgument'],
|
||||
|
|
@ -62,8 +60,6 @@ return [
|
|||
'htdocs/accountancy/supplier/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/accountancy/tpl/export_journal.tpl.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/adherents/admin/member.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/adherents/canvas/actions_adherentcard_common.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/adherents/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/adherents/class/adherent.class.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/adherents/class/adherent_type.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/adherents/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable'],
|
||||
|
|
@ -99,7 +95,6 @@ return [
|
|||
'htdocs/api/class/api_documents.class.php' => ['PhanPluginDuplicateExpressionBinaryOp'],
|
||||
'htdocs/api/class/api_setup.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchReturn'],
|
||||
'htdocs/asset/admin/setup.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/asset/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/asset/class/asset.class.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/asset/class/assetdepreciationoptions.class.php' => ['PhanTypeInvalidDimOffset'],
|
||||
'htdocs/asset/class/assetmodel.class.php' => ['PhanUndeclaredProperty'],
|
||||
|
|
@ -149,7 +144,6 @@ return [
|
|||
'htdocs/compta/bank/account_statement_document.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/compta/bank/annuel.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/bank/bankentries_list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/compta/bank/card.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/bank/categ.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/bank/class/account.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/compta/bank/class/paymentvarious.class.php' => ['PhanTypeMismatchArgument'],
|
||||
|
|
@ -166,7 +160,6 @@ return [
|
|||
'htdocs/compta/cashcontrol/cashcontrol_list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/compta/charges/index.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/compta/clients.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/compta/deplacement/card.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/deplacement/class/deplacement.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/deplacement/class/deplacementstats.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/deplacement/stats/index.php' => ['PhanTypeMismatchArgument'],
|
||||
|
|
@ -181,14 +174,14 @@ return [
|
|||
'htdocs/compta/localtax/index.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/localtax/list.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/compta/paiement.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchDimFetch'],
|
||||
'htdocs/compta/paiement/card.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/compta/paiement/card.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/compta/paiement/cheque/card.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/paiement/cheque/class/remisecheque.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/paiement/cheque/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/compta/paiement/class/paiement.class.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/compta/paiement/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/compta/paiement/rapport.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/prelevement/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/compta/prelevement/card.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/prelevement/class/bonprelevement.class.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/compta/prelevement/class/rejetprelevement.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/prelevement/demandes.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
|
|
@ -197,13 +190,12 @@ return [
|
|||
'htdocs/compta/resultat/index.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/resultat/projects.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/resultat/result.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/sociales/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/compta/sociales/card.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/compta/sociales/list.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/sociales/payments.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/compta/stats/cabyprodserv.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/compta/stats/supplier_turnover_by_prodserv.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/compta/stats/supplier_turnover_by_thirdparty.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/tva/card.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/tva/class/paymentvat.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/compta/tva/class/tva.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/tva/clients.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument'],
|
||||
|
|
@ -212,8 +204,6 @@ return [
|
|||
'htdocs/compta/tva/payments.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentNullableInternal'],
|
||||
'htdocs/compta/tva/quadri_detail.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument'],
|
||||
'htdocs/contact/ajax/contact.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/contact/canvas/actions_contactcard_common.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/contact/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/contact/class/contact.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/contact/consumption.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/contact/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
|
|
@ -344,10 +334,8 @@ return [
|
|||
'htdocs/datapolicy/class/datapolicycron.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/dav/dav.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/debugbar/class/TraceableDB.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/delivery/card.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/delivery/class/delivery.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/don/admin/donation.php' => ['PhanUndeclaredMethod'],
|
||||
'htdocs/don/card.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/don/class/don.class.php' => ['PhanParamTooMany'],
|
||||
'htdocs/don/document.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/don/info.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
|
|
@ -355,8 +343,6 @@ return [
|
|||
'htdocs/don/note.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/ecm/class/ecmdirectory.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/ecm/class/ecmfiles.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/ecm/dir_add_card.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/ecm/file_card.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/ecm/file_note.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/ecm/search.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/emailcollector/class/emailcollector.class.php' => ['PhanUndeclaredProperty'],
|
||||
|
|
@ -369,13 +355,13 @@ return [
|
|||
'htdocs/eventorganization/conferenceorboothattendee_list.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/eventorganization/core/actions_massactions_mail.inc.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/expedition/ajax/searchfrombarcode.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/expedition/card.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/expedition/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/expedition/class/expedition.class.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/expedition/class/expeditionlinebatch.class.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/expedition/list.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/expedition/shipment.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/expensereport/ajax/ajaxik.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/expensereport/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/expensereport/card.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/expensereport/class/expensereport.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/expensereport/class/expensereportline.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/expensereport/class/expensereportstats.class.php' => ['PhanTypeMismatchArgument'],
|
||||
|
|
@ -389,7 +375,6 @@ return [
|
|||
'htdocs/externalsite/frames.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/fichinter/agenda.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/fichinter/card-rec.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/fichinter/card.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/fichinter/class/api_interventions.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/fichinter/class/fichinterrec.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/fichinter/contact.php' => ['PhanTypeMismatchArgument'],
|
||||
|
|
@ -407,7 +392,6 @@ return [
|
|||
'htdocs/fourn/facture/paiement.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/fourn/facture/rapport.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/holiday/card.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/holiday/card_group.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/holiday/list.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/hrm/class/evaluation.class.php' => ['PhanUndeclaredProperty'],
|
||||
|
|
@ -440,7 +424,6 @@ return [
|
|||
'htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/partnership/partnership_card.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/partnership/partnership_list.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/product/card.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/product/class/api_products.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchReturn', 'PhanUndeclaredProperty'],
|
||||
'htdocs/product/class/html.formproduct.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/product/class/productfournisseurprice.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
|
||||
|
|
@ -448,7 +431,6 @@ return [
|
|||
'htdocs/product/price.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/product/price_suppliers.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/product/reassort.php' => ['PhanTypeExpectedObjectPropAccessButGotNull'],
|
||||
'htdocs/product/stock/card.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/product/stock/info.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/product/stock/list.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/product/stock/movement_card.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
|
|
@ -463,7 +445,7 @@ return [
|
|||
'htdocs/product/stock/tpl/stockcorrection.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/product/stock/tpl/stocktransfer.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/projet/admin/project.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/projet/card.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/projet/card.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/projet/tasks.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/projet/tasks/time.php' => ['PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/projet/tasks/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
|
|
@ -477,7 +459,7 @@ return [
|
|||
'htdocs/public/project/viewandvote.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/public/recruitment/view.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/public/webportal/tpl/menu.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/reception/card.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/reception/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/reception/class/reception.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/reception/list.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/recruitment/class/recruitmentcandidature.class.php' => ['PhanUndeclaredProperty'],
|
||||
|
|
@ -495,10 +477,9 @@ return [
|
|||
'htdocs/salaries/paiement_salary.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/salaries/virement_request.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/societe/ajax/company.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/societe/card.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/societe/class/societe.class.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/societe/paymentmodes.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument'],
|
||||
'htdocs/supplier_proposal/card.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/supplier_proposal/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/supplier_proposal/class/api_supplier_proposals.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/supplier_proposal/class/supplier_proposal.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/takepos/index.php' => ['PhanPluginUndeclaredVariableIsset'],
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2013-2024 Alexandre Spangaro <aspangaro@easya.solutions>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2025 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
|
||||
|
|
@ -250,7 +251,7 @@ if ($action == 'create') {
|
|||
// Account parent
|
||||
print '<tr><td>'.$langs->trans("Accountparent").'</td>';
|
||||
print '<td>';
|
||||
print $formaccounting->select_account($object->account_parent, 'account_parent', 1, [], 0, 0, 'minwidth200');
|
||||
print $formaccounting->select_account((string) $object->account_parent, 'account_parent', 1, [], 0, 0, 'minwidth200');
|
||||
print '</td></tr>';
|
||||
|
||||
// Chart of accounts type
|
||||
|
|
@ -327,7 +328,7 @@ if ($action == 'create') {
|
|||
print '<tr><td>'.$langs->trans("Accountparent").'</td>';
|
||||
print '<td>';
|
||||
// Note: We accept disabled account as parent account so we can build a hierarchy and use only children
|
||||
print $formaccounting->select_account($object->account_parent, 'account_parent', 1, array(), 0, 0, 'minwidth100 maxwidth300 maxwidthonsmartphone', 1, '');
|
||||
print $formaccounting->select_account((string) $object->account_parent, 'account_parent', 1, array(), 0, 0, 'minwidth100 maxwidth300 maxwidthonsmartphone', '1', '');
|
||||
print '</td></tr>';
|
||||
|
||||
// Chart of accounts type
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2014-2024 Alexandre Spangaro <aspangaro@easya.solutions>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2025 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
|
||||
|
|
@ -356,14 +357,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
|
||||
// Date start
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey("DateStart", 'date_start', $object->date_start, $object, 0, 'datepicker');
|
||||
print $form->editfieldkey("DateStart", 'date_start', (string) $object->date_start, $object, 0, 'datepicker');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval("DateStart", 'date_start', $object->date_start, $object, 0, 'datepicker');
|
||||
print '</td></tr>';
|
||||
|
||||
// Date end
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey("DateEnd", 'date_end', $object->date_end, $object, 0, 'datepicker');
|
||||
print $form->editfieldkey("DateEnd", 'date_end', (string) $object->date_end, $object, 0, 'datepicker');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval("DateEnd", 'date_end', $object->date_end, $object, 0, 'datepicker');
|
||||
print '</td></tr>';
|
||||
|
|
@ -384,7 +385,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
print '<div class="tabsAction">';
|
||||
|
||||
if (getDolGlobalString('ACCOUNTING_CAN_REOPEN_CLOSED_PERIOD') && $object->status == $object::STATUS_CLOSED) {
|
||||
print dolGetButtonAction($langs->trans("ReOpen"), '', 'reopen', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen&token='.newToken(), 'reopen', $permissiontoadd);
|
||||
print dolGetButtonAction($langs->trans("ReOpen"), '', 'reopen', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen&token='.newToken(), 'reopen', (int) $permissiontoadd);
|
||||
}
|
||||
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$id.'">'.$langs->trans('Modify').'</a>';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2012 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 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
|
||||
|
|
@ -169,7 +169,7 @@ abstract class ActionsAdherentCardCommon
|
|||
}
|
||||
|
||||
// Country
|
||||
$this->tpl['select_country'] = $form->select_country($this->object->country_id, 'country_id');
|
||||
$this->tpl['select_country'] = $form->select_country((string) $this->object->country_id, 'country_id');
|
||||
$countrynotdefined = $langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')';
|
||||
|
||||
if ($user->admin) {
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
// Create new object
|
||||
if ($result > 0 && !$error) {
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
// Change values
|
||||
$object->civility_id = trim(GETPOST("civility_id", 'alphanohtml'));
|
||||
|
|
@ -862,7 +862,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
if ($action == 'update_extras' && $user->hasRight('adherent', 'creer')) {
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
$attribute_name = GETPOST('attribute', 'restricthtml');
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
|
|
@ -1484,7 +1484,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
// Login Dolibarr
|
||||
print '<tr><td>'.$langs->trans("LinkedToDolibarrUser").'</td><td colspan="2" class="valeur">';
|
||||
if ($object->user_id) {
|
||||
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'none');
|
||||
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, (string) $object->user_id, 'none');
|
||||
} else {
|
||||
print $langs->trans("NoDolibarrAccess");
|
||||
}
|
||||
|
|
@ -1957,10 +1957,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
// Login Dolibarr - Link to user
|
||||
print '<tr><td>';
|
||||
$editenable = $user->hasRight('adherent', 'creer') && $user->hasRight('user', 'user', 'creer');
|
||||
print $form->editfieldkey('LinkedToDolibarrUser', 'login', '', $object, $editenable);
|
||||
print $form->editfieldkey('LinkedToDolibarrUser', 'login', '', $object, (int) $editenable);
|
||||
print '</td><td colspan="2" class="valeur">';
|
||||
if ($action == 'editlogin') {
|
||||
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'userid', array());
|
||||
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, (string) $object->user_id, 'userid', array());
|
||||
} else {
|
||||
if ($object->user_id) {
|
||||
$linkeduser = new User($db);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2017 Open-DSI <support@open-dsi.fr>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -101,7 +101,7 @@ if ($action == 'set') {
|
|||
dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
$defaultValues = new DefaultValues($db);
|
||||
$result = $defaultValues->fetchAll('', '', 0, 0, array('t.page' => 'comm/action/card.php', 't.param' => 'complete', 't.user_id' => '0', 't.type' => 'createform', 't.entity' => $conf->entity));
|
||||
$result = $defaultValues->fetchAll('', '', 0, 0, array('t.page' => 'comm/action/card.php', 't.param' => 'complete', 't.user_id' => '0', 't.type' => 'createform', 't.entity' => (string) $conf->entity));
|
||||
if (!is_array($result) && $result < 0) {
|
||||
setEventMessages($defaultValues->error, $defaultValues->errors, 'errors');
|
||||
} elseif (count($result) > 0) {
|
||||
|
|
@ -391,7 +391,7 @@ print '<td class="center"> </td>'."\n";
|
|||
print '<td class="right nowrap">'."\n";
|
||||
$defval = 'na';
|
||||
$defaultValues = new DefaultValues($db);
|
||||
$result = $defaultValues->fetchAll('', '', 0, 0, array('t.page' => 'comm/action/card.php', 't.param' => 'complete', 't.user_id' => '0', 't.type' => 'createform', 't.entity' => $conf->entity));
|
||||
$result = $defaultValues->fetchAll('', '', 0, 0, array('t.page' => 'comm/action/card.php', 't.param' => 'complete', 't.user_id' => '0', 't.type' => 'createform', 't.entity' => (string) $conf->entity));
|
||||
if (!is_array($result) && $result < 0) {
|
||||
setEventMessages($defaultValues->error, $defaultValues->errors, 'errors');
|
||||
} elseif (count($result) > 0) {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2025 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
|
||||
|
|
@ -127,7 +128,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
}
|
||||
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
$triggermodname = 'ASSET_MODIFY'; // Name of trigger action code to execute when we modify record
|
||||
|
||||
// Action dispose object
|
||||
|
|
@ -283,11 +284,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
$disposal_subject_to_vat = !empty($disposal_subject_to_vat) ? 1 : 0;
|
||||
|
||||
$object->fields['fk_disposal_type']['visible'] = 1;
|
||||
$disposal_type_form = $object->showInputField(null, 'fk_disposal_type', $fk_disposal_type, '', '', '', 0);
|
||||
$disposal_type_form = $object->showInputField(null, 'fk_disposal_type', (string) $fk_disposal_type, '', '', '', 0);
|
||||
$object->fields['fk_disposal_type']['visible'] = -2;
|
||||
|
||||
$object->fields['disposal_invoice_id'] = array('type' => 'integer:Facture:compta/facture/class/facture.class.php::entity IN (__SHARED_ENTITIES__)', 'enabled' => '1', 'notnull' => 1, 'visible' => 1, 'index' => 1, 'validate' => '1',);
|
||||
$disposal_invoice_form = $object->showInputField(null, 'disposal_invoice_id', $disposal_invoice_id, '', '', '', 0);
|
||||
$disposal_invoice_form = $object->showInputField(null, 'disposal_invoice_id', (string) $disposal_invoice_id, '', '', '', 0);
|
||||
unset($object->fields['disposal_invoice_id']);
|
||||
|
||||
// Create an array for form
|
||||
|
|
@ -343,7 +344,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
print '<table class="border centpercent tableforfield">'."\n";
|
||||
|
||||
// Common attributes
|
||||
$keyforbreak='date_acquisition'; // We change column just before this field
|
||||
$keyforbreak = 'date_acquisition'; // We change column just before this field
|
||||
//unset($object->fields['fk_project']); // Hide field already shown in banner
|
||||
//unset($object->fields['fk_soc']); // Hide field already shown in banner
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) 2017-2023 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2023 Charlene Benke <charlene@patas-monkey.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 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
|
||||
|
|
@ -181,7 +181,7 @@ if (empty($reshook)) {
|
|||
$disable_stock_change = GETPOSTINT('disable_stock_change');
|
||||
$fk_workstation = GETPOSTINT('idworkstations');
|
||||
$efficiency = price2num(GETPOST('efficiency', 'alpha'));
|
||||
$fk_unit = GETPOST('fk_unit', 'alphanohtml');
|
||||
$fk_unit = GETPOSTINT('fk_unit');
|
||||
|
||||
$fk_default_workstation = 0;
|
||||
if (!empty($idprod) && isModEnabled('workstation')) {
|
||||
|
|
@ -235,7 +235,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
}
|
||||
|
||||
$result = $object->addLine($idprod, $qty, $qty_frozen, $disable_stock_change, $efficiency, -1, $bom_child_id, null, $fk_unit, $array_options, $fk_default_workstation);
|
||||
$result = $object->addLine((int) $idprod, (float) $qty, (float) $qty_frozen, $disable_stock_change, (float) $efficiency, -1, $bom_child_id, null, $fk_unit, $array_options, $fk_default_workstation);
|
||||
|
||||
if ($result <= 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
|
|
@ -264,7 +264,7 @@ if (empty($reshook)) {
|
|||
$qty_frozen = price2num(GETPOST('qty_frozen', 'alpha'), 'MS');
|
||||
$disable_stock_change = GETPOSTINT('disable_stock_change');
|
||||
$efficiency = price2num(GETPOST('efficiency', 'alpha'));
|
||||
$fk_unit = GETPOST('fk_unit', 'alphanohtml');
|
||||
$fk_unit = GETPOSTINT('fk_unit');
|
||||
|
||||
if ($qty == '') {
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors');
|
||||
|
|
@ -291,7 +291,7 @@ if (empty($reshook)) {
|
|||
$fk_default_workstation = GETPOSTINT('idworkstations');
|
||||
}
|
||||
|
||||
$result = $object->updateLine($lineid, $qty, (int) $qty_frozen, (int) $disable_stock_change, $efficiency, $bomline->position, $bomline->import_key, $fk_unit, $array_options, $fk_default_workstation);
|
||||
$result = $object->updateLine($lineid, (float) $qty, (int) $qty_frozen, (int) $disable_stock_change, (float) $efficiency, $bomline->position, $bomline->import_key, $fk_unit, $array_options, $fk_default_workstation);
|
||||
|
||||
if ($result <= 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2022 Charlene Benke <charlene@patas-monkey.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 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
|
||||
|
|
@ -470,7 +470,7 @@ if ($action == 'create') {
|
|||
print '<tr><td>'.$langs->trans('State').'</td><td>';
|
||||
if ($selectedcode) {
|
||||
print img_picto('', 'state', 'class="pictofixedwidth"');
|
||||
print $formcompany->select_state(GETPOSTISSET("account_state_id") ? GETPOST("account_state_id") : '', $selectedcode, 'account_state_id');
|
||||
print $formcompany->select_state(GETPOSTISSET("account_state_id") ? GETPOSTINT("account_state_id") : 0, $selectedcode, 'account_state_id');
|
||||
} else {
|
||||
print $countrynotdefined;
|
||||
}
|
||||
|
|
@ -672,7 +672,7 @@ if ($action == 'create') {
|
|||
/** @var FormAccounting $formaccounting */
|
||||
print '<tr><td class="'.$fieldrequired.'titlefieldcreate">'.$langs->trans("AccountancyJournal").'</td>';
|
||||
print '<td>';
|
||||
print $formaccounting->select_journal($object->fk_accountancy_journal, 'fk_accountancy_journal', 4, 1, 0, 0);
|
||||
print $formaccounting->select_journal((string) $object->fk_accountancy_journal, 'fk_accountancy_journal', 4, 1, 0, 0);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
|
@ -1130,7 +1130,7 @@ if ($action == 'create') {
|
|||
/** @var FormAccounting $formaccounting */
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("AccountancyJournal").'</td>';
|
||||
print '<td>';
|
||||
print $formaccounting->select_journal($object->fk_accountancy_journal, 'fk_accountancy_journal', 4, 1, 0, 0);
|
||||
print $formaccounting->select_journal((string) $object->fk_accountancy_journal, 'fk_accountancy_journal', 4, 1, 0, 0);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ if ($action == 'create') {
|
|||
|
||||
print "<tr>";
|
||||
print '<td class="fieldrequired">'.$langs->trans("Type").'</td><td>';
|
||||
$form->select_type_fees(GETPOSTINT('type'), 'type', 1);
|
||||
$form->select_type_fees((string) GETPOSTINT('type'), 'type', 1);
|
||||
print '</td></tr>';
|
||||
|
||||
print "<tr>";
|
||||
|
|
@ -419,7 +419,7 @@ if ($action == 'create') {
|
|||
|
||||
// Km/Price
|
||||
print '<tr><td class="tdtop">';
|
||||
print $form->editfieldkey("FeesKilometersOrAmout", 'km', $object->km, $object, $user->hasRight('deplacement', 'creer'), 'numeric:6');
|
||||
print $form->editfieldkey("FeesKilometersOrAmout", 'km', (string) $object->km, $object, $user->hasRight('deplacement', 'creer'), 'numeric:6');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval("FeesKilometersOrAmout", 'km', $object->km, $object, $user->hasRight('deplacement', 'creer'), 'numeric:6');
|
||||
print "</td></tr>";
|
||||
|
|
@ -449,9 +449,9 @@ if ($action == 'create') {
|
|||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
if ($action == 'classify') {
|
||||
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1);
|
||||
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, 'projectid', 0, 0, 1);
|
||||
} else {
|
||||
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0);
|
||||
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, 'none', 0, 0);
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -539,7 +539,7 @@ if ($resql) {
|
|||
$paiement = $invoice->getSommePaiement();
|
||||
$creditnotes = $invoice->getSumCreditNotesUsed();
|
||||
$deposits = $invoice->getSumDepositsUsed();
|
||||
$alreadypayed = price2num($paiement + $creditnotes + $deposits, 'MT');
|
||||
$alreadypaid = price2num($paiement + $creditnotes + $deposits, 'MT');
|
||||
$remaintopay = price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits, 'MT');
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
|
@ -577,7 +577,7 @@ if ($resql) {
|
|||
print '<td class="right"><span class="amount">'.price($remaintopay).'</span></td>';
|
||||
|
||||
// Status
|
||||
print '<td class="right">'.$invoice->getLibStatut(5, $alreadypayed).'</td>';
|
||||
print '<td class="right">'.$invoice->getLibStatut(5, (float) $alreadypaid).'</td>';
|
||||
|
||||
$parameters = array('fk_paiement' => (int) $object->id);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $objp, $action); // Note that $action and $object may have been modified by hook
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 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
|
||||
|
|
@ -112,7 +112,7 @@ if ($reshook < 0) {
|
|||
|
||||
if (empty($reshook)) {
|
||||
if ($action == 'setbankaccount' && $permissiontoadd) {
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
$object->fk_bank_account = GETPOSTINT('fk_bank_account');
|
||||
|
||||
$object->update($user);
|
||||
|
|
@ -150,7 +150,7 @@ if (empty($reshook)) {
|
|||
$mesg='BadFile';
|
||||
}*/
|
||||
|
||||
$error = $object->set_infotrans($user, $dt, GETPOST('methode', 'alpha'));
|
||||
$error = $object->set_infotrans($user, $dt, GETPOSTINT('methode'));
|
||||
|
||||
if ($error) {
|
||||
header("Location: card.php?id=".$id."&error=$error");
|
||||
|
|
@ -315,9 +315,9 @@ if ($id > 0 || $ref) {
|
|||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editfkbankaccount') {
|
||||
$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $fk_bank_account, 'fk_bank_account', 0);
|
||||
$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $fk_bank_account, 'fk_bank_account', 0);
|
||||
} else {
|
||||
$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $fk_bank_account, 'none');
|
||||
$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $fk_bank_account, 'none');
|
||||
}
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ if (empty($reshook)) {
|
|||
|
||||
// Link to a project
|
||||
if ($action == 'classin' && $permissiontoadd) {
|
||||
$object->setProject(GETPOST('fk_project'));
|
||||
$object->setProject(GETPOSTINT('fk_project'));
|
||||
}
|
||||
|
||||
if ($action == 'setfk_user' && $permissiontoadd) {
|
||||
|
|
@ -243,7 +243,7 @@ if (empty($reshook)) {
|
|||
} else {
|
||||
$result = $object->fetch($id);
|
||||
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
$object->type = $actioncode;
|
||||
$object->date_ech = $dateech;
|
||||
|
|
@ -384,7 +384,7 @@ if ($action == 'create') {
|
|||
print $langs->trans("Type");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
$formsocialcontrib->select_type_socialcontrib(GETPOST('actioncode', 'alpha') ? GETPOST('actioncode', 'alpha') : '', 'actioncode', 1);
|
||||
$formsocialcontrib->select_type_socialcontrib(GETPOST('actioncode', 'alpha') ? GETPOSTINT('actioncode') : 0, 'actioncode', 1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
|
@ -438,7 +438,7 @@ if ($action == 'create') {
|
|||
|
||||
// Payment Mode
|
||||
print '<tr><td>'.$langs->trans('DefaultPaymentMode').'</td><td colspan="2">';
|
||||
$form->select_types_paiements(GETPOSTINT('mode_reglement_id'), 'mode_reglement_id');
|
||||
$form->select_types_paiements((string) GETPOSTINT('mode_reglement_id'), 'mode_reglement_id');
|
||||
print '</td></tr>';
|
||||
|
||||
// Bank Account
|
||||
|
|
@ -567,7 +567,7 @@ if ($id > 0) {
|
|||
if ($action != 'classify') {
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.((int) $object->id).'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (!getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') ? $object->socid : -1), $object->fk_project, ($action == 'classify' ? 'fk_project' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (!getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') ? $object->socid : -1), (string) $object->fk_project, ($action == 'classify' ? 'fk_project' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
|
|
@ -648,9 +648,9 @@ if ($id > 0) {
|
|||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editmode') {
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', '', 1, 1);
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', '', 1, 1);
|
||||
} else {
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'none');
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->mode_reglement_id, 'none');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
@ -666,9 +666,9 @@ if ($id > 0) {
|
|||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editbankaccount') {
|
||||
$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1);
|
||||
$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'fk_account', 1);
|
||||
} else {
|
||||
$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none');
|
||||
$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'none');
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* Copyright (C) 2015-2023 Alexandre Spangaro <aspangaro@easya.solutions>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 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
|
||||
|
|
@ -493,7 +493,7 @@ if ($action == 'create') {
|
|||
|
||||
// Type payment
|
||||
print '<tr><td class="fieldrequired" id="label_type_payment">'.$langs->trans("PaymentMode").'</td><td>';
|
||||
print $form->select_types_paiements(GETPOSTINT("type_payment"), "type_payment", '', 0, 1, 0, 0, 1, 'maxwidth500 widthcentpercentminusx', 1);
|
||||
print $form->select_types_paiements((string) GETPOSTINT("type_payment"), "type_payment", '', 0, 1, 0, 0, 1, 'maxwidth500 widthcentpercentminusx', 1);
|
||||
print "</td>\n";
|
||||
print "</tr>";
|
||||
|
||||
|
|
@ -617,7 +617,7 @@ if ($id > 0) {
|
|||
print '</td></tr>';*/
|
||||
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey($form->textwithpicto($langs->trans("PeriodEndDate"), $langs->trans("LastDayTaxIsRelatedTo")), 'datev', $object->datev, $object, $user->hasRight('tax', 'charges', 'creer'), 'day');
|
||||
print $form->editfieldkey($form->textwithpicto($langs->trans("PeriodEndDate"), $langs->trans("LastDayTaxIsRelatedTo")), 'datev', (string) $object->datev, $object, $user->hasRight('tax', 'charges', 'creer'), 'day');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval("PeriodEndDate", 'datev', $object->datev, $object, $user->hasRight('tax', 'charges', 'creer'), 'day');
|
||||
//print dol_print_date($object->datev,'day');
|
||||
|
|
@ -640,9 +640,9 @@ if ($id > 0) {
|
|||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editmode') {
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->type_payment, 'mode_reglement_id');
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->type_payment, 'mode_reglement_id');
|
||||
} else {
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->type_payment, 'none');
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->type_payment, 'none');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
@ -658,9 +658,9 @@ if ($id > 0) {
|
|||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editbankaccount') {
|
||||
$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1);
|
||||
$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'fk_account', 1);
|
||||
} else {
|
||||
$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none');
|
||||
$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'none');
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 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
|
||||
|
|
@ -179,7 +179,7 @@ abstract class ActionsContactCardCommon
|
|||
}
|
||||
|
||||
// Country
|
||||
$this->tpl['select_country'] = $form->select_country($this->object->country_id, 'country_id');
|
||||
$this->tpl['select_country'] = $form->select_country((string) $this->object->country_id, 'country_id');
|
||||
$countrynotdefined = $langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')';
|
||||
|
||||
if ($user->admin) {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2019 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
||||
* Copyright (C) 2020 Open-Dsi <support@open-dsi.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 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
|
||||
|
|
@ -329,7 +329,7 @@ if (empty($reshook)) {
|
|||
|
||||
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('societe', 'contact', 'supprimer')) {
|
||||
$result = $object->fetch($id);
|
||||
$object->oldcopy = clone $object;
|
||||
$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
$result = $object->delete($user);
|
||||
if ($result > 0) {
|
||||
|
|
@ -413,7 +413,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
}
|
||||
|
||||
$object->oldcopy = clone $object;
|
||||
$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
$object->socid = $socid;
|
||||
$object->lastname = (string) GETPOST("lastname", 'alpha');
|
||||
|
|
@ -537,7 +537,7 @@ if (empty($reshook)) {
|
|||
|
||||
// Update extrafields
|
||||
if ($action == 'update_extras' && $user->hasRight('societe', 'contact', 'creer')) {
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
|
||||
|
|
@ -865,7 +865,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
print '<td class="noemail"><label for="no_email">'.$langs->trans("No_Email").'</label></td>';
|
||||
print '<td>';
|
||||
// Default value is in MAILING_CONTACT_DEFAULT_BULK_STATUS that you can modify in setup of module emailing
|
||||
print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOSTINT("no_email") : getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS')), 1, false, (getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2));
|
||||
print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOSTINT("no_email") : getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS')), 1, false, (int) (getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2));
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
|
@ -1105,7 +1105,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
print '<input type="text" name="fax" id="fax" class="maxwidth200" maxlength="80" value="'.(GETPOSTISSET('phone_fax') ? GETPOST('phone_fax', 'alpha') : $object->fax).'"></td></tr>';
|
||||
|
||||
// EMail
|
||||
print '<tr><td>'.$form->editfieldkey('EMail', 'email', GETPOST('email', 'alpha'), $object, 0, 'string', '', (getDolGlobalString('SOCIETE_EMAIL_MANDATORY'))).'</td>';
|
||||
print '<tr><td>'.$form->editfieldkey('EMail', 'email', GETPOST('email', 'alpha'), $object, 0, 'string', '', (int) (getDolGlobalInt('SOCIETE_EMAIL_MANDATORY'))).'</td>';
|
||||
print '<td>';
|
||||
print img_picto('', 'object_email', 'class="pictofixedwidth"');
|
||||
print '<input type="text" name="email" id="email" class="maxwidth100onsmartphone quatrevingtpercent" value="'.(GETPOSTISSET('email') ? GETPOST('email', 'alpha') : $object->email).'"></td>';
|
||||
|
|
@ -1152,7 +1152,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
print '<td class="noemail"><label for="no_email">'.$langs->trans("No_Email").'</label></td>';
|
||||
print '<td>';
|
||||
$useempty = (getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2);
|
||||
print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOSTINT("no_email") : $object->no_email), 1, false, $useempty);
|
||||
print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOSTINT("no_email") : $object->no_email), 1, false, (int) $useempty);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
|
@ -1440,7 +1440,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editlevel') {
|
||||
$formcompany->formProspectContactLevel($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_prospectlevel, 'prospect_contact_level_id', 1);
|
||||
$formcompany->formProspectContactLevel($_SERVER['PHP_SELF'].'?id='.$object->id, (int) $object->fk_prospectlevel, 'prospect_contact_level_id', 1);
|
||||
} else {
|
||||
print $object->getLibProspLevel();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9432,7 +9432,7 @@ class Form
|
|||
* Show a multiselect form from an array. WARNING: Use this only for short lists.
|
||||
*
|
||||
* @param string $htmlname Name of select
|
||||
* @param array<string|int,string|array{id:string,label:string,color:string,picto:string,labelhtml:string}> $array Array(key=>value) or Array(key=>array('id'=>key, 'label'=>value, 'color'=> , 'picto'=> , 'labelhtml'=> ))
|
||||
* @param array<string|int,string|array{id:int|string,label:string,color:string,picto:string,labelhtml:string}> $array Array(key=>value) or Array(key=>array('id'=>key, 'label'=>value, 'color'=> , 'picto'=> , 'labelhtml'=> ))
|
||||
* @param string[] $selected Array of keys preselected
|
||||
* @param int<0,1> $key_in_label 1 to show key like in "[key] value"
|
||||
* @param int<0,1> $value_as_key 1 to use value as key
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2016-2024 Alexandre Spangaro <aspangaro@easya.solutions>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -155,13 +155,13 @@ class FormAccounting extends Form
|
|||
*
|
||||
* @param string[] $selectedIds Preselected journal code array
|
||||
* @param string $htmlname Name of field in html form
|
||||
* @param int $nature Limit the list to a particular type of journals (1:various operations / 2:sale / 3:purchase / 4:bank / 9: has-new)
|
||||
* @param int<0,9> $nature Limit the list to a particular type of journals (1:various operations / 2:sale / 3:purchase / 4:bank / 9: has-new)
|
||||
* @param int $showempty Add an empty field
|
||||
* @param int $select_in 0=selectid value is the journal rowid (default) or 1=selectid is journal code
|
||||
* @param int $select_out Set value returned by select. 0=rowid (default), 1=code
|
||||
* @param string $morecss More css non HTML object
|
||||
* @param string $usecache Key to use to store result into a cache. Next call with same key will reuse the cache.
|
||||
* @param int $disabledajaxcombo Disable ajax combo box.
|
||||
* @param int<0,1> $disabledajaxcombo Disable ajax combo box.
|
||||
* @return string|int<-1,-1> String with HTML select, or -1 if error
|
||||
*/
|
||||
public function multi_select_journal($selectedIds = array(), $htmlname = 'journal', $nature = 0, $showempty = 0, $select_in = 0, $select_out = 0, $morecss = '', $usecache = '', $disabledajaxcombo = 0)
|
||||
|
|
@ -233,12 +233,12 @@ class FormAccounting extends Form
|
|||
* Return list of accounting category.
|
||||
* Use mysoc->country_id or mysoc->country_code so they must be defined.
|
||||
*
|
||||
* @param int $selected Preselected type
|
||||
* @param string $htmlname Name of field in form
|
||||
* @param int $useempty Set to 1 if we want an empty value
|
||||
* @param int $maxlen Max length of text in combo box
|
||||
* @param int $help Add or not the admin help picto
|
||||
* @param int $allcountries All countries
|
||||
* @param int $selected Preselected type
|
||||
* @param string $htmlname Name of field in form
|
||||
* @param int<0,1> $useempty Set to 1 if we want an empty value
|
||||
* @param int $maxlen Max length of text in combo box
|
||||
* @param int<0,1> $help Add or not the admin help picto
|
||||
* @param int<0,1> $allcountries All countries
|
||||
* @return void|string HTML component with the select
|
||||
*/
|
||||
public function select_accounting_category($selected = 0, $htmlname = 'account_category', $useempty = 0, $maxlen = 0, $help = 1, $allcountries = 0)
|
||||
|
|
@ -365,7 +365,7 @@ class FormAccounting extends Form
|
|||
* @param int $select_out Set value returned by select. 0=rowid (default), 1=account_number
|
||||
* @param string $morecss More css non HTML object
|
||||
* @param string $usecache Key to use to store result into a cache. Next call with same key will reuse the cache.
|
||||
* @param string $active Filter on status active or not: '0', '1' or '' for no filter
|
||||
* @param '1'|'0'|'' $active Filter on status active or not: '0', '1' or '' for no filter
|
||||
* @return string|int<-1,-1> String with HTML select, or -1 if error
|
||||
*/
|
||||
public function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $morecss = 'minwidth100 maxwidth300 maxwidthonsmartphone', $usecache = '', $active = '1')
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ if ($action == 'setdate_delivery' && $permissiontoadd) {
|
|||
|
||||
// Update extrafields
|
||||
if ($action == 'update_extras' && $permissiontoadd) {
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
|
||||
|
|
|
|||
|
|
@ -343,7 +343,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
if ($action == 'update_extras' && $permissiontoadd) {
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2008-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2025 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
|
||||
|
|
@ -95,7 +96,7 @@ if (!$sortfield) {
|
|||
|
||||
$ecmdir = new EcmDirectory($db);
|
||||
if (!empty($section)) {
|
||||
$result = $ecmdir->fetch($section);
|
||||
$result = $ecmdir->fetch((int) $section);
|
||||
if (!($result > 0)) {
|
||||
dol_print_error($db, $ecmdir->error);
|
||||
exit;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2008-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2025 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
|
||||
|
|
@ -87,7 +88,7 @@ if (!$urlfile) {
|
|||
|
||||
// Load ecm object
|
||||
$ecmdir = new EcmDirectory($db);
|
||||
$result = $ecmdir->fetch(GETPOST("section", 'alpha'));
|
||||
$result = $ecmdir->fetch(GETPOSTINT("section"));
|
||||
if (!($result > 0)) {
|
||||
dol_print_error($db, $ecmdir->error);
|
||||
exit;
|
||||
|
|
|
|||
|
|
@ -411,7 +411,7 @@ if (empty($reshook)) {
|
|||
$nbstockline = count($stockLine[$i]);
|
||||
for ($j = 0; $j < $nbstockline; $j++) {
|
||||
if ($stockLine[$i][$j]['qty'] > 0 || ($stockLine[$i][$j]['qty'] == 0 && getDolGlobalString('SHIPMENT_GETS_ALL_ORDER_PRODUCTS'))) {
|
||||
$ret = $object->addline($stockLine[$i][$j]['warehouse_id'], $stockLine[$i][$j]['ix_l'], $stockLine[$i][$j]['qty'], $array_options[$i]);
|
||||
$ret = $object->addline($stockLine[$i][$j]['warehouse_id'], $stockLine[$i][$j]['ix_l'], (float) $stockLine[$i][$j]['qty'], $array_options[$i]);
|
||||
if ($ret < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
|
|
@ -430,7 +430,7 @@ if (empty($reshook)) {
|
|||
$entrepot_id = 0;
|
||||
}
|
||||
|
||||
$ret = $object->addline($entrepot_id, GETPOSTINT($idl), price2num(GETPOSTFLOAT($qty), 'MS'), $array_options[$i]);
|
||||
$ret = $object->addline($entrepot_id, GETPOSTINT($idl), (float) price2num(GETPOSTFLOAT($qty), 'MS'), $array_options[$i]);
|
||||
if ($ret < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
|
|
|
|||
|
|
@ -365,7 +365,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
if ($action == 'update_extras' && $permissiontoadd) {
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
|
||||
|
|
@ -1364,7 +1364,7 @@ if (empty($reshook)) {
|
|||
|
||||
if (!$error) {
|
||||
// TODO Use update method of ExpenseReportLine
|
||||
$result = $object->updateline($rowid, $type_fees_id, $projet_id, $vatrate, $comments, (float) $qty, (float) $value_unit, $date, $id, $fk_c_exp_tax_cat, $fk_ecm_files);
|
||||
$result = $object->updateline($rowid, $type_fees_id, $projet_id, (float) $vatrate, $comments, (float) $qty, (float) $value_unit, $date, $id, $fk_c_exp_tax_cat, $fk_ecm_files);
|
||||
if ($result >= 0) {
|
||||
if ($result > 0) {
|
||||
// Define output language
|
||||
|
|
@ -2420,7 +2420,7 @@ if ($action == 'create') {
|
|||
if (getDolGlobalString('MAIN_USE_EXPENSE_IK')) {
|
||||
print '<td class="fk_c_exp_tax_cat">';
|
||||
$params = array('fk_expense' => $object->id, 'fk_expense_det' => $line->id, 'date' => $line->date);
|
||||
print $form->selectExpenseCategories($line->fk_c_exp_tax_cat, 'fk_c_exp_tax_cat', 1, array(), 'fk_c_type_fees', (string) $userauthor->default_c_exp_tax_cat, $params);
|
||||
print $form->selectExpenseCategories((string) $line->fk_c_exp_tax_cat, 'fk_c_exp_tax_cat', 1, array(), 'fk_c_type_fees', (int) $userauthor->default_c_exp_tax_cat, $params);
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -819,7 +819,7 @@ if (empty($reshook)) {
|
|||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||
|
||||
if ($action == 'update_extras' && $permissiontoadd) {
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
$attribute_name = GETPOST('attribute', 'restricthtml');
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
|
|
|
|||
|
|
@ -309,7 +309,7 @@ if (empty($reshook)) {
|
|||
if ($action == 'update' && GETPOSTISSET('savevalidator') && $user->hasRight('holiday', 'approve')) {
|
||||
$object->fetch($id);
|
||||
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
$object->fk_validator = GETPOSTINT('valideur');
|
||||
|
||||
|
|
@ -468,7 +468,7 @@ if (empty($reshook)) {
|
|||
|
||||
// If draft and owner of leave
|
||||
if ($object->status == Holiday::STATUS_DRAFT && $permissiontoadd) {
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
$object->status = Holiday::STATUS_VALIDATED;
|
||||
|
||||
|
|
@ -584,7 +584,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
if ($action == 'update_extras') {
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
|
||||
|
|
@ -612,7 +612,7 @@ if (empty($reshook)) {
|
|||
|
||||
// If status is waiting approval and approver is also user
|
||||
if ($object->status == Holiday::STATUS_VALIDATED && ($user->id == $object->fk_validator || $permissiontoaddall) && $user->hasRight('holiday', 'approve')) {
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
$object->date_approval = dol_now();
|
||||
$object->fk_user_approve = $user->id;
|
||||
|
|
|
|||
|
|
@ -490,7 +490,7 @@ if (empty($reshook)) {
|
|||
|
||||
// Quick edit for extrafields
|
||||
if ($action == 'update_extras' && $usercancreate) {
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
|
||||
|
|
@ -783,7 +783,7 @@ if (empty($reshook)) {
|
|||
} else {
|
||||
if ($object->id > 0) {
|
||||
//Need dol_clone methode 1 (same object class) because update product use hasbatch() method on oldcopy
|
||||
$object->oldcopy = dol_clone($object, 1);
|
||||
$object->oldcopy = dol_clone($object, 1); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
if (!getDolGlobalString('PRODUCT_GENERATE_REF_AFTER_FORM')) {
|
||||
$object->ref = (string) $ref;
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@ if (empty($reshook)) {
|
|||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
} elseif ($action == 'update_extras' && $user->hasRight('stock', 'creer')) {
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
|
||||
|
|
|
|||
|
|
@ -315,7 +315,7 @@ if (empty($reshook)) {
|
|||
$db->begin();
|
||||
$old_start_date = 0;
|
||||
if (!$error) {
|
||||
$object->oldcopy = clone $object;
|
||||
$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
$old_start_date = $object->date_start;
|
||||
|
||||
|
|
@ -384,7 +384,7 @@ if (empty($reshook)) {
|
|||
|
||||
if (!$error) {
|
||||
if (GETPOST("reportdate") && ($object->date_start != $old_start_date)) {
|
||||
$result = $object->shiftTaskDate($old_start_date);
|
||||
$result = $object->shiftTaskDate((int) $old_start_date);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorShiftTaskDate").':'.$object->error, $object->errors, 'errors');
|
||||
|
|
@ -561,7 +561,7 @@ if (empty($reshook)) {
|
|||
|
||||
// Quick edit for extrafields
|
||||
if ($action == 'update_extras' && $permissiontoadd) {
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
|
||||
|
|
|
|||
|
|
@ -273,7 +273,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
if ($action == 'update_extras' && $permissiontoadd) {
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
|
||||
|
|
|
|||
|
|
@ -265,7 +265,7 @@ if (empty($reshook)) {
|
|||
if ($action == 'update_extras' && $permissiontoadd) {
|
||||
$object->fetch($socid);
|
||||
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
|
@ -322,7 +322,7 @@ if (empty($reshook)) {
|
|||
if (!$error) {
|
||||
if ($action == 'update') { // Test on permission not required here
|
||||
$ret = $object->fetch($socid);
|
||||
$object->oldcopy = clone $object;
|
||||
$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
} else {
|
||||
$object->canvas = $canvas;
|
||||
}
|
||||
|
|
@ -838,7 +838,7 @@ if (empty($reshook)) {
|
|||
// Delete third party
|
||||
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('societe', 'supprimer')) {
|
||||
$object->fetch($socid);
|
||||
$object->oldcopy = clone $object;
|
||||
$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
$result = $object->delete($socid, $user);
|
||||
|
||||
if ($result > 0) {
|
||||
|
|
@ -2071,7 +2071,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
|
|||
$prefixSupplierIsUsed = false;
|
||||
}
|
||||
|
||||
$object->oldcopy = clone $object;
|
||||
$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
if (GETPOSTISSET('name')) {
|
||||
// We overwrite with values if posted
|
||||
|
|
|
|||
|
|
@ -1157,7 +1157,7 @@ if (empty($reshook)) {
|
|||
// Multicurrency rate
|
||||
$result = $object->setMulticurrencyRate(GETPOSTFLOAT('multicurrency_tx'), GETPOSTINT('calculation_mode'));
|
||||
} elseif ($action == 'update_extras' && $usercancreate) {
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
$attribute_name = GETPOST('attribute', 'restricthtml');
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
|
|
|
|||
Loading…
Reference in a new issue