method info documentation in bbn\Appui\Task

function(string $id, bool $withComments = false, bool $withChildren = true) { if ($info = $this->db->rselect('bbn_tasks', [], ['id' => $id])) { $info['title'] = $this->getTitle($id); $info['content'] = $this->getContent($id); $info['first'] = $this->db->selectOne('bbn_tasks_logs', 'chrono', [ 'id_task' => $id, 'action' => $this->idAction('insert') ], ['chrono' => 'ASC']); $info['last'] = $this->db->selectOne('bbn_tasks_logs', 'chrono', [ 'id_task' => $id, ], ['chrono' => 'DESC']); $info['last_action'] = !empty($info['last']) ? date('Y-m-d H:i:s', $info['last']) : $info['creation_date']; $info['roles'] = $this->infoRoles($id); $roleCode = $this->hasRole($id, $this->id_user); $info['role'] = !empty($roleCode) ? $this->idRole($roleCode) : null; $info['notes'] = $withComments ? $this->getComments($id) : $this->getCommentsIds($id); $info['children'] = $withChildren ? $this->getChildren($id) : $this->getChildrenIds($id); $info['children_price'] = $this->getChildrenPrices($id); $info['children_noprice'] = $this->getChildrenNoPrice($id); $info['num_children_noprice'] = count($info['children_noprice']); $info['parent_has_price'] = $this->parentHasPrice($id, true); $info['parent_unapproved'] = $this->parentIsUnapproved($id, true); $info['approved'] = $this->getApprovalInfo($id); $info['aliases'] = $this->db->rselectAll([ 'table' => 'bbn_tasks', 'fields' => [ 'bbn_tasks.id', 'bbn_notes_versions.title' ], 'join' => [[ 'table' => 'bbn_notes_versions', 'on' => [ 'conditions' => [[ 'field' => 'bbn_notes_versions.id_note', 'exp' => 'bbn_tasks.id_note' ], [ 'field' => 'bbn_notes_versions.latest', 'value' => 1 ]] ] ]], 'where' => [ 'bbn_tasks.id_alias' => $id, 'bbn_tasks.active' => 1 ] ]); $info['num_notes'] = \count($info['notes']); $info['num_children'] = \count($info['children']); $info['has_children'] = !empty($info['num_children']); $info['reference'] = null; if ( $this->references ){ foreach ( $this->references as $table => $ref ){ foreach ( $ref['refs'] as $j => $r ){ if ( $id_ref = $this->db->selectOne($table, $j, [$ref['column'] => $id]) ){ $info['reference'] = $this->template === false ? $id_ref : \call_user_func($this->template, $this->db, $id_ref, $table); break; } } if ( $info['reference'] ){ break; } } } if (!empty($info['id_parent'])) { $info['parent'] = $this->info($info['id_parent'], $withComments, false); } return $info; } return null; }

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.