Пример #1
0
 public function componentSearchbuilder()
 {
     $this->templates = entities\SavedSearch::getTemplates();
     $this->filters = $this->appliedfilters;
     $this->nondatecustomfields = entities\CustomDatatype::getAllExceptTypes(array(entities\CustomDatatype::DATE_PICKER));
     $this->datecustomfields = entities\CustomDatatype::getByFieldType(entities\CustomDatatype::DATE_PICKER);
     $i18n = framework\Context::getI18n();
     $columns = array('title' => $i18n->__('Issue title'), 'issuetype' => $i18n->__('Issue type'), 'assigned_to' => $i18n->__('Assigned to'), 'posted_by' => $i18n->__('Posted by'), 'status' => $i18n->__('Status'), 'resolution' => $i18n->__('Resolution'), 'category' => $i18n->__('Category'), 'severity' => $i18n->__('Severity'), 'percent_complete' => $i18n->__('Percent completed'), 'reproducability' => $i18n->__('Reproducability'), 'priority' => $i18n->__('Priority'), 'components' => $i18n->__('Component(s)'), 'milestone' => $i18n->__('Milestone'), 'estimated_time' => $i18n->__('Estimate'), 'spent_time' => $i18n->__('Time spent'), 'last_updated' => $i18n->__('Last updated time'), 'posted' => $i18n->__('Posted at'), 'comments' => $i18n->__('Number of comments'));
     foreach ($this->nondatecustomfields as $field) {
         $columns[$field->getKey()] = $i18n->__($field->getName());
     }
     foreach ($this->datecustomfields as $field) {
         $columns[$field->getKey()] = $i18n->__($field->getName());
     }
     $this->columns = $columns;
     $groupoptions = array();
     if (!framework\Context::isProjectContext()) {
         $groupoptions['project_id'] = $i18n->__('Project');
     }
     $groupoptions['milestone'] = $i18n->__('Milestone');
     $groupoptions['assignee'] = $i18n->__("Who's assigned");
     $groupoptions['posted_by'] = $i18n->__("Who posted the issue");
     $groupoptions['state'] = $i18n->__('State (open or closed)');
     $groupoptions['status'] = $i18n->__('Status');
     $groupoptions['category'] = $i18n->__('Category');
     $groupoptions['priority'] = $i18n->__('Priority');
     $groupoptions['severity'] = $i18n->__('Severity');
     $groupoptions['resolution'] = $i18n->__('Resolution');
     $groupoptions['issuetype'] = $i18n->__('Issue type');
     $groupoptions['edition'] = $i18n->__('Edition');
     $groupoptions['build'] = $i18n->__('Release');
     $groupoptions['component'] = $i18n->__('Component');
     $groupoptions['posted'] = $i18n->__('Posted at');
     $this->groupoptions = $groupoptions;
 }
Пример #2
0
 /**
  * Performs the "find issues" action
  *
  * @param framework\Request $request
  */
 public function runFindIssues(framework\Request $request)
 {
     $this->resultcount = 0;
     if ($request['quicksearch'] == true) {
         if ($request->isAjaxCall()) {
             return $this->redirect('quicksearch');
         } else {
             $issues = $this->issues;
             $issue = array_shift($issues);
             if ($issue instanceof entities\Issue) {
                 return $this->forward($this->getRouting()->generate('viewissue', array('project_key' => $issue->getProject()->getKey(), 'issue_no' => $issue->getFormattedIssueNo())));
             }
         }
     }
     if ($this->search_object->hasQuickfoundIssues()) {
         $issues = $this->search_object->getQuickfoundIssues();
         $issue = array_shift($issues);
         if ($issue instanceof entities\Issue) {
             return $this->forward($this->getRouting()->generate('viewissue', array('project_key' => $issue->getProject()->getKey(), 'issue_no' => $issue->getFormattedIssueNo())));
         }
     }
     $this->search_error = framework\Context::getMessageAndClear('search_error');
     $this->search_message = framework\Context::getMessageAndClear('search_message');
     $this->appliedfilters = $this->filters;
     $this->templates = entities\SavedSearch::getTemplates();
 }