28require
'../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
37$langs->loadLangs(array(
"admin",
"workflow",
"propal",
"workflow",
"orders",
"supplier_proposal",
"receptions",
"errors",
'sendings'));
39$action =
GETPOST(
'action',
'aZ09');
46if (preg_match(
'/set(.*)/', $action, $reg)) {
52if (preg_match(
'/del(.*)/', $action, $reg)) {
61$workflowcodes = array(
63 'WORKFLOW_PROPAL_AUTOCREATE_ORDER'=>array(
66 'enabled'=>(isModEnabled(
"propal") && isModEnabled(
'commande')),
69 'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array(
72 'enabled'=>(isModEnabled(
'commande') && isModEnabled(
'facture')),
75 'WORKFLOW_TICKET_CREATE_INTERVENTION' => array(
78 'enabled'=>(isModEnabled(
'ticket') && isModEnabled(
'ficheinter')),
82 'separator1'=>array(
'family'=>
'separator',
'position'=>25,
'title'=>
'',
'enabled'=>((isModEnabled(
"propal") && isModEnabled(
'commande')) || (isModEnabled(
'commande') && isModEnabled(
'facture')) || (isModEnabled(
'ticket') && isModEnabled(
'ficheinter')))),
85 'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array(
86 'family'=>
'classify_proposal',
88 'enabled'=>(isModEnabled(
"propal") && isModEnabled(
'commande')),
92 'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL'=>array(
93 'family'=>
'classify_proposal',
95 'enabled'=>(isModEnabled(
"propal") && isModEnabled(
'facture')),
101 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING'=>array(
102 'family'=>
'classify_order',
104 'enabled'=>(isModEnabled(
"expedition") && isModEnabled(
'commande')),
107 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED'=>array(
108 'family'=>
'classify_order',
110 'enabled'=>(isModEnabled(
"expedition") && isModEnabled(
'commande')),
113 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array(
114 'family'=>
'classify_order',
116 'enabled'=>(isModEnabled(
'facture') && isModEnabled(
'commande')),
122 'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL'=>array(
123 'family'=>
'classify_supplier_proposal',
125 'enabled'=>(isModEnabled(
'supplier_proposal') && (isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice"))),
126 'picto'=>
'supplier_proposal',
131 'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION'=>array(
132 'family'=>
'classify_supplier_order',
134 'enabled'=>(
getDolGlobalString(
'MAIN_FEATURES_LEVEL') && isModEnabled(
"reception") && isModEnabled(
'supplier_order')),
135 'picto'=>
'supplier_order',
139 'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION_CLOSED'=>array(
140 'family'=>
'classify_supplier_order',
142 'enabled'=>(
getDolGlobalString(
'MAIN_FEATURES_LEVEL') && isModEnabled(
"reception") && isModEnabled(
'supplier_order')),
143 'picto'=>
'supplier_order',
147 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER'=>array(
148 'family'=>
'classify_supplier_order',
150 'enabled'=>(isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice")),
151 'picto'=>
'supplier_order',
166 'WORKFLOW_SHIPPING_CLASSIFY_BILLED_INVOICE' => array(
167 'family' =>
'classify_shipping',
169 'enabled' => isModEnabled(
"expedition") && isModEnabled(
"facture") &&
getDolGlobalString(
'WORKFLOW_BILL_ON_SHIPMENT') !==
'0',
170 'picto' =>
'shipment'
183 'WORKFLOW_RECEPTION_CLASSIFY_BILLED_INVOICE' => array(
184 'family' =>
'classify_reception',
186 'enabled' => isModEnabled(
"reception") && isModEnabled(
"supplier_invoice") &&
getDolGlobalString(
'WORKFLOW_BILL_ON_RECEPTION') !==
'0',
187 'picto' =>
'shipment'
191 'separator2'=>array(
'family'=>
'separator',
'position'=>400,
'enabled' => (isModEnabled(
'ticket') && isModEnabled(
'contract'))),
194 'WORKFLOW_TICKET_LINK_CONTRACT' => array(
195 'family' =>
'link_ticket',
197 'enabled' => (isModEnabled(
'ticket') && isModEnabled(
'contract')),
200 'WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS' => array(
201 'family' =>
'link_ticket',
203 'enabled' => (isModEnabled(
'ticket') && isModEnabled(
'contract')),
208if (!empty($conf->modules_parts[
'workflow']) && is_array($conf->modules_parts[
'workflow'])) {
209 foreach ($conf->modules_parts[
'workflow'] as $workflow) {
210 $workflowcodes = array_merge($workflowcodes, $workflow);
215$workflowcodes = array_filter($workflowcodes,
function ($var) {
216 return $var[
'enabled'];
223llxHeader(
'', $langs->trans(
"WorkflowSetup"),
"EN:Module_Workflow_En|FR:Module_Workflow|ES:Módulo_Workflow");
225$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
226print
load_fiche_titre($langs->trans(
"WorkflowSetup"), $linkback,
'title_setup');
228print
'<span class="opacitymedium">'.$langs->trans(
"WorkflowDesc").
'</span>';
233if (count($workflowcodes) < 1) {
234 print $langs->trans(
"ThereIsNoWorkflowToModify");
244print
'<table class="noborder centpercent">';
248foreach ($workflowcodes as $key => $params) {
249 if ($params[
'family'] ==
'separator') {
253 print
'<table class="noborder centpercent">';
259 if ($oldfamily != $params[
'family']) {
260 if ($params[
'family'] ==
'create') {
261 $header = $langs->trans(
"AutomaticCreation");
262 } elseif (preg_match(
'/classify_(.*)/', $params[
'family'], $reg)) {
263 $header = $langs->trans(
"AutomaticClassification");
264 if ($reg[1] ==
'proposal') {
265 $header .=
' - '.$langs->trans(
'Proposal');
267 if ($reg[1] ==
'order') {
268 $header .=
' - '.$langs->trans(
'Order');
270 if ($reg[1] ==
'supplier_proposal') {
271 $header .=
' - '.$langs->trans(
'SupplierProposal');
273 if ($reg[1] ==
'supplier_order') {
274 $header .=
' - '.$langs->trans(
'SupplierOrder');
276 if ($reg[1] ==
'reception') {
277 $header .=
' - '.$langs->trans(
'Reception');
279 if ($reg[1] ==
'shipping') {
280 $header .=
' - '.$langs->trans(
'Shipment');
282 } elseif (preg_match(
'/link_(.*)/', $params[
'family'], $reg)) {
283 $header = $langs->trans(
"AutomaticLinking");
284 if ($reg[1] ==
'ticket') {
285 $header .=
' - '.$langs->trans(
'Ticket');
288 $header = $langs->trans(
"Description");
291 print
'<tr class="liste_titre">';
292 print
'<th>'.$header.
'</th>';
293 print
'<th class="right">'.$langs->trans(
"Status").
'</th>';
296 $oldfamily = $params[
'family'];
299 print
'<tr class="oddeven">';
301 print
img_object(
'', $params[
'picto'],
'class="pictofixedwidth"');
302 print
' '.$langs->trans(
'desc'.$key);
304 if (!empty($params[
'warning'])) {
305 print
' '.img_warning($langs->transnoentitiesnoconv($params[
'warning']));
307 if (!empty($params[
'deprecated'])) {
308 print
' '.img_warning($langs->transnoentitiesnoconv(
"Deprecated"));
313 print
'<td class="right">';
315 if (!empty($conf->use_javascript_ajax)) {
316 print ajax_constantonoff($key);
319 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=del'.$key.
'&token='.newToken().
'">';
320 print
img_picto($langs->trans(
"Activated"),
'switch_on');
323 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=set'.$key.
'&token='.newToken().
'">';
324 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($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $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 second index function, which produces ascending (default) or descending output...
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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.