/**
  * ctor
  * @return void
  */
 public function __construct(\library\application $application, $module, $action)
 {
     parent::__construct($application, $module, $action);
     require 'functions/functions.php';
     //delegations
     $delegationsCategories = array();
     $delegationsInstances = array();
     if (isset($_SESSION['users'])) {
         $delegationService = new \applications\modules\instances\services\delegationsService();
         unset($_SESSION['delegations']);
         $_SESSION['delegations']['categories'] = $delegationService->getDelegationGivenForCategories($this->application->getHttpRequest()->getGET('id'), $_SESSION['users']->id);
         $_SESSION['delegations']['instances'] = $delegationService->getDelegationGivenForInstances($this->application->getHttpRequest()->getGET('id'), $_SESSION['users']->id);
         $_SESSION['delegations']['receiveForCategories'] = $delegationService->getDelegationReceiveForCategories($this->application->getHttpRequest()->getGET('id'), $_SESSION['users']->id);
         $_SESSION['delegations']['receiveForInstances'] = $delegationService->getDelegationReceiveForInstances($this->application->getHttpRequest()->getGET('id'), $_SESSION['users']->id, $this->application->getHttpRequest()->getGET('categories'));
         foreach ($_SESSION['delegations']['receiveForCategories'] as $v) {
             array_push($delegationsCategories, $v);
         }
         foreach ($_SESSION['delegations']['receiveForInstances'] as $v) {
             array_push($delegationsInstances, $v);
         }
     } else {
         unset($_SESSION['delegations']);
     }
     $this->page->addVar('delegationsCategories', $delegationsCategories);
     $this->page->addVar('delegationsInstances', $delegationsInstances);
 }
 /**
  * list of delegations
  * @param \library\httpRequest $request
  * @return void
  */
 public function delegationsAction(\library\httpRequest $request)
 {
     $delegationService = new \applications\modules\instances\services\delegationsService();
     $this->page->addVar('delegationsGiven', $delegationService->getDelegationGiven($_SESSION['users']->id));
     $this->page->addVar('delegationsReceive', $delegationService->getDelegationReceive($_SESSION['users']->id));
 }