Initial commit
This commit is contained in:
199
typo3conf/ext/if_oberstufenplaner/Classes/Domain/Model/Fach.php
Normal file
199
typo3conf/ext/if_oberstufenplaner/Classes/Domain/Model/Fach.php
Normal file
@@ -0,0 +1,199 @@
|
||||
<?php
|
||||
|
||||
namespace Internetfabrik\IfOberstufenplaner\Domain\Model;
|
||||
|
||||
class Fach
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $name;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $typ;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $wochenStunden11;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $wochenStunden12;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $jahreswochenstunden;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $halbjahresleistungen;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $pruefung = null;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $rgbColor;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @return Fach
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getTyp()
|
||||
{
|
||||
return $this->typ;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $typ
|
||||
* @return Fach
|
||||
*/
|
||||
public function setTyp($typ)
|
||||
{
|
||||
$this->typ = $typ;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getWochenStunden11()
|
||||
{
|
||||
return $this->wochenStunden11;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $wochenStunden11
|
||||
* @return Fach
|
||||
*/
|
||||
public function setWochenStunden11($wochenStunden11)
|
||||
{
|
||||
$this->wochenStunden11 = $wochenStunden11;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getWochenStunden12()
|
||||
{
|
||||
return $this->wochenStunden12;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $wochenStunden12
|
||||
* @return Fach
|
||||
*/
|
||||
public function setWochenStunden12($wochenStunden12)
|
||||
{
|
||||
$this->wochenStunden12 = $wochenStunden12;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getJahreswochenstunden()
|
||||
{
|
||||
return $this->jahreswochenstunden;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $jahreswochenstunden
|
||||
* @return Fach
|
||||
*/
|
||||
public function setJahreswochenstunden($jahreswochenstunden)
|
||||
{
|
||||
$this->jahreswochenstunden = $jahreswochenstunden;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getHalbjahresleistungen()
|
||||
{
|
||||
return $this->halbjahresleistungen;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $halbjahresleistungen
|
||||
* @return Fach
|
||||
*/
|
||||
public function setHalbjahresleistungen($halbjahresleistungen)
|
||||
{
|
||||
$this->halbjahresleistungen = $halbjahresleistungen;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getPruefung()
|
||||
{
|
||||
return $this->pruefung;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $pruefung
|
||||
* @return Fach
|
||||
*/
|
||||
public function setPruefung($pruefung)
|
||||
{
|
||||
$this->pruefung = $pruefung;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getRgbColor()
|
||||
{
|
||||
return $this->rgbColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $rgbColor
|
||||
* @return Fach
|
||||
*/
|
||||
public function setRgbColor($rgbColor)
|
||||
{
|
||||
if ($rgbColor == 'gelb') {
|
||||
$rgbColor = array(255, 193, 7);
|
||||
} elseif ($rgbColor == 'gruen') {
|
||||
$rgbColor = array(75, 175, 79);
|
||||
} elseif ($rgbColor == 'blau') {
|
||||
$rgbColor = array(0, 142, 205);
|
||||
} elseif ($rgbColor == 'orange') {
|
||||
$rgbColor = array(255, 87, 34);
|
||||
}
|
||||
$this->rgbColor = $rgbColor;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
|
||||
namespace Internetfabrik\IfOberstufenplaner\Domain\Model;
|
||||
|
||||
class Schule extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
|
||||
{
|
||||
/**
|
||||
* name
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name;
|
||||
|
||||
/**
|
||||
* name2
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name2;
|
||||
|
||||
/**
|
||||
* comments
|
||||
*
|
||||
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Internetfabrik\IfOberstufenplaner\Domain\Model\SchuleRef>
|
||||
* @cascade remove
|
||||
* @lazy
|
||||
*/
|
||||
protected $refs = NULL;
|
||||
|
||||
/**
|
||||
* __construct
|
||||
*/
|
||||
public function __construct() {
|
||||
//Do not remove the next line: It would break the functionality
|
||||
$this->initStorageObjects();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes all ObjectStorage properties
|
||||
* Do not modify this method!
|
||||
* It will be rewritten on each save in the extension builder
|
||||
* You may modify the constructor of this class instead
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function initStorageObjects() {
|
||||
$this->refs = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @return Schule
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName2()
|
||||
{
|
||||
return $this->name2;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name2
|
||||
* @return Schule
|
||||
*/
|
||||
public function setName2($name2)
|
||||
{
|
||||
$this->name2 = $name2;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the refs
|
||||
*
|
||||
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Internetfabrik\IfOberstufenplaner\Domain\Model\SchuleRef> $refs
|
||||
*/
|
||||
public function getRefs() {
|
||||
return $this->refs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the refs
|
||||
*
|
||||
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Internetfabrik\IfOberstufenplaner\Domain\Model\SchuleRef> $refs
|
||||
* @return void
|
||||
*/
|
||||
public function setComments(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $refs) {
|
||||
$this->refs = $refs;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
namespace Internetfabrik\IfOberstufenplaner\Domain\Repository;
|
||||
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2015 Johann Gammel <support@jcmedia.de>, JC Media Internetagentur GmbH
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
/**
|
||||
* The repository for Entries
|
||||
*/
|
||||
class SchuleRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
|
||||
|
||||
/**
|
||||
* @param string $searchText
|
||||
* @param int $limit
|
||||
* @return \TYPO3\CMS\Extbase\Persistence\QueryResultInterface
|
||||
*/
|
||||
public function searchBy($searchText, $limit = -1) {
|
||||
$query = $this->createQuery();
|
||||
$query->matching(
|
||||
$query->logicalOr(
|
||||
$query->like('uid', '%'.$searchText.'%'),
|
||||
$query->like('name', '%'.$searchText.'%')
|
||||
)
|
||||
);
|
||||
if ($limit != -1) {
|
||||
$query->setLimit($limit);
|
||||
}
|
||||
return $query->execute();
|
||||
}
|
||||
|
||||
|
||||
public function findTypenBySchulnummer($nummer) {
|
||||
$query = $this->createQuery();
|
||||
$query->statement("SELECT typ.* FROM tx_ifoberstufenplaner_domain_model_schuletyp typ
|
||||
LEFT JOIN tx_ifoberstufenplaner_domain_model_schuleref ref
|
||||
ON typ.Schulgliederung=ref.SchulGl
|
||||
WHERE ref.GLSchnr = ".intval($nummer)/*,
|
||||
[$nummer]*/
|
||||
);
|
||||
// $query->setLimit(99);
|
||||
// $query->getQuerySettings()->setReturnRawQueryResult(TRUE);
|
||||
// \TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($query);exit;
|
||||
return $query->execute(true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user