first commit

This commit is contained in:
2025-08-02 16:30:27 +02:00
commit 23646bfcee
14851 changed files with 1750626 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
namespace KupShop\B2BBundle\Admin\Tabs;
use KupShop\AdminBundle\Admin\WindowTab;
class B2BLanguageSettingsTab extends WindowTab
{
protected $title = 'flapB2B';
protected $template = 'languageSettings.b2b.tpl';
public static function getTypes(): array
{
return [
'languagesSettings' => 1,
];
}
public function getLabel()
{
return 'B2B';
}
}

View File

@@ -0,0 +1,24 @@
<?php
namespace KupShop\B2BBundle\Admin\Tabs;
use KupShop\AdminBundle\Admin\WindowTab;
class CurrenciesWindowTab extends WindowTab
{
protected $title = 'flapB2B';
protected $template = 'CurrenciesWindowTab.tpl';
public static function getTypes()
{
return [
'currencies' => 1,
];
}
public static function isAllowed()
{
return findModule(\Modules::B2B);
}
}

View File

@@ -0,0 +1,24 @@
<?php
namespace KupShop\B2BBundle\Admin\Tabs;
use KupShop\AdminBundle\Admin\WindowTab;
class SettingsWindowTab extends WindowTab
{
protected $title = 'flapB2B';
protected $template = 'SettingsWindowTab.tpl';
public static function getTypes()
{
return [
'settings' => 1,
];
}
public static function isAllowed()
{
return findModule(\Modules::B2B);
}
}

View File

@@ -0,0 +1,6 @@
<?php
$txt_str['currenciesWindowTab'] = [
'flapB2B' => 'B2B',
'redefineForB2B' => 'Změnit pro B2B',
];

View File

@@ -0,0 +1,5 @@
<?php
$txt_str['settingsWindowTab'] = [
'flapB2B' => 'B2B',
];

View File

@@ -0,0 +1,117 @@
<div id="flapB2B" class="tab-pane fade in boxFlex">
<div class="form-group form-group-flex">
<div class="col-md-3 control-label">
<label>{'redefineForB2B'|translate:'currenciesWindowTab'}</label>
</div>
<div class="col-md-4">
<div class="input-group">
{if $body.data.data.b2b.price_round_direction}
{$enabled = true}
{else}
{$enabled = false}
{/if}
{print_toggle name="dummy" value=$enabled attrs=' data-currencies-b2b-toggle '}
</div>
</div>
</div>
<div id="b2b-container">
<div class="row bottom-space">
<div class="col-md-12">
<h1 class="h4 main-panel-title">{'PricesOfGoods'|translate}</h1>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<div class="col-md-6 control-label"><label>{'price_round_direction'|translate}</label></div>
<div class="col-md-6">
<select name="data[data][b2b][price_round_direction]" class="selecter">
{foreach from=$body.directions item=direction key=key}
<option value="{$key}" {if $key==$body.data.data.b2b.price_round_direction}selected{/if}>{$direction}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group form-group-flex">
<div class="col-md-6 control-label"><label>{'price_round'|translate}</label></div>
<div class="col-md-6">
<select name="data[data][b2b][price_round]" class="selecter">
{foreach from=$body.rounds item=round key=key}
<option value="{$key}" {if $key==$body.data.data.b2b.price_round}selected{/if}>{$round}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group form-group-flex">
<div class="col-md-6 control-label"><label>{'price_round_order'|translate}</label></div>
<div class="col-md-6">
<select name="data[data][b2b][price_round_order]" class="selecter">
{foreach from=$body.rounds item=round key=key}
<option value="{$key}" {if $key==$body.data.data.b2b.price_round_order}selected{/if}>{$round}</option>
{/foreach}
</select>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-group-flex">
<div class="col-md-6 control-label"><label>{'price_decimal_mark'|translate}</label></div>
<div class="col-md-6">
<select name="data[data][b2b][price_decimal_mark]" class="selecter">
{foreach from=$body.mark item=mark key=key}
<option value="{$key}" {if $key==$body.data.data.b2b.price_decimal_mark}selected{/if}>{$mark}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<div class="col-md-6 control-label"><label>{'price_precision'|translate}</label></div>
<div class="col-md-6">
<select name="data[data][b2b][price_precision]" class="selecter">
{foreach from=$body.precisions item=precision key=key}
<option value="{$key}" {if $key==$body.data.data.b2b.price_precision}selected{/if}>{$precision}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<div class="col-md-6 control-label"><label>Baťovské ceny</label></div>
<div class="col-md-6">
<select name="data[data][b2b][bata]" class="selecter">
<option value="">ne</option>
<option value="1" {if $body.data.data.b2b.bata == 1}selected{/if}>9,-</option>
<option value="0.1" {if $body.data.data.b2b.bata == 0.1}selected{/if}>9,90</option>
<option value="0.01" {if $body.data.data.b2b.bata == 0.01}selected{/if}>9,99</option>
</select>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$('[data-currencies-b2b-toggle]').on('change', function() {
if ($(this).prop('checked')) {
$('#b2b-container').fadeIn().find('input, select').removeAttr('disabled').trigger('chosen:updated');
} else {
$('#b2b-container').fadeOut().find('input, select').attr('disabled', true);
}
});
if ($('[data-currencies-b2b-toggle]').prop('checked')) {
$('#b2b-container').show().find('input, select').removeAttr('disabled');
} else {
$('#b2b-container').hide().find('input, select').attr('disabled', true);
}
</script>

View File

@@ -0,0 +1,78 @@
<div id="flapB2B" class="tab-pane fade in boxFlex">
<h4 class="main-panel-title">Objednávky</h4>
<div class="form-group">
<div class="col-md-2 control-label">
<label>Minimální cena objednávky</label>
</div>
<div class="col-md-2">
<div class="input-group">
<input type="number" class="form-control input-sm" name="data[b2b][minOrderPrice]" min="0"
value="{$body.data.b2b.minOrderPrice}">
<span class="input-group-addon">Kč</span>
</div>
</div>
</div>
{ifmodule RETURNS}
<h4 class="main-panel-title">Vratky</h4>
<div class="form-group">
<div class="col-md-4 control-label">
<label>Povolit B2B uživatelům vytvářet vratky</label>
</div>
<div class="col-md-1">
{print_toggle name="b2b][allowCreateReturns" value=$body.data.b2b.allowCreateReturns}
</div>
</div>
{/ifmodule}
<h4 class="main-panel-title">Uživatelé</h4>
<div class="form-group">
<div class="col-md-4 control-label">
<label>Zakázat B2B uživatelům editaci fakturačních údajů</label>
<a class="help-tip" data-toggle="tooltip" title="v košíku, v uživatelském účtu"><i class="bi bi-question-circle"></i></a>
</div>
<div class="col-md-1">
{print_toggle name="b2b][disallowEditB2B" value=$body.data.b2b.disallowEditB2B}
</div>
</div>
{ifmodule USER_ADDRESSES}
<div class="form-group">
<div class="col-md-4 control-label">
<label>{'edit_user_addresses'|translate: 'UserAddresses'}</label>
</div>
<div class="col-md-1">
{print_toggle name="edit_user_addresses" numeric=1}
</div>
<div class="col-md-7">
<span class="help-block">{'edit_user_addresses_tooltip'|translate: 'UserAddresses'}</span>
</div>
</div>
{/ifmodule}
<h4 class="main-panel-title">Registrační formulář</h4>
<div class="form-group">
<div class="col-md-3 control-label">
<label>Vytvářet při registraci uživatele</label>
<a class="help-tip" data-toggle="tooltip" title="Uživatel bude vytvořen s údaji z formuláře, ale bude neaktivní, dokud mu účet neaktivujete."><i class="bi bi-question-circle"></i></a>
</div>
<div class="col-md-1">
{print_toggle name="b2b][formCreateUser" value=$body.data.b2b.formCreateUser}
</div>
</div>
<div class="form-group">
<div class="col-md-3 control-label">
<label>Email pro nové registrace</label>
<a class="help-tip" data-toggle="tooltip" title="Na tento email budou zasílány nové registrace"><i class="bi bi-question-circle"></i></a>
</div>
<div class="col-md-4">
<input type="text" class="form-control input-sm" name="data[b2b][formCreateEmail]" placeholder="{$dbcfg.order_shopkeeper_mail}"
value="{$body.data.b2b.formCreateEmail}">
</div>
</div>
{include 'block.b2b.invoicing-data.tpl' placeholdersData=$body.data}
</div>

View File

@@ -0,0 +1,53 @@
<h4 class="main-panel-title">Fakturace</h4>
<div class="form-group">
<div class="col-md-2 control-label"><label>{'EshopOwner'|translate}</label>
<a class="help-tip" data-toggle="tooltip" title="Provozovatel je oficiální název společnosti nebo podnikatele. Většinou se uvádí pouze na faktuře.
Pokud faktury nepoužíváte, nebo je-li provozovatel stejný jako název webu, můžete toto pole nechat prázdné."><i
class="bi bi-question-circle"></i></a></div>
<div class="col-md-3">
<input type="text" class="form-control input-sm" name="data[b2b][invoicing][shop_firm_owner]" size="30"
maxlength="100"
value="{$body.data.b2b.invoicing.shop_firm_owner}"
placeholder="{$placeholdersData.shop_firm_owner}"
>
</div>
</div>
<div class="form-group">
<div class="col-md-2 control-label"><label>{'shop_email'|translate}</label></div>
<div class="col-md-3">
<input type="text" class="form-control input-sm" name="data[b2b][invoicing][shop_email]" size="30" maxlength="100"
value="{$body.data.b2b.invoicing.shop_email}"
placeholder="{$placeholdersData.shop_email}"
>
</div>
<div class="col-md-2 control-label"><label>{'shop_phone'|translate}</label></div>
<div class="col-md-3">
<input type="text" class="form-control input-sm" name="data[b2b][invoicing][shop_phone]" size="20" maxlength="20"
value="{$body.data.b2b.invoicing.shop_phone}"
placeholder="{$placeholdersData.shop_phone}"
>
</div>
</div>
<div class="form-group">
<div class="col-md-2 control-label"><label>{'shop_ico'|translate}</label></div>
<div class="col-md-3">
<input type="text" class="form-control input-sm" name="data[b2b][invoicing][shop_ico]" size="20" maxlength="20"
value="{$body.data.b2b.invoicing.shop_ico}"
placeholder="{$placeholdersData.shop_ico}"
>
</div>
<div class="col-md-2 control-label"><label>{'shop_dic'|translate}</label></div>
<div class="col-md-3">
<input type="text" class="form-control input-sm" name="data[b2b][invoicing][shop_dic]" size="20" maxlength="20"
value="{$body.data.b2b.invoicing.shop_dic}"
placeholder="{$placeholdersData.shop_dic}"
>
</div>
</div>
<div class="form-group">
<div class="col-md-2 control-label"><label>{'shop_address'|translate}</label></div>
<div class="col-md-8">
<textarea name="data[b2b][invoicing][shop_address]" class="form-control input-sm" rows="3" cols="30"
placeholder="{$placeholdersData.shop_address}">{$body.data.b2b.invoicing.shop_address}</textarea>
</div>
</div>

View File

@@ -0,0 +1,3 @@
<div id="flapB2B" class="tab-pane fade in boxFlex">
{include 'block.b2b.invoicing-data.tpl' placeholdersData=$dbcfg}
</div>

View File

@@ -0,0 +1,59 @@
<?php
namespace KupShop\B2BBundle;
use KupShop\KupShopBundle\Config;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class B2BBundle extends Bundle
{
public function boot()
{
parent::boot();
$cfg = &Config::get()->getContainer();
$cfg['Modules']['users_groups_types'] = array_merge($cfg['Modules']['users_groups_types'] ?? [], [
'b2b' => ['name' => 'B2B'],
]);
$cfg['Modules']['info_panels']['types'] = array_merge($cfg['Modules']['info_panels']['types'] ?? [], [
[
'type' => 'b2b',
'descr' => 'B2B',
],
]);
$cfg['Modules']['pricelists'] = true;
if (!findModule(\Modules::XML_FEEDS_B2B)) {
$cfg['Modules']['xml_feeds_b2b'] = true;
}
if (!findModule(\Modules::B2B, \Modules::SUB_OLD)) {
$cfg['Modules']['products'] = array_merge($cfg['Modules']['products'], ['modern_prices' => true]);
}
if (empty($cfg['Order']['Flags']['B2B'])) {
$cfg['Order']['Flags']['B2B'] = ['name' => 'B2B'];
}
$cfg['Modules']['forms'] = array_merge($cfg['Modules']['forms'] ?? [],
['registration-b2b-default' => [
'title' => 'Registrace B2B',
'template' => 'form/registration-b2b.tpl',
'message' => 'email/registration-b2b.tpl',
'subject' => 'email/registration-b2b_subject.tpl',
'message_answer' => 'email/registration-b2b_answer.tpl',
'subject_answer' => 'email/registration-b2b_subject_answer.tpl',
],
]
);
// B2B modul to zapina, ale je potreba to jeste pridat do cfg
if (empty($cfg['Modules']['xml_feeds_b2b'])) {
$cfg['Modules']['xml_feeds_b2b'] = [
'secure' => true,
];
}
}
}

View File

@@ -0,0 +1,36 @@
<?php
namespace KupShop\B2BBundle\Controller;
use KupShop\B2BBundle\View\B2BContactForm;
use KupShop\KupShopBundle\Routing\TranslatedRoute;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController as Controller;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
class B2BController extends Controller
{
/**
* @TranslatedRoute("/#b2b-registration#/", notModule="components")
*/
public function b2bRegistrationAction(Request $request, B2BContactForm $B2BContactForm)
{
if (findModule(\Modules::B2B, \Modules::SUB_OLD)) {
return $this->forward('KupShop\ContentBundle\Controller\ContactFormController::SendFormAction', ['type' => 'registration-b2b']);
}
if ($request->isMethod('POST')) {
$B2BContactForm->setRequest($request);
$B2BContactForm->setFormData(array_merge($request->query->all(), $request->request->all()));
if ($B2BContactForm->submitForm()) {
return new RedirectResponse(
path('kupshop_content_contactform_sendform_sent', ['type' => 'registration-b2b-default'])
);
}
}
return $B2BContactForm->getResponse();
}
}

View File

@@ -0,0 +1,49 @@
<?php
namespace KupShop\B2BBundle\EventListeners;
use KupShop\KupShopBundle\Context\ContextManager;
use KupShop\KupShopBundle\Context\UserContext;
use KupShop\OrderingBundle\Event\OrderEvent;
use KupShop\OrderingBundle\Util\Order\OrderUtil;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Contracts\Service\Attribute\Required;
class OrderListener implements EventSubscriberInterface
{
#[Required]
public UserContext $userContext;
#[Required]
public ContextManager $contextManager;
#[Required]
public OrderUtil $orderUtil;
public static function getSubscribedEvents()
{
$events = [
OrderEvent::ORDER_CREATED => [
['addB2BOrderFlag', 100],
],
];
return $events;
}
public function addB2BOrderFlag(OrderEvent $event): void
{
$order = $event->getOrder();
if ($order->id_user) {
$this->contextManager->activateContexts(
[UserContext::class => $order->id_user],
function () use ($order) {
if ($this->userContext->isType('b2b')) {
$this->orderUtil->addFlag($order, 'b2b');
}
}
);
}
}
}

View File

@@ -0,0 +1,11 @@
twig_component:
defaults:
KupShop\B2BBundle\Twig\Components\: '@B2BBundle/components/'
services:
_defaults:
autowire: true
autoconfigure: true
KupShop\B2BBundle\:
resource: ../../{Twig}

View File

@@ -0,0 +1,3 @@
content:
resource: "@B2BBundle/Controller/"
type: annotation

View File

@@ -0,0 +1,9 @@
services:
KupShop\B2BBundle\:
autowire: true
autoconfigure: true
resource: ../../{EventListeners,Controller,View}
KupShop\B2BBundle\Admin\Tabs\:
resource: ../../Admin/Tabs/*.php
autoconfigure: true

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="en" trgLang="cs">
<file id="b2b.cs">
<unit id="jQ2_jZg" name="b2b.registraion.email.answer.title">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Resources/views/emails/b2b-registration_answer.html.twig:6</note>
</notes>
<segment>
<source>b2b.registraion.email.answer.title</source>
<target>Chcete s námi spolupracovat? To rádi slyšíme.</target>
</segment>
</unit>
<unit id="NcFPg43" name="b2b.registraion.email.answer.text">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Resources/views/emails/b2b-registration_answer.html.twig:10</note>
</notes>
<segment>
<source>b2b.registraion.email.answer.text</source>
<target>Dobrý den, přijali jsme Vaši žádost o spolupráci.</target>
</segment>
</unit>
<unit id="6KeKGku" name="b2b.registraion.email.answer.message">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Resources/views/emails/b2b-registration_answer.html.twig:12</note>
</notes>
<segment>
<source>b2b.registraion.email.answer.message</source>
<target>Po ověření fakturačních údajů Vám bude odeslán e-mail na dokončení registrace</target>
</segment>
</unit>
</file>
</xliff>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="en" trgLang="de">
<file id="b2b.de">
<unit id="jQ2_jZg" name="b2b.registraion.email.answer.title">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Resources/views/emails/b2b-registration_answer.html.twig:6</note>
</notes>
<segment>
<source>b2b.registraion.email.answer.title</source>
<target></target>
</segment>
</unit>
<unit id="NcFPg43" name="b2b.registraion.email.answer.text">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Resources/views/emails/b2b-registration_answer.html.twig:10</note>
</notes>
<segment>
<source>b2b.registraion.email.answer.text</source>
<target></target>
</segment>
</unit>
<unit id="6KeKGku" name="b2b.registraion.email.answer.message">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Resources/views/emails/b2b-registration_answer.html.twig:12</note>
</notes>
<segment>
<source>b2b.registraion.email.answer.message</source>
<target></target>
</segment>
</unit>
</file>
</xliff>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="en" trgLang="en">
<file id="b2b.en">
<unit id="jQ2_jZg" name="b2b.registraion.email.answer.title">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Resources/views/emails/b2b-registration_answer.html.twig:6</note>
</notes>
<segment>
<source>b2b.registraion.email.answer.title</source>
<target>Do you want to work with us? That's what we like to hear.</target>
</segment>
</unit>
<unit id="NcFPg43" name="b2b.registraion.email.answer.text">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Resources/views/emails/b2b-registration_answer.html.twig:10</note>
</notes>
<segment>
<source>b2b.registraion.email.answer.text</source>
<target>Hello, we have accepted your request for cooperation.</target>
</segment>
</unit>
<unit id="6KeKGku" name="b2b.registraion.email.answer.message">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Resources/views/emails/b2b-registration_answer.html.twig:12</note>
</notes>
<segment>
<source>b2b.registraion.email.answer.message</source>
<target>Once your billing information has been verified, an email will be sent to you to complete your registration.</target>
</segment>
</unit>
</file>
</xliff>

View File

@@ -0,0 +1,181 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="en" trgLang="cs">
<file id="forms.cs">
<unit id="rFg7YWI" name="different.address.delivery">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Resources/views/components/B2BUserRegistrationForm/Form.1.html.twig:54</note>
</notes>
<segment>
<source>different.address.delivery</source>
<target>Dodání na jinou adresu nebo do zaměstnání</target>
</segment>
</unit>
<unit id="aWYgDAd" name="form.policy.agree">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Resources/views/components/B2BUserRegistrationForm/Form.1.html.twig:74</note>
</notes>
<segment>
<source>form.policy.agree</source>
<target><![CDATA[Odesláním formuláře souhlasím se <a href="{ consentUrl }" target="_blank">zpracováním osobních údajů</a> za účelem registrace a beru na vědomí <a href="{ privacyPolicyUrl }" target="_blank">Zásady zpracování osobních údajů</a>]]></target>
</segment>
</unit>
<unit id="kohqA_C" name="form.submit">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Resources/views/components/B2BUserRegistrationForm/Form.1.html.twig:78</note>
</notes>
<segment>
<source>form.submit</source>
<target>Odeslat</target>
</segment>
</unit>
<unit id="JMeHvOj" name="form.title.b2b">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/Form.php:36</note>
</notes>
<segment>
<source>form.title.b2b</source>
<target>Registrace do B2B</target>
</segment>
</unit>
<unit id="j4B_lYm" name="form.success">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/Form.php:127</note>
</notes>
<segment>
<source>form.success</source>
<target>Odeslání bylo úspěšně. Odpovíme vám co nejdříve</target>
</segment>
</unit>
<unit id=".Zs7dJ6" name="form.error">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/Form.php:129</note>
</notes>
<segment>
<source>form.error</source>
<target>Při odeslání došlo k chybě. Zkuste to prosím znovu.</target>
</segment>
</unit>
<unit id="7tBnQvb" name="form.label.name">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:26</note>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:91</note>
</notes>
<segment>
<source>form.label.name</source>
<target>Jméno</target>
</segment>
</unit>
<unit id="5CIhZwS" name="form.label.surname">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:30</note>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:95</note>
</notes>
<segment>
<source>form.label.surname</source>
<target>Příjmení</target>
</segment>
</unit>
<unit id="OF6XF6p" name="form.label.email">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:34</note>
</notes>
<segment>
<source>form.label.email</source>
<target>E-mail</target>
</segment>
</unit>
<unit id="JVyz3ak" name="form.label.invoice_email">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:38</note>
</notes>
<segment>
<source>form.label.invoice_email</source>
<target>E-mail pro fakturaci</target>
</segment>
</unit>
<unit id="_EyN2jB" name="form.label.company">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:42</note>
</notes>
<segment>
<source>form.label.company</source>
<target>Název firmy</target>
</segment>
</unit>
<unit id="WfF5F2." name="form.label.phone">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:46</note>
</notes>
<segment>
<source>form.label.phone</source>
<target>Telefon</target>
</segment>
</unit>
<unit id="_pcUlK3" name="form.label.ico">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:56</note>
</notes>
<segment>
<source>form.label.ico</source>
<target>IČO</target>
</segment>
</unit>
<unit id=".veGhv8" name="form.label.dic">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:60</note>
</notes>
<segment>
<source>form.label.dic</source>
<target>DIČ</target>
</segment>
</unit>
<unit id="arHKQ35" name="form.label.street">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:64</note>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:99</note>
</notes>
<segment>
<source>form.label.street</source>
<target>Ulice a č.p.</target>
</segment>
</unit>
<unit id="uHJcphH" name="form.label.city">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:68</note>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:107</note>
</notes>
<segment>
<source>form.label.city</source>
<target>Město</target>
</segment>
</unit>
<unit id="HNN8GHS" name="form.label.psc">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:72</note>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:111</note>
</notes>
<segment>
<source>form.label.psc</source>
<target>PSČ</target>
</segment>
</unit>
<unit id="FgNmpx1" name="form.label.country">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:76</note>
</notes>
<segment>
<source>form.label.country</source>
<target>Stát</target>
</segment>
</unit>
<unit id="1lwoOoz" name="form.label.additional_address">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:87</note>
</notes>
<segment>
<source>form.label.additional_address</source>
<target>Upřesnění adresy (firma, areál..)</target>
</segment>
</unit>
</file>
</xliff>

View File

@@ -0,0 +1,181 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="en" trgLang="de">
<file id="forms.de">
<unit id="rFg7YWI" name="different.address.delivery">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Resources/views/components/B2BUserRegistrationForm/Form.1.html.twig:54</note>
</notes>
<segment>
<source>different.address.delivery</source>
<target>Lieferung an eine andere Adresse oder an Ihren Arbeitsplatz</target>
</segment>
</unit>
<unit id="aWYgDAd" name="form.policy.agree">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Resources/views/components/B2BUserRegistrationForm/Form.1.html.twig:74</note>
</notes>
<segment>
<source>form.policy.agree</source>
<target><![CDATA[Mit dem Absenden des Formulars stimme ich der <a href="{ consentUrl }" target="_blank">Verarbeitung meiner personenbezogenen Daten</a> zu und erkenne die <a href="{ privacyPolicyUrl }" target="_blank">Datenschutzbestimmungen</a> an.]]></target>
</segment>
</unit>
<unit id="kohqA_C" name="form.submit">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Resources/views/components/B2BUserRegistrationForm/Form.1.html.twig:78</note>
</notes>
<segment>
<source>form.submit</source>
<target>Senden</target>
</segment>
</unit>
<unit id="JMeHvOj" name="form.title.b2b">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/Form.php:36</note>
</notes>
<segment>
<source>form.title.b2b</source>
<target>B2B Registrierung</target>
</segment>
</unit>
<unit id="j4B_lYm" name="form.success">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/Form.php:127</note>
</notes>
<segment>
<source>form.success</source>
<target>Der Upload war erfolgreich. Wir werden Ihnen so schnell wie möglich antworten</target>
</segment>
</unit>
<unit id=".Zs7dJ6" name="form.error">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/Form.php:129</note>
</notes>
<segment>
<source>form.error</source>
<target>Beim Senden ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut.</target>
</segment>
</unit>
<unit id="7tBnQvb" name="form.label.name">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:26</note>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:91</note>
</notes>
<segment>
<source>form.label.name</source>
<target>Name</target>
</segment>
</unit>
<unit id="5CIhZwS" name="form.label.surname">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:30</note>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:95</note>
</notes>
<segment>
<source>form.label.surname</source>
<target>Nachname</target>
</segment>
</unit>
<unit id="OF6XF6p" name="form.label.email">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:34</note>
</notes>
<segment>
<source>form.label.email</source>
<target>E-mail</target>
</segment>
</unit>
<unit id="JVyz3ak" name="form.label.invoice_email">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:38</note>
</notes>
<segment>
<source>form.label.invoice_email</source>
<target>E-Mail für die Rechnungsstellung</target>
</segment>
</unit>
<unit id="_EyN2jB" name="form.label.company">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:42</note>
</notes>
<segment>
<source>form.label.company</source>
<target>Name des Unternehmens</target>
</segment>
</unit>
<unit id="WfF5F2." name="form.label.phone">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:46</note>
</notes>
<segment>
<source>form.label.phone</source>
<target>Telefon</target>
</segment>
</unit>
<unit id="_pcUlK3" name="form.label.ico">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:56</note>
</notes>
<segment>
<source>form.label.ico</source>
<target>Firmen ID</target>
</segment>
</unit>
<unit id=".veGhv8" name="form.label.dic">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:60</note>
</notes>
<segment>
<source>form.label.dic</source>
<target>USt-IdNr</target>
</segment>
</unit>
<unit id="arHKQ35" name="form.label.street">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:64</note>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:99</note>
</notes>
<segment>
<source>form.label.street</source>
<target>Straße und Hausnr.</target>
</segment>
</unit>
<unit id="uHJcphH" name="form.label.city">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:68</note>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:107</note>
</notes>
<segment>
<source>form.label.city</source>
<target>Stadt</target>
</segment>
</unit>
<unit id="HNN8GHS" name="form.label.psc">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:72</note>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:111</note>
</notes>
<segment>
<source>form.label.psc</source>
<target>Postleitzahl</target>
</segment>
</unit>
<unit id="FgNmpx1" name="form.label.country">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:76</note>
</notes>
<segment>
<source>form.label.country</source>
<target>Land</target>
</segment>
</unit>
<unit id="1lwoOoz" name="form.label.additional_address">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:87</note>
</notes>
<segment>
<source>form.label.additional_address</source>
<target>Angabe der Adresse (Unternehmen, Räumlichkeiten...)</target>
</segment>
</unit>
</file>
</xliff>

View File

@@ -0,0 +1,181 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="en" trgLang="en">
<file id="forms.en">
<unit id="rFg7YWI" name="different.address.delivery">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Resources/views/components/B2BUserRegistrationForm/Form.1.html.twig:54</note>
</notes>
<segment>
<source>different.address.delivery</source>
<target>Delivery to another address or work</target>
</segment>
</unit>
<unit id="aWYgDAd" name="form.policy.agree">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Resources/views/components/B2BUserRegistrationForm/Form.1.html.twig:74</note>
</notes>
<segment>
<source>form.policy.agree</source>
<target><![CDATA[By submitting the form, I agree to <a href="{ consentUrl }" target="_blank">the processing of personal data</a> for the purpose of registration and acknowledge the <a href="{ privacyPolicyUrl }" target="_blank">Privacy Policy</a>]]></target>
</segment>
</unit>
<unit id="kohqA_C" name="form.submit">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Resources/views/components/B2BUserRegistrationForm/Form.1.html.twig:78</note>
</notes>
<segment>
<source>form.submit</source>
<target>Submit</target>
</segment>
</unit>
<unit id="JMeHvOj" name="form.title.b2b">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/Form.php:36</note>
</notes>
<segment>
<source>form.title.b2b</source>
<target>B2B registration</target>
</segment>
</unit>
<unit id="j4B_lYm" name="form.success">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/Form.php:127</note>
</notes>
<segment>
<source>form.success</source>
<target>Submission of the form was successful. We will reply to you as soon as possible.</target>
</segment>
</unit>
<unit id=".Zs7dJ6" name="form.error">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/Form.php:129</note>
</notes>
<segment>
<source>form.error</source>
<target>There was an error when sending. Please try again.</target>
</segment>
</unit>
<unit id="7tBnQvb" name="form.label.name">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:26</note>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:91</note>
</notes>
<segment>
<source>form.label.name</source>
<target>Name</target>
</segment>
</unit>
<unit id="5CIhZwS" name="form.label.surname">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:30</note>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:95</note>
</notes>
<segment>
<source>form.label.surname</source>
<target>Surname</target>
</segment>
</unit>
<unit id="OF6XF6p" name="form.label.email">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:34</note>
</notes>
<segment>
<source>form.label.email</source>
<target>E-mail</target>
</segment>
</unit>
<unit id="JVyz3ak" name="form.label.invoice_email">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:38</note>
</notes>
<segment>
<source>form.label.invoice_email</source>
<target>E-mail for billing</target>
</segment>
</unit>
<unit id="_EyN2jB" name="form.label.company">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:42</note>
</notes>
<segment>
<source>form.label.company</source>
<target>Company name</target>
</segment>
</unit>
<unit id="WfF5F2." name="form.label.phone">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:46</note>
</notes>
<segment>
<source>form.label.phone</source>
<target>Phone</target>
</segment>
</unit>
<unit id="_pcUlK3" name="form.label.ico">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:56</note>
</notes>
<segment>
<source>form.label.ico</source>
<target>CIN</target>
</segment>
</unit>
<unit id=".veGhv8" name="form.label.dic">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:60</note>
</notes>
<segment>
<source>form.label.dic</source>
<target>TIN</target>
</segment>
</unit>
<unit id="arHKQ35" name="form.label.street">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:64</note>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:99</note>
</notes>
<segment>
<source>form.label.street</source>
<target>Street and no.</target>
</segment>
</unit>
<unit id="uHJcphH" name="form.label.city">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:68</note>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:107</note>
</notes>
<segment>
<source>form.label.city</source>
<target>Cit</target>
</segment>
</unit>
<unit id="HNN8GHS" name="form.label.psc">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:72</note>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:111</note>
</notes>
<segment>
<source>form.label.psc</source>
<target>POSTCODE</target>
</segment>
</unit>
<unit id="FgNmpx1" name="form.label.country">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:76</note>
</notes>
<segment>
<source>form.label.country</source>
<target>Country</target>
</segment>
</unit>
<unit id="1lwoOoz" name="form.label.additional_address">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:87</note>
</notes>
<segment>
<source>form.label.additional_address</source>
<target>Specification of address (company, premises..)</target>
</segment>
</unit>
</file>
</xliff>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="en" trgLang="cs">
<file id="validators.cs">
<unit id="7PcB_I9" name="form.label.phone.invalid">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:51</note>
</notes>
<segment>
<source>form.label.phone.invalid</source>
<target>Zadejte platné telefonní číslo.</target>
</segment>
</unit>
</file>
</xliff>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="en" trgLang="de">
<file id="validators.de">
<unit id="7PcB_I9" name="form.label.phone.invalid">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:51</note>
</notes>
<segment>
<source>form.label.phone.invalid</source>
<target>Geben Sie eine gültige Rufnummer ein.</target>
</segment>
</unit>
</file>
</xliff>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="en" trgLang="en">
<file id="validators.en">
<unit id="7PcB_I9" name="form.label.phone.invalid">
<notes>
<note category="file-source" priority="1">engine/bundles/KupShop/B2BBundle/Twig/Components/B2BUserRegistration/FormType.php:51</note>
</notes>
<segment>
<source>form.label.phone.invalid</source>
<target>Enter a valid telephone number.</target>
</segment>
</unit>
</file>
</xliff>

View File

@@ -0,0 +1,9 @@
<?php
declare(strict_types=1);
namespace KupShop\ArticlesBundle\Resources\upgrade;
class B2BUpgrade extends \UpgradeNew
{
}

View File

@@ -0,0 +1,82 @@
{% trans_default_domain 'forms' %}
<div {{ attributes }}>
<h4 class="title">{{ 'form.title.b2b'|trans }}</h4>
{{ form_start(form, {
attr: {
'data-action': 'live#action',
'data-live-action-param': 'handleForm',
'data-recaptcha-lazy': '',
},
}) }}
<div class="form-group required">
{{ form_row(form.name, {attr: {class: 'form-control'}}) }}
</div>
<div class="form-group required">
{{ form_row(form.surname, {attr: {class: 'form-control'}}) }}
</div>
<div class="form-group required">
{{ form_row(form.email, {attr: {class: 'form-control'}}) }}
</div>
<div class="form-group">
{{ form_row(form.invoice_email, {attr: {class: 'form-control'}}) }}
</div>
<div class="form-group required">
{{ form_row(form.company, {attr: {class: 'form-control'}}) }}
</div>
<div class="form-group required">
{{ form_row(form.phone, {attr: {class: 'form-control'}}) }}
</div>
<div class="form-group required">
{{ form_row(form.ico, {attr: {class: 'form-control'}}) }}
</div>
<div class="form-group required">
{{ form_row(form.dic, {attr: {class: 'form-control'}}) }}
</div>
<div class="form-group required">
{{ form_row(form.street, {attr: {class: 'form-control'}}) }}
</div>
<div class="form-group required">
{{ form_row(form.city, {attr: {class: 'form-control'}}) }}
</div>
<div class="form-group country required">
{{ form_row(form.psc, {attr: {class: 'form-control'}}) }}
{{ form_row(form.country, {attr: {class: 'form-control'}}) }}
</div>
<div class="form-group">
{{ form_row(form.additional_address, {attr: {class: 'form-control'}}) }}
</div>
<div class="form-group checkbox{% if this.showAdditionalAddress %} active{% endif %}">
<a data-action="live#action" data-live-action-param="toggleAdditionalAddress" role="button">
{{ form_row(form.additional_address_delivery, {attr: {class: 'form-control'}, checked: this.showAdditionalAddress ? 'checked' : null }) }}
<twig:ux:icon name="check" class="c-icon"/>
</a>
<p>{{ 'different.address.delivery'|trans }}</p>
</div>
{% if this.showAdditionalAddress %}
<div class="form-group required">
{{ form_row(form.iname, {attr: {class: 'form-control'}}) }}
</div>
<div class="form-group required">
{{ form_row(form.isurname, {attr: {class: 'form-control'}}) }}
</div>
<div class="form-group required">
{{ form_row(form.istreet, {attr: {class: 'form-control'}}) }}
</div>
<div class="form-group required">
{{ form_row(form.icity, {attr: {class: 'form-control'}}) }}
</div>
<div class="form-group required">
{{ form_row(form.ipsc, {attr: {class: 'form-control'}}) }}
</div>
{% endif %}
<p class="privacy-policy">
{{ 'form.policy.agree'|trans({'%consentUrl%': this.consentUrl, '%privacyPolicyUrl%': this.privacyPolicyUrl})|raw }}
</p>
<div class="submit-wrapper">
<button class="btn" type="submit">
{{ 'form.submit'|trans }}
</button>
</div>
{{ form_end(form, {render_rest: false}) }}
</div>

View File

@@ -0,0 +1,183 @@
@use "sass:map";
@use "@twig/scss/_global" as global;
@use "@twig/scss/variables/_variables-components" as components;
$params: (
"max-width": 734px,
"margin": 0,
"form-items-per-row": 2,
"form-gap": 10px,
"form-label-color": global.$text-dark,
"btn-more-margin": 13px 0,
"btn-more-gap": 15px,
"btn-more-indicator-size": 26px,
"btn-more-indicator-border": 1px solid global.$border-color,
"btn-more-indicator-icon-size": 18px,
"btn-more-indicator-icon-color": global.$white,
"btn-more-indicator-text-size": global.$font-size-larger,
"btn-more-indicator-text-weight": global.$font-weight-bold,
"btn-more-indicator-text-color": global.$text-dark,
"title-margin": 0 0 15px 0,
"title-font-size": inherit,
"title-text-align": left,
"privacy-policy-max-width": 100%,
"privacy-policy-margin": 0 0 8px 0,
"privacy-policy-link-color": global.$text-dark,
"privacy-policy-color": inherit,
"privacy-policy-text-align": inherit,
"btn-send-margin": 0 0 18px 0,
"btn-send-max-width": 360px,
"btn-send-style": "btn-primary",
"btn-send-text-align": left,
);
@if global-variable-exists(c-b2b-user-registration-form, components) {
$keys: map.keys(components.$c-b2b-user-registration-form);
@each $name in $keys {
@if not map.get($params, $name) {
@warn "Neexistující proměnná '#{$name}' v komponentě '$#{component("B2BUserRegistration:Form", "class")}'.";
}
}
$params: map.merge($params, components.$c-b2b-user-registration-form);
}
.#{component("B2BUserRegistration:Form", "class")} {
max-width: map.get($params, "max-width");
margin: map.get($params, "margin");
.title {
font-size: map.get($params, "title-font-size");
margin: map.get($params, "title-margin");
text-align: map.get($params, "title-text-align");
}
form {
container-type: inline-size;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
gap: map.get($params, "form-gap");
> div {
flex-basis: 100%;
max-width: 100%;
}
label {
color: map.get($params, "form-label-color");
}
.form-group {
margin-bottom: 0;
}
.country {
display: flex;
gap: map.get($params, "form-gap");
> div {
flex: 1;
&:first-child {
flex-basis: calc(33% - (#{map.get($params, "form-gap")} / 2));
max-width: calc(33% - (#{map.get($params, "form-gap")} / 2));
}
}
}
.privacy-policy {
max-width: map.get($params, "privacy-policy-max-width");
margin: map.get($params, "privacy-policy-margin");
color: map.get($params, "privacy-policy-color");
text-align: map.get($params, "privacy-policy-text-align");
a {
display: inline-block;
color: map.get($params, "privacy-policy-link-color");
}
}
.submit-wrapper {
width: 100%;
margin: map.get($params, "btn-send-margin");
text-align: map.get($params, "btn-send-text-align");
}
button {
@include global.set-btn-style(map.get($params, "btn-send-style"));
max-width: map.get($params, "btn-send-max-width");
width: 100%;
flex-basis: 100%;
}
.checkbox {
display: flex;
gap: map.get($params, "btn-more-gap");
margin: map.get($params, "btn-more-margin");
width: 100%;
> a {
position: relative;
cursor: pointer;
> div {
height: map.get($params, "btn-more-indicator-size");
}
}
input {
position: relative;
appearance: none;
display: inline-block;
min-width: unset;
min-height: unset;
border: map.get($params, "btn-more-indicator-border");
border-radius: global.$border-radius-base;
width: map.get($params, "btn-more-indicator-size");
height: map.get($params, "btn-more-indicator-size");
padding: 0;
cursor: pointer;
}
.c-icon {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
font-size: map.get($params, "btn-more-indicator-icon-size");
color: map.get($params, "btn-more-indicator-icon-color");
display: none;
}
p {
margin-bottom: 0;
font-size: map.get($params, "btn-more-indicator-text-size");
font-weight: map.get($params, "btn-more-indicator-text-weight");
color: map.get($params, "btn-more-indicator-text-color");
}
&.active {
input:checked {
background-color: global.$state-success;
}
.c-icon {
display: block;
}
}
}
@container (inline-size > 500px) {
@include global.container-query-selector("> div:not(.submit-wrapper):not(.checkbox)") {
@include global.item-size(map.get($params, "form-items-per-row"), map.get($params, "form-gap"));
}
}
}
}

View File

@@ -0,0 +1,40 @@
{% extends '@Components/emails/base_admin.html.twig' %}
{% block email_content %}
<h4>Byla přijata nová žádost o velkoobchodní spolupráci.</h4>
<p><strong>Jméno:</strong> {DATA_NAME}</p>
<p><strong>Příjmení:</strong> {DATA_SURNAME}</p>
<p><strong>E-mail:</strong> {DATA_EMAIL}</p>
{% if form.DATA_INVOICE_EMAIL %}
<p><strong>E-mail pro fakturaci:</strong> {DATA_INVOICE_EMAIL}</p>
{% endif %}
<p><strong>Název firmy:</strong> {DATA_COMPANY}</p>
<p><strong>IČO:</strong> {DATA_ICO}</p>
<p><strong>DIČ:</strong> {DATA_DIC}</p>
<p><strong>Ulice a č.p.:</strong> {DATA_STREET}</p>
<p><strong>Město:</strong> {DATA_CITY}</p>
<p><strong>PSČ:</strong> {DATA_PSC}</p>
<p><strong>Stát:</strong> {DATA_COUNTRY}</p>
{% if form.DATA_ADDITIONAL_ADDRESS %}
<p><strong>Upřesnění adresy:</strong> {DATA_ADDITIONAL_ADDRESS}</p>
{% endif %}
<hr>
{% if form.DATA_INAME %}
<p><strong>Dodání na jinou adresu nebo do zaměstnání</strong></p>
{% endif %}
{% if form.DATA_INAME %}
<p><strong>Jméno:</strong> {DATA_INAME}</p>
{% endif %}
{% if form.DATA_ISURNAME %}
<p><strong>Příjmení:</strong> {DATA_ISURNAME}</p>
{% endif %}
{% if form.DATA_ISTREET %}
<p><strong>Ulice a č.p.:</strong> {DATA_ISTREET}</p>
{% endif %}
{% if form.DATA_ICITY %}
<p><strong>Město:</strong> {DATA_ICITY}</p>
{% endif %}
{% if form.DATA_IPSC %}
<p><strong>PSČ:</strong> {DATA_IPSC}</p>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,11 @@
{% trans_default_domain 'b2b' %}
{% extends '@Components/emails/base.html.twig' %}
{% block email_hello %}
<h3>{{ 'b2b.registraion.email.answer.title'|trans }}</h3>
{% endblock %}
{% block email_content %}
<p>{{ 'b2b.registraion.email.answer.text'|trans }}</p>
<p>{{ 'b2b.registraion.email.answer.message'|trans }}</p>
{% endblock %}

View File

@@ -0,0 +1,16 @@
<?php
namespace KupShop\B2BBundle\Twig\Components\B2BUserRegistration;
class B2BUserRegistrationAnswerEmail extends B2BUserRegistrationEmail
{
protected static $name = 'Děkujeme za registraci';
protected static $type = 'B2BUSERREGISTRATIONEMAIL_ANSWER_TEMPLATE';
protected $subject = 'Děkujeme za registraci';
public $is_answer = true;
public function renderEmail($message, $data = [], $base_template = '@B2B/emails/b2b-registration_answer.html.twig'): array
{
return parent::renderEmail($message, $data, $base_template);
}
}

View File

@@ -0,0 +1,56 @@
<?php
namespace KupShop\B2BBundle\Twig\Components\B2BUserRegistration;
use KupShop\ComponentsBundle\Twig\Components\Utils\Forms\BaseComponentEmail;
class B2BUserRegistrationEmail extends BaseComponentEmail
{
protected static $name = 'Registrace do b2b';
protected static $type = 'B2BUSERREGISTRATIONEMAIL_TEMPLATE';
protected $subject = 'Registrace do b2b';
protected bool $formDataToTemplate = true;
public function renderEmail($message, $data = [], $base_template = '@B2B/emails/b2b-registration.html.twig'): array
{
return parent::renderEmail($message, $data, $base_template);
}
public static function getPlaceholders()
{
$placeholders = parent::getPlaceholders();
$placeholders[self::$type] = array_merge($placeholders[self::$type] ?? [], [
'DATA_NAME' => ['text' => 'Jméno uživatele'],
'DATA_SURNAME' => ['text' => 'Přijmení uživatele'],
'DATA_EMAIL' => ['text' => 'Email uživatele'],
'DATA_INVOICE_EMAIL' => ['text' => 'Fakturační email uživatele'],
'DATA_COMPANY' => ['text' => 'Název firmy uživatele'],
'DATA_ICO' => ['text' => 'IČO uživatele'],
'DATA_DIC' => ['text' => 'DIČ uživatele'],
'DATA_STREET' => ['text' => 'Ulice a č.p. uživatele'],
'DATA_CITY' => ['text' => 'Město uživatele'],
'DATA_PSC' => ['text' => 'PSČ uživatele'],
'DATA_COUNTRY' => ['text' => 'Stát'],
'DATA_ADDITIONAL_ADDRESS' => ['text' => 'Upřesnění adresy (firma, areál…) uživatele'],
'DATA_INAME' => ['text' => 'Dodání na jinou adresu - jméno uživatele'],
'DATA_ISURNAME' => ['text' => 'Dodání na jinou adresu - Příjmení uživatele'],
'DATA_ISTREET' => ['text' => 'Dodání na jinou adresu - Ulice a č.p. uživatele'],
'DATA_ICITY' => ['text' => 'Dodání na jinou adresu - Město uživatele'],
'DATA_IPSC' => ['text' => 'Dodání na jinou adresu - PSČ uživatele'],
]);
return $placeholders;
}
public function replacePlaceholdersItem($placeholder)
{
$replace = parent::replacePlaceholdersItem($placeholder);
if (is_null($replace)) {
return $this->data[$placeholder] ?? null;
}
return $replace;
}
}

View File

@@ -0,0 +1,76 @@
<?php
namespace KupShop\B2BBundle\Twig\Components\B2BUserRegistration;
use Symfony\Component\Validator\Constraints as Assert;
class Entity
{
#[Assert\Sequentially([
new Assert\NotBlank(),
new Assert\Type('string'),
])]
public string $name;
#[Assert\Sequentially([
new Assert\NotBlank(),
new Assert\Type('string'),
])]
public string $surname;
#[Assert\Sequentially([
new Assert\NotBlank(),
new Assert\Email(),
])]
public string $email;
#[Assert\Email]
public string $invoice_email;
#[Assert\NotBlank]
public string $company;
public string $phone;
#[Assert\Sequentially([
new Assert\NotBlank(),
new Assert\Length(min: 8, max: 10),
new Assert\Type('string'),
])]
public string $ico;
#[Assert\Sequentially([
new Assert\NotBlank(),
new Assert\Length(min: 10, max: 12),
new Assert\Type('string'),
])]
public string $dic;
#[Assert\NotBlank]
public string $street;
#[Assert\NotBlank]
public string $city;
#[Assert\NotBlank]
public string $psc;
#[Assert\NotBlank]
public string $country;
public string $additional_address;
public bool $additional_address_delivery;
#[Assert\When(
expression: 'this.additional_address_delivery == true',
constraints: [new Assert\NotBlank()],
)]
public string $iname;
#[Assert\When(
expression: 'this.additional_address_delivery == true',
constraints: [new Assert\NotBlank()],
)]
public string $isurname;
#[Assert\When(
expression: 'this.additional_address_delivery == true',
constraints: [new Assert\NotBlank()],
)]
public string $istreet;
#[Assert\When(
expression: 'this.additional_address_delivery == true',
constraints: [new Assert\NotBlank()],
)]
public string $icity;
#[Assert\When(
expression: 'this.additional_address_delivery == true',
constraints: [new Assert\NotBlank()],
)]
public string $ipsc;
}

View File

@@ -0,0 +1,126 @@
<?php
namespace KupShop\B2BBundle\Twig\Components\B2BUserRegistration;
use KupShop\ComponentsBundle\Attributes\Blocek;
use KupShop\ComponentsBundle\Attributes\Component;
use KupShop\ComponentsBundle\Attributes\Version;
use KupShop\ComponentsBundle\Twig\Components\Utils\Forms\EmailForm;
use KupShop\KupShopBundle\Context\UserContext;
use KupShop\KupShopBundle\Util\System\UrlFinder;
use Symfony\Component\Form\FormInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use Symfony\UX\LiveComponent\Attribute\AsLiveComponent;
use Symfony\UX\LiveComponent\Attribute\LiveAction;
use Symfony\UX\LiveComponent\Attribute\LiveProp;
use Symfony\UX\LiveComponent\ComponentWithFormTrait;
#[AsLiveComponent(template: '@B2B/components/B2BUserRegistrationForm/Form.1.html.twig')]
#[Component(1, [
new Version(1, newJs: null),
])]
#[Blocek(title: 'Registrační formulář (B2B)')]
class Form extends EmailForm
{
use ComponentWithFormTrait;
public function __construct(
private readonly UserContext $userContext,
private readonly UrlFinder $urlFinder,
protected TranslatorInterface $translator,
) {
}
#[LiveProp]
public bool $showAdditionalAddress = false;
#[LiveAction]
public function toggleAdditionalAddress(): void
{
$this->showAdditionalAddress = !$this->showAdditionalAddress;
}
private function processUrl($params): string
{
return htmlspecialchars(createScriptURL($params), ENT_QUOTES);
}
public function getConsentUrl(): string
{
return $this->processUrl(['s' => 'page', 'label' => 'consent']);
}
public function getPrivacyPolicyUrl(): string
{
return $this->processUrl(['s' => 'page', 'label' => 'privacy_policy']);
}
protected function instantiateForm(): FormInterface
{
return $this->createForm(FormType::class, null, [
'action' => 'javascript:void(0);',
]);
}
public function getIsUserLogged(): bool
{
return !empty($this->userContext->getActiveId());
}
#[LiveAction]
public function handleForm(): void
{
$this->submitForm();
/** @var Entity $entity */
$entity = $this->getForm()->getData();
try {
$user = $this->userContext->getActive();
// Report
$this->sendEmail(B2BUserRegistrationEmail::getType(), function (B2BUserRegistrationEmail $emailService) use ($entity, $user) {
$userEmail = $entity->email ?? $user->email;
$emailService->setSender($userEmail);
$emailService->setData([
'DATA_NAME' => $entity->name,
'DATA_SURNAME' => $entity->surname,
'DATA_EMAIL' => $userEmail,
'DATA_INVOICE_EMAIL' => $entity->invoice_email ?? '',
'DATA_COMPANY' => $entity->company,
'DATA_PHONE' => $entity->phone,
'DATA_ICO' => $entity->ico,
'DATA_DIC' => $entity->dic,
'DATA_STREET' => $entity->street,
'DATA_CITY' => $entity->city,
'DATA_PSC' => $entity->psc,
'DATA_COUNTRY' => $entity->country,
'DATA_ADDITIONAL_ADDRESS' => $entity->additional_address ?? '',
'DATA_INAME' => $entity->iname ?? '',
'DATA_ISURNAME' => $entity->isurname ?? '',
'DATA_ISTREET' => $entity->istreet ?? '',
'DATA_ICITY' => $entity->icity ?? '',
'DATA_IPSC' => $entity->ipsc ?? '',
]);
return $emailService;
});
// Answer
$this->sendEmail(B2BUserRegistrationAnswerEmail::getType(), function (B2BUserRegistrationAnswerEmail $emailService) use ($entity, $user) {
$userEmail = $entity->email ?? $user->email;
$emailService->setSender($userEmail);
return $emailService;
});
addUserMessage($this->translator->trans('form.success', [], 'forms'), 'success');
} catch (\Exception $e) {
addUserMessage($this->translator->trans('form.error', [], 'forms'), 'error');
addUserMessage($e->getMessage(), 'error');
}
$this->resetForm();
}
}

View File

@@ -0,0 +1,124 @@
<?php
namespace KupShop\B2BBundle\Twig\Components\B2BUserRegistration;
use KupShop\KupShopBundle\Context\CountryContext;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\ChoiceList\Loader\CallbackChoiceLoader;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints\Regex;
use Symfony\Contracts\Service\Attribute\Required;
class FormType extends AbstractType
{
#[Required]
public CountryContext $countryContext;
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('name', TextType::class, [
'label' => 'form.label.name',
'required' => true,
])
->add('surname', TextType::class, [
'label' => 'form.label.surname',
'required' => true,
])
->add('email', EmailType::class, [
'label' => 'form.label.email',
'required' => true,
])
->add('invoice_email', EmailType::class, [
'label' => 'form.label.invoice_email',
'required' => false,
])
->add('company', TextType::class, [
'label' => 'form.label.company',
'required' => true,
])
->add('phone', TextType::class, [
'label' => 'form.label.phone',
'constraints' => [
new Regex([
'pattern' => '/^\+?[0-9]{9,15}$/',
'message' => 'form.label.phone.invalid',
]),
],
'required' => true,
])
->add('ico', TextType::class, [
'label' => 'form.label.ico',
'required' => true,
])
->add('dic', TextType::class, [
'label' => 'form.label.dic',
'required' => true,
])
->add('street', TextType::class, [
'label' => 'form.label.street',
'required' => true,
])
->add('city', TextType::class, [
'label' => 'form.label.city',
'required' => true,
])
->add('psc', NumberType::class, [
'label' => 'form.label.psc',
'required' => true,
])
->add('country', ChoiceType::class, [
'label' => 'form.label.country',
'required' => true,
'preferred_choices' => [$this->countryContext->getActive()->getName()],
'duplicate_preferred_choices' => false,
'choice_loader' => new CallbackChoiceLoader(function (): array {
$countries = array_map(function ($e) {return $e->getName(); }, $this->countryContext->getAll());
return array_combine($countries, $countries);
}),
])
->add('additional_address', TextType::class, [
'label' => 'form.label.additional_address',
'required' => false,
])
->add('iname', TextType::class, [
'label' => 'form.label.name',
'required' => true,
])
->add('isurname', TextType::class, [
'label' => 'form.label.surname',
'required' => true,
])
->add('istreet', TextType::class, [
'label' => 'form.label.street',
'required' => true,
])
->add('additional_address_delivery', CheckboxType::class, [
'label' => false,
'required' => false,
])
->add('icity', TextType::class, [
'label' => 'form.label.city',
'required' => true,
])
->add('ipsc', NumberType::class, [
'label' => 'form.label.psc',
'required' => true,
]);
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => Entity::class,
'translation_domain' => 'forms',
]);
}
}

View File

@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
namespace KupShop\B2BBundle\Utils;
use Query\Operator;
use Query\QueryBuilder;
class Query
{
public static function filterB2BOrders()
{
return function (QueryBuilder $qb) {
$qb->join('u', 'users_groups_relations', 'ugr', 'ugr.id_user = u.id')
->join('ugr', 'users_groups', 'ug', 'ug.id = ugr.id_group and FIND_IN_SET("b2b", ug.types)');
return $qb;
};
}
public static function checkIfOrderIsB2B($orderId)
{
$qb = sqlQueryBuilder()->select('1')
->from('orders', 'o')
->join('o', 'users', 'u', 'u.id = o.id_user')
->join('u', 'users_groups_relations', 'ugr', 'ugr.id_user = u.id')
->join('ugr', 'users_groups', 'ug', 'ug.id = ugr.id_group and FIND_IN_SET("b2b", ug.types)')
->where(Operator::equals(['o.id' => $orderId]));
return (bool) $qb->execute()->fetchOne();
}
}

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace KupShop\B2BBundle\View;
use KupShop\ContentBundle\View\ContactFormView;
class B2BContactForm extends ContactFormView
{
protected $formType = 'registration-b2b-default';
}