29require
'../main.inc.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
38$langs->loadLangs(array(
"admin",
"workflow",
"propal",
"workflow",
"orders",
"supplier_proposal",
"receptions",
"errors",
'sendings'));
40$action =
GETPOST(
'action',
'aZ09');
47if (preg_match(
'/set(.*)/', $action, $reg)) {
53if (preg_match(
'/del(.*)/', $action, $reg)) {
62$workflowcodes = array(
64 'WORKFLOW_PROPAL_AUTOCREATE_ORDER' => array(
67 'enabled' => (isModEnabled(
"propal") && isModEnabled(
'order')),
70 'WORKFLOW_ORDER_AUTOCREATE_INVOICE' => array(
73 'enabled' => (isModEnabled(
'order') && isModEnabled(
'invoice')),
76 'WORKFLOW_TICKET_CREATE_INTERVENTION' => array(
79 'enabled' => (isModEnabled(
'ticket') && isModEnabled(
'intervention')),
83 'separator1' => array(
'family' =>
'separator',
'position' => 25,
'title' =>
'',
'enabled' => ((isModEnabled(
"propal") && isModEnabled(
'order')) || (isModEnabled(
'order') && isModEnabled(
'invoice')) || (isModEnabled(
'ticket') && isModEnabled(
'intervention')))),
86 'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL' => array(
87 'family' =>
'classify_proposal',
89 'enabled' => (isModEnabled(
"propal") && isModEnabled(
'order')),
93 'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL' => array(
94 'family' =>
'classify_proposal',
96 'enabled' => (isModEnabled(
"propal") && isModEnabled(
'invoice')),
102 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING' => array(
103 'family' =>
'classify_order',
105 'enabled' => (isModEnabled(
"shipping") && isModEnabled(
'order')),
108 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED' => array(
109 'family' =>
'classify_order',
111 'enabled' => (isModEnabled(
"shipping") && isModEnabled(
'order')),
114 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER' => array(
115 'family' =>
'classify_order',
117 'enabled' => (isModEnabled(
'invoice') && isModEnabled(
'order')),
122 'WORKFLOW_SUM_INVOICES_AMOUNT_CLASSIFY_BILLED_ORDER' => array(
123 'family' =>
'classify_order',
125 'enabled' => (isModEnabled(
'invoice') && isModEnabled(
'order')),
131 'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL' => array(
132 'family' =>
'classify_supplier_proposal',
134 'enabled' => (isModEnabled(
'supplier_proposal') && (isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice"))),
135 'picto' =>
'supplier_proposal',
140 'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION' => array(
141 'family' =>
'classify_supplier_order',
143 'enabled' => (
getDolGlobalString(
'MAIN_FEATURES_LEVEL') && isModEnabled(
"reception") && isModEnabled(
'supplier_order')),
144 'picto' =>
'supplier_order',
148 'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION_CLOSED' => array(
149 'family' =>
'classify_supplier_order',
151 'enabled' => (
getDolGlobalString(
'MAIN_FEATURES_LEVEL') && isModEnabled(
"reception") && isModEnabled(
'supplier_order')),
152 'picto' =>
'supplier_order',
156 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER' => array(
157 'family' =>
'classify_supplier_order',
159 'enabled' => (isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice")),
160 'picto' =>
'supplier_order',
175 'WORKFLOW_SHIPPING_CLASSIFY_BILLED_INVOICE' => array(
176 'family' =>
'classify_shipping',
178 'enabled' => isModEnabled(
"shipping") && isModEnabled(
"invoice") &&
getDolGlobalString(
'WORKFLOW_BILL_ON_SHIPMENT') !==
'0',
179 'picto' =>
'shipment'
192 'WORKFLOW_RECEPTION_CLASSIFY_BILLED_INVOICE' => array(
193 'family' =>
'classify_reception',
195 'enabled' => isModEnabled(
"reception") && isModEnabled(
"supplier_invoice") &&
getDolGlobalString(
'WORKFLOW_BILL_ON_RECEPTION') !==
'0',
196 'picto' =>
'shipment'
200 'separator2' => array(
'family' =>
'separator',
'position' => 400,
'enabled' => (isModEnabled(
'ticket') && isModEnabled(
'contract'))),
203 'WORKFLOW_TICKET_LINK_CONTRACT' => array(
204 'family' =>
'link_ticket',
206 'enabled' => (isModEnabled(
'ticket') && isModEnabled(
'contract')),
211 'WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS' => array(
212 'family' =>
'link_ticket',
214 'enabled' => (isModEnabled(
'ticket') && isModEnabled(
'contract') &&
getDolGlobalString(
'WORKFLOW_TICKET_LINK_CONTRACT')),
219if (!empty($conf->modules_parts[
'workflow']) && is_array($conf->modules_parts[
'workflow'])) {
220 foreach ($conf->modules_parts[
'workflow'] as $workflow) {
221 $workflowcodes = array_merge($workflowcodes, $workflow);
226$workflowcodes = array_filter(
232 static function ($var) {
233 return (
bool) $var[
'enabled'];
243llxHeader(
'', $langs->trans(
"WorkflowSetup"),
"EN:Module_Workflow_En|FR:Module_Workflow|ES:Módulo_Workflow",
'', 0, 0,
'',
'',
'',
'mod-admin page-workflow');
245$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
246print
load_fiche_titre($langs->trans(
"WorkflowSetup"), $linkback,
'title_setup');
248print
'<span class="opacitymedium">'.$langs->trans(
"WorkflowDesc").
'</span>';
253if (count($workflowcodes) < 1) {
254 print $langs->trans(
"ThereIsNoWorkflowToModify");
264print
'<table class="noborder centpercent">';
268foreach ($workflowcodes as $key => $params) {
269 if ($params[
'family'] ==
'separator') {
273 print
'<table class="noborder centpercent">';
279 if ($oldfamily != $params[
'family']) {
280 if ($params[
'family'] ==
'create') {
281 $header = $langs->trans(
"AutomaticCreation");
282 } elseif (preg_match(
'/classify_(.*)/', $params[
'family'], $reg)) {
283 $header = $langs->trans(
"AutomaticClassification");
284 if ($reg[1] ==
'proposal') {
285 $header .=
' - '.$langs->trans(
'Proposal');
287 if ($reg[1] ==
'order') {
288 $header .=
' - '.$langs->trans(
'Order');
290 if ($reg[1] ==
'supplier_proposal') {
291 $header .=
' - '.$langs->trans(
'SupplierProposal');
293 if ($reg[1] ==
'supplier_order') {
294 $header .=
' - '.$langs->trans(
'SupplierOrder');
296 if ($reg[1] ==
'reception') {
297 $header .=
' - '.$langs->trans(
'Reception');
299 if ($reg[1] ==
'shipping') {
300 $header .=
' - '.$langs->trans(
'Shipment');
302 } elseif (preg_match(
'/link_(.*)/', $params[
'family'], $reg)) {
303 $header = $langs->trans(
"AutomaticLinking");
304 if ($reg[1] ==
'ticket') {
305 $header .=
' - '.$langs->trans(
'Ticket');
308 $header = $langs->trans(
"Description");
311 print
'<tr class="liste_titre">';
312 print
'<th>'.$header.
'</th>';
313 print
'<th class="right">'.$langs->trans(
"Status").
'</th>';
316 $oldfamily = $params[
'family'];
319 print
'<tr class="oddeven">';
321 print
img_object(
'', $params[
'picto'],
'class="pictofixedwidth"');
322 print
' '.$langs->trans(
'desc'.$key);
324 if (!empty($params[
'warning'])) {
325 print
' '.img_warning($langs->transnoentitiesnoconv($params[
'warning']));
327 if (!empty($params[
'deprecated'])) {
328 print
' '.img_warning($langs->transnoentitiesnoconv(
"Deprecated"));
333 print
'<td class="right">';
335 if (!empty($conf->use_javascript_ajax)) {
336 if (!empty($params[
'reloadpage'])) {
337 print ajax_constantonoff($key, array(),
null, 0, 0, 1);
339 print ajax_constantonoff($key);
343 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=del'.$key.
'&token='.
newToken().
'">';
344 print
img_picto($langs->trans(
"Activated"),
'switch_on');
347 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=set'.$key.
'&token='.
newToken().
'">';
348 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
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).
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
newToken()
Return the value of token currently saved into session with name 'newtoken'.
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=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.