27 require
'../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
34 $langs->loadLangs(array(
"admin",
"workflow",
"propal",
"workflow",
"orders",
"supplier_proposal",
"receptions",
"errors"));
36 $action =
GETPOST(
'action',
'aZ09');
43 if (preg_match(
'/set(.*)/', $action, $reg)) {
49 if (preg_match(
'/del(.*)/', $action, $reg)) {
58 $workflowcodes = array(
60 'WORKFLOW_PROPAL_AUTOCREATE_ORDER'=>array(
63 'enabled'=>(!empty($conf->propal->enabled) && !empty($conf->commande->enabled)),
66 'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array(
69 'enabled'=>(!empty($conf->commande->enabled) && !empty($conf->facture->enabled)),
73 'separator1'=>array(
'family'=>
'separator',
'position'=>25),
76 'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array(
77 'family'=>
'classify_proposal',
79 'enabled'=>(!empty($conf->propal->enabled) && !empty($conf->commande->enabled)),
83 'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL'=>array(
84 'family'=>
'classify_proposal',
86 'enabled'=>(!empty($conf->propal->enabled) && !empty($conf->facture->enabled)),
92 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING'=>array(
93 'family'=>
'classify_order',
95 'enabled'=>(!empty($conf->expedition->enabled) && !empty($conf->commande->enabled)),
98 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array(
99 'family'=>
'classify_order',
101 'enabled'=>(!empty($conf->facture->enabled) && !empty($conf->commande->enabled)),
106 'separator2'=>array(
'family'=>
'separator',
'position'=>50),
109 'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL'=>array(
110 'family'=>
'classify_supplier_proposal',
112 '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))),
118 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER'=>array(
119 'family'=>
'classify_supplier_order',
121 'enabled'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)),
127 'WORKFLOW_BILL_ON_RECEPTION'=>array(
128 'family'=>
'classify_reception',
130 '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))),
135 if (!empty($conf->modules_parts[
'workflow']) && is_array($conf->modules_parts[
'workflow'])) {
136 foreach ($conf->modules_parts[
'workflow'] as $workflow) {
137 $workflowcodes = array_merge($workflowcodes, $workflow);
142 $workflowcodes = array_filter($workflowcodes,
function ($var) {
143 return $var[
'enabled']; });
149 llxHeader(
'', $langs->trans(
"WorkflowSetup"),
"EN:Module_Workflow_En|FR:Module_Workflow|ES:Módulo_Workflow");
151 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
154 print '<span class="opacitymedium">'.$langs->trans(
"WorkflowDesc").
'</span>';
159 if (count($workflowcodes) < 1) {
160 print $langs->trans(
"ThereIsNoWorkflowToModify");
170 print '<table class="noborder centpercent">';
174 foreach ($workflowcodes as $key => $params) {
175 if ($params[
'family'] ==
'separator') {
178 print '<table class="noborder centpercent">';
183 if ($oldfamily != $params[
'family']) {
184 if ($params[
'family'] ==
'create') {
185 $header = $langs->trans(
"AutomaticCreation");
186 } elseif (preg_match(
'/classify_(.*)/', $params[
'family'], $reg)) {
187 $header = $langs->trans(
"AutomaticClassification");
188 if ($reg[1] ==
'proposal') $header .=
' - '.$langs->trans(
'Proposal');
189 if ($reg[1] ==
'order') $header .=
' - '.$langs->trans(
'Order');
190 if ($reg[1] ==
'supplier_proposal') $header .=
' - '.$langs->trans(
'SupplierProposal');
191 if ($reg[1] ==
'supplier_order') $header .=
' - '.$langs->trans(
'SupplierOrder');
192 if ($reg[1] ==
'reception') $header .=
' - '.$langs->trans(
'Reception');
194 $header = $langs->trans(
"Description");
197 print '<tr class="liste_titre">';
198 print '<th>'.$header.
'</th>';
199 print '<th align="center">'.$langs->trans(
"Status").
'</th>';
202 $oldfamily = $params[
'family'];
205 print '<tr class="oddeven">';
208 print ' '.$langs->trans(
'desc'.$key);
210 if (!empty($params[
'warning'])) {
211 print ' '.img_warning($langs->transnoentitiesnoconv($params[
'warning']));
216 print '<td class="center">';
218 if (!empty($conf->use_javascript_ajax)) {
221 if (!empty($conf->global->$key)) {
222 print '<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=del'.$key.
'&token='.
newToken().
'">';
226 print '<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=set'.$key.
'&token='.
newToken().
'">';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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).
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
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)
On/off button for constant.
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 ...
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...
print
Draft customers invoices.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
newToken()
Return the value of token currently saved into session with name 'newtoken'.