Esempio n. 1
0
 function action_select_filter($input)
 {
     $permName = $input->permName->word();
     $trackerId = $input->trackerId->int();
     $tracker = \Tracker_Definition::get($trackerId);
     if (!$tracker) {
         throw new Services_Exception_NotFound();
     }
     Services_Exception_Denied::checkObject('tiki_p_view_trackers', 'tracker', $trackerId);
     $schema = new \Tracker\Filter\Collection($tracker);
     $local = $schema->getFieldCollection($permName);
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $column = $schema->addFilter($permName, $input->mode->text());
         return ['field' => $column->getField(), 'mode' => $column->getMode(), 'label' => $column->getLabel()];
     }
     return ['title' => tr('Fields in %0', $tracker->getConfiguration('name')), 'trackerId' => $trackerId, 'permName' => $permName, 'collection' => $local];
 }