diff --git a/htdocs/admin/debugbar.php b/htdocs/admin/debugbar.php new file mode 100644 index 00000000000..c55de38f5e2 --- /dev/null +++ b/htdocs/admin/debugbar.php @@ -0,0 +1,103 @@ + + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2007 Rodolphe Quiedeville + * Copyright (C) 2013 Juanjo Menent + * + * 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 3 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/debugbar.php + * \ingroup debugbar + * \brief Setup page for debugbar module + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; + +global $conf; + +if (!$user->admin) accessforbidden(); + +// Load translation files required by the page +$langs->loadLangs(array("admin","other")); + +$error=0; +$action = GETPOST('action', 'aZ09'); + + +/* + * Actions + */ + +// Set modes +if ($action == 'set') +{ + $db->begin(); + + $result = dolibarr_set_const($db, "DEBUGBAR_LOGS_LINES_NUMBER", GETPOST('DEBUGBAR_LOGS_LINES_NUMBER', 'int'), 'chaine', 0, '', 0); + if ($result < 0) + { + $error++; + } + + if (! $error) + { + $db->commit(); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + $db->rollback(); + setEventMessages($error, $errors, 'errors'); + } +} + + +/* + * View + */ + +llxHeader(); + +$form=new Form($db); + +$linkback=''.$langs->trans("BackToModuleList").''; +print load_fiche_titre($langs->trans("DebugBarSetup"), $linkback, 'title_setup'); +print '
'; + +//print load_fiche_titre($langs->trans("DebugBar")); + +// Level +print '
'; +print ''; +print ''; + +print ''; +print ''; +print ''; +print ''; +print "\n"; + +print ''; +print ''; + +print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("DEBUGBAR_LOGS_LINES_NUMBER").''; +print '
'; +print "
\n"; + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index 2d6b68fcb93..69c2c48ffca 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -269,7 +269,7 @@ print '
'."\n\n"; print load_fiche_titre($langs->trans("SyslogLevel")); // Level -print '
'; +print ''; print ''; print ''; print ''; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 600c4f7b57a..39978cd82d1 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -687,14 +687,14 @@ if ($resql) if (! empty($arrayfields['f.ref']['checked'])) { print ''; } // Ref customer if (! empty($arrayfields['f.ref_client']['checked'])) { print ''; } // Type @@ -737,22 +737,22 @@ if ($resql) // Project if (! empty($arrayfields['p.ref']['checked'])) { - print ''; + print ''; } // Thirpdarty if (! empty($arrayfields['s.nom']['checked'])) { - print ''; + print ''; } // Town - if (! empty($arrayfields['s.town']['checked'])) print ''; + if (! empty($arrayfields['s.town']['checked'])) print ''; // Zip - if (! empty($arrayfields['s.zip']['checked'])) print ''; + if (! empty($arrayfields['s.zip']['checked'])) print ''; // State if (! empty($arrayfields['state.nom']['checked'])) { print ''; } // Country @@ -780,35 +780,35 @@ if ($resql) { // Amount print ''; } if (! empty($arrayfields['f.total_vat']['checked'])) { // Amount print ''; } if (! empty($arrayfields['f.total_localtax1']['checked'])) { // Localtax1 print ''; } if (! empty($arrayfields['f.total_localtax2']['checked'])) { // Localtax2 print ''; } if (! empty($arrayfields['f.total_ttc']['checked'])) { // Amount print ''; } if (! empty($arrayfields['dynamount_payed']['checked'])) diff --git a/htdocs/core/modules/modDebugBar.class.php b/htdocs/core/modules/modDebugBar.class.php index eae80e428b1..6592ecb5acf 100644 --- a/htdocs/core/modules/modDebugBar.class.php +++ b/htdocs/core/modules/modDebugBar.class.php @@ -48,7 +48,7 @@ class modDebugBar extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i', '', get_class($this)); - $this->description = "Debug bar"; + $this->description = "A tool for developper adding a debug bar in your browser."; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version $this->version = 'dolibarr'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); @@ -75,7 +75,7 @@ class modDebugBar extends DolibarrModules $this->requiredby = array(); // Config pages - $this->config_page_url = array(); + $this->config_page_url = array("debugbar.php"); // Constants // Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',0), diff --git a/htdocs/debugbar/class/DataCollector/DolLogsCollector.php b/htdocs/debugbar/class/DataCollector/DolLogsCollector.php index 9aa57c6b003..74782b0b524 100644 --- a/htdocs/debugbar/class/DataCollector/DolLogsCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolLogsCollector.php @@ -32,7 +32,7 @@ class DolLogsCollector extends MessagesCollector parent::__construct($name); $this->path = $path ?: $this->getLogsFile(); - $this->lines = $conf->global->DEBUGBAR_LOGS_LINES_NUMBER ? $conf->global->DEBUGBAR_LOGS_LINES_NUMBER : 100; + $this->lines = $conf->global->DEBUGBAR_LOGS_LINES_NUMBER ? $conf->global->DEBUGBAR_LOGS_LINES_NUMBER : 1000; } /** diff --git a/htdocs/debugbar/class/DataCollector/DolMemoryCollector.php b/htdocs/debugbar/class/DataCollector/DolMemoryCollector.php index cbaa4efe0f4..4947ef73282 100644 --- a/htdocs/debugbar/class/DataCollector/DolMemoryCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolMemoryCollector.php @@ -17,6 +17,8 @@ class DolMemoryCollector extends MemoryCollector { global $langs; + $langs->load("other"); + return array( "memory" => array( "icon" => "cogs", diff --git a/htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php b/htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php index bfa1ed92e7a..e4d8e89159a 100644 --- a/htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php @@ -17,6 +17,8 @@ class DolRequestDataCollector extends RequestDataCollector { global $langs; + $langs->load("other"); + return array( $langs->transnoentities('Request') => array( "icon" => "tags", diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 46a3f039ac0..fbf37558a8e 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1865,6 +1865,8 @@ RootCategoryForProductsToSell=Root category of products to sell RootCategoryForProductsToSellDesc=If defined, only products inside this category or childs of this category will be available in the Point Of Sale DebugBar=Debug Bar DebugBarDesc=Toolbar that comes with a plenty of tools to simplify debugging +DebugBarSetup=DebugBar Setup GeneralOptions=General Options LogsLinesNumber=Number of lines to show on logs tab UseDebugBar=Use the debug bar +DEBUGBAR_LOGS_LINES_NUMBER=Number of last log lines to keep in console \ No newline at end of file diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index 1e3d95e4a3f..d85d7973305 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -266,3 +266,6 @@ WEBSITE_IMAGE=Image WEBSITE_IMAGEDesc=Relative path of the image media. You can keep this empty as this is rarely used (it can be used by dynamic content to show a preview of a list of blog posts). WEBSITE_KEYWORDS=Keywords LinesToImport=Lines to import + +MemoryUsage=Memory usage +RequestDuration=Duration of request \ No newline at end of file
'; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print '