From a138c1503a53bf2aaf6f832984c97a88feaaf88c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Feb 2016 07:04:07 +0100 Subject: [PATCH] Little cleaning on how options ar shown --- htdocs/admin/workflow.php | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index bdd84a50a7f..28feb8ab23e 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -69,21 +69,16 @@ print "
"; // List of workflow we can enable print ''."\n"; -print ''."\n"; -print ' '; -print ' '; -print "\n"; clearstatcache(); $workflowcodes=array( - 'WORKFLOW_PROPAL_AUTOCREATE_ORDER'=>array('enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order'), - 'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array('enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order','warning'=>'WarningCloseAlways'), - 'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array('enabled'=>'! empty($conf->commande->enabled) && ! empty($conf->facture->enabled)', 'picto'=>'bill'), + 'WORKFLOW_PROPAL_AUTOCREATE_ORDER'=>array('family'=>'create', 'position'=>10, 'enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order'), + 'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array('family'=>'create', 'position'=>20, 'enabled'=>'! empty($conf->commande->enabled) && ! empty($conf->facture->enabled)', 'picto'=>'bill'), + 'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array('family'=>'classify', 'position'=>30, 'enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order','warning'=>'WarningCloseAlways'), // For the following 2 options, if module invoice is disabled, they does not exists, so "Classify billed" for order must be done manually from order card. - 'WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER'=>array('enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'bill','warning'=>'WarningCloseAlways'), - 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array('enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'bill','warning'=>'WarningCloseAlways'), - + 'WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER'=>array('family'=>'classify', 'position'=>40, 'enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'bill','warning'=>'WarningCloseAlways'), + 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array('family'=>'classify', 'position'=>50, 'enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'bill','warning'=>'WarningCloseAlways'), ); if (! empty($conf->modules_parts['workflow']) && is_array($conf->modules_parts['workflow'])) @@ -94,16 +89,30 @@ if (! empty($conf->modules_parts['workflow']) && is_array($conf->modules_parts[' } } +// TODO We must sort on position here + $nbqualified=0; +$oldfamily=''; foreach($workflowcodes as $key => $params) { $picto=$params['picto']; $enabled=$params['enabled']; + $family=$params['family']; if (! verifCond($enabled)) continue; $nbqualified++; - $var = !$var; + + if ($oldfamily != $family) + { + print ''."\n"; + print ' '; + print ' '; + print "\n"; + $oldfamily = $family; + } + + $var = !$var; print "\n"; print "
'.$langs->trans("Description").''.$langs->trans("Status").'
'.$langs->trans("Description").''.$langs->trans("Status").'
".img_object('', $picto).$langs->trans('desc'.$key); if (! empty($params['warning']))