Qual: Fix notices for FormSms, RssParser, ExpenseReportIk and related (#31086)

* Qual: Fix Array of tabs typing hints

# Qual: Fix Array of tabs typing hints

Fixed same typing hints accross several files

* Qual: Fix pdf.lib.php, project.lib.php and related files

# Qual: Fix pdf.lib.php, project.lib.php and related files

Fix most phan notices for pdf.lib.php and project.lib.php.
And fixed some items in other files in the process

* Qual: Fix notifications commande/card advtarget.tpl fichinter/card societe/card supplier_proposal/card

* Qual: Fix notices for FormSms, RssParser, ExpenseReportIk and related

# Qual: Fix notices for FormSms, RssParser, ExpenseReportIk and related

Fix notices in the files for the classes above and other files to accomodate
these changes/fixes
This commit is contained in:
MDW 2024-09-23 00:37:30 +02:00 committed by GitHub
parent 038e1e8f05
commit 7b4c4d772c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
60 changed files with 768 additions and 515 deletions

View File

@ -138,7 +138,7 @@ function updateCopyrightNotice($filename, $fileType, $name, $email)
// If the existing year is the same, no need to update
} else {
// Adjust tabs for proper alignment
print "Offset:".$nameStartToMailStartOffset."\n";
// print "Offset:".$nameStartToMailStartOffset."\n";
$emailTabs = str_repeat("\t", (int) (max(0, ($nameStartToMailStartOffset + 4 - mb_strlen($name)) / 4)));
// No match found, add a new line to the header
@ -162,8 +162,8 @@ function updateCopyrightNotice($filename, $fileType, $name, $email)
}
// Write the updated content back to the file
//file_put_contents($filename, $fileContent);
print $fileContent;
file_put_contents($filename, $fileContent);
// print $fileContent;
return true; // Change detected
}

View File

@ -9,38 +9,38 @@
*/
return [
// # Issue statistics:
// PhanPluginUnknownPropertyType : 1550+ occurrences
// PhanTypeMismatchArgumentProbablyReal : 890+ occurrences
// PhanPluginUnknownPropertyType : 1520+ occurrences
// PhanUndeclaredProperty : 840+ occurrences
// PhanPossiblyUndeclaredGlobalVariable : 750+ occurrences
// PhanPluginUnknownArrayMethodReturnType : 480+ occurrences
// PhanUndeclaredGlobalVariable : 470+ occurrences
// PhanPluginUnknownArrayMethodParamType : 410+ occurrences
// PhanPossiblyUndeclaredVariable : 350+ occurrences
// PhanPluginUnknownObjectMethodCall : 330+ occurrences
// PhanPluginUnknownArrayFunctionReturnType : 220+ occurrences
// PhanTypeMismatchProperty : 210+ occurrences
// PhanPluginUnknownArrayFunctionParamType : 160+ occurrences
// PhanTypeMismatchArgumentProbablyReal : 780+ occurrences
// PhanPossiblyUndeclaredGlobalVariable : 730+ occurrences
// PhanPluginUnknownArrayMethodReturnType : 470+ occurrences
// PhanUndeclaredGlobalVariable : 440+ occurrences
// PhanPluginUnknownArrayMethodParamType : 400+ occurrences
// PhanPossiblyUndeclaredVariable : 330+ occurrences
// PhanPluginUnknownObjectMethodCall : 230+ occurrences
// PhanTypeMismatchProperty : 200+ occurrences
// PhanPluginUnknownArrayFunctionReturnType : 160+ occurrences
// PhanPluginUnknownArrayFunctionParamType : 150+ occurrences
// PhanTypeMismatchArgumentNullableInternal : 110+ occurrences
// PhanPluginUnknownArrayPropertyType : 80+ occurrences
// PhanPluginUndeclaredVariableIsset : 70+ occurrences
// PhanPluginEmptyStatementIf : 60+ occurrences
// PhanPluginEmptyStatementIf : 55+ occurrences
// PhanRedefineFunction : 55+ occurrences
// PhanTypeExpectedObjectPropAccess : 50+ occurrences
// PhanTypeSuspiciousNonTraversableForeach : 50+ occurrences
// PhanTypeMismatchDimFetch : 40+ occurrences
// PhanTypeExpectedObjectPropAccess : 25+ occurrences
// PhanPossiblyNullTypeMismatchProperty : 15+ occurrences
// PhanTypeComparisonFromArray : 15+ occurrences
// PhanUndeclaredConstant : 15+ occurrences
// PhanEmptyForeach : 10+ occurrences
// PhanPluginBothLiteralsBinaryOp : 10+ occurrences
// PhanPluginConstantVariableNull : 10+ occurrences
// PhanPluginDuplicateExpressionBinaryOp : 10+ occurrences
// PhanPluginSuspiciousParamPosition : 10+ occurrences
// PhanTypeExpectedObjectPropAccessButGotNull : 9 occurrences
// PhanUndeclaredMethod : 9 occurrences
// PhanPluginBothLiteralsBinaryOp : 8 occurrences
// PhanPluginDuplicateArrayKey : 8 occurrences
// PhanTypeMismatchDimFetchNullable : 7 occurrences
// PhanTypeExpectedObjectPropAccessButGotNull : 6 occurrences
// PhanInvalidFQSENInClasslike : 2 occurrences
// PhanParamTooMany : 2 occurrences
// PhanAccessMethodProtected : 1 occurrence
@ -129,7 +129,6 @@ return [
'htdocs/comm/propal/class/propalestats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'],
'htdocs/comm/propal/list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/comm/propal/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/commande/card.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'],
'htdocs/commande/class/api_orders.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/commande/class/commande.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'],
'htdocs/commande/class/commandestats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'],
@ -291,7 +290,7 @@ return [
'htdocs/core/class/canvas.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'],
'htdocs/core/class/ccountry.class.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'],
'htdocs/core/class/cgenericdic.class.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'],
'htdocs/core/class/commondocgenerator.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanTypeSuspiciousNonTraversableForeach', 'PhanUndeclaredProperty'],
'htdocs/core/class/commondocgenerator.class.php' => ['PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanTypeSuspiciousNonTraversableForeach', 'PhanUndeclaredProperty'],
'htdocs/core/class/commonhookactions.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayPropertyType'],
'htdocs/core/class/commoninvoice.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'],
'htdocs/core/class/commonobject.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeComparisonFromArray', 'PhanTypeMismatchDimFetch', 'PhanUndeclaredProperty'],
@ -333,7 +332,6 @@ return [
'htdocs/core/class/html.formother.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'],
'htdocs/core/class/html.formprojet.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/class/html.formsetup.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayPropertyType'],
'htdocs/core/class/html.formsms.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccessButGotNull'],
'htdocs/core/class/html.formticket.class.php' => ['PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/class/html.formwebsite.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType'],
'htdocs/core/class/infobox.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
@ -344,7 +342,7 @@ return [
'htdocs/core/class/notify.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'],
'htdocs/core/class/openid.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'],
'htdocs/core/class/reddithandler.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType'],
'htdocs/core/class/rssparser.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeExpectedObjectPropAccess'],
'htdocs/core/class/rssparser.class.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/class/smtps.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchDimFetch'],
'htdocs/core/class/socialnetworkmanager.class.php' => ['PhanPluginUnknownArrayMethodParamType'],
'htdocs/core/class/stats.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchDimFetch'],
@ -367,23 +365,18 @@ return [
'htdocs/core/lib/ajax.lib.php' => ['PhanPluginUnknownArrayFunctionParamType'],
'htdocs/core/lib/asset.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/bank.lib.php' => ['PhanPluginEmptyStatementIf', 'PhanUndeclaredProperty'],
'htdocs/core/lib/categories.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/company.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty'],
'htdocs/core/lib/contact.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/contract.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/cron.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/customreports.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchDimFetch'],
'htdocs/core/lib/date.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'],
'htdocs/core/lib/doc.lib.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/lib/donation.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/ecm.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/emailing.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/eventorganization.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/expedition.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/expensereport.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/fichinter.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall'],
'htdocs/core/lib/files.lib.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'],
'htdocs/core/lib/fiscalyear.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/fourn.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/ftp.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'],
'htdocs/core/lib/functions.lib.php' => ['PhanPluginDuplicateArrayKey'],
@ -401,16 +394,15 @@ return [
'htdocs/core/lib/loan.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/mailmanspip.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/memory.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/multicurrency.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/multicurrency.lib.php' => ['PhanPluginUnknownArrayFunctionParamType'],
'htdocs/core/lib/oauth.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/openid_connect.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/order.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/payments.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/pdf.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/core/lib/pdf.lib.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredProperty'],
'htdocs/core/lib/prelevement.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/price.lib.php' => ['PhanPluginSuspiciousParamPosition', 'PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable'],
'htdocs/core/lib/product.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable'],
'htdocs/core/lib/project.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/core/lib/project.lib.php' => ['PhanUndeclaredProperty'],
'htdocs/core/lib/propal.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall'],
'htdocs/core/lib/receiptprinter.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/reception.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
@ -419,18 +411,16 @@ return [
'htdocs/core/lib/salaries.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/security.lib.php' => ['PhanPluginUnknownArrayFunctionParamType'],
'htdocs/core/lib/security2.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable'],
'htdocs/core/lib/sendings.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/core/lib/sendings.lib.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/core/lib/signature.lib.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/lib/socialnetwork.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/stock.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/supplier_proposal.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall'],
'htdocs/core/lib/takepos.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/tax.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable'],
'htdocs/core/lib/tax.lib.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/lib/ticket.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/treeview.lib.php' => ['PhanPluginUnknownArrayFunctionParamType'],
'htdocs/core/lib/trip.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/usergroups.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/lib/vat.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/usergroups.lib.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/lib/website.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchArgumentNullableInternal'],
'htdocs/core/lib/xcal.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'],
'htdocs/core/modules/DolibarrModules.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'],
@ -530,7 +520,6 @@ return [
'htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeSuspiciousNonTraversableForeach'],
'htdocs/core/modules/workstation/mod_workstation_advanced.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/core/search_page.php' => ['PhanEmptyForeach', 'PhanPluginBothLiteralsBinaryOp'],
'htdocs/core/tpl/advtarget.tpl.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeExpectedObjectPropAccessButGotNull', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
'htdocs/core/tpl/ajaxrow.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable'],
'htdocs/core/tpl/bloc_comment.tpl.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/core/tpl/card_presend.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
@ -554,8 +543,8 @@ return [
'htdocs/core/tpl/objectline_title.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/core/tpl/objectline_view.tpl.php' => ['PhanTypeExpectedObjectPropAccessButGotNull', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/core/tpl/onlinepaymentlinks.tpl.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/core/tpl/passwordforgotten.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
'htdocs/core/tpl/passwordreset.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
'htdocs/core/tpl/passwordforgotten.tpl.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/core/tpl/passwordreset.tpl.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/core/tpl/resource_add.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
'htdocs/core/tpl/resource_view.tpl.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable'],
'htdocs/core/triggers/dolibarrtriggers.class.php' => ['PhanPluginUnknownArrayPropertyType'],
@ -572,7 +561,6 @@ return [
'htdocs/datapolicy/class/datapolicy.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'],
'htdocs/datapolicy/class/datapolicycron.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/datapolicy/lib/datapolicy.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/dav/dav.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/debugbar/class/DataCollector/DolConfigCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/debugbar/class/DataCollector/DolExceptionsCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/debugbar/class/DataCollector/DolMemoryCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'],
@ -634,10 +622,9 @@ return [
'htdocs/expedition/note.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/expedition/shipment.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
'htdocs/expedition/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/expensereport/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/expensereport/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/expensereport/class/api_expensereports.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/expensereport/class/expensereport.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeExpectedObjectPropAccessButGotNull'],
'htdocs/expensereport/class/expensereport_ik.class.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/expensereport/class/expensereport.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeExpectedObjectPropAccessButGotNull'],
'htdocs/expensereport/class/expensereportstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/expensereport/class/paymentexpensereport.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/expensereport/payment/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
@ -648,8 +635,8 @@ return [
'htdocs/expensereport/tpl/expensereport_linktofile.tpl.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/expensereport/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/externalsite/frames.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/fichinter/card-rec.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccessButGotNull', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/fichinter/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/fichinter/card-rec.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/fichinter/card.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/fichinter/class/api_interventions.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'],
'htdocs/fichinter/class/fichinter.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall'],
'htdocs/fichinter/class/fichinterrec.class.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
@ -684,7 +671,7 @@ return [
'htdocs/fourn/paiement/document.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/fourn/product/list.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/ftp/admin/ftpclient.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/ftp/index.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/ftp/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/holiday/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'],
'htdocs/holiday/card_group.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'],
'htdocs/holiday/class/holiday.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'],
@ -852,16 +839,15 @@ return [
'htdocs/product/stock/tpl/stocktransfer.tpl.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/projet/activity/index.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccessButGotNull', 'PhanUndeclaredGlobalVariable'],
'htdocs/projet/activity/perday.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/projet/activity/permonth.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/projet/activity/perweek.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/projet/admin/project.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/projet/ajax/projects.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/projet/card.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
'htdocs/projet/class/api_projects.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/projet/class/api_projects.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall'],
'htdocs/projet/class/api_tasks.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/projet/class/project.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginSuspiciousParamPosition', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/projet/class/project.class.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/projet/class/projectstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'],
'htdocs/projet/class/task.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/projet/class/task.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'],
'htdocs/projet/class/taskstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'],
'htdocs/projet/contact.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeComparisonFromArray', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/projet/element.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
@ -968,7 +954,7 @@ return [
'htdocs/societe/ajax/ajaxcompanies.php' => ['PhanUndeclaredProperty'],
'htdocs/societe/ajax/company.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/societe/canvas/actions_card_common.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanTypeSuspiciousNonTraversableForeach'],
'htdocs/societe/card.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'],
'htdocs/societe/card.php' => ['PhanTypeMismatchProperty'],
'htdocs/societe/checkvat/checkVatPopup.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/societe/class/api_contacts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'],
'htdocs/societe/class/api_thirdparties.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanTypeSuspiciousNonTraversableForeach', 'PhanUndeclaredProperty'],
@ -985,26 +971,23 @@ return [
'htdocs/societe/website.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/stripe/admin/stripe.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/stripe/ajax/ajax.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/stripe/charge.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/stripe/class/actions_stripe.class.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginSuspiciousParamPosition', 'PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/stripe/class/actions_stripe.class.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginSuspiciousParamPosition', 'PhanPluginUnknownArrayMethodParamType', 'PhanUndeclaredProperty'],
'htdocs/stripe/class/stripe.class.php' => ['PhanPluginConstantVariableNull', 'PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/stripe/lib/stripe.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/stripe/payout.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/stripe/transaction.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/supplier_proposal/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
'htdocs/supplier_proposal/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/supplier_proposal/class/api_supplier_proposals.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'],
'htdocs/supplier_proposal/class/supplier_proposal.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/supplier_proposal/list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/support/inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanRedefineFunction'],
'htdocs/takepos/admin/orderprinters.php' => ['PhanTypeMismatchDimFetch'],
'htdocs/takepos/admin/terminal.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/takepos/admin/terminal.php' => ['PhanPluginUnknownObjectMethodCall'],
'htdocs/takepos/ajax/ajax.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/takepos/floors.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/takepos/freezone.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/takepos/index.php' => ['PhanPluginUndeclaredVariableIsset'],
'htdocs/takepos/invoice.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/takepos/pay.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/takepos/pay.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/takepos/public/menu.php' => ['PhanUndeclaredProperty'],
'htdocs/takepos/split.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/theme/eldy/badges.inc.php' => ['PhanRedefineFunction'],
@ -1043,7 +1026,6 @@ return [
'htdocs/variants/class/ProductAttribute.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/variants/class/ProductCombination.class.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/variants/combinations.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty'],
'htdocs/variants/lib/variants.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/variants/tpl/productattributevalueline_edit.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/variants/tpl/productattributevalueline_view.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/viewimage.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanRedefineFunction'],

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2012 Mikael Carlavan <contact@mika-carl.fr>
* Copyright (C) 2017 ATM Consulting <contact@atm-consulting.fr>
* Copyright (C) 2017 Pierre-Henry Favre <phf@atm-consulting.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
@ -144,6 +145,8 @@ foreach ($rangesbycateg as $fk_c_exp_tax_cat => $Tab) {
$tranche = 1;
foreach ($Tab['ranges'] as $k => $range) {
$ik = $range->ik;
'@phan-var-force ExpenseReportIk $ik';
if (isset($Tab['ranges'][$k + 1])) {
$label = $langs->trans('expenseReportRangeFromTo', $range->range_ik, ($Tab['ranges'][$k + 1]->range_ik - 1));
} else {
@ -161,35 +164,35 @@ foreach ($rangesbycateg as $fk_c_exp_tax_cat => $Tab) {
// Offset
echo '<td class="nowraponall">';
if ($action == 'edit' && $range->ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) {
echo '<input type="text" class="maxwidth100" name="ikoffset" value="'.$range->ik->ikoffset.'" />';
if ($action == 'edit' && $ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) {
echo '<input type="text" class="maxwidth100" name="ikoffset" value="'.$ik->ikoffset.'" />';
} else {
echo $range->ik->ikoffset;
echo $ik->ikoffset;
}
echo '</td>';
// Coef
echo '<td class="nowraponall">';
if ($action == 'edit' && $range->ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) {
echo '<input type="text" class="maxwidth100" name="coef" value="'.$range->ik->coef.'" />';
if ($action == 'edit' && $ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) {
echo '<input type="text" class="maxwidth100" name="coef" value="'.$ik->coef.'" />';
} else {
echo($range->ik->id > 0 ? $range->ik->coef : $langs->trans('expenseReportCoefUndefined'));
echo($ik->id > 0 ? $ik->coef : $langs->trans('expenseReportCoefUndefined'));
}
echo '</td>';
// Total for one
echo '<td class="nowraponall">'.$langs->trans('expenseReportPrintExample', price($range->ik->ikoffset + 5 * $range->ik->coef)).'</td>';
echo '<td class="nowraponall">'.$langs->trans('expenseReportPrintExample', price($ik->ikoffset + 5 * $ik->coef)).'</td>';
// Action
echo '<td class="right">';
if ($range->range_active == 1) {
if ($action == 'edit' && $range->ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) {
if ($action == 'edit' && $ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) {
echo '<input id="" class="button button-save" name="save" value="'.$langs->trans("Save").'" type="submit" />';
echo '<input class="button button-cancel" value="'.$langs->trans("Cancel").'" onclick="history.go(-1)" type="button" />';
} else {
echo '<a class="editfielda marginrightonly paddingleft paddingright" href="'.$_SERVER['PHP_SELF'].'?action=edit&token='.newToken().'&id='.$range->ik->id.'&fk_c_exp_tax_cat='.$range->fk_c_exp_tax_cat.'&fk_range='.$range->rowid.'">'.img_edit().'</a>';
if (!empty($range->ik->id)) {
echo '<a class="paddingleft paddingright" href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&id='.$range->ik->id.'">'.img_delete().'</a>';
echo '<a class="editfielda marginrightonly paddingleft paddingright" href="'.$_SERVER['PHP_SELF'].'?action=edit&token='.newToken().'&id='.$ik->id.'&fk_c_exp_tax_cat='.$range->fk_c_exp_tax_cat.'&fk_range='.$range->rowid.'">'.img_edit().'</a>';
if (!empty($ik->id)) {
echo '<a class="paddingleft paddingright" href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&id='.$ik->id.'">'.img_delete().'</a>';
}
// TODO add delete link
}

View File

@ -78,6 +78,7 @@ if (GETPOST('button_removefilter_x', 'alpha')) {
$search_email = '';
}
$array_query = array();
'@phan-var-force array<string,int|string|string[]> $array_query';
$object = new Mailing($db);
$advTarget = new AdvanceTargetingMailing($db);
@ -465,6 +466,10 @@ if ($object->fetch($id) >= 0) {
// Show email selectors
if ($object->status == 0 && $user->hasRight('mailing', 'creer')) {
// @phan-assert FormAdvTargetEmailing $formadvtargetemaling
// @phan-assert AdvanceTargetingMailing $advTarget
// @phan-assert array<string,int|string|string[] $array_query'
include DOL_DOCUMENT_ROOT.'/core/tpl/advtarget.tpl.php';
}
}

View File

@ -157,6 +157,8 @@ $error = 0;
$date_delivery = dol_mktime(GETPOSTINT('liv_hour'), GETPOSTINT('liv_min'), 0, GETPOSTINT('liv_month'), GETPOSTINT('liv_day'), GETPOSTINT('liv_year'));
$selectedLines = array();
/*
* Actions
@ -389,6 +391,7 @@ if (empty($reshook)) {
$classname = ucfirst($subelement);
$srcobject = new $classname($db);
'@phan-var-force Commande|Propal|Contrat $srcobject';
dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines");
$result = $srcobject->fetch($object->origin_id);
@ -1765,6 +1768,7 @@ if ($action == 'create' && $usercancreate) {
$classname = ucfirst($subelement);
$objectsrc = new $classname($db);
'@phan-var-force Commande|Propal|Contrat $objectsrc'; // Can possibly be other class but CommonObject is too general
$objectsrc->fetch($originid);
if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) {
$objectsrc->fetch_lines();
@ -1902,7 +1906,7 @@ if ($action == 'create' && $usercancreate) {
} else {
print '<td class="valuefieldcreate">';
$filter = '((s.client:IN:1,2,3) AND (s.status:=:1))';
print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, null, 0, 'minwidth175 maxwidth500 widthcentpercentminusxx');
print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth175 maxwidth500 widthcentpercentminusxx');
// reload page to retrieve customer information
if (!getDolGlobalString('RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED')) {
print '<script>
@ -2468,7 +2472,7 @@ if ($action == 'create' && $usercancreate) {
$filter = '(s.client:IN:1,2,3)';
// Create an array for form
$formquestion = array(
array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOSTINT('socid'), 'socid', $filter, '', 0, 0, null, 0, 'maxwidth300'))
array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOSTINT('socid'), 'socid', $filter, '', 0, 0, array(), 0, 'maxwidth300'))
);
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneOrder', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
}
@ -2564,8 +2568,8 @@ if ($action == 'create' && $usercancreate) {
print '<tr><td class="titlefield">'.$langs->trans('Discounts').'</td><td class="valuefield">';
$absolute_discount = $soc->getAvailableDiscounts('', $filterabsolutediscount);
$absolute_creditnote = $soc->getAvailableDiscounts('', $filtercreditnote);
$absolute_discount = $soc->getAvailableDiscounts(null, $filterabsolutediscount);
$absolute_creditnote = $soc->getAvailableDiscounts(null, $filtercreditnote);
$absolute_discount = price2num($absolute_discount, 'MT');
$absolute_creditnote = price2num($absolute_creditnote, 'MT');
@ -3146,7 +3150,7 @@ if ($action == 'create' && $usercancreate) {
// Show links to link elements
$linktoelem = $form->showLinkToObjectBlock($object, null, array('order'));
$linktoelem = $form->showLinkToObjectBlock($object, array(), array('order'));
$compatibleImportElementsList = false;
if ($usercancreate

View File

@ -405,6 +405,7 @@ class ChargeSociales extends CommonObject
*/
public function solde($year = 0)
{
global $conf;
$sql = "SELECT SUM(f.amount) as amount";
$sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as f";
$sql .= " WHERE f.entity = ".((int) $conf->entity);

View File

@ -199,7 +199,7 @@ abstract class CommonDocGenerator
*
* @param User $user User
* @param Translate $outputlangs Language object for output
* @return array Array of substitution key->code
* @return array<string,mixed> Array of substitution key->code
*/
public function get_substitutionarray_user($user, $outputlangs)
{
@ -248,7 +248,7 @@ abstract class CommonDocGenerator
*
* @param Adherent $member Member
* @param Translate $outputlangs Language object for output
* @return array Array of substitution key->code
* @return array<string,mixed> Array of substitution key->code
*/
public function getSubstitutionarrayMember($member, $outputlangs)
{
@ -295,7 +295,7 @@ abstract class CommonDocGenerator
*
* @param Societe $mysoc Object thirdparty
* @param Translate $outputlangs Language object for output
* @return array Array of substitution key->code
* @return array<string,mixed> Array of substitution key->code
*/
public function get_substitutionarray_mysoc($mysoc, $outputlangs)
{
@ -355,7 +355,7 @@ abstract class CommonDocGenerator
* @param Societe $object Object
* @param Translate $outputlangs Language object for output
* @param string $array_key Name of the key for return array
* @return array Array of substitution key->code
* @return array<string,mixed> Array of substitution key->code
*/
public function get_substitutionarray_thirdparty($object, $outputlangs, $array_key = 'company')
{
@ -422,7 +422,7 @@ abstract class CommonDocGenerator
* @param Contact $object contact
* @param Translate $outputlangs object for output
* @param string $array_key Name of the key for return array
* @return array Array of substitution key->code
* @return array<string,mixed> Array of substitution key->code
*/
public function get_substitutionarray_contact($object, $outputlangs, $array_key = 'object')
{
@ -481,7 +481,7 @@ abstract class CommonDocGenerator
* Define array with couple substitution key => substitution value
*
* @param Translate $outputlangs Language object for output
* @return array Array of substitution key->code
* @return array<string,mixed> Array of substitution key->code
*/
public function get_substitutionarray_other($outputlangs)
{
@ -524,7 +524,7 @@ abstract class CommonDocGenerator
* @param CommonObject $object Main object to use as data source
* @param Translate $outputlangs Lang object to use for output
* @param string $array_key Name of the key for return array
* @return array Array of substitution
* @return array<string,mixed> Array of substitution
*/
public function get_substitutionarray_object($object, $outputlangs, $array_key = 'object')
{
@ -728,7 +728,7 @@ abstract class CommonDocGenerator
* @param CommonObjectLine $line Object line
* @param Translate $outputlangs Translate object to use for output
* @param int $linenumber The number of the line for the substitution of "object_line_pos"
* @return array Return a substitution array
* @return array<string,mixed> Return a substitution array
*/
public function get_substitutionarray_lines($line, $outputlangs, $linenumber = 0)
{
@ -855,7 +855,7 @@ abstract class CommonDocGenerator
* @param Expedition $object Main object to use as data source
* @param Translate $outputlangs Lang object to use for output
* @param string $array_key Name of the key for return array
* @return array Array of substitution
* @return array<string,mixed> Array of substitution
*/
public function get_substitutionarray_shipment($object, $outputlangs, $array_key = 'object')
{
@ -920,10 +920,10 @@ abstract class CommonDocGenerator
/**
* Define array with couple substitution key => substitution value
*
* @param Object $object Dolibarr Object
* @param Translate $outputlangs Language object for output
* @param boolean|int $recursive Want to fetch child array or child object.
* @return array Array of substitution key->code
* @param array<string,mixed> $object Dolibarr Object
* @param Translate $outputlangs Language object for output
* @param boolean|int $recursive Want to fetch child array or child object.
* @return array<string,mixed> Array of substitution key->code
*/
public function get_substitutionarray_each_var_object(&$object, $outputlangs, $recursive = 1)
{
@ -965,12 +965,12 @@ abstract class CommonDocGenerator
* Fill array with couple extrafield key => extrafield value
* Note that vars into substitutions array are formatted.
*
* @param Object $object Object with extrafields (must have $object->array_options filled)
* @param array $array_to_fill Substitution array
* @param CommonObject $object Object with extrafields (must have $object->array_options filled)
* @param array<string,string> $array_to_fill Substitution array
* @param Extrafields $extrafields Extrafields object
* @param string $array_key Prefix for name of the keys into returned array
* @param Translate $outputlangs Lang object to use for output
* @return array Substitution array
* @return array<string,string> Substitution array
*/
public function fill_substitutionarray_with_extrafields($object, $array_to_fill, $extrafields, $array_key, $outputlangs)
{
@ -1063,8 +1063,8 @@ abstract class CommonDocGenerator
* @param float $y Ordinate of first point
* @param float $l ??
* @param float $h ??
* @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
* @param int $hidebottom Hide bottom
* @param int<-1,1> $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
* @param int<0,1> $hidebottom Hide bottom
* @return void
*/
public function printRect($pdf, $x, $y, $l, $h, $hidetop = 0, $hidebottom = 0)
@ -1083,9 +1083,9 @@ abstract class CommonDocGenerator
/**
* uasort callback function to Sort columns fields
*
* @param array $a PDF lines array fields configs
* @param array $b PDF lines array fields configs
* @return int Return compare result
* @param array{rank?:int} $a PDF lines array fields configs
* @param array{rank?:int} $b PDF lines array fields configs
* @return int<-1,1> Return compare result
*/
public function columnSort($a, $b)
{
@ -1104,11 +1104,11 @@ abstract class CommonDocGenerator
/**
* Prepare Array Column Field
*
* @param object $object common object
* @param CommonObject $object common object
* @param Translate $outputlangs langs
* @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return void
*/
public function prepareArrayColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
@ -1218,7 +1218,7 @@ abstract class CommonDocGenerator
* get column position rank from column key
*
* @param string $newColKey the new column key
* @param array $defArray a single column definition array
* @param array{rank?:int} $defArray a single column definition array
* @param string $targetCol target column used to place the new column beside
* @param bool $insertAfterTarget insert before or after target column ?
* @return int new rank on success and -1 on error
@ -1308,12 +1308,12 @@ abstract class CommonDocGenerator
* @param TCPDI|TCPDF $pdf Pdf object
* @param float $curY current Y position
* @param string $colKey the column key
* @param object $object CommonObject
* @param CommonObject $object CommonObject
* @param int $i the $object->lines array key
* @param Translate $outputlangs Output language
* @param int $hideref hide ref
* @param int $hidedesc hide desc
* @param int $issupplierline if object need supplier product
* @param int<0,1> $hideref hide ref
* @param int<0,1> $hidedesc hide desc
* @param int<0,1> $issupplierline if object needx supplier product
* @return void
*/
public function printColDescContent($pdf, &$curY, $colKey, $object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, $issupplierline = 0)
@ -1415,7 +1415,7 @@ abstract class CommonDocGenerator
*
* @param CommonObjectLine $object line of common object
* @param Translate $outputlangs Output language
* @param array $params array of additional parameters
* @param array<string,mixed> $params array of additional parameters
* @return string Html string
*/
public function getExtrafieldsInHtml($object, $outputlangs, $params = array())

View File

@ -535,12 +535,12 @@ abstract class CommonObject
public $multicurrency_total_ttc;
/**
* @var float Multicurrency total localta1
* @var float|string Multicurrency total localtax1
*/
public $multicurrency_total_localtax1; // not in database
/**
* @var float Multicurrency total localtax2
* @var float|string Multicurrency total localtax2
*/
public $multicurrency_total_localtax2; // not in database
@ -2751,111 +2751,111 @@ abstract class CommonObject
/** @var Propal $this */
/** @var PropaleLigne $line */
$this->updateline(
$line->id,
$line->subprice,
$line->qty,
$line->remise_percent,
$line->tva_tx,
$line->localtax1_tx,
$line->localtax2_tx,
($line->description ? $line->description : $line->desc),
'HT',
$line->info_bits,
$line->special_code,
$line->fk_parent_line,
$line->skip_update_total,
$line->fk_fournprice,
$line->pa_ht,
$line->label,
$line->product_type,
$line->date_start,
$line->date_end,
$line->array_options,
$line->fk_unit,
$line->multicurrency_subprice
$line->id,
$line->subprice,
$line->qty,
$line->remise_percent,
$line->tva_tx,
$line->localtax1_tx,
$line->localtax2_tx,
($line->description ? $line->description : $line->desc),
'HT',
$line->info_bits,
$line->special_code,
$line->fk_parent_line,
$line->skip_update_total,
$line->fk_fournprice,
$line->pa_ht,
$line->label,
$line->product_type,
$line->date_start,
$line->date_end,
$line->array_options,
$line->fk_unit,
$line->multicurrency_subprice
);
break;
case 'commande':
/** @var Commande $this */
/** @var OrderLine $line */
$this->updateline(
$line->id,
($line->description ? $line->description : $line->desc),
$line->subprice,
$line->qty,
$line->remise_percent,
$line->tva_tx,
$line->localtax1_tx,
$line->localtax2_tx,
'HT',
$line->info_bits,
$line->date_start,
$line->date_end,
$line->product_type,
$line->fk_parent_line,
$line->skip_update_total,
$line->fk_fournprice,
$line->pa_ht,
$line->label,
$line->special_code,
$line->array_options,
$line->fk_unit,
$line->multicurrency_subprice
$line->id,
($line->description ? $line->description : $line->desc),
$line->subprice,
$line->qty,
$line->remise_percent,
$line->tva_tx,
$line->localtax1_tx,
$line->localtax2_tx,
'HT',
$line->info_bits,
$line->date_start,
$line->date_end,
$line->product_type,
$line->fk_parent_line,
$line->skip_update_total,
$line->fk_fournprice,
$line->pa_ht,
$line->label,
$line->special_code,
$line->array_options,
$line->fk_unit,
$line->multicurrency_subprice
);
break;
case 'facture':
/** @var Facture $this */
/** @var FactureLigne $line */
$this->updateline(
$line->id,
($line->description ? $line->description : $line->desc),
$line->subprice,
$line->qty,
$line->remise_percent,
$line->date_start,
$line->date_end,
$line->tva_tx,
$line->localtax1_tx,
$line->localtax2_tx,
'HT',
$line->info_bits,
$line->product_type,
$line->fk_parent_line,
$line->skip_update_total,
$line->fk_fournprice,
$line->pa_ht,
$line->label,
$line->special_code,
$line->array_options,
$line->situation_percent,
$line->fk_unit,
$line->multicurrency_subprice
$line->id,
($line->description ? $line->description : $line->desc),
$line->subprice,
$line->qty,
$line->remise_percent,
$line->date_start,
$line->date_end,
$line->tva_tx,
$line->localtax1_tx,
$line->localtax2_tx,
'HT',
$line->info_bits,
$line->product_type,
$line->fk_parent_line,
$line->skip_update_total,
$line->fk_fournprice,
$line->pa_ht,
$line->label,
$line->special_code,
$line->array_options,
$line->situation_percent,
$line->fk_unit,
$line->multicurrency_subprice
);
break;
case 'supplier_proposal':
/** @var SupplierProposal $this */
/** @var SupplierProposalLine $line */
$this->updateline(
$line->id,
$line->subprice,
$line->qty,
$line->remise_percent,
$line->tva_tx,
$line->localtax1_tx,
$line->localtax2_tx,
($line->description ? $line->description : $line->desc),
'HT',
$line->info_bits,
$line->special_code,
$line->fk_parent_line,
$line->skip_update_total,
$line->fk_fournprice,
$line->pa_ht,
$line->label,
$line->product_type,
$line->array_options,
$line->ref_fourn,
$line->multicurrency_subprice
$line->id,
$line->subprice,
$line->qty,
$line->remise_percent,
$line->tva_tx,
$line->localtax1_tx,
$line->localtax2_tx,
($line->description ? $line->description : $line->desc),
'HT',
$line->info_bits,
$line->special_code,
$line->fk_parent_line,
$line->skip_update_total,
$line->fk_fournprice,
$line->pa_ht,
$line->label,
$line->product_type,
$line->array_options,
$line->ref_fourn,
$line->multicurrency_subprice
);
break;
case 'order_supplier':
@ -8106,20 +8106,20 @@ abstract class CommonObject
if (!empty($param_list_array[2])) { // If the entry into $fields is set, we must add a create button
if ((!GETPOSTISSET('backtopage') || strpos(GETPOST('backtopage'), $_SERVER['PHP_SELF']) === 0) // // To avoid to open several times the 'Plus' button (we accept only one level)
&& empty($val['disabled']) && empty($nonewbutton)) { // and to avoid to show the button if the field is protected by a "disabled".
list($class, $classfile) = explode(':', $param_list[0]);
list($class, $classfile) = explode(':', $param_list[0]);
if (file_exists(dol_buildpath(dirname(dirname($classfile)).'/card.php'))) {
$url_path = dol_buildpath(dirname(dirname($classfile)).'/card.php', 1);
} else {
$url_path = dol_buildpath(dirname(dirname($classfile)).'/'.strtolower($class).'_card.php', 1);
}
$paramforthenewlink = '';
$paramforthenewlink .= (GETPOSTISSET('action') ? '&action='.GETPOST('action', 'aZ09') : '');
$paramforthenewlink .= (GETPOSTISSET('id') ? '&id='.GETPOSTINT('id') : '');
$paramforthenewlink .= (GETPOSTISSET('origin') ? '&origin='.GETPOST('origin', 'aZ09') : '');
$paramforthenewlink .= (GETPOSTISSET('originid') ? '&originid='.GETPOSTINT('originid') : '');
$paramforthenewlink .= '&fk_'.strtolower($class).'=--IDFORBACKTOPAGE--';
// TODO Add JavaScript code to add input fields already filled into $paramforthenewlink so we won't loose them when going back to main page
$out .= '<a class="butActionNew" title="'.$langs->trans("New").'" href="'.$url_path.'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF'].($paramforthenewlink ? '?'.$paramforthenewlink : '')).'"><span class="fa fa-plus-circle valignmiddle"></span></a>';
$paramforthenewlink = '';
$paramforthenewlink .= (GETPOSTISSET('action') ? '&action='.GETPOST('action', 'aZ09') : '');
$paramforthenewlink .= (GETPOSTISSET('id') ? '&id='.GETPOSTINT('id') : '');
$paramforthenewlink .= (GETPOSTISSET('origin') ? '&origin='.GETPOST('origin', 'aZ09') : '');
$paramforthenewlink .= (GETPOSTISSET('originid') ? '&originid='.GETPOSTINT('originid') : '');
$paramforthenewlink .= '&fk_'.strtolower($class).'=--IDFORBACKTOPAGE--';
// TODO Add JavaScript code to add input fields already filled into $paramforthenewlink so we won't loose them when going back to main page
$out .= '<a class="butActionNew" title="'.$langs->trans("New").'" href="'.$url_path.'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF'].($paramforthenewlink ? '?'.$paramforthenewlink : '')).'"><span class="fa fa-plus-circle valignmiddle"></span></a>';
}
}
} elseif ($type == 'password') {

View File

@ -266,8 +266,8 @@ class FormCompany extends Form
* The key of the list is the code (there can be several entries for a given code but in this case, the country field differs).
* Thus the links with the departments are done on a department independently of its name.
*
* @param int $selected Code state preselected (mus be state id)
* @param integer $country_codeid Country code or id: 0=list for all countries, otherwise country code or country rowid to show
* @param int $selected Code state preselected (must be state id)
* @param int $country_codeid Country code or id: 0=list for all countries, otherwise country code or country rowid to show
* @param string $htmlname Id of department. If '', we want only the string with <option>
* @param string $morecss Add more css
* @return string String with HTML select
@ -378,9 +378,9 @@ class FormCompany extends Form
* The key of the list is the code (there can be several entries for a given code but in this case, the country field differs).
* Thus the links with the departments are done on a department independently of its name.
*
* @param string $parent_field_id Parent select name to monitor
* @param integer $selected Code state preselected (mus be state id)
* @param integer $country_codeid Country code or id: 0=list for all countries, otherwise country code or country rowid to show
* @param string $parent_field_id Parent select name to monitor
* @param int $selected Code state preselected (must be state id)
* @param int $country_codeid Country code or id: 0=list for all countries, otherwise country code or country rowid to show
* @param string $htmlname Id of department. If '', we want only the string with <option>
* @param string $morecss Add more css
* @return string String with HTML select
@ -522,14 +522,14 @@ class FormCompany extends Form
* Return the list of all juridical entity types for all countries or a specific country.
* A country separator is included in case the list for all countries is returned.
*
* @param string $selected Preselected code for juridical type
* @param mixed $country_codeid 0=All countries, else the code of the country to display
* @param int $selected Preselected code for juridical type
* @param int $country_codeid 0=All countries, else the code of the country to display
* @param string $filter Add a SQL filter on list
* @return void
* @deprecated Use print xxx->select_juridicalstatus instead
* @see select_juridicalstatus()
*/
public function select_forme_juridique($selected = '', $country_codeid = 0, $filter = '')
public function select_forme_juridique($selected = 0, $country_codeid = 0, $filter = '')
{
// phpcs:enable
print $this->select_juridicalstatus($selected, $country_codeid, $filter);
@ -540,14 +540,14 @@ class FormCompany extends Form
* Return the list of all juridical entity types for all countries or a specific country.
* A country separator is included in case the list for all countries is returned.
*
* @param string $selected Preselected code of juridical type
* @param int $selected Preselected code of juridical type
* @param int $country_codeid 0=list for all countries, otherwise list only country requested
* @param string $filter Add a SQL filter on list. Data must not come from user input.
* @param string $htmlname HTML name of select
* @param string $morecss More CSS
* @return string String with HTML select
*/
public function select_juridicalstatus($selected = '', $country_codeid = 0, $filter = '', $htmlname = 'forme_juridique_code', $morecss = '')
public function select_juridicalstatus($selected = 0, $country_codeid = 0, $filter = '', $htmlname = 'forme_juridique_code', $morecss = '')
{
// phpcs:enable
global $conf, $langs, $user;

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010 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>
*
* 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
@ -38,38 +39,62 @@ class FormSms
*/
public $db;
/**
* @var int
*/
public $fromid;
/**
* @var string
*/
public $fromname;
/**
* @var string
*/
public $fromsms;
/**
* @var string
*/
public $fromtype;
/**
* @var string
*/
public $replytoname;
/**
* @var string
*/
public $replytomail;
/**
* @var string
*/
public $toname;
/**
* @var string
*/
public $tomail;
/**
* @var int<0,1>
*/
public $withsubstit; // Show substitution array
/**
* @var int
* @var int<0,1>
*/
public $withfrom;
/**
* @var int
* @var int<0,1>
*/
public $withto;
/**
* @var int
* @var int<0,1>
*/
public $withtopic;
/**
* @var int
* @var int<0,1>
*/
public $withbody;
@ -77,15 +102,38 @@ class FormSms
* @var int Id of company
*/
public $withtosocid;
/**
* @var int<0,1>
*/
public $withfromreadonly;
/**
* @var int<0,1>
*/
public $withreplytoreadonly;
/**
* @var int<0,1>
*/
public $withtoreadonly;
/**
* @var int<0,1>
*/
public $withtopicreadonly;
/**
* @var int<0,1>
*/
public $withbodyreadonly;
/**
* @var int<0,1>
*/
public $withcancel;
/**
* @var array<string,string>
*/
public $substit = array();
/**
* @var array{}|array{action:string,models:string,smsid:int,returnurl:string}
*/
public $param = array();
/**
@ -206,6 +254,8 @@ function limitChars(textarea, limit, infodiv)
print "</td></tr>\n";
} else {
print '<tr><td class="'.$morecss.'">'.$langs->trans("SmsFrom")."</td><td>";
$resultsender = array();
$sms = null;
if (getDolGlobalString('MAIN_SMS_SENDMODE')) {
$sendmode = getDolGlobalString('MAIN_SMS_SENDMODE'); // $conf->global->MAIN_SMS_SENDMODE looks like a value 'module'
$classmoduleofsender = getDolGlobalString('MAIN_MODULE_'.strtoupper($sendmode).'_SMS', $sendmode); // $conf->global->MAIN_MODULE_XXX_SMS looks like a value 'class@module'
@ -221,7 +271,8 @@ function limitChars(textarea, limit, infodiv)
$classname = ucfirst($classfile);
if (class_exists($classname)) {
$sms = new $classname($this->db);
$resultsender = $sms->SmsSenderList();
'@phan-var-force CommonObject $sms';
$resultsender = $sms->SmsSenderList(); // @phan-suppress-current-line PhanUndeclaredMethod
} else {
$sms = new stdClass();
$sms->error = 'The SMS manager "'.$classfile.'" defined into SMS setup MAIN_MODULE_'.strtoupper($sendmode).'_SMS is not found';
@ -232,7 +283,7 @@ function limitChars(textarea, limit, infodiv)
}
} else {
dol_syslog("Warning: The SMS sending method has not been defined into MAIN_SMS_SENDMODE", LOG_WARNING);
$resultsender = array();
$resultsender = array(0 => new stdClass());
$resultsender[0]->number = $this->fromsms;
}

View File

@ -40,36 +40,111 @@ class RssParser
*/
public $error = '';
/**
* @var string
*/
public $feed_version;
/**
* @var string
*/
private $_format = '';
/**
* @var string
*/
private $_urlRSS;
/**
* @var string
*/
private $_language;
/**
* @var string
*/
private $_generator;
/**
* @var string
*/
private $_copyright;
/**
* @var string
*/
private $_lastbuilddate;
/**
* @var string
*/
private $_imageurl;
/**
* @var string
*/
private $_link;
/**
* @var string
*/
private $_title;
/**
* @var string
*/
private $_description;
/**
* @var int
*/
private $_lastfetchdate; // Last successful fetch
/**
* @var array<array{link:string,title:string,description:string,pubDate:string,category:string,id:string,author:string}>
*/
private $_rssarray = array();
/**
* @var string|false
*/
private $current_namespace;
public $items = array();
/**
* @var array<string,string>|array<string,array<string,string>>
*/
public $current_item = array();
/**
* @var SimpleXMLElement|array<string,mixed> SimpleXMLElement when getDolGlobalString('EXTERNALRSS_USE_SIMPLEXML')
*/
public $channel = array();
/**
* @var array<string,array<string,string>> array[namespace][element]
*/
public $textinput = array();
/**
* @var array<string,array<string,string>> array[namespace][element]
*/
public $image = array();
/**
* @var bool
*/
private $initem;
/**
* @var bool
*/
private $intextinput;
/**
* @var false|string
*/
private $incontent;
/**
* @var bool
*/
private $inimage;
/**
* @var bool
*/
private $inchannel;
// For parsing with xmlparser
/**
* @var string[] For parsing with xmlparser
*/
public $stack = array(); // parser stack
/**
* @var string[]
*/
private $_CONTENT_CONSTRUCTS = array('content', 'summary', 'info', 'title', 'tagline', 'copyright');
@ -533,8 +608,8 @@ class RssParser
* Triggered when opened tag is found
*
* @param string $p Start
* @param string $element Tag
* @param array $attrs Attributes of tags
* @param string $element Tag
* @param array<string,mixed|mixed[]> $attrs Attributes of tags
* @return void
*/
public function feed_start_element($p, $element, $attrs)
@ -750,7 +825,7 @@ class RssParser
/**
* Return a description/summary for one item from a ATOM feed
*
* @param array $item A parsed item of a ATOM feed
* @param array<string,mixed> $item A parsed item of a ATOM feed
* @param int $maxlength (optional) The maximum length for the description
* @return string A summary description
*/
@ -781,7 +856,7 @@ class RssParser
/**
* Return a URL to a image of the given ATOM feed
*
* @param array $feed The ATOM feed that possible contain a link to a logo or icon
* @param array<string,mixed> $feed The ATOM feed that possible contain a link to a logo or icon
* @return string A URL to a image from a ATOM feed when found, otherwise a empty string
*/
private function getAtomImageUrl(array $feed)
@ -841,7 +916,7 @@ function rss_map_attrs($k, $v)
* Function to convert an XML object into an array
*
* @param SimpleXMLElement $xml Xml
* @return array|string
* @return array<string,mixed|mixed[]>|string
*/
function xml2php($xml)
{
@ -849,6 +924,7 @@ function xml2php($xml)
$tab = false;
$array = array();
foreach ($xml->children() as $key => $value) {
'@phan-var-force SimpleXMLElement $value';
$child = xml2php($value);
//To deal with the attributes

View File

@ -48,7 +48,7 @@ function is_empty($var, $allow_false = false, $allow_ws = false)
* Prepare array with list of tabs
*
* @param AccountingAccount $object Accounting account
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function accounting_prepare_head(AccountingAccount $object)
{

View File

@ -758,7 +758,7 @@ function dolibarr_set_const($db, $name, $value, $type = 'chaine', $visible = 0,
* @param int $nbofactivatedmodules Number if activated modules
* @param int $nboftotalmodules Nb of total modules
* @param int $nbmodulesnotautoenabled Nb of modules not auto enabled that are activated
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function modules_prepare_head($nbofactivatedmodules, $nboftotalmodules, $nbmodulesnotautoenabled)
{
@ -803,7 +803,7 @@ function modules_prepare_head($nbofactivatedmodules, $nboftotalmodules, $nbmodul
/**
* Prepare array with list of tabs
*
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function ihm_prepare_head()
{
@ -848,7 +848,7 @@ function ihm_prepare_head()
/**
* Prepare array with list of tabs
*
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function security_prepare_head()
{
@ -926,7 +926,7 @@ function security_prepare_head()
* Prepare array with list of tabs
*
* @param DolibarrModules $object Descriptor class
* @return array<array<int,string>> Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function modulehelp_prepare_head($object)
{
@ -964,7 +964,7 @@ function modulehelp_prepare_head($object)
/**
* Prepare array with list of tabs
*
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function translation_prepare_head()
{
@ -994,7 +994,7 @@ function translation_prepare_head()
/**
* Prepare array with list of tabs
*
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function defaultvalues_prepare_head()
{

View File

@ -3,6 +3,7 @@
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2022-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
@ -162,7 +163,7 @@ function print_actions_filter(
}
// Hooks
$parameters = array('canedit'=>$canedit, 'pid'=>$pid, 'socid'=>$socid);
$parameters = array('canedit' => $canedit, 'pid' => $pid, 'socid' => $socid);
$object = null;
$reshook = $hookmanager->executeHooks('searchAgendaFrom', $parameters, $object, $action); // Note that $action and $object may have been
@ -392,7 +393,7 @@ function show_array_last_actions_done($max = 5)
/**
* Prepare array with list of tabs
*
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function agenda_prepare_head()
{
@ -450,7 +451,7 @@ function agenda_prepare_head()
* Prepare array with list of tabs
*
* @param object $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function actions_prepare_head($object)
{

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2011 Regis Houssin <regis.houssin@inodbox.com>
* 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
@ -27,7 +28,7 @@
*
* @param Categorie $object Object related to tabs
* @param string $type Type of category
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function categories_prepare_head(Categorie $object, $type)
{
@ -76,7 +77,7 @@ function categories_prepare_head(Categorie $object, $type)
/**
* Prepare array with list of tabs
*
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function categoriesadmin_prepare_head()
{

View File

@ -3,6 +3,7 @@
* Copyright (C) 2010-2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015-2021 Frederic France <frederic.france@netlogic.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.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
@ -28,7 +29,7 @@
* Prepare array with list of tabs
*
* @param Contact $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function contact_prepare_head(Contact $object)
{

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2009-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2023 Charlene BENKE <charlene@patas-monkey.com>
* 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
@ -27,7 +28,7 @@
* Prepare array with list of tabs
*
* @param Contrat $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function contract_prepare_head(Contrat $object)
{
@ -99,7 +100,7 @@ function contract_prepare_head(Contrat $object)
$head[$h][0] = DOL_URL_ROOT.'/contrat/agenda.php?id='.$object->id;
$head[$h][1] = $langs->trans("Events");
if (isModEnabled('agenda')&& ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) {
if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) {
$nbEvent = 0;
// Enable caching of thirdparty count actioncomm
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.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
@ -24,7 +25,7 @@
/**
* Prepare array with list of admin tabs
*
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function donation_admin_prepare_head()
{
@ -65,7 +66,7 @@ function donation_admin_prepare_head()
* Prepare array with list of tabs
*
* @param Don $object Donation
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function donation_prepare_head($object)
{

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2008-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2022 Frédéric France <frederic.france@netlogic.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
@ -28,7 +29,7 @@
* Prepare array with list of different ecm main dashboard
*
* @param object $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function ecm_prepare_dasboard_head($object)
{
@ -86,7 +87,7 @@ function ecm_prepare_dasboard_head($object)
* @param object $object Object related to tabs
* @param string $module Module
* @param string $section Section
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function ecm_prepare_head($object, $module = 'ecm', $section = '')
{
@ -113,7 +114,7 @@ function ecm_prepare_head($object, $module = 'ecm', $section = '')
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function ecm_file_prepare_head($object)
{
@ -149,7 +150,7 @@ function ecm_file_prepare_head($object)
* Prepare array with list of tabs
*
* @param object $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function ecm_prepare_head_fm($object)
{

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2009 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
@ -25,7 +26,7 @@
* Prepare array with list of tabs
*
* @param Mailing $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function emailing_prepare_head(Mailing $object)
{

View File

@ -31,7 +31,7 @@
* Prepare array with list of tabs
*
* @param Expedition $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function expedition_prepare_head(Expedition $object)
{

View File

@ -27,7 +27,7 @@
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function expensereport_prepare_head($object)
{

View File

@ -32,7 +32,7 @@
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function fichinter_prepare_head($object)
{
@ -222,7 +222,7 @@ function fichinter_admin_prepare_head()
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function fichinter_rec_prepare_head($object)
{

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2014 Alexandre Spangaro <aspangaro@open-dsi.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
@ -25,7 +26,7 @@
* Prepare array with list of tabs
*
* @param Fiscalyear $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function fiscalyear_prepare_head(Fiscalyear $object)
{

View File

@ -32,7 +32,7 @@
* Prepare array with list of tabs
*
* @param FactureFournisseur $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function facturefourn_prepare_head(FactureFournisseur $object)
{
@ -170,7 +170,7 @@ function facturefourn_prepare_head(FactureFournisseur $object)
* Prepare array with list of tabs
*
* @param CommandeFournisseur $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function ordersupplier_prepare_head(CommandeFournisseur $object)
{

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.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
@ -25,7 +26,7 @@
* Return head table for establishment tabs screen
*
* @param Establishment $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function establishment_prepare_head($object)
{

View File

@ -29,7 +29,7 @@
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function loan_prepare_head($object)
{

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2015 ATM Consulting <support@atm-consulting.fr>
* Copyright (C) 2018 Regis Houssin <regis.houssin@inodbox.com>
* 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
@ -26,7 +27,7 @@
/**
* Prepare array with list of tabs
*
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function multicurrencyAdminPrepareHead()
{
@ -56,7 +57,7 @@ function multicurrencyAdminPrepareHead()
* Prepare array with list of currency tabs
*
* @param array $aCurrencies Currencies array
* @return array Array of tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function multicurrencyLimitPrepareHead($aCurrencies)
{

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2017 Open-DSI <support@open-dsi.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
@ -24,7 +25,7 @@
/**
* Prepare array with list of tabs
*
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function openid_connect_prepare_head()
{

View File

@ -3,6 +3,7 @@
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* 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
@ -29,7 +30,7 @@
* Prepare array with list of tabs
*
* @param Commande $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function commande_prepare_head(Commande $object)
{
@ -131,7 +132,7 @@ function commande_prepare_head(Commande $object)
$head[$h][0] = DOL_URL_ROOT.'/commande/agenda.php?id='.$object->id;
$head[$h][1] = $langs->trans("Events");
if (isModEnabled('agenda')&& ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) {
if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) {
$nbEvent = 0;
// Enable caching of thirdparty count actioncomm
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';

View File

@ -14,7 +14,7 @@
* Copyright (C) 2020 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2021-2022 Anthony Berton <anthony.berton@bb2a.fr>
* Copyright (C) 2023-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* 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
@ -43,7 +43,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
/**
* Return array head with list of tabs to view object information.
*
* @return array head array with tabs
* @return array<array{0:string,1:string,2:string}> head array with tabs
*/
function pdf_admin_prepare_head()
{
@ -382,7 +382,7 @@ function pdfGetHeightForHtmlContent(&$pdf, $htmlcontent)
*
* @param Societe|Contact $thirdparty Contact or thirdparty
* @param Translate $outputlangs Output language
* @param int $includealias 1=Include alias name after name
* @param int<0,1> $includealias 1=Include alias name after name
* @return string String with name of thirdparty (+ alias if requested)
*/
function pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includealias = 0)
@ -430,7 +430,7 @@ function pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includeali
* @param Contact|string|null $targetcontact Target contact object
* @param int $usecontact Use contact instead of company
* @param string $mode Address type ('source', 'target', 'targetwithdetails', 'targetwithdetails_xxx': target but include also phone/fax/email/url)
* @param Object|null $object Object we want to build document for
* @param ?CommonObject $object Object we want to build document for
* @return string|int String with full address or -1 if KO
*/
function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $targetcontact = '', $usecontact = 0, $mode = 'source', $object = null)
@ -725,9 +725,9 @@ function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $t
/**
* Show header of page for PDF generation
*
* @param TCPDF $pdf Object PDF
* @param Translate $outputlangs Object lang for output
* @param int $page_height Height of page
* @param TCPDF $pdf Object PDF
* @param Translate $outputlangs Object lang for output
* @param int $page_height Height of page
* @return void
*/
function pdf_pagehead(&$pdf, $outputlangs, $page_height)
@ -760,11 +760,11 @@ function pdf_pagehead(&$pdf, $outputlangs, $page_height)
* Return array of possible substitutions for PDF content (without external module substitutions).
*
* @param Translate $outputlangs Output language
* @param array|null $exclude Array of family keys we want to exclude. For example array('mycompany', 'object', 'date', 'user', ...)
* @param Object|null $object Object
* @param int $onlykey 1=Do not calculate some heavy values of keys (performance enhancement when we need only the keys), 2=Values are truncated and html sanitized (to use for help tooltip)
* @param array|null $include Array of family keys we want to include. For example array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...)
* @return array Array of substitutions
* @param null|string[] $exclude Array of family keys we want to exclude. For example array('mycompany', 'object', 'date', 'user', ...)
* @param ?Object $object Object
* @param int<0,2> $onlykey 1=Do not calculate some heavy values of keys (performance enhancement when we need only the keys), 2=Values are truncated and html sanitized (to use for help tooltip)
* @param null|string[] $include Array of family keys we want to include. For example array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...)
* @return array<string,string> Array of substitutions
*/
function pdf_getSubstitutionArray($outputlangs, $exclude = null, $object = null, $onlykey = 0, $include = null)
{
@ -797,6 +797,9 @@ function pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text)
$k = 72 / 2.54;
} elseif ($unit == 'in') {
$k = 72;
} else {
$k = 1;
dol_print_error(null, 'Unexpected unit "'.$unit.'" for pdf_watermark');
}
// Make substitution
@ -1011,8 +1014,8 @@ function pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber = 0,
* @param int $marge_basse Margin bottom we use for the autobreak
* @param int $marge_gauche Margin left (no more used)
* @param int $page_hauteur Page height
* @param Object $object Object shown in PDF
* @param int $showdetails Show company address details into footer (0=Nothing, 1=Show address, 2=Show managers, 3=Both)
* @param CommonObject $object Object shown in PDF
* @param int<0,3> $showdetails Show company address details into footer (0=Nothing, 1=Show address, 2=Show managers, 3=Both)
* @param int $hidefreetext 1=Hide free text, 0=Show free text
* @param int $page_largeur Page width
* @param string $watermark Watermark text to print on page
@ -1210,6 +1213,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
// The start of the bottom of this page footer is positioned according to # of lines
$freetextheight = 0;
$align = null;
if ($line) { // Free text
//$line="sample text<br>\nfd<strong>sf</strong>sdf<br>\nghfghg<br>";
if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) {
@ -1226,7 +1230,8 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
}
}
// For customize footer
$posy = 0;
// For customized footer
if (is_object($hookmanager)) {
$parameters = array('line1' => $line1, 'line2' => $line2, 'line3' => $line3, 'line4' => $line4, 'outputlangs' => $outputlangs);
$action = '';
@ -1242,7 +1247,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
if (getDolGlobalString('PDF_FOOTER_BACKGROUND_COLOR')) {
list($r, $g, $b) = sscanf($conf->global->PDF_FOOTER_BACKGROUND_COLOR, '%d, %d, %d');
$pdf->SetAutoPageBreak(0, 0); // Disable auto pagebreak
$pdf->Rect(0, $dims['hk'] - $posy + $freetextheight, $dims['wk'] + 1, $marginwithfooter + 1, 'F', '', $fill_color = array($r, $g, $b));
$pdf->Rect(0, $dims['hk'] - $posy + $freetextheight, $dims['wk'] + 1, $marginwithfooter + 1, 'F', array(), $fill_color = array($r, $g, $b));
$pdf->SetAutoPageBreak(1, 0); // Restore pagebreak
}
@ -1294,7 +1299,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
if (getDolGlobalString('PDF_FOOTER_BACKGROUND_COLOR')) {
list($r, $g, $b) = sscanf($conf->global->PDF_FOOTER_BACKGROUND_COLOR, '%d, %d, %d');
$pdf->SetAutoPageBreak(0, 0); // Disable auto pagebreak
$pdf->Rect(0, $dims['hk'] - $posy + $freetextheight, $dims['wk'] + 1, $marginwithfooter + 1, 'F', '', $fill_color = array($r, $g, $b));
$pdf->Rect(0, $dims['hk'] - $posy + $freetextheight, $dims['wk'] + 1, $marginwithfooter + 1, 'F', array(), $fill_color = array($r, $g, $b));
$pdf->SetAutoPageBreak(1, 0); // Restore pagebreak
}
@ -1382,7 +1387,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
* Show linked objects for PDF generation
*
* @param TCPDF $pdf Object PDF
* @param Object $object Object
* @param CommonObject $object Object
* @param Translate $outputlangs Object lang
* @param int $posx X
* @param int $posy Y
@ -1416,17 +1421,17 @@ function pdf_writeLinkedObjects(&$pdf, $object, $outputlangs, $posx, $posy, $w,
* Output line description into PDF
*
* @param TCPDF $pdf PDF object
* @param Object $object Object
* @param CommonObject $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object lang for output
* @param int $w Width
* @param int $h Height
* @param int $posx Pos x
* @param int $posy Pos y
* @param int $hideref Hide reference
* @param int $hidedesc Hide description
* @param int $issupplierline Is it a line for a supplier object ?
* @param string $align text alignment ('L', 'C', 'R', 'J' (default))
* @param int<0,1> $hideref Hide reference
* @param int<0,1> $hidedesc Hide description
* @param int<0,1> $issupplierline Is it a line for a supplier object ?
* @param 'L'|'C'|'R'|'J' $align text alignment ('L', 'C', 'R', 'J' (default))
* @return string
*/
function pdf_writelinedesc(&$pdf, $object, $i, $outputlangs, $w, $h, $posx, $posy, $hideref = 0, $hidedesc = 0, $issupplierline = 0, $align = 'J')
@ -1436,7 +1441,7 @@ function pdf_writelinedesc(&$pdf, $object, $i, $outputlangs, $w, $h, $posx, $pos
$reshook = 0;
$result = '';
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
@ -1476,7 +1481,7 @@ function pdf_writelinedesc(&$pdf, $object, $i, $outputlangs, $w, $h, $posx, $pos
/**
* Return line description translated in outputlangs and encoded into htmlentities and with <br>
*
* @param Object $object Object
* @param CommonObject $object Object
* @param int $i Current line number (0 = first line, 1 = second line, ...)
* @param Translate $outputlangs Object langs for output
* @param int $hideref Hide reference
@ -1821,7 +1826,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
/**
* Return line num
*
* @param Object $object Object
* @param CommonObject $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
@ -1834,7 +1839,7 @@ function pdf_getlinenum($object, $i, $outputlangs, $hidedetails = 0)
$reshook = 0;
$result = '';
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
@ -1854,7 +1859,7 @@ function pdf_getlinenum($object, $i, $outputlangs, $hidedetails = 0)
/**
* Return line product ref
*
* @param Object $object Object
* @param CommonObject $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
@ -1867,7 +1872,7 @@ function pdf_getlineref($object, $i, $outputlangs, $hidedetails = 0)
$reshook = 0;
$result = '';
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
@ -1883,13 +1888,14 @@ function pdf_getlineref($object, $i, $outputlangs, $hidedetails = 0)
return $result;
}
/**
* Return line ref_supplier
*
* @param Object $object Object
* @param Contrat|CommandeFournisseur|FactureFournisseur|Facture|Product|Reception|SupplierProposal $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @return string
*/
function pdf_getlineref_supplier($object, $i, $outputlangs, $hidedetails = 0)
@ -1899,7 +1905,7 @@ function pdf_getlineref_supplier($object, $i, $outputlangs, $hidedetails = 0)
$reshook = 0;
$result = '';
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
@ -1918,10 +1924,10 @@ function pdf_getlineref_supplier($object, $i, $outputlangs, $hidedetails = 0)
/**
* Return line vat rate
*
* @param Object $object Object
* @param SupplierProposal|CommandeFournisseur|FactureFournisseur|Propal|Facture|Commande|ExpenseReport|StockTransfer $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @return string
*/
function pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails = 0)
@ -1980,10 +1986,10 @@ function pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails = 0)
/**
* Return line unit price excluding tax
*
* @param Object $object Object
* @param SupplierProposal|CommandeFournisseur|Propal|Facture|FactureFournisseur|Commande|StockTransfer $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @return string
*/
function pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails = 0)
@ -1998,7 +2004,7 @@ function pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails = 0)
$result = '';
$reshook = 0;
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
@ -2023,10 +2029,10 @@ function pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails = 0)
/**
* Return line unit price including tax
*
* @param Object $object Object
* @param SupplierProposal|CommandeFournisseur|Propal|Facture|Commande $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide value (0 = no, 1 = yes, 2 = just special lines)
* @param int<0,2> $hidedetails Hide value (0 = no, 1 = yes, 2 = just special lines)
* @return string
*/
function pdf_getlineupwithtax($object, $i, $outputlangs, $hidedetails = 0)
@ -2041,7 +2047,7 @@ function pdf_getlineupwithtax($object, $i, $outputlangs, $hidedetails = 0)
$result = '';
$reshook = 0;
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
@ -2065,10 +2071,10 @@ function pdf_getlineupwithtax($object, $i, $outputlangs, $hidedetails = 0)
/**
* Return line quantity
*
* @param Object $object Object
* @param Delivery|Asset|Commande|Facture|CommandeFournisseur|FactureFournisseur|SupplierProposal|Propal|StockTransfer|MyObject $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @return string
*/
function pdf_getlineqty($object, $i, $outputlangs, $hidedetails = 0)
@ -2078,7 +2084,7 @@ function pdf_getlineqty($object, $i, $outputlangs, $hidedetails = 0)
$result = '';
$reshook = 0;
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
@ -2105,10 +2111,10 @@ function pdf_getlineqty($object, $i, $outputlangs, $hidedetails = 0)
/**
* Return line quantity asked
*
* @param Object $object Object
* @param Delivery $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @return string
*/
function pdf_getlineqty_asked($object, $i, $outputlangs, $hidedetails = 0)
@ -2118,7 +2124,7 @@ function pdf_getlineqty_asked($object, $i, $outputlangs, $hidedetails = 0)
$reshook = 0;
$result = '';
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
@ -2145,10 +2151,10 @@ function pdf_getlineqty_asked($object, $i, $outputlangs, $hidedetails = 0)
/**
* Return line quantity shipped
*
* @param Object $object Object
* @param Delivery $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @return string
*/
function pdf_getlineqty_shipped($object, $i, $outputlangs, $hidedetails = 0)
@ -2158,7 +2164,7 @@ function pdf_getlineqty_shipped($object, $i, $outputlangs, $hidedetails = 0)
$reshook = 0;
$result = '';
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
@ -2188,7 +2194,7 @@ function pdf_getlineqty_shipped($object, $i, $outputlangs, $hidedetails = 0)
* @param Object $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @return string
*/
function pdf_getlineqty_keeptoship($object, $i, $outputlangs, $hidedetails = 0)
@ -2198,7 +2204,7 @@ function pdf_getlineqty_keeptoship($object, $i, $outputlangs, $hidedetails = 0)
$reshook = 0;
$result = '';
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
@ -2225,10 +2231,10 @@ function pdf_getlineqty_keeptoship($object, $i, $outputlangs, $hidedetails = 0)
/**
* Return line unit
*
* @param Object $object Object
* @param SupplierProposal|CommandeFournisseur|Propal|Facture|FactureFournisseur|Commande|StockTransfer $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @return string Value for unit cell
*/
function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0)
@ -2238,7 +2244,7 @@ function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0)
$reshook = 0;
$result = '';
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
@ -2268,10 +2274,10 @@ function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0)
/**
* Return line remise percent
*
* @param Object $object Object
* @param SupplierProposal|CommandeFournisseur|Propal|Facture|FactureFournisseur|Commande|StockTransfer $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @return string
*/
function pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails = 0)
@ -2283,7 +2289,7 @@ function pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails = 0)
$reshook = 0;
$result = '';
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
@ -2310,11 +2316,11 @@ function pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails = 0)
/**
* Return line percent
*
* @param Object $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param HookManager|null $hookmanager Hook manager instance
* @param Facture $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param ?HookManager $hookmanager Hook manager instance
* @return string
*/
function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookmanager = null)
@ -2327,7 +2333,7 @@ function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookm
$reshook = 0;
$result = '';
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
@ -2362,10 +2368,10 @@ function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookm
/**
* Return line total excluding tax
*
* @param Object $object Object
* @param Commande|Facture|Propal|FactureFournisseur|CommandeFournisseur|SupplierProposal $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @return string Return total of line excl tax
*/
function pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails = 0)
@ -2380,7 +2386,7 @@ function pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails = 0)
$reshook = 0;
$result = '';
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
@ -2418,10 +2424,10 @@ function pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails = 0)
/**
* Return line total including tax
*
* @param Object $object Object
* @param Commande|Facture|Propal|FactureFournisseur|CommandeFournisseur|SupplierProposal $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide value (0 = no, 1 = yes, 2 = just special lines)
* @param int<0,2> $hidedetails Hide value (0 = no, 1 = yes, 2 = just special lines)
* @return string Return total of line incl tax
*/
function pdf_getlinetotalwithtax($object, $i, $outputlangs, $hidedetails = 0)
@ -2436,7 +2442,7 @@ function pdf_getlinetotalwithtax($object, $i, $outputlangs, $hidedetails = 0)
$reshook = 0;
$result = '';
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
@ -2477,7 +2483,7 @@ function pdf_getlinetotalwithtax($object, $i, $outputlangs, $hidedetails = 0)
*
* @param CommonObject $object Object
* @param Translate $outputlangs Object lang for output
* @return array Linked objects
* @return array<string,array<string,null|int|float|string>> Linked objects
*/
function pdf_getLinkedObjects(&$object, $outputlangs)
{
@ -2491,6 +2497,7 @@ function pdf_getLinkedObjects(&$object, $outputlangs)
if ($objecttype == 'facture') {
// For invoice, we don't want to have a reference line on document. Image we are using recurring invoice, we will have a line longer than document width.
} elseif ($objecttype == 'propal' || $objecttype == 'supplier_proposal') {
'@phan-var-force array<Propal|SupplierProposal> $objects';
$outputlangs->load('propal');
foreach ($objects as $elementobject) {
@ -2500,6 +2507,7 @@ function pdf_getLinkedObjects(&$object, $outputlangs)
$linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date, 'day', '', $outputlangs);
}
} elseif ($objecttype == 'commande' || $objecttype == 'supplier_order') {
'@phan-var-force array<Commande|CommandeFournisseur> $objects';
$outputlangs->load('orders');
if (count($objects) == 1) {
@ -2510,6 +2518,7 @@ function pdf_getLinkedObjects(&$object, $outputlangs)
$linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date, 'day', '', $outputlangs);
}
} elseif ($objecttype == 'contrat') {
'@phan-var-force Contrat[] $objects';
$outputlangs->load('contracts');
foreach ($objects as $elementobject) {
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefContract");
@ -2518,6 +2527,7 @@ function pdf_getLinkedObjects(&$object, $outputlangs)
$linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date_contrat, 'day', '', $outputlangs);
}
} elseif ($objecttype == 'fichinter') {
'@phan-var-force Fichinter[] $objects';
$outputlangs->load('interventions');
foreach ($objects as $elementobject) {
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("InterRef");
@ -2526,6 +2536,7 @@ function pdf_getLinkedObjects(&$object, $outputlangs)
$linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->datec, 'day', '', $outputlangs);
}
} elseif ($objecttype == 'shipping') {
'@phan-var-force Expedition[] $objects';
$outputlangs->loadLangs(array("orders", "sendings"));
if (count($objects) > 1) {
@ -2608,10 +2619,10 @@ function pdf_getLinkedObjects(&$object, $outputlangs)
/**
* Return dimensions to use for images onto PDF checking that width and height are not higher than
* maximum (16x32 by default).
* maximum (20x32 by default).
*
* @param string $realpath Full path to photo file to use
* @return array Height and width to use to output image (in pdf user unit, so mm)
* @return array{width:int,height:int} Height and width to use to output image (in pdf user unit, so mm)
*/
function pdf_getSizeForImage($realpath)
{
@ -2638,10 +2649,10 @@ function pdf_getSizeForImage($realpath)
/**
* Return line total amount discount
*
* @param CommonObject $object Object
* @param Facture $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @return float|string Return total of line excl tax
*/
function pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, $hidedetails = 0)

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011 Regis Houssin <regis.houssin@inodbox.com>
* 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
@ -29,7 +30,7 @@
* Prepare array with list of tabs
*
* @param BonPrelevement $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function prelevement_prepare_head(BonPrelevement $object)
{
@ -116,7 +117,7 @@ function prelevement_check_config($type = 'direct-debit')
return 0;
}
/**
/**
* Return array head with list of tabs to view object information
*
* @param BonPrelevement $object Member

View File

@ -6,6 +6,7 @@
* Copyright (C) 2015-2016 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2023 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2024 Jean-Rémi TAPONIER <jean-remi@netlogic.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
@ -32,7 +33,7 @@
* Prepare array with list of tabs
*
* @param Product $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function product_prepare_head($object)
{
@ -73,7 +74,7 @@ function product_prepare_head($object)
// if (!empty($object->status_buy) || (isModEnabled('margin') && !empty($object->status))) { // If margin is on and product on sell, we may need the cost price even if product os not on purchase
if ((isModEnabled("supplier_proposal") || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && ($user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'read') || $user->hasRight('supplier_invoice', 'read'))
|| (isModEnabled('margin') && $user->hasRight("margin", "liretous"))
) {
) {
if ($usercancreadprice) {
$head[$h][0] = DOL_URL_ROOT."/product/price_suppliers.php?id=".$object->id;
$head[$h][1] = $langs->trans("BuyingPrices");
@ -238,7 +239,7 @@ function product_prepare_head($object)
* Prepare array with list of tabs
*
* @param ProductLot $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function productlot_prepare_head($object)
{
@ -694,7 +695,7 @@ function show_stats_for_company($product, $socid)
print '</td>';
print '</tr>';
}
$parameters = array('socid'=>$socid);
$parameters = array('socid' => $socid);
$reshook = $hookmanager->executeHooks('addMoreProductStat', $parameters, $product, $nblines); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@ -814,7 +815,7 @@ function show_stats_for_batch($batch, $socid)
print '</tr>';
}
$parameters = array('socid'=>$socid);
$parameters = array('socid' => $socid);
$reshook = $hookmanager->executeHooks('addMoreBatchProductStat', $parameters, $batch, $nblines); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');

View File

@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
*
* @param Project $project Object related to tabs
* @param string $moreparam More param on url
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function project_prepare_head(Project $project, $moreparam = '')
{
@ -82,7 +82,7 @@ function project_prepare_head(Project $project, $moreparam = '')
} else {
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
$taskstatic = new Task($db);
$nbTasks = count($taskstatic->getTasksArray(0, 0, $project->id, 0, 0));
$nbTasks = count($taskstatic->getTasksArray(null, null, $project->id, 0, 0));
dol_setcache($cachekey, $nbTasks, 120); // If setting cache fails, this is not a problem, so we do not test result.
}
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks.php?id='.((int) $project->id).($moreparam ? '&'.$moreparam : '');
@ -369,8 +369,8 @@ function project_prepare_head(Project $project, $moreparam = '')
/**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to show
* @param CommonObject $object Object related to tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function task_prepare_head($object)
{
@ -409,7 +409,7 @@ function task_prepare_head($object)
dol_print_error($db);
}
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/time.php?id='.urlencode($object->id).(GETPOST('withproject') ? '&withproject=1' : '');
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/time.php?id='.urlencode((string) $object->id).(GETPOST('withproject') ? '&withproject=1' : '');
$head[$h][1] = $langs->trans("TimeSpent");
if ($nbTimeSpent > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">...</span>';
@ -431,7 +431,7 @@ function task_prepare_head($object)
if (!empty($object->note_public)) {
$nbNote++;
}
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/note.php?id='.urlencode($object->id).(GETPOST('withproject') ? '&withproject=1' : '');
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/note.php?id='.urlencode((string) $object->id).(GETPOST('withproject') ? '&withproject=1' : '');
$head[$h][1] = $langs->trans('Notes');
if ($nbNote > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>';
@ -477,7 +477,7 @@ function task_prepare_head($object)
*
* @param string $mode Mode
* @param string $fuser Filter on user
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function project_timesheet_prepare_head($mode, $fuser = null)
{
@ -523,7 +523,7 @@ function project_timesheet_prepare_head($mode, $fuser = null)
/**
* Prepare array with list of tabs
*
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function project_admin_prepare_head()
{
@ -593,8 +593,8 @@ function project_admin_prepare_head()
* @param int $projectidfortotallink 0 or Id of project to use on total line (link to see all time consumed for project)
* @param string $dummy Not used.
* @param int $showbilltime Add the column 'TimeToBill' and 'TimeBilled'
* @param array $arrayfields Array with displayed column information
* @param array $arrayofselected Array with selected fields
* @param array<string,null|int|float|string> $arrayfields Array with displayed column information
* @param string[] $arrayofselected Array with selected fields
* @return int Nb of tasks shown
*/
function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId = '', $addordertick = 0, $projectidfortotallink = 0, $dummy = '', $showbilltime = 0, $arrayfields = array(), $arrayofselected = array())
@ -602,6 +602,12 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
global $user, $langs, $conf, $db, $hookmanager;
global $projectstatic, $taskstatic, $extrafields;
'
@phan-var-force Project $projectstatic
@phan-var-force Task $taskstatic
@phan-var-force ExtraFields $extrafields
';
$lastprojectid = 0;
$projectsArrayId = explode(',', $projectsListId);
@ -918,13 +924,13 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
if (get_class($c) == 'User') {
print $c->getNomUrl(-2, '', 0, 0, 24, 1, '', ($ifisrt ? '' : 'notfirst'));
} else {
print $c->getNomUrl(-2, '', 0, '', -1, 0, ($ifisrt ? '' : 'notfirst'));
print $c->getNomUrl(-2, '', 0, 0, -1, 0, ($ifisrt ? '' : 'notfirst'));
}
} else {
if (get_class($c) == 'User') {
print $c->getNomUrl(2, '', 0, 0, 24, 1, '', ($ifisrt ? '' : 'notfirst'));
} else {
print $c->getNomUrl(2, '', 0, '', -1, 0, ($ifisrt ? '' : 'notfirst'));
print $c->getNomUrl(2, '', 0, 0, -1, 0, ($ifisrt ? '' : 'notfirst'));
}
}
$ifisrt = 0;
@ -1040,6 +1046,10 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
print '</td>';
}
$totalCalculatedProgress = 0;
$totalAverageDeclaredProgress = 0;
$badgeClass = '';
$progressBarClass = '';
if ($total_projectlinesa_planned) {
$totalAverageDeclaredProgress = round(100 * $total_projectlinesa_declared_if_planned / $total_projectlinesa_planned, 2);
$totalCalculatedProgress = round(100 * $total_projectlinesa_spent / $total_projectlinesa_planned, 2);
@ -1158,22 +1168,28 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
*
* @param string $inc Line number (start to 0, then increased by recursive call)
* @param int $parent Id of parent task to show (0 to show all)
* @param User|null $fuser Restrict list to user if defined
* @param ?User $fuser Restrict list to user if defined
* @param Task[] $lines Array of lines
* @param int $level Level (start to 0, then increased/decrease by recursive call)
* @param string $projectsrole Array of roles user has on project
* @param string $tasksrole Array of roles user has on task
* @param string $mine Show only task lines I am assigned to
* @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to
* @param int<0,1> $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to
* @param int $preselectedday Preselected day
* @param array $isavailable Array with data that say if user is available for several days for morning and afternoon
* @param array<int,array{morning:int<0,1>,afternoon:int<0,1>}> $isavailable Array with data that say if user is available for several days for morning and afternoon
* @param int $oldprojectforbreak Old project id of last project break
* @return array Array with time spent for $fuser for each day of week on tasks in $lines and subtasks
* @return array<int,int> Array with time spent for $fuser for each day of week on tasks in $lines and subtasks
*/
function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, $preselectedday, &$isavailable, $oldprojectforbreak = 0)
{
global $conf, $db, $user, $langs;
global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic;
'
@phan-var-force FormOther $formother
@phan-var-force Project $projectstatic
@phan-var-force Task $taskstatic
@phan-var-force Societe $thirdpartystatic
';
$lastprojectid = 0;
$totalforeachline = array();
@ -1331,6 +1347,9 @@ function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projec
print '<td class="duration'.($cssonholiday ? ' '.$cssonholiday : '').' center">';
$dayWorkLoad = $lines[$i]->timespent_duration;
if (!array_key_exists($preselectedday, $totalforeachline)) {
$totalforeachline[$preselectedday] = 0;
}
$totalforeachline[$preselectedday] += $lines[$i]->timespent_duration;
$alreadyspent = '';
@ -1379,24 +1398,30 @@ function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projec
*
* @param string $inc Line number (start to 0, then increased by recursive call)
* @param int $parent Id of parent task to show (0 to show all)
* @param User|null $fuser Restrict list to user if defined
* @param ?User $fuser Restrict list to user if defined
* @param Task[] $lines Array of lines
* @param int $level Level (start to 0, then increased/decrease by recursive call)
* @param string $projectsrole Array of roles user has on project
* @param string $tasksrole Array of roles user has on task
* @param int $mine Show only task lines I am assigned to
* @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is assigned to me, 2=Enable add time only if tasks is assigned to me and hide others
* @param int<0,1> $mine Show only task lines I am assigned to
* @param int<0,2> $restricteditformytask 0=No restriction, 1=Enable add time only if task is assigned to me, 2=Enable add time only if tasks is assigned to me and hide others
* @param int $preselectedday Preselected day
* @param array $isavailable Array with data that say if user is available for several days for morning and afternoon
* @param array<int,array{morning:int<0,1>,afternoon:int<0,1>}> $isavailable Array with data that say if user is available for several days for morning and afternoon
* @param int $oldprojectforbreak Old project id of last project break
* @param array $arrayfields Array of additional column
* @param string[] $arrayfields Array of additional column
* @param Extrafields $extrafields Object extrafields
* @return array Array with time spent for $fuser for each day of week on tasks in $lines and subtasks
* @return array<int,int> Array with time spent for $fuser for each day of week on tasks in $lines and subtasks
*/
function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, $preselectedday, &$isavailable, $oldprojectforbreak = 0, $arrayfields = array(), $extrafields = null)
{
global $conf, $db, $user, $langs;
global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic;
'
@phan-var-force FormOther $formother
@phan-var-force Project $projectstatic
@phan-var-force Task $taskstatic
@phan-var-force Societe $thirdpartystatic
';
$lastprojectid = 0;
$totalforeachday = array();
@ -1776,24 +1801,30 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
*
* @param string $inc Line output identificator (start to 0, then increased by recursive call)
* @param int $firstdaytoshow First day to show
* @param User|null $fuser Restrict list to user if defined
* @param ?User $fuser Restrict list to user if defined
* @param int $parent Id of parent task to show (0 to show all)
* @param Task[] $lines Array of lines (list of tasks but we will show only if we have a specific role on task)
* @param int $level Level (start to 0, then increased/decrease by recursive call)
* @param string $projectsrole Array of roles user has on project
* @param string $tasksrole Array of roles user has on task
* @param int $mine Show only task lines I am assigned to
* @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is assigned to me, 2=Enable add time only if tasks is assigned to me and hide others
* @param array $isavailable Array with data that say if user is available for several days for morning and afternoon
* @param int<0,1> $mine Show only task lines I am assigned to
* @param int<0,2> $restricteditformytask 0=No restriction, 1=Enable add time only if task is assigned to me, 2=Enable add time only if tasks is assigned to me and hide others
* @param array<int,array{morning:int<0,1>,afternoon:int<0,1>}> $isavailable Array with data that say if user is available for several days for morning and afternoon
* @param int $oldprojectforbreak Old project id of last project break
* @param array $arrayfields Array of additional column
* @param string[] $arrayfields Array of additional column
* @param Extrafields $extrafields Object extrafields
* @return array Array with time spent for $fuser for each day of week on tasks in $lines and subtasks
* @return array<int,int> Array with time spent for $fuser for each day of week on tasks in $lines and subtasks
*/
function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, &$isavailable, $oldprojectforbreak = 0, $arrayfields = array(), $extrafields = null)
{
global $conf, $db, $user, $langs;
global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic;
'
@phan-var-force FormOther $formother
@phan-var-force Project $projectstatic
@phan-var-force Task $taskstatic
@phan-var-force Societe $thirdpartystatic
';
$numlines = count($lines);
@ -2182,19 +2213,25 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
* @param int $level Level (start to 0, then increased/decrease by recursive call)
* @param string $projectsrole Array of roles user has on project
* @param string $tasksrole Array of roles user has on task
* @param int $mine Show only task lines I am assigned to
* @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to
* @param array $isavailable Array with data that say if user is available for several days for morning and afternoon
* @param int<0,1> $mine Show only task lines I am assigned to
* @param int<0,1> $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to
* @param array<int,array{morning:int<0,1>,afternoon:int<0,1>}> $isavailable Array with data that say if user is available for several days for morning and afternoon
* @param int $oldprojectforbreak Old project id of last project break
* @param array $TWeek Array of week numbers
* @param array $arrayfields Array of additional column
* @param string[] $TWeek Array of week numbers ('02', ...
* @param string[] $arrayfields Array of additional column
* @param Extrafields $extrafields Object extrafields
* @return array Array with time spent for $fuser for each day of week on tasks in $lines and subtasks
* @return array<string,int> Array with time spent for $fuser for each day of week on tasks in $lines and subtasks (index is string, month is '01', ...)
*/
function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, &$isavailable, $oldprojectforbreak = 0, $TWeek = array(), $arrayfields = array(), $extrafields = null)
{
global $conf, $db, $user, $langs;
global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic;
'
@phan-var-force FormOther $formother
@phan-var-force Project $projectstatic
@phan-var-force Task $taskstatic
@phan-var-force Societe $thirdpartystatic
';
$numlines = count($lines);
@ -2509,15 +2546,15 @@ function searchTaskInChild(&$inc, $parent, &$lines, &$taskrole)
/**
* Return HTML table with list of projects and number of opened tasks
*
* @param DoliDB $db Database handler
* @param Form $form Object form
* @param int $socid Id thirdparty
* @param int $projectsListId Id of project I have permission on
* @param int $mytasks Limited to task I am contact to
* @param int $status -1=No filter on statut, 0 or 1 = Filter on status
* @param array $listofoppstatus List of opportunity status
* @param array $hiddenfields List of info to not show ('projectlabel', 'declaredprogress', '...', )
* @param int $max Max nb of record to show in HTML list
* @param DoliDB $db Database handler
* @param Form $form Object form
* @param int $socid Id thirdparty
* @param int $projectsListId Id of project I have permission on
* @param int<0,1> $mytasks Limited to task I am contact to
* @param int<-1,1> $status -1=No filter on statut, 0 or 1 = Filter on status
* @param array<int,string> $listofoppstatus List of opportunity status
* @param string[] $hiddenfields List of info to not show ('projectlabel', 'declaredprogress', '...', )
* @param int<0,max> $max Max nb of record to show in HTML list
* @return void
*/
function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks = 0, $status = -1, $listofoppstatus = array(), $hiddenfields = array(), $max = 0)
@ -2598,6 +2635,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
// Get id of project we must show tasks
$arrayidofprojects = array();
$alttext = '';
$sql1 = "SELECT p.rowid as projectid";
$sql1 .= $sql;
$resql = $db->query($sql1);

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* 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
@ -27,7 +28,7 @@
* Prepare array with list of tabs
*
* @param object $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function propal_prepare_head($object)
{
@ -111,7 +112,7 @@ function propal_prepare_head($object)
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/agenda.php?id='.$object->id;
$head[$h][1] = $langs->trans("Events");
if (isModEnabled('agenda')&& ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) {
if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) {
$nbEvent = 0;
// Enable caching of thirdparty count actioncomm
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
@ -212,7 +213,7 @@ function getCustomerProposalPieChart($socid = 0)
{
global $conf, $db, $langs, $user;
$result= '';
$result = '';
if (!isModEnabled('propal') || !$user->hasRight('propal', 'lire')) {
return '';

View File

@ -4,6 +4,7 @@
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
* 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
@ -30,7 +31,7 @@
* Prepare array with list of tabs
*
* @param Reception $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function reception_prepare_head(Reception $object)
{

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
* 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
@ -30,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function shipping_prepare_head($object)
{
@ -128,7 +129,7 @@ function shipping_prepare_head($object)
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function delivery_prepare_head($object)
{
@ -362,7 +363,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '')
// Add description in form
if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) {
print (!empty($objp->description) ? ((empty($objp->product) || $objp->description != $objp->product) ? '<br>'.dol_htmlentitiesbr($objp->description) : '') : '');
print(!empty($objp->description) ? ((empty($objp->product) || $objp->description != $objp->product) ? '<br>'.dol_htmlentitiesbr($objp->description) : '') : '');
}
print '</td>';

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2009 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
@ -25,7 +26,7 @@
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function stock_prepare_head($object)
{

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2022 Frédéric France <frederic.france@netlogic.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
@ -28,7 +29,7 @@
* Prepare array with list of tabs
*
* @param object $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function supplier_proposal_prepare_head($object)
{

View File

@ -8,6 +8,7 @@
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2021-2022 Open-Dsi <support@open-dsi.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
@ -34,7 +35,7 @@
* Prepare array with list of tabs
*
* @param ChargeSociales $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function tax_prepare_head(ChargeSociales $object)
{

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2011 Regis Houssin <regis.houssin@inodbox.com>
* 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
@ -25,7 +26,7 @@
* Prepare array with list of tabs
*
* @param Deplacement $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function trip_prepare_head(Deplacement $object)
{

View File

@ -32,7 +32,7 @@
* Prepare array with list of tabs
*
* @param User $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function user_prepare_head(User $object)
{
@ -231,7 +231,7 @@ function user_prepare_head(User $object)
* Prepare array with list of tabs
*
* @param UserGroup $object Object group
* @return array Array of tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function group_prepare_head($object)
{
@ -280,7 +280,7 @@ function group_prepare_head($object)
/**
* Prepare array with list of tabs
*
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function user_admin_prepare_head()
{

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.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
@ -28,7 +29,7 @@
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function vat_prepare_head($object)
{

View File

@ -439,7 +439,7 @@ class pdf_beluga extends ModelePDFProjects
}
//var_dump("$key, $tablename, $datefieldname, $dates, $datee");
$elementarray = $object->get_element_list($key, $tablename, $datefieldname, null, null, $projectField);
$elementarray = $object->get_element_list($key, $tablename, $datefieldname, 0, 0, $projectField);
$num = count($elementarray);
if ($num >= 0) {

View File

@ -1501,6 +1501,8 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer
public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
global $conf, $hookmanager;
'@phan-var-force StockTransfer $object';
/** @var StockTransfer $object */
// Default field style for content
$this->defaultContentsFieldsStyle = array(

View File

@ -22,6 +22,13 @@ if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
}
// From controller using view
'
@phan-var-force FormAdvTargetEmailing $formadvtargetemaling
@phan-var-force AdvanceTargetingMailing $advTarget
@phan-var-force array<string,string|int|string[]> $array_query
';
print '<script>
$(document).ready(function() {
@ -112,7 +119,7 @@ if (!empty($array_query['cust_code'])) {
} else {
$cust_code_str = null;
}
print '</td><td><input type="text" name="cust_code"'.($cust_code_str!=null?' value="'.$cust_code_str:'').'"/></td><td>'."\n";
print '</td><td><input type="text" name="cust_code"'.($cust_code_str != null ? ' value="'.$cust_code_str : '').'"/></td><td>'."\n";
print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
print '</td></tr>'."\n";
@ -277,8 +284,8 @@ if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
}
print '</td><td>'."\n";
$cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1);
print $form->multiselectarray('cust_categ', $cate_arbo, GETPOST('cust_categ', 'array'), null, null, null, null, "90%");
$cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, '', 'parent', 0, 0, 1);
print $form->multiselectarray('cust_categ', $cate_arbo, GETPOST('cust_categ', 'array'), 0, 0, '', 0, "90%");
print '</td><td>'."\n";
print '</td></tr>'."\n";
}
@ -469,8 +476,8 @@ if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
}
print '</td><td>'."\n";
$cate_arbo = $form->select_all_categories(Categorie::TYPE_CONTACT, null, 'parent', null, null, 1);
print $form->multiselectarray('contact_categ', $cate_arbo, GETPOST('contact_categ', 'array'), null, null, null, null, "90%");
$cate_arbo = $form->select_all_categories(Categorie::TYPE_CONTACT, '', 'parent', 0, 0, 1);
print $form->multiselectarray('contact_categ', $cate_arbo, GETPOST('contact_categ', 'array'), 0, 0, '', 0, "90%");
print '</td><td>'."\n";
print '</td></tr>'."\n";
}

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2018 Destailleur Laurent <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
@ -45,7 +46,7 @@ if (!defined('CDAV_URI_KEY')) {
/**
* Prepare array with list of tabs
*
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function dav_admin_prepare_head()
{

View File

@ -456,7 +456,7 @@ if (empty($reshook)) {
// PREPARE SEND
$mailfile = new CMailFile($subject, $emailTo, $emailFrom, $message, $filedir, $mimetype, $filename, '', '', 0, -1);
if ($mailfile) {
if (!empty($mailfile->error)) {
// SEND
$result = $mailfile->sendfile();
if ($result) {
@ -570,7 +570,7 @@ if (empty($reshook)) {
// PREPARE SEND
$mailfile = new CMailFile($subject, $emailTo, $emailFrom, $message, $filedir, $mimetype, $filename, '', '', 0, -1);
if ($mailfile) {
if (!empty($mailfile->error)) {
// SEND
$result = $mailfile->sendfile();
if ($result) {
@ -685,7 +685,7 @@ if (empty($reshook)) {
$mailfile = new CMailFile($subject, $emailTo, $emailFrom, $message, $filedir, $mimetype, $filename, $emailCC, '', 0, -1);
if ($mailfile) {
if (!empty($mailfile->error)) {
// SEND
$result = $mailfile->sendfile();
if ($result) {
@ -796,7 +796,7 @@ if (empty($reshook)) {
// PREPARE SEND
$mailfile = new CMailFile($subject, $emailTo, $emailFrom, $message, $filedir, $mimetype, $filename, '', '', 0, -1);
if ($mailfile) {
if (!empty($mailfile->error)) {
// SEND
$result = $mailfile->sendfile();
if ($result) {
@ -912,7 +912,7 @@ if (empty($reshook)) {
// PREPARE SEND
$mailfile = new CMailFile($subject, $emailTo, $emailFrom, $message, $filedir, $mimetype, $filename, '', '', 0, -1);
if ($mailfile) {
if (!empty($mailfile->error)) {
// SEND
$result = $mailfile->sendfile();
if ($result) {
@ -1083,7 +1083,7 @@ if (empty($reshook)) {
// PREPARE SEND
$mailfile = new CMailFile($subject, $emailTo, $emailFrom, $message, $filedir, $mimetype, $filename, '', '', 0, -1);
if ($mailfile) {
if (!empty($mailfile->error)) {
// SEND
$result = $mailfile->sendfile();
if ($result) {

View File

@ -156,7 +156,7 @@ class ExpenseReportIk extends CommonObject
* Return expense categories in array
*
* @param int $mode 1=only active; 2=only inactive; other value return all
* @return array of category
* @return array<int,object> of category
*/
public function getTaxCategories($mode = 1)
{
@ -186,11 +186,11 @@ class ExpenseReportIk extends CommonObject
}
/**
* Return an array of ranges for a user
* Return a range for a user
*
* @param User $userauthor user author id
* @param int $fk_c_exp_tax_cat category
* @return boolean|array
* @return false|ExpenseReportIk
*/
public function getRangeByUser(User $userauthor, int $fk_c_exp_tax_cat)
{
@ -211,7 +211,7 @@ class ExpenseReportIk extends CommonObject
*
* @param int $fk_c_exp_tax_cat category id
* @param int $active active
* @return array
* @return ExpenseReportIk[]
*/
public function getRangesByCategory(int $fk_c_exp_tax_cat, $active = 1)
{
@ -251,7 +251,7 @@ class ExpenseReportIk extends CommonObject
/**
* Return an array of ranges grouped by category
*
* @return array
* @return array<int,array{ranges:array<Object>,label:string,active:int<0,1>}>
*/
public function getAllRanges()
{
@ -274,7 +274,7 @@ class ExpenseReportIk extends CommonObject
$ik->fetch($obj->fk_expense_ik);
}
// TODO Set a $tmparay = new stdObj(); and use it to fill $ranges array
// TODO Set a $tmparray = new stdObj(); and use it to fill $ranges array
$obj->ik = $ik;
if (!isset($ranges[$obj->fk_c_exp_tax_cat])) {

View File

@ -733,13 +733,16 @@ if ($action == 'create') {
if (isset($object->lines[$i]->product_type)) {
$type = $object->lines[$i]->product_type;
} // else { $object->lines[$i]->fk_product_type; }
// Try to enhance type detection using date_start and date_end for free lines when type
// was not saved.
if (!empty($objp->date_start)) {
$type = 1;
}
if (!empty($objp->date_end)) {
$type = 1;
if (is_object($objp)) {
// Try to enhance type detection using date_start and date_end for free lines when type
// was not saved.
if (!empty($objp->date_start)) {
$type = 1;
}
if (!empty($objp->date_end)) {
$type = 1;
}
}
// Show line

View File

@ -156,7 +156,7 @@ if (empty($reshook)) {
// Action clone object
if ($action == 'confirm_clone' && $confirm == 'yes' && $permissiontoadd) {
if (1 == 0 && !GETPOST('clone_content') && !GETPOST('clone_receivers')) {
if (false && !GETPOST('clone_content') && !GETPOST('clone_receivers')) {
setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors');
} else {
if ($object->id > 0) {
@ -368,6 +368,7 @@ if (empty($reshook)) {
$classname = ucfirst($subelement);
$srcobject = new $classname($db);
'@phan-var-force Commande|Propal|Contrat $srcobject'; // Can be other class, but CommonObject is too generic
dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines");
$result = $srcobject->fetch($object->origin_id);
@ -924,6 +925,7 @@ if ($action == 'create') {
$classname = ucfirst($subelement);
$objectsrc = new $classname($db);
'@phan-var-force Commande|Propal|Contrat $objectsrc';
$objectsrc->fetch(GETPOST('originid'));
if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) {
$objectsrc->fetch_lines();
@ -1136,7 +1138,7 @@ if ($action == 'create') {
}
print '<table class="border centpercent">';
print '<tr><td class="fieldrequired">'.$langs->trans("ThirdParty").'</td><td>';
print $form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, null, 0, 'minwidth300');
print $form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300');
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddThirdParty").'"></span></a>';
print '</td></tr>';
print '</table>';
@ -1264,7 +1266,7 @@ if ($action == 'create') {
// 1),
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value'
// => 1),
array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOSTINT('socid'), 'socid', '', '', 0, 0, null, 0, 'minwidth200')));
array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOSTINT('socid'), 'socid', '', '', 0, 0, array(), 0, 'minwidth200')));
// Paiement incomplet. On demande si motif = escompte ou autre
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneIntervention', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
}
@ -1380,7 +1382,7 @@ if ($action == 'create') {
$contratstatic = new Contrat($db);
$contratstatic->fetch($object->fk_contrat);
//print '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$selected.'">'.$projet->title.'</a>';
print $contratstatic->getNomUrl(0, '', 1);
print $contratstatic->getNomUrl(0, 0, 1);
} else {
print "&nbsp;";
}
@ -1848,7 +1850,7 @@ if ($action == 'create') {
print $formfile->showdocuments('ficheinter', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
// Show links to link elements
$linktoelem = $form->showLinkToObjectBlock($object, null, array('fichinter'));
$linktoelem = $form->showLinkToObjectBlock($object, array(), array('fichinter'));
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
// Show direct download link

View File

@ -412,9 +412,11 @@ $search_options_pattern = 'search_task_options_';
$extrafieldsobjectkey = 'projet_task';
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
$tasksarray = $taskstatic->getTasksArray(0, 0, ($project->id ? $project->id : 0), $socid, 0, $search_project_ref, $onlyopenedproject, $morewherefilter, ($search_usertoprocessid ? $search_usertoprocessid : 0), 0, $extrafields); // We want to see all tasks of open project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later.
$tasksarraywithoutfilter = array(); // Default
$tasksarray = $taskstatic->getTasksArray(null, null, ($project->id ? $project->id : 0), $socid, 0, $search_project_ref, $onlyopenedproject, $morewherefilter, ($search_usertoprocessid ? $search_usertoprocessid : 0), 0, $extrafields); // We want to see all tasks of open project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later.
if ($morewherefilter) { // Get all task without any filter, so we can show total of time spent for not visible tasks
$tasksarraywithoutfilter = $taskstatic->getTasksArray(0, 0, ($project->id ? $project->id : 0), $socid, 0, '', $onlyopenedproject, '', ($search_usertoprocessid ? $search_usertoprocessid : 0)); // We want to see all tasks of open project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later.
$tasksarraywithoutfilter = $taskstatic->getTasksArray(null, null, ($project->id ? $project->id : 0), $socid, 0, '', $onlyopenedproject, '', ($search_usertoprocessid ? $search_usertoprocessid : 0)); // We want to see all tasks of open project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later.
}
$projectsrole = $taskstatic->getUserRolesForProjectsOrTasks($usertoprocess, null, ($project->id ? $project->id : 0), 0, $onlyopenedproject);
$tasksrole = $taskstatic->getUserRolesForProjectsOrTasks(null, $usertoprocess, ($project->id ? $project->id : 0), 0, $onlyopenedproject);
@ -524,7 +526,7 @@ if (!$user->hasRight('user', 'user', 'lire')) {
$includeonly = array($user->id);
}
$selecteduser = $search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id;
$moreforfiltertmp = $form->select_dolusers($selecteduser, 'search_usertoprocessid', 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200');
$moreforfiltertmp = $form->select_dolusers($selecteduser, 'search_usertoprocessid', 0, null, 0, $includeonly, array(), 0, 0, 0, '', 0, '', 'maxwidth200');
if ($form->num > 1 || empty($conf->dol_optimize_smallscreen)) {
$moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= '<div class="inline-block hideonsmartphone"></div>';
@ -668,6 +670,8 @@ if (count($tasksarray) > 0) {
}
//var_dump($listofdistinctprojectid);
$totalforeachweek = array();
'@phan-var-force array<string,int> $totalforeachweek';
foreach ($listofdistinctprojectid as $tmpprojectid) {
$projectstatic->id = $tmpprojectid;
$projectstatic->loadTimeSpentMonth($firstdaytoshow, 0, $usertoprocess->id); // Load time spent from table element_time for the project into this->weekWorkLoad and this->weekWorkLoadPerTask for all days of a week

View File

@ -218,7 +218,7 @@ if (empty($reshook)) {
$object->title = GETPOST('title', 'alphanohtml');
$object->socid = GETPOSTINT('socid');
$object->description = GETPOST('description', 'restricthtml'); // Do not use 'alpha' here, we want field as it is
$object->public = GETPOST('public', 'alphanohtml');
$object->public = GETPOSTINT('public') ? 1 : 0;
$object->opp_amount = GETPOSTFLOAT('opp_amount');
$object->budget_amount = GETPOSTFLOAT('budget_amount');
$object->date_c = dol_now();
@ -319,7 +319,7 @@ if (empty($reshook)) {
$object->status = GETPOSTINT('status');
$object->socid = GETPOSTINT('socid');
$object->description = GETPOST('description', 'restricthtml'); // Do not use 'alpha' here, we want field as it is
$object->public = GETPOST('public', 'alpha');
$object->public = GETPOSTINT('public') ? 1 : 0;
$object->date_start = (!GETPOST('projectstart')) ? '' : $date_start;
$object->date_end = (!GETPOST('projectend')) ? '' : $date_end;
$object->date_start_event = (!GETPOST('date_start_event')) ? '' : $date_start_event;
@ -817,11 +817,11 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
}
if (count($array) > 0) {
print $form->selectarray('public', $array, GETPOST('public'), 0, 0, 0, '', 0, 0, 0, '', '', 1);
print $form->selectarray('public', $array, GETPOSTINT('public') ? 1 : 0, 0, 0, 0, '', 0, 0, 0, '', '', 1);
} else {
print '<input type="hidden" name="public" id="public" value="'.GETPOST('public').'">';
print '<input type="hidden" name="public" id="public" value="'.(GETPOSTINT('public') ? 1 : 0).'">';
if (GETPOST('public') == 0) {
if (GETPOSTINT('public') == 0) {
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
print $langs->trans("PrivateProject");
} else {

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2016 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
@ -16,10 +17,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
use Luracast\Restler\RestException;
use Luracast\Restler\RestException;
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
/**
* API class for projects
@ -106,7 +107,7 @@ class Projects extends DolibarrApi
throw new RestException(403);
}
$result = $this->project->fetch('', $ref);
$result = $this->project->fetch(0, $ref);
if (!$result) {
throw new RestException(404, 'Project with supplied ref not found');
}
@ -137,7 +138,7 @@ class Projects extends DolibarrApi
throw new RestException(403);
}
$result = $this->project->fetch('', '', $ref_ext);
$result = $this->project->fetch(0, '', $ref_ext);
if (!$result) {
throw new RestException(404, 'Project with supplied ref_ext not found');
}
@ -168,7 +169,7 @@ class Projects extends DolibarrApi
throw new RestException(403);
}
$result = $this->project->fetch('', '', '', $email_msgid);
$result = $this->project->fetch(0, '', '', $email_msgid);
if (!$result) {
throw new RestException(404, 'Project with supplied email_msgid not found');
}

View File

@ -90,8 +90,7 @@ class Project extends CommonObject
/**
* @var int Date start
* @deprecated
* @see $date_start
* @deprecated Use $date_start
*/
public $dateo;
@ -102,8 +101,7 @@ class Project extends CommonObject
/**
* @var int Date end
* @deprecated
* @see $date_end
* @deprecated Use $date_end
*/
public $datee;
@ -132,6 +130,9 @@ class Project extends CommonObject
*/
public $date_close;
/**
* @var int Id of thirdparty
*/
public $socid; // To store id of thirdparty
/**
@ -139,14 +140,20 @@ class Project extends CommonObject
*/
public $thirdparty_name; // To store name of thirdparty (defined only in some cases)
public $user_author_id; //!< Id of project creator. Not defined if shared project.
/**
* @var int Id of project creator. Not defined if shared project.
*/
public $user_author_id;
/**
* @var int user close id
*/
public $fk_user_close;
public $public; //!< Tell if this is a public or private project
/**
* @var int<0,1> Tell if this is a public or private project
*/
public $public;
/**
* @var float|string budget Amount (May need price2num)
@ -200,8 +207,7 @@ class Project extends CommonObject
/**
* @var int status
* @deprecated
* @see $status
* @deprecated Use $status
*/
public $statut; // 0=draft, 1=opened, 2=closed
@ -240,25 +246,33 @@ class Project extends CommonObject
*/
public $email_msgid;
/**
* @var ?static
*/
public $oldcopy;
public $weekWorkLoad; // Used to store workload details of a projet
/**
* @var array<int,int> Used to store workload details of a projet (array[day])
*/
public $weekWorkLoad;
/**
* @var array<int,array<int,int>> Used to store workload details of a projet (array[day][taskid])
*/
public $weekWorkLoadPerTask; // Used to store workload details of tasks of a projet
/**
* @var array Used to store workload details of a projet
* @var array<string,int> Used to store workload details of a projet
*/
public $monthWorkLoad;
/**
* @var array Used to store workload details of tasks of a projet
* @var array<string,array<int,int>> Used to store workload details of tasks of a projet (array[weeknbr][task_id])
*/
public $monthWorkLoadPerTask;
/**
* @var int Creation date
* @deprecated
* @see $date_c
* @deprecated Use $date_c
*/
public $datec;
@ -269,8 +283,7 @@ class Project extends CommonObject
/**
* @var int Modification date
* @deprecated
* @see $date_m
* @deprecated Use $date_m
*/
public $datem;
@ -1361,10 +1374,9 @@ class Project extends CommonObject
/**
* getTooltipContentArray
*
* @param array $params ex option, infologin
* @param array<string,mixed> $params params to construct tooltip data
* @since v18
* @return array
* @return array{picto:string,ref?:string,refsupplier?:string,label?:string,date?:string,date_echeance?:string,amountht?:string,total_ht?:string,totaltva?:string,amountlt1?:string,amountlt2?:string,amountrevenustamp?:string,totalttc?:string}|array{optimize:string}
*/
public function getTooltipContentArray($params)
{
@ -1637,7 +1649,7 @@ class Project extends CommonObject
* @param int $list 0=Return array, 1=Return string list
* @param int $socid 0=No filter on third party, id of third party
* @param string $filter Additional filter on project (statut, ref, ...). TODO Use USF syntax here.
* @return array|string Array of projects id, or string with projects id separated with "," if list is 1
* @return int[]|string Array of projects id, or string with projects id separated with "," if list is 1
*/
public function getProjectsAuthorizedForUser($user, $mode = 0, $list = 0, $socid = 0, $filter = '')
{
@ -1650,9 +1662,9 @@ class Project extends CommonObject
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact as ec ON ec.element_id = p.rowid";
} elseif ($mode == 1) {
$sql .= ", ".MAIN_DB_PREFIX."element_contact as ec";
} elseif ($mode == 2) {
// No filter. Use this if user has permission to see all project
}
} // elseif ($mode == 2) {
// No filter. Use this if user has permission to see all project
// }
$sql .= " WHERE p.entity IN (".getEntity('project').")";
// Internal users must see project he is contact to even if project linked to a third party he can't see.
//if ($socid || ! $user->rights->societe->client->voir) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".((int) $socid).")";
@ -1688,9 +1700,9 @@ class Project extends CommonObject
$sql .= " ( ec.fk_c_type_contact IN (".$this->db->sanitize(implode(',', array_keys($listofprojectcontacttype))).")";
$sql .= " AND ec.fk_socpeople = ".((int) $user->id).")";
$sql .= " )";
} elseif ($mode == 2) {
// No filter. Use this if user has permission to see all project
}
} // elseif ($mode == 2) {
// No filter. Use this if user has permission to see all project
//}
// Manage filter
$errormessage = '';
@ -1802,6 +1814,7 @@ class Project extends CommonObject
$filefound = 1;
dol_include_once($reldir."core/modules/project/".$obj.'.php');
$modProject = new $obj();
'@phan-var-force ModeleNumRefProjects $modProject';
$defaultref = $modProject->getNextValue(is_object($clone_project->thirdparty) ? $clone_project->thirdparty : null, $clone_project);
break;
}
@ -1914,9 +1927,10 @@ class Project extends CommonObject
$socid = $user->socid;
}
$tasksarray = $taskstatic->getTasksArray(0, 0, $fromid, $socid, 0);
$tasksarray = $taskstatic->getTasksArray(null, null, $fromid, $socid, 0);
$tab_conv_child_parent = array();
$result_clonse = 0;
// Loop on each task, to clone it
foreach ($tasksarray as $tasktoclone) {
@ -1937,7 +1951,7 @@ class Project extends CommonObject
}
//Parse all clone node to be sure to update new parent
$tasksarray = $taskstatic->getTasksArray(0, 0, $clone_project_id, $socid, 0);
$tasksarray = $taskstatic->getTasksArray(null, null, $clone_project_id, $socid, 0);
foreach ($tasksarray as $task_cloned) {
$taskstatic->fetch($task_cloned->id);
if ($taskstatic->fk_task_parent != 0) {
@ -1986,7 +2000,7 @@ class Project extends CommonObject
$socid = $user->socid;
}
$tasksarray = $taskstatic->getTasksArray(0, 0, $this->id, $socid, 0);
$tasksarray = $taskstatic->getTasksArray(null, null, $this->id, $socid, 0);
foreach ($tasksarray as $tasktoshiftdate) {
$to_update = false;
@ -2000,6 +2014,8 @@ class Project extends CommonObject
$error++;
$this->error .= $task->error;
}
} else {
continue;
}
//print "$this->date_start + $tasktoshiftdate->date_start - $old_project_dt_start";exit;
@ -2162,7 +2178,7 @@ class Project extends CommonObject
//print $sql;
$resql = $this->db->query($sql);
if ($resql) {
$daylareadyfound = array();
$dayallreadyfound = array();
$num = $this->db->num_rows($resql);
$i = 0;
@ -2170,14 +2186,14 @@ class Project extends CommonObject
while ($i < $num) {
$obj = $this->db->fetch_object($resql);
$day = $this->db->jdate($obj->element_date); // task_date is date without hours
if (empty($daylareadyfound[$day])) {
if (empty($dayallreadyfound[$day])) {
$this->weekWorkLoad[$day] = $obj->element_duration;
$this->weekWorkLoadPerTask[$day][$obj->fk_element] = $obj->element_duration;
} else {
$this->weekWorkLoad[$day] += $obj->element_duration;
$this->weekWorkLoadPerTask[$day][$obj->fk_element] += $obj->element_duration;
}
$daylareadyfound[$day] = 1;
$dayallreadyfound[$day] = 1;
$i++;
}
$this->db->free($resql);
@ -2228,6 +2244,7 @@ class Project extends CommonObject
$num = $this->db->num_rows($resql);
$i = 0;
$week_number = ''; // Initialisation for static analysis
// Loop on each record found, so each couple (project id, task id)
while ($i < $num) {
$obj = $this->db->fetch_object($resql);
@ -2235,7 +2252,6 @@ class Project extends CommonObject
$date = explode('-', $obj->element_date);
$week_number = getWeekNumber((int) $date[2], (int) $date[1], (int) $date[0]);
}
'@phan-var-force int $week_number'; // Needed because phan considers it might be null
if (empty($weekalreadyfound[$week_number])) {
$this->monthWorkLoad[$week_number] = $obj->element_duration;
$this->monthWorkLoadPerTask[$week_number][$obj->fk_element] = $obj->element_duration;
@ -2462,7 +2478,7 @@ class Project extends CommonObject
/**
* Create an array of tasks of current project
*
* @param User $user Object user we want project allowed to
* @param ?User $user Object user we want project allowed to
* @param int $loadRoleMode 1= will test Roles on task; 0 used in delete project action
* @return int >0 if OK, <0 if KO
*/
@ -2471,7 +2487,7 @@ class Project extends CommonObject
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
$taskstatic = new Task($this->db);
$this->lines = $taskstatic->getTasksArray(0, $user, $this->id, 0, 0, '', '-1', '', 0, 0, array(), 0, array(), 0, $loadRoleMode);
$this->lines = $taskstatic->getTasksArray(null, $user, $this->id, 0, 0, '', '-1', '', 0, 0, null, 0, array(), 0, $loadRoleMode);
return 1;
}
@ -2481,9 +2497,9 @@ class Project extends CommonObject
*
* @param string $text Content of message (not html entities encoded)
* @param string $subject Subject of message
* @param array $filename_list Array of attached files
* @param array $mimetype_list Array of mime types of attached files
* @param array $mimefilename_list Array of public names of attached files
* @param string[] $filename_list Array of attached files
* @param string[] $mimetype_list Array of mime types of attached files
* @param string[] $mimefilename_list Array of public names of attached files
* @param string $addr_cc Email cc
* @param string $addr_bcc Email bcc
* @param int $deliveryreceipt Ask a delivery receipt
@ -2555,7 +2571,7 @@ class Project extends CommonObject
$return .= '</div>';
if (!empty($this->thirdparty->phone)) {
$return .= '<div class="inline-block valignmiddle">';
$return .= dol_print_phone($this->thirdparty->phone, $this->thirdparty->country_code, 0, $this->thirdparty->id, 'tel', 'hidenum', 'phone', $this->thirdparty->phone, 0, 'paddingleft paddingright');
$return .= dol_print_phone($this->thirdparty->phone, $this->thirdparty->country_code, 0, $this->thirdparty->id, 'tel', 'hidenum', 'phone', $this->thirdparty->phone, 0, 'paddingleft paddingright'); // @phan-suppress-current-line PhanPluginSuspiciousParamPosition
$return .= '</div>';
}
if (!empty($this->thirdparty->email)) {
@ -2602,7 +2618,7 @@ class Project extends CommonObject
/**
* Return array of sub-projects of the current project
*
* @return array Children of this project as objects with rowid & title as members
* @return stdClass[] Children of this project as objects with rowid & title as members
*/
public function getChildren()
{

View File

@ -3,6 +3,7 @@
* Copyright (C) 2006-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.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
@ -63,7 +64,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_comments.inc.php';
// Retrieve First Task ID of Project if withprojet is on to allow project prev next to work
if (!empty($project_ref) && !empty($withproject)) {
if ($projectstatic->fetch('', $project_ref) > 0) {
if ($projectstatic->fetch(0, $project_ref) > 0) {
$objectsarray = $object->getTasksArray(0, 0, $projectstatic->id, $socid, 0);
if (count($objectsarray) > 0) {
$id = $objectsarray[0]->id;
@ -335,7 +336,7 @@ if ($id > 0 || !empty($ref)) {
// Other attributes
$cols = 3;
$parameters = array('socid'=>$socid);
$parameters = array('socid' => $socid);
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
print '</table>';

View File

@ -203,8 +203,8 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $user->hasRight('projet'
// Retrieve First Task ID of Project if withprojet is on to allow project prev next to work
if (!empty($project_ref) && !empty($withproject)) {
if ($projectstatic->fetch('', $project_ref) > 0) {
$tasksarray = $object->getTasksArray(0, 0, $projectstatic->id, $socid, 0);
if ($projectstatic->fetch(0, $project_ref) > 0) {
$tasksarray = $object->getTasksArray(null, null, $projectstatic->id, $socid, 0);
if (count($tasksarray) > 0) {
$id = $tasksarray[0]->id;
} else {

View File

@ -67,6 +67,10 @@ if (isModEnabled('eventorganization')) {
require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php';
}
$u = '';
$p = '';
$myafm = '';
if ($mysoc->country_code == 'GR') {
$u = getDolGlobalString('AADE_WEBSERVICE_USER');
$p = getDolGlobalString('AADE_WEBSERVICE_KEY');
@ -172,6 +176,7 @@ $result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'ro
*/
$parameters = array('id' => $socid, 'objcanvas' => $objcanvas);
$current_logo = '';
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@ -986,6 +991,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
}
$modCodeClient = new $module($db);
'@phan-var-force ModeleThirdPartyCode $modCodeClient';
// Load object modCodeFournisseur
$module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON', 'mod_codeclient_leopard');
if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {
@ -999,6 +1005,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
}
$modCodeFournisseur = new $module($db);
'@phan-var-force ModeleThirdPartyCode $modCodeFournisseur';
// Define if customer/prospect or supplier status is set or not
if (GETPOST("type", 'aZ') != 'f') {
@ -1148,7 +1155,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
$object->country_code = $tmparray['code'];
$object->country = $tmparray['label'];
}
$object->forme_juridique_code = GETPOST('forme_juridique_code');
$object->forme_juridique_code = GETPOSTINT('forme_juridique_code');
// We set multicurrency_code if enabled
if (isModEnabled("multicurrency")) {
@ -1831,7 +1838,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
if (getDolGlobalInt('MAIN_MULTILANGS')) {
print '<tr><td>'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).'</td><td colspan="3" class="maxwidthonsmartphone">'."\n";
print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone');
print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, array(), 1, 0, 0, 'maxwidth200onsmartphone');
print '</td>';
print '</tr>';
}
@ -1866,13 +1873,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
// Customer
print '<tr class="visibleifcustomer"><td class="toptd">'.$form->editfieldkey('CustomersProspectsCategoriesShort', 'custcats', '', $object, 0).'</td><td colspan="3">';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, '', 'parent', 64, 0, 3);
print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), null, null, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), 0, 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
print "</td></tr>";
if (getDolGlobalString('THIRDPARTY_SUGGEST_ALSO_ADDRESS_CREATION')) {
print '<tr class="individualline"><td class="toptd">'.$form->editfieldkey('ContactCategoriesShort', 'contcats', '', $object, 0).'</td><td colspan="3">';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_CONTACT, '', 'parent', 64, 0, 3);
print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('contcats', $cate_arbo, GETPOST('contcats', 'array'), null, null, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('contcats', $cate_arbo, GETPOST('contcats', 'array'), 0, 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
print "</td></tr>";
}
@ -1880,7 +1887,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
if (isModEnabled("supplier_proposal") || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
print '<tr class="visibleifsupplier"><td class="toptd">'.$form->editfieldkey('SuppliersCategoriesShort', 'suppcats', '', $object, 0).'</td><td colspan="3">';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER, '', 'parent', 64, 0, 3);
print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('suppcats', $cate_arbo, GETPOST('suppcats', 'array'), null, null, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('suppcats', $cate_arbo, GETPOST('suppcats', 'array'), 0, 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
print "</td></tr>";
}
}
@ -1905,7 +1912,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '<td>'.$langs->trans('ParentCompany').'</td>';
print '<td colspan="3" class="maxwidthonsmartphone">';
print img_picto('', 'company', 'class="paddingrightonly"');
print $form->select_company(GETPOST('parent_company_id'), 'parent_company_id', '', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300 maxwidth500 widthcentpercentminusxx');
print $form->select_company(GETPOST('parent_company_id'), 'parent_company_id', '', 'SelectThirdParty', 0, 0, array(), 0, 'minwidth300 maxwidth500 widthcentpercentminusxx');
print '</td></tr>';
}
@ -1939,14 +1946,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '<tr><td class="titlefieldcreate">'.$langs->trans("ProductAccountancySellCode").'</td>';
print '<td>';
$accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
print $formaccounting->select_account($accountancy_code_sell, 'accountancy_code_sell', 1, null, 1, 1, '');
print $formaccounting->select_account($accountancy_code_sell, 'accountancy_code_sell', 1, array(), 1, 1, '');
print '</td></tr>';
// Accountancy_code_buy
print '<tr><td class="titlefieldcreate">'.$langs->trans("ProductAccountancyBuyCode").'</td>';
print '<td>';
$accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
print $formaccounting->select_account($accountancy_code_buy, 'accountancy_code_buy', 1, null, 1, 1, '');
print $formaccounting->select_account($accountancy_code_buy, 'accountancy_code_buy', 1, array(), 1, 1, '');
print '</td></tr>';
} else { // For external software
// Accountancy_code_sell
@ -1966,7 +1973,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print dol_get_fiche_end();
print $form->buttonsSaveCancel("AddThirdParty", 'Cancel', null, 0, '', $dol_openinpopup);
print $form->buttonsSaveCancel('AddThirdParty', 'Cancel', array(), 0, '', $dol_openinpopup);
print '</form>'."\n";
} elseif ($action == 'edit') {
@ -1991,9 +1998,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
}
$modCodeClient = new $module($db);
'@phan-var-force ModeleThirdPartyCode $modCodeClient';
// We check if the prefix tag is used
if ($modCodeClient->code_auto) {
$prefixCustomerIsUsed = $modCodeClient->verif_prefixIsUsed();
} else {
$prefixCustomerIsUsed = false;
}
$module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON');
if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {
@ -2007,9 +2017,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
}
$modCodeFournisseur = new $module($db);
'@phan-var-force ModeleThirdPartyCode $modCodeFournisseur';
// We check if the prefix tag is used
if ($modCodeFournisseur->code_auto) {
$prefixSupplierIsUsed = $modCodeFournisseur->verif_prefixIsUsed();
} else {
$prefixSupplierIsUsed = false;
}
$object->oldcopy = clone $object;
@ -2650,7 +2663,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
// Default language
if (getDolGlobalInt('MAIN_MULTILANGS')) {
print '<tr><td>'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).'</td><td colspan="3">'."\n";
print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language($object->default_lang, 'default_lang', 0, null, '1', 0, 0, 'maxwidth300 widthcentpercentminusx');
print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language($object->default_lang, 'default_lang', 0, array(), '1', 0, 0, 'maxwidth300 widthcentpercentminusx');
print '</td>';
print '</tr>';
}
@ -2715,7 +2728,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '<td>'.$langs->trans('ParentCompany').'</td>';
print '<td colspan="3" class="maxwidthonsmartphone">';
print img_picto('', 'company', 'class="pictofixedwidth"');
print $form->select_company(GETPOST('parent_company_id') ? GETPOST('parent_company_id') : $object->parent, 'parent_company_id', '', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300 maxwidth500 widthcentpercentminusxx');
print $form->select_company(GETPOST('parent_company_id') ? GETPOST('parent_company_id') : $object->parent, 'parent_company_id', '', 'SelectThirdParty', 0, 0, array(), 0, 'minwidth300 maxwidth500 widthcentpercentminusxx');
print '</td></tr>';
}
@ -2771,13 +2784,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
// Accountancy_code_sell
print '<tr><td>'.$langs->trans("ProductAccountancySellCode").'</td>';
print '<td>';
print $formaccounting->select_account($object->accountancy_code_sell, 'accountancy_code_sell', 1, '', 1, 1);
print $formaccounting->select_account($object->accountancy_code_sell, 'accountancy_code_sell', 1, array(), 1, 1);
print '</td></tr>';
// Accountancy_code_buy
print '<tr><td>'.$langs->trans("ProductAccountancyBuyCode").'</td>';
print '<td>';
print $formaccounting->select_account($object->accountancy_code_buy, 'accountancy_code_buy', 1, '', 1, 1);
print $formaccounting->select_account($object->accountancy_code_buy, 'accountancy_code_buy', 1, array(), 1, 1);
print '</td></tr>';
} else { // For external software
// Accountancy_code_sell
@ -2827,7 +2840,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
'name' => 'soc_origin',
'label' => $langs->trans('MergeOriginThirdparty'),
'type' => 'other',
'value' => $form->select_company('', 'soc_origin', '', 'SelectThirdParty', 0, 0, array(), 0, 'minwidth200', '', '', 1, null, false, array($object->id))
'value' => $form->select_company('', 'soc_origin', '', 'SelectThirdParty', 0, 0, array(), 0, 'minwidth200', '', '', 1, array(), false, array($object->id))
)
);
@ -3242,7 +3255,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
if (isModEnabled('accounting')) {
if (!empty($object->accountancy_code_sell)) {
$accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch('', $object->accountancy_code_sell, 1);
$accountingaccount->fetch(0, $object->accountancy_code_sell, 1);
print $accountingaccount->getNomUrl(0, 1, 1, '', 1);
}
@ -3258,7 +3271,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
if (isModEnabled('accounting')) {
if (!empty($object->accountancy_code_buy)) {
$accountingaccount2 = new AccountingAccount($db);
$accountingaccount2->fetch('', $object->accountancy_code_buy, 1);
$accountingaccount2->fetch(0, $object->accountancy_code_buy, 1);
print $accountingaccount2->getNomUrl(0, 1, 1, '', 1);
}
@ -3282,7 +3295,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '</tr></table>';
print '</td><td>';
$html_name = ($action == 'editparentcompany') ? 'parent_id' : 'none';
$form->form_thirdparty($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->parent, $html_name, '', 1, 0, 0, null, 0, array($object->id));
$form->form_thirdparty($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->parent, $html_name, '', 1, 0, 0, array(), 0, array($object->id));
print '</td></tr>';
}
@ -3295,7 +3308,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '<tr><td>'.$langs->trans("LinkedToDolibarrMember").'</td>';
print '<td>';
$adh = new Adherent($db);
$result = $adh->fetch('', '', $object->id);
$result = $adh->fetch(0, '', $object->id);
if ($result > 0) {
$adh->ref = $adh->getFullName($langs);
print $adh->getNomUrl(-1);
@ -3363,12 +3376,15 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
if (!empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile)) {
$cloneSocietetUrl = '';
$cloneButtonId = 'action-clone';
} else {
$cloneSocietetUrl = '';
$cloneButtonId = '';
}
print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $cloneSocietetUrl, $cloneButtonId, $user->hasRight('societe', 'creer'));
if (isModEnabled('member')) {
$adh = new Adherent($db);
$result = $adh->fetch('', '', $object->id);
$result = $adh->fetch(0, '', $object->id);
if ($result == 0 && ($object->client == 1 || $object->client == 3) && getDolGlobalString('MEMBER_CAN_CONVERT_CUSTOMERS_TO_MEMBERS')) {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/adherents/card.php?&action=create&socid='.$object->id.'" title="'.dol_escape_htmltag($langs->trans("NewMember")).'">'.$langs->trans("NewMember").'</a>'."\n";
}

View File

@ -90,6 +90,8 @@ $hookmanager->initHooks(array('supplier_proposalcard', 'globalcard'));
$object = new SupplierProposal($db);
$extrafields = new ExtraFields($db);
$objectsrc = null;
// fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
@ -173,7 +175,7 @@ if (empty($reshook)) {
// Action clone object
if ($action == 'confirm_clone' && $confirm == 'yes' && $usercancreate) {
if (1 == 0 && !GETPOST('clone_content') && !GETPOST('clone_receivers')) {
if (false && !GETPOST('clone_content') && !GETPOST('clone_receivers')) {
setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors');
} else {
if ($object->id > 0) {
@ -349,7 +351,7 @@ if (empty($reshook)) {
$element = $subelement = 'contrat';
}
if ($element == 'inter') {
$element = $subelement = 'ficheinter';
$element = $subelement = 'fichinter';
}
if ($element == 'shipping') {
$element = $subelement = 'expedition';
@ -370,6 +372,7 @@ if (empty($reshook)) {
$classname = ucfirst($subelement);
$srcobject = new $classname($db);
'@phan-var-force Commande|Propal|Contrat|Fichinter|Expedition $srcobject'; // Maybe other class but CommonObject is too generic
dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines");
$result = $srcobject->fetch($object->origin_id);
@ -399,6 +402,8 @@ if (empty($reshook)) {
if (method_exists($lines[$i], 'fetch_optionals')) {
$lines[$i]->fetch_optionals();
$array_options = $lines[$i]->array_options;
} else {
$array_options = array();
}
$result = $object->addline(
@ -1112,7 +1117,7 @@ if (empty($reshook)) {
exit();
} elseif ($action == 'classin' && $usercancreate) {
// Set project
$object->setProject(GETPOST('projectid'), 'int');
$object->setProject(GETPOSTINT('projectid'));
} elseif ($action == 'setavailability' && $usercancreate) {
// Delivery delay
$result = $object->availability(GETPOST('availability_id'));
@ -1212,6 +1217,7 @@ if ($action == 'create') {
$classname = ucfirst($subelement);
$objectsrc = new $classname($db);
'@phan-var-force Commande|Propal|CommandeFournisseur|SupplierProposal $objectsrc'; // Could be other classes, but CommonObject is too generic
$objectsrc->fetch($originid);
if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) {
$objectsrc->fetch_lines();
@ -1278,7 +1284,7 @@ if ($action == 'create') {
} else {
print '<td colspan="2">';
$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>
@ -2077,7 +2083,7 @@ if ($action == 'create') {
// Show links to link elements
$linktoelem = $form->showLinkToObjectBlock($object, null, array('supplier_proposal'));
$linktoelem = $form->showLinkToObjectBlock($object, array(), array('supplier_proposal'));
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
$MAXEVENT = 10;

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2022 Open-Dsi <support@open-dsi.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
@ -27,7 +28,7 @@
* Prepare array with list of tabs
*
* @param ProductAttribute $object Object related to tabs
* @return array Array of tabs to show
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function productAttributePrepareHead($object)
{