Go to the documentation of this file.
28 require
'../main.inc.php';
29 require_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');
46 if (preg_match(
'/set(.*)/', $action, $reg)) {
52 if (preg_match(
'/del(.*)/', $action, $reg)) {
61 $workflowcodes = array(
63 'WORKFLOW_PROPAL_AUTOCREATE_ORDER'=>array(
69 'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array(
75 'WORKFLOW_TICKET_CREATE_INTERVENTION' => array (
85 'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array(
86 'family'=>
'classify_proposal',
92 'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL'=>array(
93 'family'=>
'classify_proposal',
101 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING'=>array(
102 'family'=>
'classify_order',
107 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED'=>array(
108 'family'=>
'classify_order',
113 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array(
114 'family'=>
'classify_order',
122 'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL'=>array(
123 'family'=>
'classify_supplier_proposal',
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',
151 'picto'=>
'supplier_order',
156 'WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE' => array(
157 'family' =>
'classify_shipping',
160 'picto' =>
'shipment'
164 'WORKFLOW_EXPEDITION_CLASSIFY_CLOSED_INVOICE'=>array(
165 'family'=>
'classify_reception',
171 'separator2'=>array(
'family'=>
'separator',
'position'=>400,
'enabled' => (
isModEnabled(
'ticket') &&
isModEnabled(
'contract'))),
174 'WORKFLOW_TICKET_LINK_CONTRACT' => array(
175 'family' =>
'link_ticket',
180 'WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS' => array(
181 'family' =>
'link_ticket',
188 if (!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'];
203 llxHeader(
'', $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>';
206 print
load_fiche_titre($langs->trans(
"WorkflowSetup"), $linkback,
'title_setup');
208 print
'<span class="opacitymedium">'.$langs->trans(
"WorkflowDesc").
'</span>';
213 if (count($workflowcodes) < 1) {
214 print $langs->trans(
"ThereIsNoWorkflowToModify");
224 print
'<table class="noborder centpercent">';
228 foreach ($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)) {
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');
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...
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0, $forcereload=0, $marginleftonlyshort=2, $forcenoajax=0, $setzeroinsteadofdel=0, $suffix='', $mode='', $morecss='inline-block')
On/off button for constant.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
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.