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

namespace Kufer\Web\KuferTools\Basis\PdfListen;


class SonstigePdfListen extends DruckPdfListen
{
  
  public function getListAry()
  {
    
    $sprachSettings = \SettingsFactory::getSettings('SprachSettingsObject');

    return array(
              'KursvertragSonstiges' => $sprachSettings->Kurs['Singular']['Nominativ'] . 'vertrag (1 Vertrag je '
              . $sprachSettings->Kurs['Singular']['Nominativ'] . ')',
              'KurssammelvertragSonstiges' => $sprachSettings->Kurs['Singular']['Nominativ'] . 'sammelvertrag');
  }

  

  
  public function getListenrechte($pListe)
  {
    $druckallowed = false;
    $einstellallowed = false;
    $infoallowed = false; 
    
    $sectID = $this->toolSectionID;
    switch ($pListe) {
      case 'KursvertragSonstiges':
        $druckallowed = \SecurityOperations::privilegAllowed($this->userId, $this->toolId, $sectID . '.0.2') > 1;
        $einstellallowed = \SecurityOperations::privilegAllowed($this->userId, $this->toolId, $sectID . '.0.3') > 1;
        $infoallowed = \SecurityOperations::privilegAllowed($this->userId, $this->toolId, $sectID . '.2.2') > 1;
        break;
      case 'KurssammelvertragSonstiges':
        $druckallowed = \SecurityOperations::privilegAllowed($this->userId, $this->toolId, $sectID . '.0.4') > 1;
        $einstellallowed = \SecurityOperations::privilegAllowed($this->userId, $this->toolId, $sectID . '.0.5') > 1;
        $infoallowed = \SecurityOperations::privilegAllowed($this->userId, $this->toolId, $sectID . '.2.3') > 1;
        break;
    } 
    
    if (\SecurityOperations::privilegAllowed($this->userId, $this->toolId, $sectID . '.0.1') <= 1) {
      $einstellallowed = false;
    }
    
    if (\SecurityOperations::privilegAllowed($this->userId, $this->toolId, $sectID . '.2.1') <= 1) {
      $infoallowed = false;
    }

    return array('druck' => $druckallowed, 'einstell' => $einstellallowed, 'info' => $infoallowed);
  }

  
}