|
CDR Report, Call Duration... hace 12 Meses
|
Karma: 0
|
|
In previous versions of elastix, this would show as a simple numerical value in seconds. The new version of Elastix appends text to convert this into minutes.
When I export to a spreadsheet, the column is now text, and I can't autosum. Is there a way to revert this back to plain text?
|
|
|
|
|
|
|
Re: CDR Report, Call Duration... hace 11 Meses, 3 Semanas
|
Karma: 0
|
|
No one has this same problem?
|
|
|
|
|
|
|
Re: CDR Report, Call Duration... hace 11 Meses, 3 Semanas
|
Karma: 98
|
|
Hi,
Indeed, that`s how it works now...
I get why it´s not suitable for you, the way around this is to change what is send to the export function itself, I will give it a check and tell you about it.
Regards,
Claudio
|
|
|
|
Última edición: 30/05/2012 11:59 por soborno.
|
|
|
Re: CDR Report, Call Duration... hace 11 Meses, 3 Semanas
|
Karma: 98
|
A minor change in code will be enough to solve your problem:
You need to edit the index of cdr_reports module (do not forget to make a backup!):
| Código: |
vim /var/www/html/modules/cdrreport/index.php
|
Later, go almost to the end of the file, in line 259(aprox) you are going to see an if with the ExportAction
Below that you should see this:
| Código: |
if(is_array($arrResult['cdrs']) && $total>0){
foreach($arrResult['cdrs'] as $key => $value){
$arrTmp[0] = $value[0];
$arrTmp[1] = $value[1];
$arrTmp[2] = $value[11];
$arrTmp[3] = $value[2];
$arrTmp[4] = $value[3];
$arrTmp[5] = $value[9];
$arrTmp[6] = $value[4];
$arrTmp[7] = $value[5];
$iDuracion = $value[8];
$iSec = $iDuracion % 60; $iDuracion = (int)(($iDuracion - $iSec) / 60);
$iMin = $iDuracion % 60; $iDuracion = (int)(($iDuracion - $iMin) / 60);
$sTiempo = "{$value[8]}s";
if ($value[8] >= 60) {
if ($iDuracion > 0) $sTiempo .= " ({$iDuracion}h {$iMin}m {$iSec}s)";
elseif ($iMin > 0) $sTiempo .= " ({$iMin}m {$iSec}s)";
}
$arrTmp[8] = $sTiempo;
$arrData[] = $arrTmp;
}
}
|
change it for this:
| Código: |
if(is_array($arrResult['cdrs']) && $total>0){
foreach($arrResult['cdrs'] as $key => $value){
$arrTmp[0] = $value[0];
$arrTmp[1] = $value[1];
$arrTmp[2] = $value[11];
$arrTmp[3] = $value[2];
$arrTmp[4] = $value[3];
$arrTmp[5] = $value[9];
$arrTmp[6] = $value[4];
$arrTmp[7] = $value[5];
$arrTmp[8] = $value[8];
/*$iDuracion = $value[8];
$iSec = $iDuracion % 60; $iDuracion = (int)(($iDuracion - $iSec) / 60);
$iMin = $iDuracion % 60; $iDuracion = (int)(($iDuracion - $iMin) / 60);
$sTiempo = "{$value[8]}s";
if ($value[8] >= 60) {
if ($iDuracion > 0) $sTiempo .= " ({$iDuracion}h {$iMin}m {$iSec}s)";
elseif ($iMin > 0) $sTiempo .= " ({$iMin}m {$iSec}s)";
}
$arrTmp[8] = $sTiempo;*/
$arrData[] = $arrTmp;
}
}
|
NOTE: Tested in version 2.2
Regards,
Claudio
|
|
|
|
Última edición: 30/05/2012 12:55 por soborno.
|
|
|
Re: CDR Report, Call Duration... hace 11 Meses, 3 Semanas
|
Karma: 0
|
|
Claudio,
This is golden, thank you very much. Tonight, when my users are offfline, I will run my backup, and try this out. Again, thank you for the insight.
Victor
|
|
|
|
|
|
|
Re: CDR Report, Call Duration... hace 11 Meses, 3 Semanas
|
Karma: 98
|
|
No problem.
As for the backup, you don`t need to make a full system backup, just copy the index.php under cdrreport, so if something happens you can put the 'original' back.
Note: The code changes that I paste before are for version 2.2, for the rest should be similiar or exactly the same, but not really tested.
Regards,
Claudio
|
|
|
|
|
|
|
Re:CDR Report, Call Duration... hace 11 Meses, 3 Semanas
|
Karma: 0
|
|
Hey Claudio,
I just wanted to say that the report works as intended now. Thank you so much for your valuable assistance.
Victor
|
|
|
|
|
|
|
Re:CDR Report, Call Duration... hace 11 Meses, 3 Semanas
|
Karma: 98
|
|
Nice!
Regards,
Claudio
|
|
|
|
|
|
|
Re: CDR Report, Call Duration... hace 4 Meses, 1 Semana
|
Karma: 0
|

in the export action replace with this:
| Código: |
if(is_array($arrResult['cdrs']) && $total>0){
foreach($arrResult['cdrs'] as $key => $value){
$arrTmp[0] = $value[0];
$arrTmp[1] = $value[1];
$arrTmp[2] = $value[11];
$arrTmp[3] = $value[2];
$arrTmp[4] = $value[3];
$arrTmp[5] = $value[9];
$arrTmp[6] = $value[4];
$arrTmp[7] = $value[5];
$iDuracion = $value[8];
$sTiempo = "{$value[8]}";
$arrTmp[8] = $sTiempo;
$arrData[] = $arrTmp;
}
}
|
and you have only numeric values....
Greetings friends
|
|
|
|
Última edición: 10/01/2013 17:21 por abrahammontes.
|
|
|