add options in workflow admin panel : WORKFLOW_TICKET_LINK_CONTRACT, WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS

This commit is contained in:
Thomas Negre
2022-02-08 11:54:52 +01:00
parent 90ab7da40d
commit 8d997de3bb
3 changed files with 29 additions and 3 deletions

View File

@@ -161,7 +161,21 @@ $workflowcodes = array(
'position' => 90,
'enabled' => ! empty($conf->expedition->enabled) && ! empty($conf->facture->enabled),
'picto' => 'shipment'
)
),
// Automatic link ticket -> contract
'WORKFLOW_TICKET_LINK_CONTRACT' => array(
'family' => 'link_ticket',
'position' => 75,
'enabled' => ! empty($conf->ticket->enabled) && ! empty($conf->contract->enabled),
'picto' => 'ticket'
),
'WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS' => array(
'family' => 'link_ticket',
'position' => 76,
'enabled' => ! empty($conf->ticket->enabled) && ! empty($conf->contract->enabled),
'picto' => 'ticket'
),
);
if (!empty($conf->modules_parts['workflow']) && is_array($conf->modules_parts['workflow'])) {
@@ -237,6 +251,11 @@ foreach ($workflowcodes as $key => $params) {
if ($reg[1] == 'shipping') {
$header .= ' - '.$langs->trans('Shipment');
}
} elseif (preg_match('/link_(.*)/', $params['family'], $reg)) {
$header = $langs->trans("AutomaticLinking");
if ($reg[1] == 'ticket') {
$header .= ' - '.$langs->trans('Ticket');
}
} else {
$header = $langs->trans("Description");
}