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'=>(!empty($conf->global->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'=>(!empty($conf->global->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',
156 'WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE' => array(
157 'family' =>
'classify_shipping',
159 'enabled' => isModEnabled(
"expedition") && isModEnabled(
"facture"),
160 'picto' =>
'shipment'
164 'WORKFLOW_RECEPTION_CLASSIFY_CLOSED_INVOICE'=>array(
165 'family'=>
'classify_reception',
167 'enabled'=>(isModEnabled(
"reception") && (isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice"))),
171 'separator2'=>array(
'family'=>
'separator',
'position'=>400,
'enabled' => (isModEnabled(
'ticket') && isModEnabled(
'contract'))),
174 'WORKFLOW_TICKET_LINK_CONTRACT' => array(
175 'family' =>
'link_ticket',
177 'enabled' => (isModEnabled(
'ticket') && isModEnabled(
'contract')),
180 'WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS' => array(
181 'family' =>
'link_ticket',
183 'enabled' => (isModEnabled(
'ticket') && isModEnabled(
'contract')),
188if (!empty($conf->modules_parts[
'workflow']) && is_array($conf->modules_parts[
'workflow'])) {
189 foreach ($conf->modules_parts[
'workflow'] as $workflow) {
190 $workflowcodes = array_merge($workflowcodes, $workflow);
195$workflowcodes = array_filter($workflowcodes,
function ($var) {
196 return $var[
'enabled'];
203llxHeader(
'', $langs->trans(
"WorkflowSetup"),
"EN:Module_Workflow_En|FR:Module_Workflow|ES:Módulo_Workflow");
205$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
206print
load_fiche_titre($langs->trans(
"WorkflowSetup"), $linkback,
'title_setup');
208print
'<span class="opacitymedium">'.$langs->trans(
"WorkflowDesc").
'</span>';
213if (count($workflowcodes) < 1) {
214 print $langs->trans(
"ThereIsNoWorkflowToModify");
224print
'<table class="noborder centpercent">';
228foreach ($workflowcodes as $key => $params) {
229 if ($params[
'family'] ==
'separator') {
233 print
'<table class="noborder centpercent">';
239 if ($oldfamily != $params[
'family']) {
240 if ($params[
'family'] ==
'create') {
241 $header = $langs->trans(
"AutomaticCreation");
242 } elseif (preg_match(
'/classify_(.*)/', $params[
'family'], $reg)) {
243 $header = $langs->trans(
"AutomaticClassification");
244 if ($reg[1] ==
'proposal') {
245 $header .=
' - '.$langs->trans(
'Proposal');
247 if ($reg[1] ==
'order') {
248 $header .=
' - '.$langs->trans(
'Order');
250 if ($reg[1] ==
'supplier_proposal') {
251 $header .=
' - '.$langs->trans(
'SupplierProposal');
253 if ($reg[1] ==
'supplier_order') {
254 $header .=
' - '.$langs->trans(
'SupplierOrder');
256 if ($reg[1] ==
'reception') {
257 $header .=
' - '.$langs->trans(
'Reception');
259 if ($reg[1] ==
'shipping') {
260 $header .=
' - '.$langs->trans(
'Shipment');
262 } elseif (preg_match(
'/link_(.*)/', $params[
'family'], $reg)) {
263 $header = $langs->trans(
"AutomaticLinking");
264 if ($reg[1] ==
'ticket') {
265 $header .=
' - '.$langs->trans(
'Ticket');
268 $header = $langs->trans(
"Description");
271 print
'<tr class="liste_titre">';
272 print
'<th>'.$header.
'</th>';
273 print
'<th class="right">'.$langs->trans(
"Status").
'</th>';
276 $oldfamily = $params[
'family'];
279 print
'<tr class="oddeven">';
281 print
img_object(
'', $params[
'picto'],
'class="pictofixedwidth"');
282 print
' '.$langs->trans(
'desc'.$key);
284 if (!empty($params[
'warning'])) {
285 print
' '.img_warning($langs->transnoentitiesnoconv($params[
'warning']));
290 print
'<td class="right">';
292 if (!empty($conf->use_javascript_ajax)) {
293 print ajax_constantonoff($key);
295 if (!empty($conf->global->$key)) {
296 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=del'.$key.
'&token='.newToken().
'">';
297 print
img_picto($langs->trans(
"Activated"),
'switch_on');
300 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=set'.$key.
'&token='.newToken().
'">';
301 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.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.