Skip to content
Snippets Groups Projects
Commit 88742e41 authored by Regis Houssin's avatar Regis Houssin
Browse files

Merge branch 'develop' of git+ssh://git@github.com/Dolibarr/dolibarr.git into develop

parents 95c26501 bd5acde0
Branches
Tags
No related merge requests found
...@@ -62,6 +62,7 @@ For developers: ...@@ -62,6 +62,7 @@ For developers:
- New: Basic implementation of hooks and triggers for a lot (most) of core modules: - New: Basic implementation of hooks and triggers for a lot (most) of core modules:
action/calendar, trips and expenses, dons, vat payment, contact/society, contract, product lines, action/calendar, trips and expenses, dons, vat payment, contact/society, contract, product lines,
expedition, order supplier and order invoice (lines included), intervention card, project, tasks. expedition, order supplier and order invoice (lines included), intervention card, project, tasks.
- New: Add ChromePHP output into syslog module.
For translators: For translators:
- New: Update language files (de, tr, pt, ca, es, en, fr). - New: Update language files (de, tr, pt, ca, es, en, fr).
......
...@@ -36,6 +36,7 @@ $action = GETPOST("action"); ...@@ -36,6 +36,7 @@ $action = GETPOST("action");
$syslog_file_on=(defined('SYSLOG_FILE_ON') && constant('SYSLOG_FILE_ON'))?1:0; $syslog_file_on=(defined('SYSLOG_FILE_ON') && constant('SYSLOG_FILE_ON'))?1:0;
$syslog_syslog_on=(defined('SYSLOG_SYSLOG_ON') && constant('SYSLOG_SYSLOG_ON'))?1:0; $syslog_syslog_on=(defined('SYSLOG_SYSLOG_ON') && constant('SYSLOG_SYSLOG_ON'))?1:0;
$syslog_firephp_on=(defined('SYSLOG_FIREPHP_ON') && constant('SYSLOG_FIREPHP_ON'))?1:0; $syslog_firephp_on=(defined('SYSLOG_FIREPHP_ON') && constant('SYSLOG_FIREPHP_ON'))?1:0;
$syslog_chromephp_on=(defined('SYSLOG_CHROMEPHP_ON') && constant('SYSLOG_CHROMEPHP_ON'))?1:0;
/* /*
...@@ -54,6 +55,7 @@ if ($action == 'set') ...@@ -54,6 +55,7 @@ if ($action == 'set')
$syslog_file_on=0; $syslog_file_on=0;
$syslog_syslog_on=0; $syslog_syslog_on=0;
$syslog_firephp_on=0; $syslog_firephp_on=0;
$syslog_chromephp_on=0;
if (! $error && GETPOST("filename")) if (! $error && GETPOST("filename"))
{ {
...@@ -99,12 +101,18 @@ if ($action == 'set') ...@@ -99,12 +101,18 @@ if ($action == 'set')
} }
} }
if (! $error && isset($_POST['SYSLOG_FIREPHP_ON'])) // If firephp no available, post is not present if (! $error && isset($_POST['SYSLOG_FIREPHP_ON'])) // If firephp no available, post is not present. We must keep isset here.
{ {
$syslog_firephp_on=GETPOST('SYSLOG_FIREPHP_ON'); $syslog_firephp_on=GETPOST('SYSLOG_FIREPHP_ON');
if (! $error) $res = dolibarr_set_const($db,"SYSLOG_FIREPHP_ON",$syslog_firephp_on,'chaine',0,'',0); if (! $error) $res = dolibarr_set_const($db,"SYSLOG_FIREPHP_ON",$syslog_firephp_on,'chaine',0,'',0);
} }
if (! $error && isset($_POST['SYSLOG_CHROMEPHP_ON'])) // If chromephp no available, post is not present. We must keep isset here.
{
$syslog_chromephp_on=GETPOST('SYSLOG_CHROMEPHP_ON');
if (! $error) $res = dolibarr_set_const($db,"SYSLOG_CHROMEPHP_ON",$syslog_chromephp_on,'chaine',0,'',0);
}
if (! $error) if (! $error)
{ {
$db->commit(); $db->commit();
...@@ -176,6 +184,7 @@ print '<td align="right" colspan="2"><input type="submit" class="button" '.$opti ...@@ -176,6 +184,7 @@ print '<td align="right" colspan="2"><input type="submit" class="button" '.$opti
print "</tr>\n"; print "</tr>\n";
$var=true; $var=true;
// Output to file
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td width="140"><input '.$bc[$var].' type="checkbox" name="SYSLOG_FILE_ON" '.$option.' value="1" '.($syslog_file_on?' checked="checked"':'').'> '.$langs->trans("SyslogSimpleFile").'</td>'; print '<tr '.$bc[$var].'><td width="140"><input '.$bc[$var].' type="checkbox" name="SYSLOG_FILE_ON" '.$option.' value="1" '.($syslog_file_on?' checked="checked"':'').'> '.$langs->trans("SyslogSimpleFile").'</td>';
print '<td nowrap="nowrap">'.$langs->trans("SyslogFilename").': <input type="text" class="flat" name="filename" '.$option.' size="60" value="'.$defaultsyslogfile.'">'; print '<td nowrap="nowrap">'.$langs->trans("SyslogFilename").': <input type="text" class="flat" name="filename" '.$option.' size="60" value="'.$defaultsyslogfile.'">';
...@@ -183,6 +192,7 @@ print '</td>'; ...@@ -183,6 +192,7 @@ print '</td>';
print "<td align=\"left\">".$form->textwithpicto('',$langs->trans("YouCanUseDOL_DATA_ROOT")); print "<td align=\"left\">".$form->textwithpicto('',$langs->trans("YouCanUseDOL_DATA_ROOT"));
print '</td></tr>'; print '</td></tr>';
// Output to syslog
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td width="140"><input '.$bc[$var].' type="checkbox" name="SYSLOG_SYSLOG_ON" '.$option.' value="1" '.($syslog_syslog_on?' checked="checked"':'').'> '.$langs->trans("SyslogSyslog").'</td>'; print '<tr '.$bc[$var].'><td width="140"><input '.$bc[$var].' type="checkbox" name="SYSLOG_SYSLOG_ON" '.$option.' value="1" '.($syslog_syslog_on?' checked="checked"':'').'> '.$langs->trans("SyslogSyslog").'</td>';
print '<td nowrap="nowrap">'.$langs->trans("SyslogFacility").': <input type="text" class="flat" name="facility" '.$option.' value="'.$defaultsyslogfacility.'">'; print '<td nowrap="nowrap">'.$langs->trans("SyslogFacility").': <input type="text" class="flat" name="facility" '.$option.' value="'.$defaultsyslogfacility.'">';
...@@ -190,6 +200,7 @@ print '</td>'; ...@@ -190,6 +200,7 @@ print '</td>';
print "<td align=\"left\">".$form->textwithpicto('', $langs->trans('OnlyWindowsLOG_USER')); print "<td align=\"left\">".$form->textwithpicto('', $langs->trans('OnlyWindowsLOG_USER'));
print '</td></tr>'; print '</td></tr>';
// Output to Firebug
try try
{ {
set_include_path('/usr/share/php/'); set_include_path('/usr/share/php/');
...@@ -214,6 +225,31 @@ catch(Exception $e) ...@@ -214,6 +225,31 @@ catch(Exception $e)
print '<!-- FirePHP no available into PHP -->'."\n"; print '<!-- FirePHP no available into PHP -->'."\n";
} }
// Output to Chrome
try
{
set_include_path('/usr/share/php/');
$res=@include_once 'ChromePhp.php';
restore_include_path();
if ($res)
{
$var=!$var;
print '<tr '.$bc[$var].'><td width="140"><input '.$bc[$var].' type="checkbox" name="SYSLOG_CHROMEPHP_ON" '.$option.' value="1" ';
if (! class_exists('ChromePHP')) print ' disabled="disabled"';
else print ($syslog_chromephp_on?' checked="checked"':"");
print '> '.$langs->trans("ChromePHP").'</td>';
print '<td nowrap="nowrap">';
print '</td>';
print "<td align=\"left\">".$form->textwithpicto('','ChromePHP must be installed onto PHP path and ChromePHP plugin for Chrome must also be installed');
print '</td></tr>';
}
}
catch(Exception $e)
{
// Do nothing
print '<!-- ChromePHP no available into PHP -->'."\n";
}
print "</table>\n"; print "</table>\n";
print "</form>\n"; print "</form>\n";
......
...@@ -570,7 +570,7 @@ function dol_syslog($message, $level=LOG_INFO) ...@@ -570,7 +570,7 @@ function dol_syslog($message, $level=LOG_INFO)
set_include_path('/usr/share/php/'); set_include_path('/usr/share/php/');
include_once 'FirePHPCore/FirePHP.class.php'; include_once 'FirePHPCore/FirePHP.class.php';
set_include_path($oldinclude); set_include_path($oldinclude);
ob_start(); ob_start(); // To be sure headers are not flushed until all page is completely processed
$firephp = FirePHP::getInstance(true); $firephp = FirePHP::getInstance(true);
if ($level == LOG_ERR) $firephp->error($message); if ($level == LOG_ERR) $firephp->error($message);
elseif ($level == LOG_WARNING) $firephp->warn($message); elseif ($level == LOG_WARNING) $firephp->warn($message);
...@@ -579,7 +579,29 @@ function dol_syslog($message, $level=LOG_INFO) ...@@ -579,7 +579,29 @@ function dol_syslog($message, $level=LOG_INFO)
} }
catch(Exception $e) catch(Exception $e)
{ {
// Do not use dol_syslog to avoid infinite loop // Do not use dol_syslog here to avoid infinite loop
}
}
// Check if log is to syslog (SYSLOG_FIREPHP_ON defined)
if (defined("SYSLOG_CHROMEPHP_ON") && constant("SYSLOG_CHROMEPHP_ON") && ! empty($_SERVER["SERVER_NAME"])) //! empty($_SERVER["SERVER_NAME"]) to be sure to enable this in Web mode only
{
try
{
// Warning ChromePHP must be into PHP include path. It is not possible to use into require_once() a constant from
// database or config file because we must be able to log data before database or config file read.
$oldinclude=get_include_path();
set_include_path('/usr/share/php/');
include_once 'ChromePhp.php';
set_include_path($oldinclude);
ob_start(); // To be sure headers are not flushed until all page is completely processed
if ($level == LOG_ERR) ChromePhp::error($message);
elseif ($level == LOG_WARNING) ChromePhp::warn($message);
elseif ($level == LOG_INFO) ChromePhp::log($message);
else ChromePhp::log($message);
}
catch(Exception $e)
{
// Do not use dol_syslog here to avoid infinite loop
} }
} }
} }
......
...@@ -60,6 +60,7 @@ if (! empty($conf->margin->enabled)) { ...@@ -60,6 +60,7 @@ if (! empty($conf->margin->enabled)) {
<form name="addproduct" id="addproduct" action="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id; ?>#add" method="POST"> <form name="addproduct" id="addproduct" action="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id; ?>#add" method="POST">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" /> <input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
<input type="hidden" name="action" value="addline" /> <input type="hidden" name="action" value="addline" />
<input type="hidden" name="usenewaddlineform" value="1" />
<input type="hidden" name="id" value="<?php echo $this->id; ?>" /> <input type="hidden" name="id" value="<?php echo $this->id; ?>" />
<?php if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { ?> <?php if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { ?>
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
<form action="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'#'.$line->id; ?>" method="POST"> <form action="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'#'.$line->id; ?>" method="POST">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>"> <input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>">
<input type="hidden" name="action" value="updateligne"> <input type="hidden" name="action" value="updateligne">
<input type="hidden" name="usenewupdatelineform" value="1" />
<input type="hidden" name="id" value="<?php echo $this->id; ?>"> <input type="hidden" name="id" value="<?php echo $this->id; ?>">
<input type="hidden" name="lineid" value="<?php echo $line->id; ?>"> <input type="hidden" name="lineid" value="<?php echo $line->id; ?>">
<input type="hidden" id="product_type" name="type" value="<?php echo $line->product_type; ?>"> <input type="hidden" id="product_type" name="type" value="<?php echo $line->product_type; ?>">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment