Ajout plus d'info dans description audit.

This commit is contained in:
Laurent Destailleur 2014-10-31 15:41:58 +01:00
parent 24862d6314
commit 9c51effe5c
5 changed files with 12 additions and 7 deletions

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
*
* This program is free software; you can redistribute it and/or modify
@ -229,10 +229,11 @@ if ($result)
// Description
print '<td>';
$text=$langs->trans($obj->description);
if (preg_match('/\((.*)\)/i',$obj->description,$reg))
if (preg_match('/\((.*)\)(.*)/i',$obj->description,$reg))
{
$val=explode(',',$reg[1]);
$text=$langs->trans($val[0], isset($val[1])?$val[1]:'', isset($val[2])?$val[2]:'', isset($val[3])?$val[3]:'', isset($val[4])?$val[4]:'');
if (! empty($reg[2])) $text.=$reg[2];
}
print $text;
print '</td>';

View File

@ -111,7 +111,7 @@ class Events // extends CommonObject
$this->description=trim($this->description);
// Check parameters
if (! $this->description) { $this->error='ErrorBadValueForParameter'; return -1; }
if (empty($this->description)) { $this->error='ErrorBadValueForParameter'; return -1; }
// Insert request
$sql = "INSERT INTO ".MAIN_DB_PREFIX."events(";
@ -129,7 +129,7 @@ class Events // extends CommonObject
$sql.= " ".($_SERVER['HTTP_USER_AGENT']?"'".dol_trunc($_SERVER['HTTP_USER_AGENT'],250)."'":'NULL').",";
$sql.= " '".$this->db->idate($this->dateevent)."',";
$sql.= " ".($user->id?"'".$user->id."'":'NULL').",";
$sql.= " '".$this->db->escape($this->description)."'";
$sql.= " '".$this->db->escape(dol_trunc($this->description,250))."'";
$sql.= ")";
dol_syslog(get_class($this)."::create", LOG_DEBUG);

View File

@ -66,7 +66,9 @@ class InterfaceLogevents extends DolibarrTriggers
// Initialisation donnees (date,duree,texte,desc)
$text="(UserLogged,".$object->login.")";
$text.=(empty($object->trigger_mesg)?'':' - '.$object->trigger_mesg);
$desc="(UserLogged,".$object->login.")";
$desc.=(empty($object->trigger_mesg)?'':' - '.$object->trigger_mesg);
}
if ($action == 'USER_LOGIN_FAILED')
{

View File

@ -1064,8 +1064,8 @@ ALTER TABLE llx_adherent CHANGE COLUMN civilite civility VARCHAR(6);
ALTER TABLE llx_socpeople CHANGE COLUMN civilite civility VARCHAR(6);
ALTER TABLE llx_user CHANGE COLUMN civilite civility VARCHAR(6);
ALTER TABLE llx_societe CHANGE COLUMN nom varchar(128);
ALTER TABLE llx_adherent CHANGE COLUMN societe varchar(128);
ALTER TABLE llx_societe MODIFY COLUMN nom varchar(128);
ALTER TABLE llx_adherent MODIFY COLUMN societe varchar(128);
ALTER TABLE llx_c_type_fees CHANGE COLUMN libelle label VARCHAR(30);
ALTER TABLE llx_c_type_fees ADD COLUMN accountancy_code varchar(32) DEFAULT NULL AFTER label;

View File

@ -460,7 +460,7 @@ if (! defined('NOLOGIN'))
$datesecond=dol_stringtotime($_POST["dst_second"]);
if ($datenow >= $datefirst && $datenow < $datesecond) $dol_dst=1;
}
//print $datefirst.'-'.$datesecond.'-'.$datenow; exit;
//print $datefirst.'-'.$datesecond.'-'.$datenow.'-'.$dol_tz.'-'.$dol_tzstring.'-'.$dol_dst; exit;
}
if (! $login)
@ -621,6 +621,8 @@ if (! defined('NOLOGIN'))
$user->update_last_login_date();
$user->trigger_mesg = 'TZ='.$_SESSION["dol_tz"].';TZString='.$_SESSION["dol_tz_string"].';Screen='.$_SESSION["dol_screenwidth"].'x'.$_SESSION["dol_screenheight"];
// TODO We should use a hook here, not a trigger
// Call triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';