<?php
/**
 * @copyright (c) Kufer Software GmbH, Loisachstrasse 4, D-84453 Mühldorf
 */

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

class TermineUseCase extends \Kufer\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\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\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;
  }
}