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

namespace Kufer\Web\KuferTools\Basis\PdfListen;


class GrafikPdfListen extends DruckPdfListen
{
  
  public function getListAry()
  {
    
    $sprachSettings = \SettingsFactory::getSettings('SprachSettingsObject');
    $artikel = 'Ihrer';
    if ($this->toolId == \ToolsAPI::TOOL_DOZENTENINFO_MA) {
      $artikel = 'der';
    }

    return array(
        'Doz1grafik' => 'tagesorientierte grafische &Uuml;bersicht ' . $artikel . ' ' . $sprachSettings->Kurstag['Plural']['Nominativ'],
        'Doz2grafik' => 'wochenorientierte grafische &Uuml;bersicht ' . $artikel . ' ' . $sprachSettings->Kurstag['Plural']['Nominativ'],
        'Stundeplangrafik' => 'Stundenplan',
        'Wochenplangrafik' => 'Wochenplan',
        'Monatsplangrafik' => 'Monatsplan',
        'Schuelerstundplangrafik' => 'Sch&uuml;lerstundenplan');
  }

  

  
  public function getListenrechte($pListe)
  {
    $druckallowed = false;
    $einstellallowed = false;
    $infoallowed = false; 
    
    $sectID = $this->toolSectionID;
    switch ($pListe) {
      case 'Doz1grafik':
        $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 'Doz2grafik':
        $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;
      case 'Stundeplangrafik':
        $druckallowed = \SecurityOperations::privilegAllowed($this->userId, $this->toolId, $sectID . '.0.6') > 1;
        $einstellallowed = \SecurityOperations::privilegAllowed($this->userId, $this->toolId, $sectID . '.0.7') > 1;
        $infoallowed = \SecurityOperations::privilegAllowed($this->userId, $this->toolId, $sectID . '.2.4') > 1;
        break;
      case 'Wochenplangrafik':
        $druckallowed = \SecurityOperations::privilegAllowed($this->userId, $this->toolId, $sectID . '.0.8') > 1;
        $einstellallowed = \SecurityOperations::privilegAllowed($this->userId, $this->toolId, $sectID . '.0.9') > 1;
        $infoallowed = \SecurityOperations::privilegAllowed($this->userId, $this->toolId, $sectID . '.2.5') > 1;
        break;
      case 'Monatsplangrafik':
        $druckallowed = \SecurityOperations::privilegAllowed($this->userId, $this->toolId, $sectID . '.0.10') > 1;
        $einstellallowed = \SecurityOperations::privilegAllowed($this->userId, $this->toolId, $sectID . '.0.11') > 1;
        $infoallowed = \SecurityOperations::privilegAllowed($this->userId, $this->toolId, $sectID . '.2.6') > 1;
        break;
      case 'Schuelerstundplangrafik':
        $druckallowed = \SecurityOperations::privilegAllowed($this->userId, $this->toolId, $sectID . '.0.12') > 1;
        $einstellallowed = \SecurityOperations::privilegAllowed($this->userId, $this->toolId, $sectID . '.0.13') > 1;
        $infoallowed = \SecurityOperations::privilegAllowed($this->userId, $this->toolId, $sectID . '.2.7') > 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);
  }

  
}