/**
  * @NoAdminRequired
  * @NoCSRFRequired
  */
 public function index()
 {
     // get versions
     $confVersions = Helper::getVersions();
     $versions = array();
     if (is_array($confVersions)) {
         foreach ($confVersions as $confVersion) {
             $version = array();
             $version['version'] = $confVersion;
             $version['label'] = $confVersion . " " . $this->l->n("day", "days", $confVersion);
             array_push($versions, $version);
         }
     }
     // get all todo, running and done requests
     $todos = $runnings = $dones = array();
     // TEST DATAS
     // list($todos, $runnings, $dones) = $this->getTestDatas();
     // $precedingNb = 3 ;
     $todos = $this->requestService->getTodos();
     $runnings = $this->requestService->getRunnings();
     $dones = $this->requestService->getDones();
     // get number of preceding requests
     $precedingNb = $this->requestService->getPrecedingNb();
     return $this->render('main', array('versions' => $versions, 'todos' => $todos, 'runnings' => $runnings, 'dones' => $dones, 'precedingRequests' => $precedingNb));
 }
 /**
  * Returns allowed "versions"
  * @NoAdminRequired
  * @NoCSRFRequired
  */
 public function versions()
 {
     try {
         $versions = Helper::getVersions();
     } catch (\Exception $e) {
         $response = new JSONResponse();
         return array('status' => 'error', 'data' => array('msg' => $e->getMessage()));
     }
     return array('status' => 'success', 'data' => array('msg' => $this->l->t('Allowed versions'), 'versions' => json_encode($versions)));
 }