space between last date and number
[auerswald-callnotifier.git] / src / callnotifier / Logger / CallFileTop.php
index 6caa551f2d2b30571094a9745f80018249781672..4fd8917b271593f533c3c752e312ae507b010e3b 100644 (file)
@@ -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:
@@ -68,7 +68,7 @@ class Logger_CallFileTop extends Logger_CallBase
             //same date as previous log entry
             $arLines = array_pad($arLines, -count($arLines) - 1, '');
         } else {
-            $arLines = array_pad($arLines, -count($arLines) - 2, '');
+            $arLines = array_pad($arLines, -count($arLines) - 3, '');
         }
         $arLines[0] = $date;
         $arLines[1] = $logline;
@@ -85,14 +85,24 @@ 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);
 
-        return array($str . "\n", date("d.m.Y, l\n", $call->start));
+        setlocale(LC_TIME, 'de_DE.utf-8');
+        return array($str . "\n", strftime("%x, %A\n", $call->start));
     }
 
 }