/**
  * Set a view with the list of process instances (both started or finished) and available process definitions
  *
  * @access public
  * @author CRP Henri Tudor - TAO Team - {@link http://www.tao.lu}
  * @param processDefinitionUri
  * @return void
  */
 public function index()
 {
     $user = common_session_SessionManager::getSession()->getUser();
     /**
      * Retrieve resumable deliveries (via delivery execution)
      */
     $resumableData = array();
     foreach ($this->service->getResumableDeliveries($user) as $de) {
         $resumableData[] = DeliveryHelper::buildFromDeliveryExecution($de);
     }
     $this->setData('resumableDeliveries', $resumableData);
     $assignmentService = $this->getServiceManager()->get(AssignmentService::CONFIG_ID);
     $deliveryData = array();
     foreach ($assignmentService->getAssignments($user) as $delivery) {
         $deliveryData[] = DeliveryHelper::buildFromAssembly($delivery, $user);
     }
     $this->setData('availableDeliveries', $deliveryData);
     /**
      *  Require JS config
      */
     $this->setData('client_config_url', $this->getClientConfigUrl());
     /**
      * Header & footer info
      */
     $this->setData('showControls', $this->showControls());
     $this->setData('userLabel', common_session_SessionManager::getSession()->getUserLabel());
     /**
      * Layout template + real template inclusion
      */
     $this->setData('content-template', 'DeliveryServer/index.tpl');
     $this->setData('content-extension', 'taoDelivery');
     $this->setView('DeliveryServer/layout.tpl', 'taoDelivery');
 }
 /**
  * Set a view with the list of process instances (both started or finished) and available process definitions
  *
  * @access public
  * @author CRP Henri Tudor - TAO Team - {@link http://www.tao.lu}
  * @param processDefinitionUri
  * @return void
  */
 public function index()
 {
     $user = common_session_SessionManager::getSession()->getUser();
     /**
      * Retrieve resumable deliveries (via delivery execution)
      */
     $resumableData = array();
     foreach ($this->service->getResumableDeliveries($user) as $de) {
         $resumableData[] = DeliveryHelper::buildFromDeliveryExecution($de);
     }
     $this->setData('resumableDeliveries', $resumableData);
     $assignmentService = $this->getServiceManager()->get(AssignmentService::CONFIG_ID);
     $deliveryData = array();
     foreach ($assignmentService->getAssignments($user) as $delivery) {
         $deliveryData[] = DeliveryHelper::buildFromAssembly($delivery, $user);
     }
     $this->setData('availableDeliveries', $deliveryData);
     /**
      * Header & footer info
      */
     $this->setData('showControls', $this->showControls());
     $this->setData('userLabel', common_session_SessionManager::getSession()->getUserLabel());
     // Require JS config
     $this->setData('client_config_url', $this->getClientConfigUrl());
     $this->setData('client_timeout', $this->getClientTimeout());
     $loaderRenderer = new \Renderer(Template::getTemplate('DeliveryServer/blocks/loader.tpl', 'taoDelivery'));
     $loaderRenderer->setData('client_config_url', $this->getClientConfigUrl());
     $loaderParams = [];
     if ($this->getRequest()->hasParameter('warning') && !empty($this->getRequest()->getParameter('warning'))) {
         $loaderParams['message'] = ['level' => 'danger', 'content' => $this->getRequest()->getParameter('warning'), 'timeout' => -1];
     }
     $loaderRenderer->setData('parameters', $loaderParams);
     /**
      * Layout template + real template inclusion
      */
     $this->setData('additional-header', $loaderRenderer);
     $this->setData('content-template', 'DeliveryServer/index.tpl');
     $this->setData('content-extension', 'taoDelivery');
     $this->setView('DeliveryServer/layout.tpl', 'taoDelivery');
 }