Merge branch 'reseller'
This commit is contained in:
@@ -78,20 +78,20 @@ class ResellerController extends ActionController
|
||||
/**
|
||||
* @param Reseller $reseller
|
||||
* @param Product $product
|
||||
* @return bool
|
||||
|
||||
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
|
||||
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException
|
||||
*/
|
||||
public function excelAction(Reseller $reseller, Product $product)
|
||||
public function copypasteAction(Reseller $reseller, Product $product)
|
||||
{
|
||||
if (!$reseller->getProducts()->contains($product)) {
|
||||
$this->redirect('list', null, null, [ 'reseller' => $reseller ]);
|
||||
}
|
||||
|
||||
$data = $this->resellerService->preprocessSingle($product, $reseller);
|
||||
var_dump($data);
|
||||
$productData = $this->resellerService->preprocessSingle($product, $reseller);
|
||||
|
||||
return false;
|
||||
$this->view->assign('reseller', $reseller);
|
||||
$this->view->assign('productData', $productData);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -100,8 +100,6 @@ class ResellerController extends ActionController
|
||||
*/
|
||||
public function xmlAction(Reseller $reseller)
|
||||
{
|
||||
$products = $reseller->getProducts();
|
||||
|
||||
$data = $this->resellerService->preprocessAll($reseller);
|
||||
|
||||
$encoders = [new XmlEncoder('products')];
|
||||
|
||||
@@ -51,6 +51,18 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
|
||||
self::CATEGORY_SUPER_DELUXE => 'Superdeluxe',
|
||||
];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public static $typeLabels = [
|
||||
0 => 'Unbestimmt',
|
||||
self::TYPE_HOLIDAY_FLAT => 'Ferienwohnung',
|
||||
self::TYPE_SPORTS_CLUB => 'Sportclub',
|
||||
self::TYPE_APPARTMENT => 'Appartment',
|
||||
self::TYPE_GUESTHOUSE => 'Gästehaus',
|
||||
self::TYPE_PENSION => 'Pension',
|
||||
];
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
@@ -163,9 +175,9 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
|
||||
protected $additionalCodes;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @var int
|
||||
*/
|
||||
protected $type = '';
|
||||
protected $type = 0;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
@@ -609,7 +621,7 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string $type
|
||||
* @return int $type
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
@@ -617,7 +629,7 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $type
|
||||
* @param int $type
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
|
||||
@@ -36,6 +36,16 @@ class Hotel
|
||||
*/
|
||||
public $name;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $type;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $category;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
@@ -60,6 +70,8 @@ class Hotel
|
||||
$hotel = new self;
|
||||
|
||||
$hotel->name = $entity->getName();
|
||||
$hotel->category = \EP\EpProducts\Domain\Model\Hotel::$categoryLabels[$entity->getCategory()];
|
||||
$hotel->type = \EP\EpProducts\Domain\Model\Hotel::$typeLabels[$entity->getType()];
|
||||
$hotel->description = SerializationUtility::sanitizeText($entity->getDescription());
|
||||
$hotel->features = SerializationUtility::sanitizeText($entity->getFeatures());
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace EP\EpProducts\Domain\Serialization;
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use EP\EpProducts\Domain\Model\Fact;
|
||||
use EP\EpProducts\Utility\SerializationUtility;
|
||||
|
||||
class Product
|
||||
@@ -92,6 +93,7 @@ class Product
|
||||
$product->name = preg_replace('/[\r\n\s]+/', ' ', $entity->getName());
|
||||
|
||||
$product->facts['fact'] = array_map(function ($fact) {
|
||||
/** @var Fact $fact */
|
||||
return htmlspecialchars($fact->getName());
|
||||
}, $entity->getFacts()->toArray());
|
||||
|
||||
|
||||
@@ -301,10 +301,10 @@ $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\EP\EpProducts\T
|
||||
'EP.' . $_EXTKEY,
|
||||
'reseller',
|
||||
[
|
||||
'Reseller' => 'list,xml,excel',
|
||||
'Reseller' => 'list,xml,copypaste',
|
||||
],
|
||||
[
|
||||
'Reseller' => 'list,xml,excel',
|
||||
'Reseller' => 'list,xml,copypaste',
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
@@ -24,8 +24,3 @@ xmlExport {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
excelExport < xmlExport
|
||||
excelExport.typeNum = 1984
|
||||
excelExport.config.additionalHeaders = Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
||||
excelExport.10.switchableControllerActions.Reseller.1 = excel
|
||||
|
||||
@@ -0,0 +1,293 @@
|
||||
<html data-namespace-typo3-fluid="true" lang="en"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
|
||||
xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers">
|
||||
|
||||
<f:layout name="Default"/>
|
||||
|
||||
<f:section name="Main">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<h1>Datenexport <em>{productData.name}</em></h1>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-group" role="tablist" id="accordion">
|
||||
<f:render section="CollapsibleSimple" arguments="{id: 1, label: 'Facts', facts: productData.facts.fact}"/>
|
||||
<f:render section="CollapsibleSimple" arguments="{id: 2, label: 'Konzept', name: productData.concept.name, description: productData.concept.description}"/>
|
||||
<f:render section="CollapsibleRegion" arguments="{id: 3, label: 'Gebiet', region: productData.region}"/>
|
||||
<f:render section="CollapsibleCity" arguments="{id: 4, label: 'Ort', city: productData.city}"/>
|
||||
<f:render section="CollapsibleSimple" arguments="{id: 5, label: 'Party', description: productData.city.party}"/>
|
||||
<f:render section="CollapsibleSimple" arguments="{id: 6, label: 'Freizeitangebot', description: productData.city.leisure}"/>
|
||||
<f:render section="CollapsibleSimple" arguments="{id: 7, label: 'Skipass', description: productData.skipass}"/>
|
||||
<f:render section="CollapsibleSimple" arguments="{id: 8, label: 'Verpflegung', description: productData.board}"/>
|
||||
<f:render section="CollapsibleSimple" arguments="{id: 9, label: 'Programm', description: productData.programme}"/>
|
||||
<f:for each="{productData.hotels.hotel}" as="hotel" iteration="iteration">
|
||||
<f:render section="CollapsibleHotel" arguments="{id: '10-{iteration.cycle}', label: 'Unterkunft{f:if(condition: \'{productData.hotels.hotel -> f:count()} > 1\', then: \' {iteration.cycle}\')}, Termine, Zimmer, Leistungen', hotel: hotel}"/>
|
||||
</f:for>
|
||||
<f:render section="CollapsibleImages" arguments="{id: 11, label: 'Bilder', images: productData.images.image}"/>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<f:link.action action="list" arguments="{reseller: reseller}">zurück</f:link.action>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</f:section>
|
||||
|
||||
<f:section name="CollapsibleSimple">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse{id}"
|
||||
aria-expanded="true" aria-controls="collapseOne">{label}</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="collapse{id}" class="panel-collapse collapse">
|
||||
<div class="panel-body">
|
||||
<f:if condition="{name}">
|
||||
<div class="form-group">
|
||||
<label class="control-label">Name</label>
|
||||
<input type="text" value="{name}" class="form-control">
|
||||
</div>
|
||||
</f:if>
|
||||
<f:if condition="{description}">
|
||||
<div class="form-group">
|
||||
<label class="control-label">Beschreibung</label>
|
||||
<textarea rows="5" class="form-control" onclick="this.select()">{description}</textarea>
|
||||
</div>
|
||||
</f:if>
|
||||
<f:if condition="{facts}">
|
||||
<div class="form-group">
|
||||
<label class="control-label">Facts</label>
|
||||
<textarea rows="5" class="form-control" onclick="this.select()">{facts -> v:iterator.implode(glue: 'constant:LF')}</textarea>
|
||||
</div>
|
||||
</f:if>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</f:section>
|
||||
|
||||
<f:section name="CollapsibleHotel">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse{id}"
|
||||
aria-expanded="true" aria-controls="collapseOne">{label}</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="collapse{id}" class="panel-collapse collapse">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="control-label">Name</label>
|
||||
<input type="text" value="{hotel.name}" class="form-control">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">Kategorie</label>
|
||||
<input type="text" value="{hotel.category}" class="form-control">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">Unterkunftsart</label>
|
||||
<input type="text" value="{hotel.type}" class="form-control">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">Beschreibung</label>
|
||||
<textarea rows="5" class="form-control" onclick="this.select()">{hotel.description}</textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">Ausstattung</label>
|
||||
<textarea rows="5" class="form-control" onclick="this.select()">{hotel.features}</textarea>
|
||||
</div>
|
||||
<h4>Termine, Zimmer und Leistungen</h4>
|
||||
<f:for each="{hotel.dates.date}" as="date">
|
||||
<table class="table table-condensed table-striped">
|
||||
<tr>
|
||||
<th>von</th>
|
||||
<td>{date.from}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>bis</th>
|
||||
<td>{date.to}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Nächte</th>
|
||||
<td>{date.nights}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Abpreis</th>
|
||||
<td>{date.minprice} €</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Bus inkl.</th>
|
||||
<td>{f:if(condition: date.busincluded, then: 'ja', else: 'nein')}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Skipass inkl.</th>
|
||||
<td>{f:if(condition: date.skipassincluded, then: 'ja', else: 'nein')}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Zimmer</th>
|
||||
<td>
|
||||
<table class="table table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Bezeichnung</th>
|
||||
<th>Preis</th>
|
||||
<th>verfügbar</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<f:for each="{date.rooms.room}" as="room">
|
||||
<tr>
|
||||
<td>{room.name}</td>
|
||||
<td>{room.price} €</td>
|
||||
<td>{room.available}</td>
|
||||
</tr>
|
||||
</f:for>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Inklusivleistungen</th>
|
||||
<td>
|
||||
{date.servicesincluded.service -> v:iterator.implode(glue: '<br/>')}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Zusatzleistungen</th>
|
||||
<td>
|
||||
<table class="table table-condesed">
|
||||
<f:for each="{date.services.service}" as="service">
|
||||
<tr>
|
||||
<td>{service.label}</td>
|
||||
<td>{service.price} €</td>
|
||||
</tr>
|
||||
</f:for>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Buchungslink</th>
|
||||
<td><a href="{date.bookingurl}" target="_blank">URL</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</f:for>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</f:section>
|
||||
|
||||
<f:section name="CollapsibleCity">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse{id}"
|
||||
aria-expanded="true" aria-controls="collapseOne">{label}</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="collapse{id}" class="panel-collapse collapse">
|
||||
<div class="panel-body">
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<label class="control-label">Name</label>
|
||||
<input type="text" value="{city.name}" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<label class="control-label">Beschreibung</label>
|
||||
<textarea rows="5" class="form-control" onclick="this.select()">{city.description}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<div class="form-group">
|
||||
<label class="control-label">Facts</label>
|
||||
<textarea rows="5" class="form-control" onclick="this.select()">{city.facts.fact -> v:iterator.implode(glue: 'constant:LF')}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</f:section>
|
||||
|
||||
<f:section name="CollapsibleRegion">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse{id}"
|
||||
aria-expanded="true" aria-controls="collapseOne">{label}</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="collapse{id}" class="panel-collapse collapse">
|
||||
<div class="panel-body">
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<label class="control-label">Name</label>
|
||||
<input type="text" value="{region.name}" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<label class="control-label">Beschreibung</label>
|
||||
<textarea rows="5" class="form-control" onclick="this.select()">{region.description} {region.descriptionExtended}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<label class="control-label">Skipass</label>
|
||||
<textarea rows="5" class="form-control" onclick="this.select()">{region.skipass}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<label class="control-label">News</label>
|
||||
<textarea rows="5" class="form-control" onclick="this.select()">{region.news}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<div class="form-group">
|
||||
<label class="control-label">Facts</label>
|
||||
<textarea rows="5" class="form-control" onclick="this.select()">{region.facts.fact -> v:iterator.implode(glue: 'constant:LF')}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<div class="form-group">
|
||||
<label class="control-label">Pisten</label>
|
||||
<input type="text" class="form-control" value="{region.piste}"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">Höhe</label>
|
||||
<input type="text" class="form-control" value="{region.height}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<div class="form-group">
|
||||
<label class="control-label">Lifte</label>
|
||||
<input type="text" class="form-control" value="{region.lifts}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</f:section>
|
||||
|
||||
<f:section name="CollapsibleImages">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse{id}"
|
||||
aria-expanded="true" aria-controls="collapseOne">{label}</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="collapse{id}" class="panel-collapse collapse">
|
||||
<div class="panel-body">
|
||||
<f:for each="{images}" as="image">
|
||||
<a href="{image}" target="_blank">{image}</a><br>
|
||||
</f:for>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</f:section>
|
||||
|
||||
</html>
|
||||
@@ -12,14 +12,12 @@
|
||||
<h1>{reseller.name}</h1>
|
||||
<h2>Gesamtexport XML</h2>
|
||||
<f:link.action arguments="{reseller: reseller}" pageType="1972" target="_blank">Export XML</f:link.action>
|
||||
<f:comment>
|
||||
<h2>Einzelexport Excel</h2>
|
||||
<h2>Einzelexport für Copy&Paste</h2>
|
||||
<ul>
|
||||
<f:for each="{products}" as="product">
|
||||
<li><f:link.action arguments="{product: product, reseller: reseller}" pageType="1984">Export XLS: {product.name}</f:link.action></li>
|
||||
<li><f:link.action action="copypaste" arguments="{product: product, reseller: reseller}">{product.name}</f:link.action></li>
|
||||
</f:for>
|
||||
</ul>
|
||||
</f:comment>
|
||||
</f:if>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user