Source for file class.INTRO.php

Documentation is available at class.INTRO.php

  1. <?php
  2.  
  3. /**
  4.  * erstellt die Startseite und überprüft ob eine Woche vorüber ist
  5.  *
  6.  * @author Kay Koch
  7.  * @package src
  8.  * @since 15.12.04
  9.  * @subpackage foundation_user
  10.  * @version 1
  11.  */
  12.  
  13. if (version_compare(PHP_VERSION'5')) {
  14.     die('This file was generated for PHP 5');
  15. }
  16.  
  17. /**
  18.  * Basisklasse der ausführenden Klassen
  19.  * Stellt Methoden und Eigenschaften zur Ein- und Ausgabe über das Webinterface
  20.  * Verfügung
  21.  *
  22.  * @author Kay Koch
  23.  * @since 15.12.04
  24.  * @version 1
  25.  */
  26. require_once ('src/foundation/user/class.PARENTUSER.php');
  27.  
  28. /* user defined includes */
  29. // section -64--88-122--2-1328c7a:100b87cbb1c:-7fc6-includes begin
  30. // section -64--88-122--2-1328c7a:100b87cbb1c:-7fc6-includes end
  31.  
  32. /* user defined constants */
  33. // section -64--88-122--2-1328c7a:100b87cbb1c:-7fc6-constants begin
  34. // section -64--88-122--2-1328c7a:100b87cbb1c:-7fc6-constants end
  35.  
  36.  
  37.  
  38. /**
  39.  * erstellt die Startseite und überprüft ob eine Woche vorüber ist
  40.  *
  41.  * @access public
  42.  * @author Kay Koch
  43.  * @package src
  44.  * @since 15.12.04
  45.  * @subpackage foundation_user
  46.  * @version 1
  47.  */
  48.     // --- ATTRIBUTES ---
  49.  
  50.     // --- OPERATIONS ---
  51.  
  52.     
  53.  
  54.     /**
  55.      * erstellt die Startseite
  56.      *
  57.      * @access private
  58.      * @author Kay Koch, <kay.koch@gmx.de>
  59.      * @return void 
  60.      */
  61.     private function makePage($tpl'intro'{
  62.         // section -64--88-122--2-1328c7a:100b87cbb1c:-7fc2 begin
  63.         // Array data in einzelne Variablen umwandeln
  64.         $contentsrc_tools_TEMPLATE :: getTemplate($tpl$this);
  65.         $this->printPage($content);
  66.         // section -64--88-122--2-1328c7a:100b87cbb1c:-7fc2 end
  67.     }
  68.  
  69.     /**
  70.      * Konstruktor
  71.      *
  72.      * @access public
  73.      * @author Kay Koch, <kay.koch@gmx.de>
  74.      * @return void 
  75.      */
  76.     public function __construct({
  77.         // section -64--88-122--2-1328c7a:101ce91d1f9:-7ffd begin
  78.         parent :: __construct();
  79.         try {
  80.             if (!src_foundation_tables_PARENTTABLES :: getFlags()->isSaison()) // Saison gestartet ?
  81.                 {
  82.                 $tpl$this->setOutputValues("noSaison");
  83.                 throw new Exception();
  84.             }
  85.             $tpl$this->setOutputValues("saison");
  86.             if (src_foundation_tables_PARENTTABLES :: getFlags()->isNewDay()) // ein neuer Tag ?
  87.                 {
  88.                 if (!$this->updateDaySettings()) // Tagesupdates vornehmen
  89.                     throw new Exception();
  90.                 src_foundation_tables_PARENTTABLES :: getFlags()->updateDayCheck()// Datum für neuen Tag aktualisieren
  91.             }
  92.             if (src_foundation_tables_PARENTTABLES :: getFlags()->isNewWeek()) // eine neue Woche ?
  93.                 {
  94.                 if (!$this->updateWeekSettings()) // Wochenupdates vornehmen
  95.                     throw new Exception();
  96.                 src_foundation_tables_PARENTTABLES :: getFlags()->updateWeekCheck()// Datum für neue Woche aktualisieren
  97.             }
  98.  
  99.         catch (Exception $e{
  100.         }
  101.         $this->makePage($tpl);
  102.         // section -64--88-122--2-1328c7a:101ce91d1f9:-7ffd end
  103.     }
  104.  
  105.     /**
  106.      * aktualisiert alle Daten für ein tägliches Update
  107.      *
  108.      * - Säuberung der nicht abgeholten Buchungen
  109.      *
  110.      * @access private
  111.      * @author Kay Koch, <kay.koch@gmx.de>
  112.      * @return boolean 
  113.      */
  114.     private function updateDaySettings({
  115.         $returnValue= (bool) false;
  116.  
  117.         // section -64--88-122--2--5ee49331:10456be0103:-7fd2 begin
  118.         src_tools_CACHE :: clearCache();
  119.         $oBuchungnew src_foundation_tables_BUCHUNGEN();
  120.         $oBuchung->cleanBuchungen()// säubern
  121.         $returnValuetrue;
  122.         // section -64--88-122--2--5ee49331:10456be0103:-7fd2 end
  123.  
  124.         return (bool) $returnValue;
  125.     }
  126.  
  127.     /**
  128.      * aktualisiert alle Daten für ein wöchentliches Update
  129.      *
  130.      *  - neue frei Plätze einfügen
  131.      *  - wöchentliche pdf erstellen
  132.      *  - wöchentliche Mails verschicken
  133.      *  - alte freie Plätze archivieren
  134.      *  - alte Buchugnen löschen
  135.      *  - alte freie Plätze löschen
  136.      *
  137.      * @access private
  138.      * @author Kay Koch, <kay.koch@gmx.de>
  139.      * @param array 
  140.      * @return boolean 
  141.      */
  142.     private function updateWeekSettings({
  143.         $returnValue= (bool) false;
  144.         // section -64--88-122--2--5ee49331:10456be0103:-7fd0 begin
  145.         try {
  146.             src_tools_CACHE :: clearCache();
  147.             $arrRestPlaces$this->oNF->getOldEntries()// Restplätze auslesen
  148.             if (empty ($arrRestPlaces))
  149.                 throw new Exception(101);
  150.             $oBuchungnew src_foundation_tables_BUCHUNGEN();
  151.             $arrOldBuchungen$oBuchung->getOldBuchungen()// Einträge auslesen
  152.             $oPDFnew src_pdf_MYFPDF();
  153.             $oPDF->setBuchData($arrOldBuchungensrc_foundation_tables_PARENTTABLES :: getFlags()->prizePerPersonsrc_foundation_tables_PARENTTABLES :: getFlags()->lastBackupDate);
  154.             $oMailsrc_mail_MAIL :: singleton();
  155.             foreach ($arrRestPlaces as $see_id => $arrDatum{
  156.                 $pdfLocation$oPDF->createWeekPDF($arrDatum$this->oSeen-> $see_id)// pdf-erstellen
  157.                 if (empty ($pdfLocation))
  158.                     throw new Exception(103);
  159.                 if (!$oMail->sendWeekMail($this->oSeen-> $see_id$pdfLocationsrc_foundation_tables_PARENTTABLES :: getFlags()->lastBackupDate)) // Mail verschicken
  160.                     throw new Exception(104);
  161.             }
  162.             $oArchivnew src_foundation_tables_ARCHIV();
  163.             $oArchiv->deleteRow()// Archiv der letzten Woche löschen
  164.             $oArchiv->saveOldBuchungen($oBuchung->getTableName())// Buchungen archivieren
  165.             $oBuchung->cleanBuchungen(true)// löscht alle nicht abgeholten Einträge
  166.             $oBuchung->deleteOldBuchungen()// löscht alle abgeholten Einträge
  167.             $oBlocksnew src_foundation_tables_BLOCKADEN();
  168.             $oBlocks->deleteOldEntries()// alte Blockaden löschen
  169.             $oBlocks->setEntriesToNewWeek()// regelmäßige Blockaden aktualisieren
  170.             $this->oNF->saveCalendarFile();
  171.             $returnValuetrue;
  172.         catch (Exception $e{
  173.             src_tools_ERROR :: setError($e__METHOD__);
  174.         }
  175.         // section -64--88-122--2--5ee49331:10456be0103:-7fd0 end
  176.  
  177.         return (bool) $returnValue;
  178.     }
  179.     /**
  180.      *
  181.      * @access private
  182.      * @author Kay Koch, <kay.koch@gmx.de>
  183.      * @param array 
  184.      * @return void 
  185.      */
  186.     private function setOutputValues($tpl{
  187.         $returnValue= (string) "";
  188.  
  189.         if ($tpl == "saison"{
  190.             $returnValue"saison"//Standardtemplate
  191.             $this->disabled"";
  192.             $this->infosrc_foundation_tables_PARENTTABLES :: getFlags()->info//Info für Startseite
  193.             $this->infoStyle(src_foundation_tables_PARENTTABLES :: getFlags()->isError"error" "normal"// CSS-Style der Info
  194.         else {
  195.             $returnValue"noSaison";
  196.             $this->disabled"disabled";
  197.             $this->saisonData$this->oSeen->getSaisonTable();
  198.         }
  199.         //
  200.  
  201.         return (string) $returnValue;
  202.     }
  203.  
  204. /* end of class src_foundation_user_INTRO */
  205. ?>

Documentation generated on Sat, 24 Mar 2007 09:59:33 +0100 by phpDocumentor 1.3.1