Esempio n. 1
0
 /**
  * Performs the "find issues" action
  *
  * @param TBGRequest $request
  */
 public function runFindIssues(TBGRequest $request)
 {
     $this->resultcount = 0;
     if ($this->show_results) {
         $this->doSearch($request);
         $this->issues = $this->foundissues;
     }
     if ($request['quicksearch'] == true) {
         if ($request->isAjaxCall()) {
             $this->redirect('quicksearch');
         } else {
             $issues = $this->issues;
             $issue = array_shift($issues);
             if ($issue instanceof TBGIssue) {
                 return $this->forward($this->getRouting()->generate('viewissue', array('project_key' => $issue->getProject()->getKey(), 'issue_no' => $issue->getFormattedIssueNo())));
             }
         }
     }
     $this->search_error = TBGContext::getMessageAndClear('search_error');
     $this->search_message = TBGContext::getMessageAndClear('search_message');
     $this->appliedfilters = $this->filters;
     $this->templates = TBGSavedSearch::getTemplates();
 }
Esempio n. 2
0
 /**
  * Return whether the user can access a saved search
  *
  * @param B2DBrow $savedsearch
  * 
  * @return boolean
  */
 public function canAccessSavedSearch(TBGSavedSearch $savedsearch)
 {
     return (bool) ($savedsearch->isPublic() || $savedsearch->getUserID() == $this->getID());
 }
 /**
  * @param TBGRequest $request
  *
  * @return TBGSavedSearch
  */
 public static function getFromRequest(TBGRequest $request)
 {
     $search = null;
     $search_id = $request['saved_search_id'] ? $request['saved_search_id'] : $request['saved_search'];
     if ($search_id) {
         $search = TBGSavedSearchesTable::getTable()->selectById($search_id);
     } else {
         $search = new TBGSavedSearch();
         $search->setValuesFromRequest($request);
     }
     return $search;
 }
Esempio n. 4
0
        echo TBGSavedSearch::getPredefinedSearchObject(TBGContext::PREDEFINED_SEARCH_MY_OWNED_OPEN_ISSUES)->getTotalNumberOfIssues();
        ?>
</span>
					</li>
					<?php 
        if ($tbg_user->hasTeams()) {
            ?>
						<li style="clear: both;">
							<?php 
            echo link_tag(make_url('my_teams_assigned_issues', array('format' => 'rss')), image_tag('icon_rss.png'), array('title' => __('Download feed')));
            ?>
							<?php 
            echo link_tag(make_url('my_teams_assigned_issues'), __('Open issues assigned to my teams'));
            ?>
<span class="num_results_badge"><?php 
            echo TBGSavedSearch::getPredefinedSearchObject(TBGContext::PREDEFINED_SEARCH_TEAM_ASSIGNED_OPEN_ISSUES)->getTotalNumberOfIssues();
            ?>
</span>
						</li>
					<?php 
        }
        ?>
				<?php 
    }
    ?>
			<?php 
}
?>
		</ul>
	</div>
	<div class="container_div">
 public function componentSearchbuilder()
 {
     $this->templates = TBGSavedSearch::getTemplates();
     $this->filters = $this->appliedfilters;
     $this->nondatecustomfields = TBGCustomDatatype::getAllExceptTypes(array(TBGCustomDatatype::DATE_PICKER));
     $this->datecustomfields = TBGCustomDatatype::getByFieldType(TBGCustomDatatype::DATE_PICKER);
     $i18n = TBGContext::getI18n();
     $this->columns = array('title' => $i18n->__('Issue title'), 'issuetype' => $i18n->__('Issue type'), 'assigned_to' => $i18n->__('Assigned to'), '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'), 'comments' => $i18n->__('Number of comments'));
     $groupoptions = array();
     if (!TBGContext::isProjectContext()) {
         $groupoptions['project_id'] = $i18n->__('Project');
     }
     $groupoptions['milestone'] = $i18n->__('Milestone');
     $groupoptions['assignee'] = $i18n->__("Who's assigned");
     $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');
     $this->groupoptions = $groupoptions;
 }