1*c9044e56Sghi<?php 2*c9044e56Sghiinclude_once DOKU_PLUGIN."bez/models/tasks.php"; 3*c9044e56Sghiinclude_once DOKU_PLUGIN."bez/models/taskactions.php"; 4*c9044e56Sghiinclude_once DOKU_PLUGIN."bez/models/taskstates.php"; 5*c9044e56Sghi 6*c9044e56Sghiif (!$helper->user_viewer()) { 7*c9044e56Sghi $errors[] = $bezlang['error_issues']; 8*c9044e56Sghi $controller->preventDefault(); 9*c9044e56Sghi} 10*c9044e56Sghi 11*c9044e56Sghi$tasko = new Tasks(); 12*c9044e56Sghi$taskao = new Taskactions(); 13*c9044e56Sghi$taskso = new Taskstates(); 14*c9044e56Sghi 15*c9044e56Sghiif (count($_POST) > 0) { 16*c9044e56Sghi $filters = $tasko->validate_filters($_POST); 17*c9044e56Sghi 18*c9044e56Sghi $query_uri = ''; 19*c9044e56Sghi foreach ($filters as $k => $v) 20*c9044e56Sghi if ($v != '-all') 21*c9044e56Sghi $query_uri .= ':'.urlencode($k).':'.urlencode($v); 22*c9044e56Sghi 23*c9044e56Sghi header('Location: ?id=bez:tasks'.$query_uri); 24*c9044e56Sghi} 25*c9044e56Sghi 26*c9044e56Sghi/*rekordy parzyste to nagłówki, nieparzyste to ich wartości.*/ 27*c9044e56Sghi/*np. status:1:type:2:podmiot:PCA*/ 28*c9044e56Sghi$value = array('action' => '-all', 'state' => '-all', 'executor' => '-all', 'year' => '-all'); 29*c9044e56Sghifor ($i = 0; $i < count($params); $i += 2) 30*c9044e56Sghi $value[urldecode($params[$i])] = urldecode($params[$i+1]); 31*c9044e56Sghi 32*c9044e56Sghi 33*c9044e56Sghi$template['uri'] = $uri; 34*c9044e56Sghi 35*c9044e56Sghi$template['actions'] = $taskao->get(); 36*c9044e56Sghi$template['states'] = $taskso->get(); 37*c9044e56Sghi$template['executors'] = $tasko->get_executors(); 38*c9044e56Sghi$template['years'] = $tasko->get_years(); 39*c9044e56Sghi 40*c9044e56Sghi$template['tasks'] = $tasko->get_filtered($value); 41