<?php
/**
 * @copyright (c) Kufer Software GmbH, Oderstraße 7, D-84453 Mühldorf
 */

namespace Kufer\Web\KuferTools\Veranstalter\KursUebersichtDerMitarbeiter\KursUebersicht\Detailsreiter\Termine;

class TermineUseCase extends \Kufer\Web\KuferTools\Basis\Kursdetails\Detailsreiter\Termine\TermineUseCase
{
  public static function getToolId()
  {
    return 61;
  }

  public static function getToolSectionId()
  {
    return 726;
  }

  protected function getMainReiterId()
  {
    return 722;
  }

  public function hasAccess($pToolSectionId = null)
  {
    if (!\Kufer\Web\KuferTools\Basis\UseCase\ToolUseCase::hasAccess(722)) {
      return false;
    }
    if (!$this->isRechtAllowed($this->getMainReiterId() . '.1.4')) {
      return false;
    }

    return true;
  }

  protected function getButtons()
  {
    $buttonsObj = new \Kufer\Web\KuferTools\Basis\Kursdetails\Detailsreiter\TnTermineReiterButtons($this, $this->request, $this->response);
    $buttonsArray = $buttonsObj->getButtons();
    $selectionDependentButtons = array('Terminplan');
    $this->response->markierenButtons = $this->markierenButtonNotwendig($buttonsArray, $selectionDependentButtons);

    return $buttonsArray;
  }
}