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

namespace Kufer\Web\KuferTools\Mitarbeiter\DozentenInfo\SammelEMail;

class SammelEMailUseCase extends \Kufer\Web\KuferTools\Basis\DozentenInfo\SammelEMail\SammelEMailUseCase
{
  public static function getToolId()
  {
    return \ToolsAPI::TOOL_DOZENTENINFO_MA;
  }

  public static function getToolSectionId()
  {
    return 54;
  }

  public function action()
  {
    $response = parent::action();
    $tool0Settings = \ToolSettingsAPI::getToolSettings(0);
    $response->emailAnDozentSenderMultiple = $this->toolSettings->emailAnDozentSenderMultiple && $tool0Settings->absenderMitarbeiterAnDozent === 'Person';
    $response->ma = \SessionOperations::getCurrentWebToolsMitarbeiter();

    return $response;
  }

  protected function getRechteKey()
  {
    return '397.0.8';
  }

  protected function isShowingEMail(): bool
  {
    return $this->toolSettings->emailAnDozentenShowEMail;
  }
}