Пример #1
0
 public function runGetMilestoneIssues(TBGRequest $request)
 {
     try {
         $i18n = TBGContext::getI18n();
         if ($request->hasParameter('milestone_id')) {
             if ($request['milestone_id']) {
                 $milestone = new TBGMilestone($request['milestone_id']);
             } else {
                 $milestone = new TBGMilestone();
                 $milestone->setName(TBGContext::getI18n()->__('Unassigned issues / backlog'));
                 $milestone->setId(0);
                 $milestone->setProject($this->selected_project);
             }
             $template = $request->getParameter('mode', 'roadmap') == 'roadmap' ? 'project/milestoneissues' : 'project/planning_milestoneissues';
             return $this->renderJSON(array('failed' => false, 'content' => $this->getTemplateHTML($template, array('milestone' => $milestone, 'selected_columns' => $milestone->getProject()->getPlanningColumns(TBGContext::getUser()), 'all_columns' => $milestone->getProject()->getIssueFields(false)))));
         } else {
             throw new Exception($i18n->__('Invalid milestone'));
         }
     } catch (Exception $e) {
         $this->getResponse()->setHttpStatus(400);
         return $this->renderJSON(array('failed' => true, 'error' => $e->getMessage()));
     }
 }