forked from Wavyzz/dolibarr
Fix & enable PhanPluginUnknownClosureParamType
# Fix & enable PhanPluginUnknownClosureParamType Typing of anonymous functions to fix this notice. Optimised some minor things.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2021 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
|
||||
@@ -60,96 +61,96 @@ clearstatcache();
|
||||
|
||||
$workflowcodes = array(
|
||||
// Automatic creation
|
||||
'WORKFLOW_PROPAL_AUTOCREATE_ORDER'=>array(
|
||||
'family'=>'create',
|
||||
'position'=>10,
|
||||
'enabled'=>(isModEnabled("propal") && isModEnabled('order')),
|
||||
'picto'=>'order'
|
||||
'WORKFLOW_PROPAL_AUTOCREATE_ORDER' => array(
|
||||
'family' => 'create',
|
||||
'position' => 10,
|
||||
'enabled' => (isModEnabled("propal") && isModEnabled('order')),
|
||||
'picto' => 'order'
|
||||
),
|
||||
'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array(
|
||||
'family'=>'create',
|
||||
'position'=>20,
|
||||
'enabled'=>(isModEnabled('order') && isModEnabled('invoice')),
|
||||
'picto'=>'bill'
|
||||
'WORKFLOW_ORDER_AUTOCREATE_INVOICE' => array(
|
||||
'family' => 'create',
|
||||
'position' => 20,
|
||||
'enabled' => (isModEnabled('order') && isModEnabled('invoice')),
|
||||
'picto' => 'bill'
|
||||
),
|
||||
'WORKFLOW_TICKET_CREATE_INTERVENTION' => array(
|
||||
'family'=>'create',
|
||||
'position'=>25,
|
||||
'enabled'=>(isModEnabled('ticket') && isModEnabled('intervention')),
|
||||
'picto'=>'ticket'
|
||||
'family' => 'create',
|
||||
'position' => 25,
|
||||
'enabled' => (isModEnabled('ticket') && isModEnabled('intervention')),
|
||||
'picto' => 'ticket'
|
||||
),
|
||||
|
||||
'separator1'=>array('family'=>'separator', 'position'=>25, 'title'=>'', 'enabled'=>((isModEnabled("propal") && isModEnabled('order')) || (isModEnabled('order') && isModEnabled('invoice')) || (isModEnabled('ticket') && isModEnabled('intervention')))),
|
||||
'separator1' => array('family' => 'separator', 'position' => 25, 'title' => '', 'enabled' => ((isModEnabled("propal") && isModEnabled('order')) || (isModEnabled('order') && isModEnabled('invoice')) || (isModEnabled('ticket') && isModEnabled('intervention')))),
|
||||
|
||||
// Automatic classification of proposal
|
||||
'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array(
|
||||
'family'=>'classify_proposal',
|
||||
'position'=>30,
|
||||
'enabled'=>(isModEnabled("propal") && isModEnabled('order')),
|
||||
'picto'=>'propal',
|
||||
'warning'=>''
|
||||
'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL' => array(
|
||||
'family' => 'classify_proposal',
|
||||
'position' => 30,
|
||||
'enabled' => (isModEnabled("propal") && isModEnabled('order')),
|
||||
'picto' => 'propal',
|
||||
'warning' => ''
|
||||
),
|
||||
'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL'=>array(
|
||||
'family'=>'classify_proposal',
|
||||
'position'=>31,
|
||||
'enabled'=>(isModEnabled("propal") && isModEnabled('invoice')),
|
||||
'picto'=>'propal',
|
||||
'warning'=>''
|
||||
'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL' => array(
|
||||
'family' => 'classify_proposal',
|
||||
'position' => 31,
|
||||
'enabled' => (isModEnabled("propal") && isModEnabled('invoice')),
|
||||
'picto' => 'propal',
|
||||
'warning' => ''
|
||||
),
|
||||
|
||||
// Automatic classification of order
|
||||
'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING'=>array( // when shipping validated
|
||||
'family'=>'classify_order',
|
||||
'position'=>40,
|
||||
'enabled'=>(isModEnabled("shipping") && isModEnabled('order')),
|
||||
'picto'=>'order'
|
||||
'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING' => array( // when shipping validated
|
||||
'family' => 'classify_order',
|
||||
'position' => 40,
|
||||
'enabled' => (isModEnabled("shipping") && isModEnabled('order')),
|
||||
'picto' => 'order'
|
||||
),
|
||||
'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED'=>array( // when shipping closed
|
||||
'family'=>'classify_order',
|
||||
'position'=>41,
|
||||
'enabled'=>(isModEnabled("shipping") && isModEnabled('order')),
|
||||
'picto'=>'order'
|
||||
'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED' => array( // when shipping closed
|
||||
'family' => 'classify_order',
|
||||
'position' => 41,
|
||||
'enabled' => (isModEnabled("shipping") && isModEnabled('order')),
|
||||
'picto' => 'order'
|
||||
),
|
||||
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array(
|
||||
'family'=>'classify_order',
|
||||
'position'=>42,
|
||||
'enabled'=>(isModEnabled('invoice') && isModEnabled('order')),
|
||||
'picto'=>'order',
|
||||
'warning'=>''
|
||||
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER' => array(
|
||||
'family' => 'classify_order',
|
||||
'position' => 42,
|
||||
'enabled' => (isModEnabled('invoice') && isModEnabled('order')),
|
||||
'picto' => 'order',
|
||||
'warning' => ''
|
||||
), // For this option, if module invoice is disabled, it does not exists, so "Classify billed" for order must be done manually from order card.
|
||||
|
||||
// Automatic classification supplier proposal
|
||||
'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL'=>array(
|
||||
'family'=>'classify_supplier_proposal',
|
||||
'position'=>60,
|
||||
'enabled'=>(isModEnabled('supplier_proposal') && (isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))),
|
||||
'picto'=>'supplier_proposal',
|
||||
'warning'=>''
|
||||
'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL' => array(
|
||||
'family' => 'classify_supplier_proposal',
|
||||
'position' => 60,
|
||||
'enabled' => (isModEnabled('supplier_proposal') && (isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))),
|
||||
'picto' => 'supplier_proposal',
|
||||
'warning' => ''
|
||||
),
|
||||
|
||||
// Automatic classification supplier order
|
||||
'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION'=>array(
|
||||
'family'=>'classify_supplier_order',
|
||||
'position'=>63,
|
||||
'enabled'=>(getDolGlobalString('MAIN_FEATURES_LEVEL') && isModEnabled("reception") && isModEnabled('supplier_order')),
|
||||
'picto'=>'supplier_order',
|
||||
'warning'=>''
|
||||
'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION' => array(
|
||||
'family' => 'classify_supplier_order',
|
||||
'position' => 63,
|
||||
'enabled' => (getDolGlobalString('MAIN_FEATURES_LEVEL') && isModEnabled("reception") && isModEnabled('supplier_order')),
|
||||
'picto' => 'supplier_order',
|
||||
'warning' => ''
|
||||
),
|
||||
|
||||
'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION_CLOSED'=>array(
|
||||
'family'=>'classify_supplier_order',
|
||||
'position'=>64,
|
||||
'enabled'=>(getDolGlobalString('MAIN_FEATURES_LEVEL') && isModEnabled("reception") && isModEnabled('supplier_order')),
|
||||
'picto'=>'supplier_order',
|
||||
'warning'=>''
|
||||
'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION_CLOSED' => array(
|
||||
'family' => 'classify_supplier_order',
|
||||
'position' => 64,
|
||||
'enabled' => (getDolGlobalString('MAIN_FEATURES_LEVEL') && isModEnabled("reception") && isModEnabled('supplier_order')),
|
||||
'picto' => 'supplier_order',
|
||||
'warning' => ''
|
||||
),
|
||||
|
||||
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER'=>array(
|
||||
'family'=>'classify_supplier_order',
|
||||
'position'=>65,
|
||||
'enabled'=>(isModEnabled("supplier_order") || isModEnabled("supplier_invoice")),
|
||||
'picto'=>'supplier_order',
|
||||
'warning'=>''
|
||||
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER' => array(
|
||||
'family' => 'classify_supplier_order',
|
||||
'position' => 65,
|
||||
'enabled' => (isModEnabled("supplier_order") || isModEnabled("supplier_invoice")),
|
||||
'picto' => 'supplier_order',
|
||||
'warning' => ''
|
||||
),
|
||||
|
||||
// Automatic classification shipping
|
||||
@@ -188,7 +189,7 @@ $workflowcodes = array(
|
||||
),
|
||||
|
||||
|
||||
'separator2'=>array('family'=>'separator', 'position'=>400, 'enabled' => (isModEnabled('ticket') && isModEnabled('contract'))),
|
||||
'separator2' => array('family' => 'separator', 'position' => 400, 'enabled' => (isModEnabled('ticket') && isModEnabled('contract'))),
|
||||
|
||||
// Automatic link ticket -> contract
|
||||
'WORKFLOW_TICKET_LINK_CONTRACT' => array(
|
||||
@@ -212,9 +213,16 @@ if (!empty($conf->modules_parts['workflow']) && is_array($conf->modules_parts['w
|
||||
}
|
||||
|
||||
// remove not available workflows (based on activated modules and global defined keys)
|
||||
$workflowcodes = array_filter($workflowcodes, function ($var) {
|
||||
return $var['enabled'];
|
||||
});
|
||||
$workflowcodes = array_filter(
|
||||
$workflowcodes,
|
||||
/**
|
||||
* @param array{enabled:int<0,1>} $var
|
||||
* @return int<0,1>
|
||||
*/
|
||||
static function ($var) {
|
||||
return $var['enabled'];
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user