diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index a58c3378ecd..da82f163a7f 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -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"); } diff --git a/htdocs/core/modules/modWorkflow.class.php b/htdocs/core/modules/modWorkflow.class.php index 4122f347664..dc05bf9dc66 100644 --- a/htdocs/core/modules/modWorkflow.class.php +++ b/htdocs/core/modules/modWorkflow.class.php @@ -93,7 +93,9 @@ class modWorkflow extends DolibarrModules 6=>array('WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION', 'chaine', '1', 'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION', 0, 'current', 0), 7=>array('WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION_CLOSED', 'chaine', '1', 'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION_CLOSED', 0, 'current', 0), 8=>array('WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER', 'chaine', '1', 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER', 0, 'current', 0), - 9=>array('WORKFLOW_BILL_ON_RECEPTION', 'chaine', '1', 'WORKFLOW_BILL_ON_RECEPTION', 0, 'current', 0) + 9=>array('WORKFLOW_BILL_ON_RECEPTION', 'chaine', '1', 'WORKFLOW_BILL_ON_RECEPTION', 0, 'current', 0), + 10=>array('WORKFLOW_TICKET_LINK_CONTRACT', 'chaine', '0', 'Automatically link a ticket to available contracts', 0, 'current', 0), + 11=>array('WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS', 'chaine', '0', 'Search among parent companies contracts when automatically linking a ticket to available contracts', 0, 'current', 0) ); // Boxes diff --git a/htdocs/langs/en_US/workflow.lang b/htdocs/langs/en_US/workflow.lang index b65f8449fef..6ddf8d9c6a3 100644 --- a/htdocs/langs/en_US/workflow.lang +++ b/htdocs/langs/en_US/workflow.lang @@ -22,9 +22,14 @@ descWORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION=Classify linked source purchase o descWORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION_CLOSED=Classify linked source purchase order as received when a reception is closed (and if the quantity received by all rceptions is the same as in the purchase order to update) # Autoclassify purchase invoice descWORKFLOW_BILL_ON_RECEPTION=Classify receptions to "billed" when a linked supplier order is validated +# Automatically link ticket to contract +descWORKFLOW_TICKET_LINK_CONTRACT=When creating a ticket, link available contracts of matching thirdparty +descWORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS=When linking contracts, search among those of parents companies # Autoclose intervention descWORKFLOW_TICKET_CLOSE_INTERVENTION=Close all interventions linked to the ticket when a ticket is closed AutomaticCreation=Automatic creation AutomaticClassification=Automatic classification # Autoclassify shipment -descWORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE=Classify linked source shipment as closed when customer invoice is validated \ No newline at end of file +descWORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE=Classify linked source shipment as closed when customer invoice is validated +AutomaticClosing=Automatic closing +AutomaticLinking=Automatic linking