formatting

This commit is contained in:
Miles Lott 2001-12-28 05:32:59 +00:00
parent 31b533d00e
commit c51972cd16
2 changed files with 35 additions and 33 deletions

View File

@ -32,8 +32,8 @@
// Translate Message into Language // Translate Message into Language
function langmsg() function langmsg()
{ {
return lang($this->msg,$this->parms); return lang($this->msg,$this->parms);
} }
function error($parms) function error($parms)
{ {
@ -56,13 +56,13 @@
$this->msg = trim($etext); $this->msg = trim($etext);
} }
$this->timestamp = time(); $this->timestamp = time();
$this->parms = $parray; $this->parms = $parray;
$this->ismsg = $parms['ismsg']; $this->ismsg = $parms['ismsg'];
$this->fname = $fname; $this->fname = $fname;
$this->line = $line; $this->line = $line;
$this->app = $GLOBALS['phpgw_info']['flags']['currentapp']; $this->app = $GLOBALS['phpgw_info']['flags']['currentapp'];
if (!$this->fname or !$this->line) if (!$this->fname or !$this->line)
{ {
$GLOBALS['phpgw']->log->error(array( $GLOBALS['phpgw']->log->error(array(
'text'=>'W-PGMERR, Programmer failed to pass __FILE__ and/or __LINE__ in next log message', 'text'=>'W-PGMERR, Programmer failed to pass __FILE__ and/or __LINE__ in next log message',

View File

@ -17,7 +17,7 @@
/***************************\ /***************************\
* Instance Variables... * * Instance Variables... *
\***************************/ \***************************/
var $errorstack = array(); var $errorstack = array();
var $public_functions = array( var $public_functions = array(
'message', 'message',
'error', 'error',
@ -106,13 +106,14 @@
{ {
$db = $GLOBALS['phpgw']->db; $db = $GLOBALS['phpgw']->db;
// $db->lock('phpgw_log'); // $db->lock('phpgw_log');
$db->query ("insert into phpgw_log (log_date, log_user, log_app, log_severity) values " $db->query("insert into phpgw_log (log_date, log_user, log_app, log_severity) values "
."('". $GLOBALS['phpgw']->db->to_timestamp(time()) ."('". $GLOBALS['phpgw']->db->to_timestamp(time())
."','".$GLOBALS['phpgw']->session->account_id ."','".$GLOBALS['phpgw']->session->account_id
."','".$GLOBALS['phpgw_info']['flags']['currentapp']."'" ."','".$GLOBALS['phpgw_info']['flags']['currentapp']."'"
.",'".$this->severity()."'" .",'".$this->severity()."'"
.")" .")"
,__LINE__,__FILE__); ,__LINE__,__FILE__
);
$log_id = $db->get_last_insert_id('phpgw_log','log_id'); $log_id = $db->get_last_insert_id('phpgw_log','log_id');
// $db->query('select max(log_id) as lid from phpgw_log'); // $db->query('select max(log_id) as lid from phpgw_log');
@ -124,21 +125,22 @@
for ($i = 0; $i < count($errorstack); $i++) for ($i = 0; $i < count($errorstack); $i++)
{ {
$err = $errorstack[$i]; $err = $errorstack[$i];
$db->query ("insert into phpgw_log_msg " $db->query("insert into phpgw_log_msg "
."(Log_msg_log_id, log_msg_seq_no, log_msg_date, log_msg_severity, " ."(Log_msg_log_id, log_msg_seq_no, log_msg_date, log_msg_severity, "
."log_msg_code, log_msg_msg, log_msg_parms, log_msg_file, log_msg_line) values " ."log_msg_code, log_msg_msg, log_msg_parms, log_msg_file, log_msg_line) values "
."(" . $log_id ."(" . $log_id
."," . $i ."," . $i
.", '" . $GLOBALS['phpgw']->db->to_timestamp($err->timestamp) .", '" . $GLOBALS['phpgw']->db->to_timestamp($err->timestamp)
."', '". $err->severity . "'" ."', '". $err->severity . "'"
.", '". $err->code . "'" .", '". $err->code . "'"
.", '". $db->db_addslashes($err->msg) . "'" .", '". $db->db_addslashes($err->msg) . "'"
.", '". $db->db_addslashes(implode('|',$err->parms)). "'" .", '". $db->db_addslashes(implode('|',$err->parms)). "'"
.", '". $err->fname . "'" .", '". $err->fname . "'"
.", " . intval($err->line) .", " . intval($err->line)
.")" .")"
,__LINE__,__FILE__); ,__LINE__,__FILE__
}; );
}
unset ($errorstack); unset ($errorstack);
unset ($this->errorstack); unset ($this->errorstack);
$this->errorstack = array(); $this->errorstack = array();
@ -160,7 +162,7 @@
unset ($this->errorstack); unset ($this->errorstack);
$this->errorstack = $new; $this->errorstack = $new;
return true; return true;
} }
function astable() function astable()
{ {
@ -200,7 +202,7 @@
$html .= "\t\t<td>".$err->fname."</td>\n"; $html .= "\t\t<td>".$err->fname."</td>\n";
$html .= "\t\t<td>".$err->line."</td>\n"; $html .= "\t\t<td>".$err->line."</td>\n";
$html .= "\t</tr>\n"; $html .= "\t</tr>\n";
}; }
$html .= "</table>\n"; $html .= "</table>\n";
$html .= "</center>\n"; $html .= "</center>\n";