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

namespace Kufer\Web\KuferTools\Mitarbeiter\Anmeldung\HandleSaveSettingsAjax;

class HandleSaveSettingsAjaxUseCase extends \Kufer\Web\KuferTools\Basis\UseCase\ToolUseCase
{
  public function __construct($request)
  {
    parent::__construct($request, new HandleSaveSettingsAjaxResponse());
  }

  public static function getToolSectionId()
  {
    return 434;
  }

  public static function getToolId()
  {
    return \ToolsAPI::TOOL_ANMELDUNGBUCHEN_MA;
  }

  public function action()
  {
    $settingsSaved = false;
    if ($this->request->savesettings) {
      
      
      \SessionOperations::setVarValueWTIntern('choosedOptions', $this->request->ausgewaehlteOptionen);
      $settingsSaved = true;
    }

    return $this->getResponse($settingsSaved);
  }

  protected function getResponse($settingsSaved)
  {
    $this->response->settingsSaved = $settingsSaved;

    return $this->response;
  }
}

class HandleSaveSettingsAjaxRequest
{
  public $savesettings;
  public $ausgewaehlteOptionen;
}

class HandleSaveSettingsAjaxResponse extends \Kufer\Web\KuferTools\Basis\UseCase\ToolResponse
{
  public $settingsSaved;
}