method translateLog documentation in bbn\Appui\Task

function(array $log) { $user = bbn\User::getInstance(); if ( $opt && $user && isset($log['action'], $log['id_user']) ){ $type = explode('_', $opt->code($log['action'])); $action = $user->getName($this->mgr->getUser($log['id_user'])).' '.$opt->text($log['action']); $log['value'] = empty($log['value']) ? [] : json_decode($log['value']); if ( !empty($log['value']) ){ $values = []; switch ( $type[0] ){ case 'deadline': foreach ( $log['value'] as $v ){ array_push($values, bbn\Date::format($v, 's')); } break; case 'title': $values = $log['value']; break; case 'comment': array_push($values, bbn\Str::cut($this->db->getOne(" SELECT content FROM bbn_notes_versions WHERE id_note = ? ORDER BY version DESC LIMIT 1", $log['value'][0]), 80)); break; case 'role': if ( ($user = bbn\User::getInstance()) && isset($log['value'][0], $log['value'][1]) ){ $values[0] = $user->getName($this->mgr->getUser($log['value'][0])); $values[1] = $opt->text($log['value'][1]); } break; case 'priority': $values = $log['value']; break; case 'price': case 'approved': foreach ( $log['value'] as $i => $v ){ $values[] = number_format((float)$v, 2, ',', '.'); } break; default: foreach ( $log['value'] as $v ){ array_push($values, $opt->text($v)); } } if ( !empty($values) ){ foreach ( $values as $i => $v ){ $values[$i] = ''.$v.''; } array_unshift($values, $action); return \sprintf(...$values); } } return $action; } return false; }

BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way

This website uses cookies to ensure you get the best experience on our website.