Go to the documentation of this file.
27 require
'../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
36 $langs->loadLangs(array(
"admin",
"workflow",
"propal",
"workflow",
"orders",
"supplier_proposal",
"receptions",
"errors",
'sendings'));
38 $action =
GETPOST(
'action',
'aZ09');
45 if (preg_match(
'/set(.*)/', $action, $reg)) {
51 if (preg_match(
'/del(.*)/', $action, $reg)) {
60 $workflowcodes = array(
62 'WORKFLOW_PROPAL_AUTOCREATE_ORDER'=>array(
65 'enabled'=>(!empty($conf->propal->enabled) && !empty($conf->commande->enabled)),
68 'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array(
71 'enabled'=>(!empty($conf->commande->enabled) &&
isModEnabled(
'facture')),
74 'WORKFLOW_TICKET_CREATE_INTERVENTION' => array (
77 'enabled'=>(!empty($conf->ticket->enabled) && !empty($conf->ficheinter->enabled)),
81 'separator1'=>array(
'family'=>
'separator',
'position'=>25,
'title'=>
''),
84 'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array(
85 'family'=>
'classify_proposal',
87 'enabled'=>(!empty($conf->propal->enabled) && !empty($conf->commande->enabled)),
91 'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL'=>array(
92 'family'=>
'classify_proposal',
94 'enabled'=>(!empty($conf->propal->enabled) &&
isModEnabled(
'facture')),
100 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING'=>array(
101 'family'=>
'classify_order',
103 'enabled'=>(!empty($conf->expedition->enabled) && !empty($conf->commande->enabled)),
106 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED'=>array(
107 'family'=>
'classify_order',
109 'enabled'=>(!empty($conf->expedition->enabled) && !empty($conf->commande->enabled)),
112 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array(
113 'family'=>
'classify_order',
115 'enabled'=>(
isModEnabled(
'facture') && !empty($conf->commande->enabled)),
120 'separator2'=>array(
'family'=>
'separator',
'position'=>50),
123 'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL'=>array(
124 'family'=>
'classify_supplier_proposal',
126 'enabled'=>(!empty($conf->supplier_proposal->enabled) && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))),
127 'picto'=>
'supplier_proposal',
132 'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION'=>array(
133 'family'=>
'classify_supplier_order',
135 'enabled'=>(!empty($conf->global->MAIN_FEATURES_LEVEL) && (!empty($conf->reception->enabled)) && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled))),
136 'picto'=>
'supplier_order',
140 'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION_CLOSED'=>array(
141 'family'=>
'classify_supplier_order',
143 'enabled'=>(!empty($conf->global->MAIN_FEATURES_LEVEL) && (!empty($conf->reception->enabled)) && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled))),
144 'picto'=>
'supplier_order',
148 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER'=>array(
149 'family'=>
'classify_supplier_order',
151 'enabled'=>((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)),
152 'picto'=>
'supplier_order',
157 'WORKFLOW_BILL_ON_RECEPTION'=>array(
158 'family'=>
'classify_reception',
160 'enabled'=>(!empty($conf->reception->enabled) && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))),
165 'WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE' => array(
166 'family' =>
'classify_shipping',
168 'enabled' => !empty($conf->expedition->enabled) && !empty($conf->facture->enabled),
169 'picto' =>
'shipment'
173 'WORKFLOW_TICKET_LINK_CONTRACT' => array(
174 'family' =>
'link_ticket',
176 'enabled' => !empty($conf->ticket->enabled) && !empty($conf->contract->enabled),
179 'WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS' => array(
180 'family' =>
'link_ticket',
182 'enabled' => !empty($conf->ticket->enabled) && !empty($conf->contract->enabled),
187 if (!empty($conf->modules_parts[
'workflow']) && is_array($conf->modules_parts[
'workflow'])) {
188 foreach ($conf->modules_parts[
'workflow'] as $workflow) {
189 $workflowcodes = array_merge($workflowcodes, $workflow);
194 $workflowcodes = array_filter($workflowcodes,
function ($var) {
195 return $var[
'enabled'];
202 llxHeader(
'', $langs->trans(
"WorkflowSetup"),
"EN:Module_Workflow_En|FR:Module_Workflow|ES:Módulo_Workflow");
204 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
205 print
load_fiche_titre($langs->trans(
"WorkflowSetup"), $linkback,
'title_setup');
207 print
'<span class="opacitymedium">'.$langs->trans(
"WorkflowDesc").
'</span>';
212 if (count($workflowcodes) < 1) {
213 print $langs->trans(
"ThereIsNoWorkflowToModify");
223 print
'<table class="noborder centpercent">';
227 foreach ($workflowcodes as $key => $params) {
228 if ($params[
'family'] ==
'separator') {
232 print
'<table class="noborder centpercent">';
237 if ($oldfamily != $params[
'family']) {
238 if ($params[
'family'] ==
'create') {
239 $header = $langs->trans(
"AutomaticCreation");
240 } elseif (preg_match(
'/classify_(.*)/', $params[
'family'], $reg)) {
241 $header = $langs->trans(
"AutomaticClassification");
242 if ($reg[1] ==
'proposal') {
243 $header .=
' - '.$langs->trans(
'Proposal');
245 if ($reg[1] ==
'order') {
246 $header .=
' - '.$langs->trans(
'Order');
248 if ($reg[1] ==
'supplier_proposal') {
249 $header .=
' - '.$langs->trans(
'SupplierProposal');
251 if ($reg[1] ==
'supplier_order') {
252 $header .=
' - '.$langs->trans(
'SupplierOrder');
254 if ($reg[1] ==
'reception') {
255 $header .=
' - '.$langs->trans(
'Reception');
257 if ($reg[1] ==
'shipping') {
258 $header .=
' - '.$langs->trans(
'Shipment');
260 } elseif (preg_match(
'/link_(.*)/', $params[
'family'], $reg)) {
261 $header = $langs->trans(
"AutomaticLinking");
262 if ($reg[1] ==
'ticket') {
263 $header .=
' - '.$langs->trans(
'Ticket');
266 $header = $langs->trans(
"Description");
269 print
'<tr class="liste_titre">';
270 print
'<th>'.$header.
'</th>';
271 print
'<th align="center">'.$langs->trans(
"Status").
'</th>';
274 $oldfamily = $params[
'family'];
277 print
'<tr class="oddeven">';
279 print
img_object(
'', $params[
'picto'],
'class="pictofixedwidth"');
280 print
' '.$langs->trans(
'desc'.$key);
282 if (!empty($params[
'warning'])) {
283 print
' '.img_warning($langs->transnoentitiesnoconv($params[
'warning']));
288 print
'<td class="center">';
290 if (!empty($conf->use_javascript_ajax)) {
293 if (!empty($conf->global->$key)) {
294 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=del'.$key.
'&token='.
newToken().
'">';
295 print
img_picto($langs->trans(
"Activated"),
'switch_on');
298 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=set'.$key.
'&token='.
newToken().
'">';
299 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0, $forcereload=0, $marginleftonlyshort=2, $forcenoajax=0, $setzeroinsteadofdel=0, $suffix='', $mode='')
On/off button for constant.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
isModEnabled($module)
Is Dolibarr module enabled.
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.