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

  
  





  
  class MenuEinstellTool10 extends MenuEinstell
  {
    public $file = 'writecolumnstool10.php';

    
    protected function _getSights()
    {
      $result = array();

      $sightIds = array(
           38 => 'Kurstage einzeln',
           39 => 'Kurstagedetails',
           49 => 'Kursdetails',
           98 => 'Kursübersicht',
           99 => 'Kurstage nach Fach',
          100 => 'Kurstage alle'
          );

      foreach ($sightIds as $sightId => $description) {
        $result[] = $this->_createSightObj($sightId, \ToolsAPI::TOOL_KURSBEWERBUNG_DOZ, $description);
      }

      return $result;
    }

    public function mainmenu($pEinstieg, $editid, $p_sightid)
    {
      
      if ($pEinstieg == 1) {
        $this->getUebersichtEinstell(SessionOperations::getVarValueIntern('menutext'));
      } else { 

        echo"
        <table border='0' cellpadding='0' cellspacing='5' height='100%' width='100%'>
          <tr>
            <td valign='top' width='100%' height='5%'>
              <p align='right'><font id='text_basys_webtools'>" . KUFERTOOLS . '</font></p>
            </td>
          </tr>
        </table>
        ';

        $curr_caption = $this->_getSightDescription($p_sightid);

        switch ($p_sightid) {
          case 38: 

            $this->mainmenuTop($curr_caption, \ToolsAPI::TOOL_KURSBEWERBUNG_DOZ, $p_sightid, $this->file); 
            $this->mainmenuCenter(\ToolsAPI::TOOL_KURSBEWERBUNG_DOZ, $editid, $p_sightid, $this->file);     
             
            $objsettings = ToolSettingsAPI::getToolSettings(\ToolsAPI::TOOL_KURSBEWERBUNG_DOZ);
            $this->file = 'writecolumnstool10.php';
            
            
            $defaultStatus = '';
            $this->showSelectionForm(
              'kt',
              \ToolsAPI::TOOL_KURSBEWERBUNG_DOZ,
              $p_sightid,
              $this->file,
              $objsettings,
              $objsettings->sortktasc,
              $objsettings->ktstatus,
              $defaultStatus,
              $objsettings->colorktstatus,
              'kt.datum'
            );

            break;


          case 39: 

            $this->mainmenuTop($curr_caption, \ToolsAPI::TOOL_KURSBEWERBUNG_DOZ, $p_sightid, $this->file); 
            $this->mainmenuCenter(\ToolsAPI::TOOL_KURSBEWERBUNG_DOZ, $editid, $p_sightid, $this->file);     
             
            $objsettings = ToolSettingsAPI::getToolSettings(\ToolsAPI::TOOL_KURSBEWERBUNG_DOZ);
            $this->file = 'writecolumnstool10.php';
            
            
            $defaultStatus = '';
            $this->showSelectionForm(
              'kt',
              \ToolsAPI::TOOL_KURSBEWERBUNG_DOZ,
              $p_sightid,
              $this->file,
              $objsettings,
              $objsettings->sortktasc,
              $objsettings->ktstatus,
              $defaultStatus,
              $objsettings->colorktstatus,
              'kt.datum'
            );

            break;

          case 49: 

            $this->mainmenuTop($curr_caption, \ToolsAPI::TOOL_KURSBEWERBUNG_DOZ, $p_sightid, $this->file); 
            $this->mainmenuCenter(\ToolsAPI::TOOL_KURSBEWERBUNG_DOZ, $editid, $p_sightid, $this->file);     
            break;

          case 98: 

            $this->mainmenuTop($curr_caption, \ToolsAPI::TOOL_KURSBEWERBUNG_DOZ, $p_sightid, $this->file); 
            $this->mainmenuCenter(\ToolsAPI::TOOL_KURSBEWERBUNG_DOZ, $editid, $p_sightid, $this->file);     

            

            $objsettings = ToolSettingsAPI::getToolSettings(\ToolsAPI::TOOL_KURSBEWERBUNG_DOZ);
            
            $arycheck = array('', '', '', '');
            if (($objsettings->sortkurstage == 'knr') && ($objsettings->sortkurstageasc)) {
              $arycheck[0] = 'checked';
            } elseif (($objsettings->sortkurstage == 'knr') && (!$objsettings->sortkurstageasc)) {
              $arycheck[1] = 'checked';
            } elseif (($objsettings->sortkurstage == 'datum') && ($objsettings->sortkurstageasc)) {
              $arycheck[2] = 'checked';
            } elseif (($objsettings->sortkurstage == 'datum') && (!$objsettings->sortkurstageasc)) {
              $arycheck[3] = 'checked';
            }

          $bewerbungQualiDoz = $objsettings->bewerbungQualiDoz ? 'checked' : '';

      echo
            BR_WT . BR_WT . BR_WT . "
            <form action='writecolumnstool10.php' method='POST'>
             <input type='hidden' value='Show_Sort_Sem' name='art'>
             <input type='hidden' value='10' name='tool'>
             <input type='hidden' value='" . CleanOperations::cleanInt($p_sightid) . "' name='sightid'>
             <table border='0' width='100%'>
              <tr>
                <td width='85%' valign='top' height='19'>
                  <font class='text_main_menu'><b>angezeigte Unterrichtseinsätze pro Seite:</b></font>"
                  . HTMLOperations::CreateInputTagPlusMinus('kurseproseite', '', 'bigger-null', $objsettings->kurseproseite, 'size="3"')
                  . BR_WT . BR_WT . BR_WT . "
                </td>
              </tr>
              <tr>
                <td width='85%' valign='top' height='19'><font class='text_main_menu'><b>Sortierung der Kurstage:</b>" . BR_WT . BR_WT . "</font>
                  <table border='0' width='100%'>
                    <tr>
                      <td width='25%' valign='top'>
                        <font class='text_main_menu'>&nbsp; -&nbsp; nach Kursnummer: </font>
                      </td>
                      <td width='25%' valign='top'>
                        <input type='radio' value='kurstageauf' " . $arycheck[0] . " name='sortkurstage'>
                        <font class='text_main_menu'>aufsteigend</font>
                      </td>
                      <td width='25%' valign='top'>
                        <input type='radio' name='sortkurstage' " . $arycheck[1] . " value='kurstageab'>
                        <font class='text_main_menu'>absteigend</font>
                      </td>
                      <td width='25%' valign='top'></td>
                    </tr>
                    <tr>
                      <td width='25%' valign='top'>
                        <font class='text_main_menu'>&nbsp; -&nbsp; nach Datum:</font>
                      </td>
                      <td width='25%' valign='top'>
                        <input type='radio' value='beginnauf' " . $arycheck[2] . " name='sortkurstage'>
                        <font class='text_main_menu'>aufsteigend</font>
                      </td>
                      <td width='25%' valign='top'>
                        <input type='radio' name='sortkurstage' " . $arycheck[3] . " value='beginnab'>
                        <font class='text_main_menu'>absteigend</font>
                      </td>
                    </tr>
                  </table>" . BR_WT . BR_WT . "
                  <table>
                    <tr>
                      <table width='100%'>
                        <tr>
                          <td width='20'><input type='checkbox' name='bewerbungQualiDoz' " . $bewerbungQualiDoz . "></td>
                          <td><font class='text_main_menu'>Bewerbung der Dozenten zulassen, die bei einem Kurs, bei dem nur alle Kurstage komplett angeboten werden, nicht alle der benötigten Qualifikationen besitzen</font></td>
                        </tr>
                      </table>
                    </tr>
                    <tr>
                      <td width='85%' height='19' valign='top'>
                  <font class='text_main_menu'><b>Kurse folgender Semester anzeigen:</b> (es können auch mehrere Semester gewählt werden)</font>" . BR_WT;
            $tool0Settings = ToolSettingsAPI::getToolSettings(0);
            echo $this->getSemester4SingleTool($objsettings->semlist, $tool0Settings->semlist, $objsettings->useAbweichendeSemester, true, $objsettings->keineAusgefallenenKurse)
                        
                        . "<input type='hidden' value='" . CleanOperations::cleanStringForHtml($this->gruppe) . "' name='gruppe'>
                        <input type='image' title='Speichern' src='layout/button_save.gif' border='0'>
                      </td>
                      <td width='25%' valign='top'>
                        " . BR_WT . BR_WT . BR_WT . '
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
             </table>
        </form>';
        break;

          case 99: 

            $this->mainmenuTop($curr_caption, \ToolsAPI::TOOL_KURSBEWERBUNG_DOZ, $p_sightid, $this->file); 
            $this->mainmenuCenter(\ToolsAPI::TOOL_KURSBEWERBUNG_DOZ, $editid, $p_sightid, $this->file);     
             
            $objsettings = ToolSettingsAPI::getToolSettings(\ToolsAPI::TOOL_KURSBEWERBUNG_DOZ);
            $this->file = 'writecolumnstool10.php';
            
            
            $defaultStatus = '';
            $this->showSelectionForm(
              'kt',
              \ToolsAPI::TOOL_KURSBEWERBUNG_DOZ,
              $p_sightid,
              $this->file,
              $objsettings,
              $objsettings->sortktasc,
              $objsettings->ktstatus,
              $defaultStatus,
              $objsettings->colorktstatus,
              'kt.datum'
            );

            break;

          case 100: 

             $this->mainmenuTop($curr_caption, \ToolsAPI::TOOL_KURSBEWERBUNG_DOZ, $p_sightid, $this->file); 
            $this->mainmenuCenter(\ToolsAPI::TOOL_KURSBEWERBUNG_DOZ, $editid, $p_sightid, $this->file);     
            
            $objsettings = ToolSettingsAPI::getToolSettings(\ToolsAPI::TOOL_KURSBEWERBUNG_DOZ);
            $this->file = 'writecolumnstool10.php';
            
            
            $defaultStatus = '';
            $this->showSelectionForm(
              'kt',
              \ToolsAPI::TOOL_KURSBEWERBUNG_DOZ,
              $p_sightid,
              $this->file,
              $objsettings,
              $objsettings->sortktasc,
              $objsettings->ktstatus,
              $defaultStatus,
              $objsettings->colorktstatus,
              'kt.datum'
            );
            break;

        }
      }
    }
  }