1<?php 2include_once DOKU_PLUGIN."bez/models/issues.php"; 3include_once DOKU_PLUGIN."bez/models/tasks.php"; 4include_once DOKU_PLUGIN."bez/models/causes.php"; 5include_once DOKU_PLUGIN."bez/models/users.php"; 6 7$tasko = new Tasks(); 8$causo = new Causes(); 9$issue_id = (int)$params[1]; 10 11/*casue*/ 12$cause_id = ''; 13if (isset($params[3])) { 14 $cause_id = (int)$params[3]; 15 $template['cause'] = $causo->join($causo->getone($cause_id)); 16} 17 18/*edycja*/ 19if (isset($params[7])) { 20 $action = $params[5]; 21 $tid = (int)$params[7]; 22 23 if ($action == 'edit') 24 $value = $tasko->getone($tid); 25 else if ($action == 'update') { 26 $tasko->update($_POST, array(), $tid); 27 if (count($errors) == 0) 28 header("Location: ?id=bez:issue_task:id:$issue_id:tid:$tid"); 29 } 30 $template['task_button'] = $bezlang['change_task_button']; 31 $template['task_action'] = $this->id('task_form', 'id', $issue_id, 32 'cause', $cause_id, 'action', 'update', 'tid', $tid); 33/*dodawania*/ 34} else { 35 if (count($_POST) > 0) { 36 $data = array('reporter' => $INFO['client'], 'date' => time(), 'issue' => $issue_id, 'cause' => $cause_id); 37 $data = $tasko->add($_POST, $data); 38 if (count($errors) == 0) { 39 $tid = $tasko->lastid(); 40 header("Location: ?id=bez:issue_task:id:$issue_id:tid:$tid"); 41 } else 42 $value = $_POST; 43 } 44 $template['task_button'] = $bezlang['add']; 45 $template['task_action'] = $this->id('task_form', 'id', $issue_id, 'cause', $cause_id, 'action', 'add'); 46} 47 48$isso = new Issues(); 49$template['issue'] = $isso->get($issue_id); 50 51$usro = new Users(); 52$template['users'] = $usro->get(); 53 54 55//$template['task'] = $tasko->join($tasko->getone($task_id)); 56