issue #0000533, getLogsClients - à tester sous linux

This commit is contained in:
Michael RICOIS 2011-02-01 13:48:46 +00:00
parent 8fd7b14d3a
commit d27aa9cfba

View File

@ -2894,7 +2894,7 @@ class WsInterne extends WsScore
/**
* getLogsClients
* @param string $mois
* @param string $mois (Format : AAAA-MM ou AAAA/MM)
* @param int $detail
* @param int $idClient
* @param string $login
@ -2907,12 +2907,15 @@ class WsInterne extends WsScore
//Initialisation
$error = new ErrorType();
if (empty($detail)) $detail = 0;
if (empty($idClient)) $idClient = 0;
if (empty($login)) $login = '';
if (empty($all)) $all = 0;
$strDetail = $strClient = $strLogin='';
// Vue détaillée ou uniquement les infos payantes
if ($detail==0)
{
if ($detail==0) {
$detail='Non';
//$strDetail=" AND (page LIKE 'greffe_%' OR page LIKE 'inpi_%' OR page='kbis' OR page='indiscore' ) AND (params<>'' OR page='indiscore' AND tarifIndiscore<>0) AND (params NOT LIKE '%erreur%' OR params LIKE '%erreur 17%') ";
$strDetail=" AND (page LIKE 'greffe_%' OR page LIKE 'inpi_%' OR page='kbis' OR page LIKE 'indiscore%' OR page='privileges' OR page='commandeAsso') AND (params<>'' OR page LIKE 'indiscore%' AND tarifIndiscore<>0) AND (params NOT LIKE '%erreur%' OR params LIKE '%erreur 17%') ";
@ -2922,15 +2925,17 @@ class WsInterne extends WsScore
// On veut uniquement le client précis
if ($all && $this->tabInfoUser['profil']=='SuperAdministrateur') {
$all='Oui';
$all = 'Oui';
} else {
$all='Non';
$all = 'Non';
// Pas d'idClient mentionné ou tentative sur autre client et non SAD
if ($idClient*1==0 || ($idClient*1<>$this->tabInfoUser['idClient'] &&
$this->tabInfoUser['profil']<>'SuperAdministrateur') ){
$idClient=$this->tabInfoUser['idClient'];
if ($idClient==0
|| ($idClient*1<>$this->tabInfoUser['idClient'] &&
$this->tabInfoUser['profil']<>'SuperAdministrateur') ){
$idClient = $this->tabInfoUser['idClient'];
}
$strClient=" AND u.idClient=$idClient ";
$strClient = " AND u.idClient=$idClient ";
}
// On veut uniquement le login précis
@ -2938,9 +2943,9 @@ class WsInterne extends WsScore
else $login='Non';
// Dates de début et de fin
$mois=strtr($mois, array('-'=>'','/'=>''))*1;
$annee=substr($mois,0,4);
$mois=substr($mois,4,2);
$mois = strtr($mois, array('-'=>'','/'=>''));
$annee = substr($mois,0,4);
$mois = substr($mois,4,2);
$dateDeb=date('Y-m-d', mktime(0,0,0,$mois,1,$annee));
$dateFin=date('Y-m-t', mktime(0,0,0,$mois,15,$annee));
@ -2963,8 +2968,8 @@ class WsInterne extends WsScore
$fp = fopen(DOC_WEB_LOCAL."/csv/logs-$annee-$mois-$detail-$idClient-$login-$all.sql", 'w');
fwrite($fp, $sql.EOL);
fclose($fp);
exec(APPLICATION_PATH."/batch/sql2csv.php sdv1 ".DOC_WEB_LOCAL."/csv/logs-$annee-$mois-$detail-$idClient-$login-$all.sql $fichierCsv > /dev/null &");
$size=$cache=0;
exec(APPLICATION_PATH."/../batch/sql2csv.php sdv1 ".DOC_WEB_LOCAL."/csv/logs-$annee-$mois-$detail-$idClient-$login-$all.sql $fichierCsv > /dev/null &");
$size = $cache = 0;
}
$result = new LogsClients();