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

namespace Kufer\Web\KuferTools\Dozent\KursUebersicht\DrucklistenAllgemein\Drucklisten\ShowSettingsKurseListen;

abstract class ShowSettingsDruckListenAllgemeinUseCase extends \Kufer\Web\KuferTools\Basis\DrucklistenAllgemein\Drucklisten\ShowSettingsKurseListen\ShowSettingsDruckListenAllgemeinUseCase
{
  public static function getToolId()
  {
    return \ToolsAPI::TOOL_KURSUEBERSICHT_DOZ;
  }

  protected function _getListSettingsResponseObj()
  {
    return new ShowSettingsDruckListenAllgemeinResponse();
  }

  protected function showKurstageNurVonEingeloggtemDozent(): bool
  {
    $tool0Settings = \ToolSettingsAPI::getToolSettings(0);
    $wtUser = \SessionOperations::getCurrentWebToolsUser();

    return $tool0Settings->kurstageNurVonEingeloggtemDozent && $wtUser->dnr > 0;
  }

  protected function getResponse($pDataModulList, $pGenerateList, $pKursNrStr, $pListObj)
  {
    parent::getResponse($pDataModulList, $pGenerateList, $pKursNrStr, $pListObj);
    $this->response->datamodulListObj->dnr = $this->request->dnr;

    return $this->response;
  }
}