* Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * \file htdocs/admin/workflow.php * \ingroup company * \brief Workflows setup page */ require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); $langs->load("admin"); $langs->load("workflow"); if (! $user->admin) accessforbidden(); $action = GETPOST('action', 'alpha'); /* * Actions */ if (preg_match('/set(.*)/',$action,$reg)) { if (! dolibarr_set_const($db, $reg[1], 1, 'chaine', 0, '', $conf->entity) > 0) { dol_print_error($db); } } if (preg_match('/del(.*)/',$action,$reg)) { if (! dolibarr_del_const($db, $reg[1], $conf->entity) > 0) { dol_print_error($db); } } /* * View */ llxHeader('',$langs->trans("WorkflowSetup"),''); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("WorkflowSetup"),$linkback,'setup'); print $langs->trans("WorkflowDesc").'
'; print "
"; // List of workflow we can enable print ''."\n"; print ''."\n"; print ' '; print ' '; print "\n"; clearstatcache(); $workflowcodes=array(); $workflow=array( 'order' => array( 'propal' => array('WORKFLOW_PROPAL_AUTOCREATE_ORDER') //,'invoice' => array('WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER') ), 'invoice' => array ( 'order' => array('WORKFLOW_ORDER_AUTOCREATE_INVOICE') //,'contract' => array('WORKFLOW_CONTRACT_AUTOCREATE_INVOICE') //, 'propal' => array('WORKFLOW_PROPAL_AUTOCREATE_INVOICE') ) ); if (! empty($conf->modules_parts['workflow']) && is_array($conf->modules_parts['workflow'])) $workflow = array_merge($workflow, $conf->modules_parts['workflow']); foreach($workflow as $child => $parents) { if ($conf->$child->enabled) { $langs->Load($child.'@'.$child); foreach($parents as $parent => $actions) { if ($conf->$parent->enabled) { foreach($actions as $action) { $workflowcodes[$action] = $action; } } } } } if (count($workflowcodes) > 0) { foreach($workflowcodes as $code) { $var = !$var; print "\n"; print "\n"; print ''; print ''; } } else { print '
'.$langs->trans("Description").''.$langs->trans("Status").'
".$langs->trans('desc'.$code)."'; if ($conf->use_javascript_ajax) { print ajax_constantonoff($code); } else { if (! empty($conf->global->$code)) { print ''; print img_picto($langs->trans("Activated"),'switch_on'); print ''; } else { print ''; print img_picto($langs->trans("Disabled"),'switch_off'); print ''; } } print '
'.$langs->trans("ThereIsNoWorkflowToModify"); } print '
'; llxFooter(); $db->close(); ?>