1<?php 2include_once DOKU_PLUGIN."bez/models/issues.php"; 3include_once DOKU_PLUGIN."bez/models/causes.php"; 4include_once DOKU_PLUGIN."bez/models/tokens.php"; 5 6/*jeżeli nie mamy tokenu generujemy nowy i przekierowujemy*/ 7$toko = new Tokens(); 8if ($this->model->acl->get_level() >= BEZ_AUTH_USER && 9 (!isset($_GET['t']) || ! $toko->check(trim($_GET['t']), $this->page_id()))) { 10 header('Location: '.$uri.'?id='.$_GET['id'].'&t='.$toko->get($this->page_id())); 11} 12 13$issue_id = $nparams['id']; 14 15//$isso = new Issues(); 16//$causo = new Causes(); 17//$tasko = new Tasks(); 18// 19//$template['issue'] = $isso->get($issue_id); 20//$template['team'] = $isso->get_team($issue_id); 21// 22//$template['real_causes'] = $causo->get_real($issue_id); 23//$template['potential_causes'] = $causo->get_potential($issue_id); 24// 25// 26//$template['tasks'] = $tasko->get_by_8d($issue_id); 27//$template['cost_total'] = $tasko->get_total_cost($issue_id); 28 29$template['issue'] = $this->model->issues->get_one($issue_id); 30$template['total_cost'] = $template['issue']->total_cost(); 31 32$template['real_causes'] = $this->model->commcauses->get_all(array( 33 'type' => '1', 34 'issue' => $issue_id 35))->fetchAll(); //fetchAll becouse we need to count rows before displaying them 36 37$template['potential_causes'] = $this->model->commcauses->get_all(array( 38 'type' => '2', 39 'issue' => $issue_id 40))->fetchAll(); //fetchAll becouse we need to count rows before displaying them 41 42$template['tasks'] = array(); 43$template['tasks']['3d'] = $this->model->tasks->get_all(array( 44 'action' => '0', 45 'state' => array('!=', '2'), 46 'issue' => $issue_id 47))->fetchAll(); //fetchAll becouse we need to count rows before displaying them 48 49$template['tasks']['5d'] = $this->model->tasks->get_all(array( 50 'action' => '1', 51 'state' => array('!=', '2'), 52 'issue' => $issue_id 53))->fetchAll(); //fetchAll becouse we need to count rows before displaying them 54 55 56$template['tasks']['7d'] = $this->model->tasks->get_all(array( 57 'action' => '2', 58 'state' => array('!=', '2'), 59 'issue' => $issue_id 60))->fetchAll(); //fetchAll becouse we need to count rows before displaying them 61 62$template['uri'] = $uri.'?'.$_SERVER['QUERY_STRING']; 63