<?php
/**
 * @copyright (c) Kufer Software GmbH, Loisachstrasse 4, D-84453 Mühldorf
 */

class GrafikDruckListen extends DruckListen
{
  
  public function getListAry()
  {
    
    $sprachsettings = new 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 = 0;
    $einstellallowed = 0;
    $infoallowed = 0; 
    
    $sectID = $this->toolSectionID;
    switch ($pListe) {
        case 'Doz1grafik':
        $druckallowed = \SecurityOperations::privilegAllowedCurrentUser($this->toolID, $sectID . '.0.2') > 1;
            $einstellallowed = \SecurityOperations::privilegAllowedCurrentUser($this->toolID, $sectID . '.0.3') > 1;
        $infoallowed = \SecurityOperations::privilegAllowedCurrentUser($this->toolID, $sectID . '.2.2') > 1;
          break;
        case 'Doz2grafik':
        $druckallowed = \SecurityOperations::privilegAllowedCurrentUser($this->toolID, $sectID . '.0.4') > 1;
            $einstellallowed = \SecurityOperations::privilegAllowedCurrentUser($this->toolID, $sectID . '.0.5') > 1;
        $infoallowed = \SecurityOperations::privilegAllowedCurrentUser($this->toolID, $sectID . '.2.3') > 1;
          break;
        case 'Stundeplangrafik':
          $druckallowed = \SecurityOperations::privilegAllowedCurrentUser($this->toolID, $sectID . '.0.6') > 1;
            $einstellallowed = \SecurityOperations::privilegAllowedCurrentUser($this->toolID, $sectID . '.0.7') > 1;
        $infoallowed = \SecurityOperations::privilegAllowedCurrentUser($this->toolID, $sectID . '.2.4') > 1;
          break;
        case 'Wochenplangrafik':
        $druckallowed = \SecurityOperations::privilegAllowedCurrentUser($this->toolID, $sectID . '.0.8') > 1;
          $einstellallowed = \SecurityOperations::privilegAllowedCurrentUser($this->toolID, $sectID . '.0.9') > 1;
      $infoallowed = \SecurityOperations::privilegAllowedCurrentUser($this->toolID, $sectID . '.2.5') > 1;
          break;
        case 'Monatsplangrafik':
        $druckallowed = \SecurityOperations::privilegAllowedCurrentUser($this->toolID, $sectID . '.0.10') > 1;
        $einstellallowed = \SecurityOperations::privilegAllowedCurrentUser($this->toolID, $sectID . '.0.11') > 1;
      $infoallowed = \SecurityOperations::privilegAllowedCurrentUser($this->toolID, $sectID . '.2.6') > 1;
          break;
        case 'Schuelerstundplangrafik':
          $druckallowed = \SecurityOperations::privilegAllowedCurrentUser($this->toolID, $sectID . '.0.12') > 1;
          $einstellallowed = \SecurityOperations::privilegAllowedCurrentUser($this->toolID, $sectID . '.0.13') > 1;
                  $infoallowed = \SecurityOperations::privilegAllowedCurrentUser($this->toolID, $sectID . '.2.7') > 1;
          break;
      }
    if (\SecurityOperations::privilegAllowedCurrentUser($this->toolID, $sectID . '.2.1') <= 1) {
      $infoallowed = 0;
    }

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

  

  
  public function _getFastHeader()
  {
    $sprachsettings = new SprachSettingsObject();
    $headertext = 'Grafiken für Ihre ' . $sprachsettings->Kurstermine['Plural']['Nominativ'];
    if ($this->toolID == \ToolsAPI::TOOL_DOZENTENINFO_MA) {
      $headertext = 'Grafiken für die ' . $sprachsettings->Kurstermine['Plural']['Nominativ'] . ' '
                    . $sprachsettings->Dozent['Singular_mit_Artikel']['Genitiv'];
    }

    return '<h1>' . CleanOperations::cleanStringForHtml($headertext) . ':</h1>';
  }

  protected function _getListFastClassName()
  {
    return 'grafiken';
  }
}