Commit b0b8535f authored by Dirk Wildt's avatar Dirk Wildt

0.0.7

parent 0cd47ae7
......@@ -152,9 +152,13 @@ abstract class AbstractController extends \TYPO3\CMS\Extbase\Mvc\Controller\Acti
private function _getFlexformValueDiePrompt( $method, $line, $sheet, $field )
{
$prompt = ''
. 'ERROR<br />'
. 'Current Flexform does\'t contain a sheet ' . $sheet . ' with field ' . $field . '<br />'
. '@ ' . $method . ' (#' . $line . ')'
. '<h1>'
. 'ERROR'
. '</h1>'
. 'Current flexform doesn\'t contain a sheet ' . $sheet . ' with field ' . $field . '<br />'
. 'Maybe the flexform wasn\'t saved once. Please save it and try again.<br />'
. '<br />'
. 'Error occurs @ ' . $method . ' (#' . $line . ')'
;
die( $prompt );
}
......
......@@ -26,6 +26,20 @@ use Netzmacher\Tile\Utility\SessionUtility;
class BookingController extends AbstractFrontendController
{
/**
* _cellIntoTheCaddy
*
* @param \Netzmacher\Tile\Domain\Model\Cell $cell
* @return boolean
* @version 0.0.7
* @since 0.0.7
*/
private function _cellIntoTheCaddy( \Netzmacher\Tile\Domain\Model\Cell $cell ): bool
{
$this->addFlashMessage( 'Ticket wurde in den Warenkorb gelegt.', '', \TYPO3\CMS\Core\Messaging\AbstractMessage::OK );
return true;
}
/**
* _cellIsSelled
*
......@@ -64,27 +78,27 @@ class BookingController extends AbstractFrontendController
}
/**
* _cellToggleCaddy
* _getAreaCells
*
* @param \Netzmacher\Tile\Domain\Model\Cell $cell
* @return boolean
* @version 0.0.7
* @since 0.0.7
* @param \Netzmacher\Tile\Domain\Model\Area $area
* @return object cells
* @version 0.0.3
* @since 0.0.3
*/
private function _cellToggleCaddy( \Netzmacher\Tile\Domain\Model\Cell $cell ): bool
private function _getAreaCells( \Netzmacher\Tile\Domain\Model\Area $area )
{
$this->addFlashMessage( 'Ticket in Warenkorb legen oder aus dem Warenkorb entfernen.', '', \TYPO3\CMS\Core\Messaging\AbstractMessage::OK );
return true;
$cells = $this->cellRepository->findBytx_tile_area( $area->getUid() );
return $cells;
}
/**
* _getArea
* _getFlexformArea
*
* @return void
* @return object area
* @version 0.0.7
* @since 0.0.7
*/
private function _getArea()
private function _getFlexformArea()
{
$xmlFlexform = $this->contentObject->data[ 'pi_flexform' ];
$sheet = 'area';
......@@ -95,26 +109,62 @@ class BookingController extends AbstractFrontendController
}
/**
* _getAreaCells
* _getFlexformCellsize
*
* @param int $default Default size
* @return integer
* @version 0.0.7
* @since 0.0.7
*/
private function _getFlexformCellsize( $default = 15 )
{
$xmlFlexform = $this->contentObject->data[ 'pi_flexform' ];
$sheet = 'area';
$field = 'settings.flexform.pi1.area.cellsize';
$cellsize = $this->_getFlexformValue( __METHOD__, __LINE__, $xmlFlexform, $sheet, $field );
if( !empty( $cellsize ) )
{
return $cellsize;
}
return $default;
}
/**
* caddy
*
* @param \Netzmacher\Tile\Domain\Model\Cell $cell
* @param \Netzmacher\Tile\Domain\Model\Area $area
* @return void
* @version 0.0.3
* @since 0.0.3
* @version 0.0.7
* @since 0.0.7
*/
private function _getAreaCells( \Netzmacher\Tile\Domain\Model\Area $area )
public function caddyAction( \Netzmacher\Tile\Domain\Model\Cell $cell, \Netzmacher\Tile\Domain\Model\Area $area )
{
$cells = $this->cellRepository->findBytx_tile_area( $area->getUid() );
return $cells;
switch( true )
{
case($this->_cellIsWoTicket( $cell )):
break;
case($this->_cellIsSelled( $cell )):
break;
case($this->_cellIntoTheCaddy( $cell )):
break;
default:
$this->addFlashMessage( 'Undefinierter Fehler @ ' . __METHOD__ . ' (#' . __LINE__ . ')', '', \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR );
break;
}
$arguments = [
'area' => $area
];
$this->redirect( 'list', NULL, NULL, $arguments );
}
/**
* initializeAction: is executed before any Action in the Controller.
*
* @return void
* @version 0.0.3
* @since 0.0.3
* @internal #t3728
* @version 0.0.7
* @since 0.0.6
*/
public function initializeAction()
{
......@@ -133,7 +183,7 @@ class BookingController extends AbstractFrontendController
*/
public function listAction()
{
$area = $this->_getArea();
$area = $this->_getFlexformArea();
$this->view->assignMultiple(
array(
......@@ -145,39 +195,9 @@ class BookingController extends AbstractFrontendController
, 'formCellWiTicketsChecked' => $this->_oSessionUtility->getSessionElement( 'formCellWiTickets', true )
, 'formCellWiUndefinedCellsChecked' => $this->_oSessionUtility->getSessionElement( 'formCellWiUndefinedCells', true )
, 'grid-template-columns' => AreaModuleUtility::getAutoElementsForGridCSS( $area )
, 'size' => '15'
, 'size' => $this->_getFlexformCellsize()
)
);
}
/**
* caddy
*
* @param \Netzmacher\Tile\Domain\Model\Cell $cell
* @param \Netzmacher\Tile\Domain\Model\Area $area
* @return void
* @version 0.0.7
* @since 0.0.7
*/
public function caddyAction( \Netzmacher\Tile\Domain\Model\Cell $cell, \Netzmacher\Tile\Domain\Model\Area $area )
{
switch( true )
{
case($this->_cellIsWoTicket( $cell )):
break;
case($this->_cellIsSelled( $cell )):
break;
case($this->_cellToggleCaddy( $cell )):
break;
default:
$this->addFlashMessage( 'Undefinierter Fehler @ ' . __METHOD__ . ' (#' . __LINE__ . ')', '', \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR );
break;
}
$arguments = [
'area' => $area
];
$this->redirect( 'list', NULL, NULL, $arguments );
}
}
......@@ -22,6 +22,24 @@
</config>
</TCEforms>
</settings.flexform.pi1.area.uid>
<settings.flexform.pi1.area.cellsize>
<TCEforms>
<exclude>1</exclude>
<label>LLL:EXT:tile/Resources/Private/Language/Flexform/Booking.xlf:sheet_area.cellsize</label>
<onChange>reload</onChange>
<config>
<type>input</type>
<size>3</size>
<max>3</max>
<eval>int,trim,required</eval>
<range>
<lower>10</lower>
<upper>400</upper>
</range>
<default>15</default>
</config>
</TCEforms>
</settings.flexform.pi1.area.cellsize>
</el>
</ROOT>
</T3DataStructure>
\ No newline at end of file
......@@ -11,6 +11,10 @@
<source>Site Plan</source>
<target>Plan</target>
</trans-unit>
<trans-unit id="sheet_area.cellsize">
<source>Size of a tile</source>
<target>Kachelgröße</target>
</trans-unit>
<trans-unit id="sheet_area.uid">
<source>Site Plan</source>
<target>Plan</target>
......
......@@ -11,6 +11,10 @@
<source>Site Plan</source>
<target>Plan</target>
</trans-unit>
<trans-unit id="sheet_area.cellsize">
<source>Size of a tile</source>
<target>Kachelgröße</target>
</trans-unit>
<trans-unit id="sheet_area.uid">
<source>Site Plan</source>
<target>Plan</target>
......
......@@ -127,10 +127,13 @@
</div>
<hr />
<h3>Ticket</h3>
<h3>Ticket kaufen</h3>
<ol>
<li>
Wähle in der Auswahlbox ein Ticket aus.
Tickets haben einen schwarzen Rand.
</li>
<li>
Klicken Sie auf eine Kachel, um ein Ticket in den Warenkorb zu legen.
</li>
</ol>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment