get_all();
if(count($audit->all_audit) == 1){
$all[0] = $audit->get_creation() ;
} elseif(count($audit->all_audit) > 1){
$all[0] = $audit->get_creation() ;
$all[1] = $audit->get_last() ;
}
break;
case '2':
$audit = new audit($type_obj, $object_id) ;
$audit->get_all() ;
$all = $audit->all_audit ;
break;
default:
case '0':
echo "" ;
break;
}
$audit_list = "
".$msg['demandes_demandeur']." | ".$msg['audit_col_nom']." | ".$msg['audit_col_username'].
" | ".$msg['audit_col_type_action']." | ".$msg['audit_col_date_heure']." | ".$msg['audit_comment']." |
";
if(count($all)){
foreach ($all as $cle => $valeur) {
//user_id, user_name, type_modif, quand, concat(prenom, ' ', nom) as prenom_nom
$info=json_decode($valeur->info);
$info_display="";
if(is_object($info)){
if($info->comment)$info_display.=$info->comment."
";
if(count($info->fields)){
foreach($info->fields as $fieldname => $values){
if(is_object($values)){
$info_display.=$fieldname." : ".$values->old." => ".$values->new."
";
}
}
}
}else $info_display=$valeur->info;
$type_user_libelle='';
if($valeur->type_user == 1) {
$type_user_libelle = $msg['empr_nom_prenom'];
}else {
$type_user_libelle = $msg[86];
}
$audit_list .= "
".$type_user_libelle." (".$valeur->user_id.") |
$valeur->prenom_nom |
$valeur->user_name |
".$msg['audit_type'.$valeur->type_modif]." |
$valeur->aff_quand |
".$info_display." |
";
}
}
$audit_list .= "
";
echo $audit_list ;
if ($type_obj == 1 || $type_obj == 3) { //Audit notices/notices de bulletin
if ($type_obj == 1) {
$requete = "SELECT date_format(create_date, '".$msg["format_date_heure"]."') as aff_create, date_format(update_date, '".$msg["format_date_heure"]."') as aff_update FROM notices WHERE notice_id='$object_id' LIMIT 1 ";
} else {
$requete = "SELECT date_format(create_date, '".$msg["format_date_heure"]."') as aff_create, date_format(update_date, '".$msg["format_date_heure"]."') as aff_update FROM notices, bulletins WHERE num_notice = notice_id AND bulletin_id='$object_id' LIMIT 1 ";
}
$result = pmb_mysql_query($requete, $dbh);
if(pmb_mysql_num_rows($result)) {
$notice = pmb_mysql_fetch_object($result);
echo "
";
echo htmlentities($msg["noti_crea_date"],ENT_QUOTES, $charset)." ".$notice->aff_create."
";
echo htmlentities($msg["noti_mod_date"],ENT_QUOTES, $charset)." ".$notice->aff_update."
";
}
}
pmb_mysql_close($dbh);