From 93ccb6364dc238d7ed12c161e39910da93fa3e86 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Sat, 25 Aug 2012 23:18:51 +0200 Subject: [PATCH] make numbers nice on dreambox, do not show from/to when only one type gets logged --- src/callnotifier/Logger/CallFileTop.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/callnotifier/Logger/CallFileTop.php b/src/callnotifier/Logger/CallFileTop.php index 4dc6b6c..58f3174 100644 --- a/src/callnotifier/Logger/CallFileTop.php +++ b/src/callnotifier/Logger/CallFileTop.php @@ -18,7 +18,7 @@ class Logger_CallFileTop extends Logger_CallBase protected $file; /** - * Create a new file call logger. + * Create a new file call logger. * * @param string $file Path to the file to log the calls in. * @param string $callTypes Which types of call to log: @@ -85,9 +85,18 @@ class Logger_CallFileTop extends Logger_CallBase $this->addUnsetVars($call); $str = ' ' . date('H:i', $call->start); if ($call->type == CallMonitor_Call::INCOMING) { - $str .= ' von ' . str_pad($this->getNumberString($call, 'from'), 30); + $prefix = ' von '; + $numstr = $this->getNumberString($call, 'from'); } else { - $str .= ' nach ' . str_pad($this->getNumberString($call, 'to'), 30); + $prefix = ' nach '; + $numstr = $this->getNumberString($call, 'to'); + } + + if ($this->callTypes == 'io') { + $str .= $prefix; + $str .= str_pad($numstr, 20); + } else { + $str .= ' ' . str_pad($numstr, 25); } $str .= ' ' . date('H:i:s', $call->end - $call->start - 3600); -- 2.30.2