From 673fbc457d9278c61073b5e648cb3403fa670714 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 23 Feb 2012 20:42:25 +0100 Subject: [PATCH] Fix: add debug mode and change with new module parts management --- htdocs/admin/const.php | 13 +++++++------ htdocs/core/modules/modWorkflow.class.php | 15 ++++++--------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 3abb32d20c3..b7a69dddd26 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2005-2011 Regis Houssin + * 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 @@ -31,6 +31,7 @@ $langs->load("admin"); if (! $user->admin) accessforbidden(); $action = GETPOST('action'); +$debug = GETPOST('debug'); $typeconst=array('yesno','texte','chaine'); @@ -182,7 +183,7 @@ print ''; print ''; print "\n"; -print '
'; +print 'entity) && $debug)?'?debug=1':'').'" method="POST">'; print ''; // Show constants @@ -195,7 +196,8 @@ $sql.= ", note"; $sql.= ", entity"; $sql.= " FROM ".MAIN_DB_PREFIX."const"; $sql.= " WHERE entity IN (".$user->entity.",".$conf->entity.")"; -if ($user->entity || empty($conf->multicompany->enabled)) $sql.= " AND visible = 1"; +if (empty($user->entity) && $debug) {} // to force for superadmin +elseif ($user->entity || empty($conf->multicompany->enabled)) $sql.= " AND visible = 1"; $sql.= " ORDER BY entity, name ASC"; dol_syslog("Const::listConstant sql=".$sql); @@ -249,7 +251,7 @@ if ($result) } else { - print ''.img_delete().''; + print ''.img_delete().''; } print "\n"; @@ -275,8 +277,7 @@ if ($conf->use_javascript_ajax) print "
\n"; +llxFooter(); $db->close(); - -llxFooter(); ?> diff --git a/htdocs/core/modules/modWorkflow.class.php b/htdocs/core/modules/modWorkflow.class.php index 68887d57543..b9af9acc789 100644 --- a/htdocs/core/modules/modWorkflow.class.php +++ b/htdocs/core/modules/modWorkflow.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2010 Laurent Destailleur +/* Copyright (C) 2010-2012 Regis Houssin + * Copyright (C) 2010 Laurent Destailleur * * 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 @@ -39,7 +39,7 @@ class modWorkflow extends DolibarrModules * * @param DoliDB $db Database handler */ - function modWorkflow($db) + function __construct($db) { $this->db = $db; @@ -65,17 +65,14 @@ class modWorkflow extends DolibarrModules // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module' $this->picto='technic'; - // Defined if the directory /mymodule/core/triggers/ contains triggers or not - $this->triggers = 1; - // Data directories to create when module is enabled $this->dirs = array("/workflow/temp"); - // Relative path to module style sheet if exists. Example: '/mymodule/mycss.css'. - $this->style_sheet = ''; - // Config pages. Put here list of php page names stored in admmin directory used to setup module. $this->config_page_url = 'workflow.php'; + + // Defined all module parts (triggers, login, substitutions, menus, css, etc...) + $this->module_parts = array('triggers' => 1); // Dependencies $this->depends = array(); // List of modules id that must be enabled if this module is enabled