Commit 6649cf43f5e83ab87f74daab1c3aa151cefc3bfd

Authored by Alexey Boroda
1 parent 8de5e9b3

-Otp and logging

Showing 1 changed file with 13 additions and 4 deletions   Show diff stats
@@ -131,12 +131,21 @@ @@ -131,12 +131,21 @@
131 131
132 public function getLogAttributes(string $attr, array $values) 132 public function getLogAttributes(string $attr, array $values)
133 { 133 {
  134 + $labels = Label::find()->with('lang')->indexBy('id')->all();
134 if ($attr == 'deadline') { 135 if ($attr == 'deadline') {
135 return [ 136 return [
136 - 'old' => ''  
137 - /**  
138 - * @todo Start here  
139 - */ 137 + 'old' => empty($values['old']) ? '' : date('d.m.Y', $values['old']),
  138 + 'new' => empty($values['new']) ? '' : date('d.m.Y', $values['new']),
  139 + ];
  140 + } elseif ($attr = 'reason') {
  141 + return [
  142 + 'old' => empty($values['old']) ? '' : self::REASONS[$values['old']],
  143 + 'new' => empty($values['new']) ? '' : self::REASONS[$values['new']],
  144 + ];
  145 + } elseif ($attr = 'label') {
  146 + return [
  147 + 'old' => empty($values['old']) ? '' : $labels[$values['old']]->lang->title,
  148 + 'new' => empty($values['new']) ? '' : $labels[$values['new']]->lang->title,
140 ]; 149 ];
141 } 150 }
142 } 151 }