diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index 2f9b43c57db..36389fabeea 100755 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -1,8 +1,8 @@ * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2005-2011 Laurent Destailleur - * Copyright (C) 2005-2010 Regis Houssin + * 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 @@ -30,13 +30,14 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); $langs->load("admin"); $langs->load("workflow"); -if (!$user->admin) -accessforbidden(); +if (! $user->admin) accessforbidden(); + +$action = GETPOST('action', 'alpha'); /* * Actions */ -if (preg_match('/set(.*)/',$_GET["action"],$reg)) +if (preg_match('/set(.*)/',$action,$reg)) { $code=$reg[1]; if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0) @@ -50,7 +51,7 @@ if (preg_match('/set(.*)/',$_GET["action"],$reg)) } } -if (preg_match('/del(.*)/',$_GET["action"],$reg)) +if (preg_match('/del(.*)/',$action,$reg)) { $code=$reg[1]; if (dolibarr_del_const($db, $code, $conf->entity) > 0) @@ -82,8 +83,8 @@ print "
"; // Choix du module de gestion des codes clients / fournisseurs -print "\n"; -print "\n"; +print '
'."\n"; +print ''."\n"; print ' '; print ' '; //print ' '; @@ -104,18 +105,27 @@ if (count($workflowcodes) > 0) $var = !$var; print "\n"; print "\n"; - if (! empty($conf->global->$code)) + print ''; + print ajax_constantonoff($code); } else { - print ''; + 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 ''; //print '
'.$langs->trans("Description").''.$langs->trans("Status").''.$langs->trans("Infos").'
".$langs->trans('desc'.$code)."'; + if ($conf->use_javascript_ajax) { - print ''; - print img_picto($langs->trans("Activated"),'switch_on'); - print ''; - print img_picto($langs->trans("Disabled"),'switch_off'); - print ''; //$s=$modCodeTiers->getToolTip($langs,$soc,-1); @@ -131,8 +141,8 @@ else } print '
'; +llxFooter(); $db->close(); -llxFooter(); ?> diff --git a/htdocs/core/ajax/constantonoff.php b/htdocs/core/ajax/constantonoff.php index ac2f244969a..3ed30274972 100644 --- a/htdocs/core/ajax/constantonoff.php +++ b/htdocs/core/ajax/constantonoff.php @@ -47,10 +47,10 @@ print '