| ... | ... |
@@ -72,7 +72,6 @@ $GLOBALS['TL_DCA']['tl_vr_wa_slotassistant'] = |
| 72 | 72 |
'sql' => 'blob NULL' |
| 73 | 73 |
], |
| 74 | 74 |
'enclosure' => [ |
| 75 |
- 'exclude' => true, |
|
| 76 | 75 |
'inputType' => 'fileTree', |
| 77 | 76 |
'eval' => ['multiple' =>true, 'fieldType' =>'checkbox', 'filesOnly' =>true, 'isDownloads' =>true, 'extensions' =>Config::get('allowedDownload'), 'mandatory' =>true, 'isSortable' =>true],
|
| 78 | 77 |
'sql' => "blob NULL" |
| ... | ... |
@@ -21,3 +21,7 @@ $GLOBALS['TL_LANG']['tl_vr_wa_standort']['notification_legend'] = 'Benachrichtig |
| 21 | 21 |
$GLOBALS['TL_LANG']['tl_vr_wa_standort']['rebsorte'] = 'Rebsorten'; |
| 22 | 22 |
$GLOBALS['TL_LANG']['tl_vr_wa_standort']['leseart'] = 'Leseart'; |
| 23 | 23 |
$GLOBALS['TL_LANG']['tl_vr_wa_standort']['lage'] = 'Lage'; |
| 24 |
+ |
|
| 25 |
+ |
|
| 26 |
+$GLOBALS['TL_LANG']['tl_vr_wa_standort']['edit'] = 'Zeitslots für Standort ID %s verwalten'; |
|
| 27 |
+$GLOBALS['TL_LANG']['tl_vr_wa_standort']['slottypes'] = 'Zeitslot-Vorlagen für Standort ID %s verwalten'; |
| ... | ... |
@@ -39,6 +39,7 @@ use MenAtWork\MultiColumnWizardBundle\Contao\Widgets\MultiColumnWizard; |
| 39 | 39 |
use Symfony\Component\HttpFoundation\RequestStack; |
| 40 | 40 |
use Symfony\Component\HttpFoundation\Response; |
| 41 | 41 |
use Symfony\Component\Routing\Annotation\Route; |
| 42 |
+use Symfony\Contracts\Translation\TranslatorInterface; |
|
| 42 | 43 |
use Twig\Environment as TwigEnvironment; |
| 43 | 44 |
use vonRotenberg\WeinanlieferungBundle\Model\WeinanlieferungLeseartModel; |
| 44 | 45 |
use vonRotenberg\WeinanlieferungBundle\Model\WeinanlieferungRebsorteModel; |
| ... | ... |
@@ -56,14 +57,17 @@ class WeinanlieferungSlotAssistantController extends AbstractController |
| 56 | 57 |
private $request; |
| 57 | 58 |
private $db; |
| 58 | 59 |
|
| 60 |
+ private $translator; |
|
| 61 |
+ |
|
| 59 | 62 |
protected $fields; |
| 60 | 63 |
|
| 61 |
- public function __construct(TwigEnvironment $twig, ContaoCsrfTokenManager $tokenManager, RequestStack $requestStack, Connection $db) |
|
| 64 |
+ public function __construct(TwigEnvironment $twig, ContaoCsrfTokenManager $tokenManager, RequestStack $requestStack, Connection $db, TranslatorInterface $translator) |
|
| 62 | 65 |
{
|
| 63 | 66 |
$this->twig = $twig; |
| 64 | 67 |
$this->tokenManager = $tokenManager; |
| 65 | 68 |
$this->request = $requestStack->getCurrentRequest(); |
| 66 | 69 |
$this->db = $db; |
| 70 |
+ $this->translator = $translator; |
|
| 67 | 71 |
|
| 68 | 72 |
$container = System::getContainer(); |
| 69 | 73 |
$objSession = $container->get('session');
|
| ... | ... |
@@ -359,7 +363,7 @@ class WeinanlieferungSlotAssistantController extends AbstractController |
| 359 | 363 |
protected function getSlottypeOptions() |
| 360 | 364 |
{
|
| 361 | 365 |
$arrOptions = [['value'=>'','label'=>'-']]; |
| 362 |
- $Slottypes = $this->db->prepare("SELECT t.id, t.title, s.title as 'standort' FROM tl_vr_wa_slottypes t INNER JOIN tl_vr_wa_standort s ON s.id = t.pid ORDER BY title")->executeQuery();
|
|
| 366 |
+ $Slottypes = $this->db->prepare("SELECT t.id, t.title, t.containers, t.duration, s.title as 'standort' FROM tl_vr_wa_slottypes t INNER JOIN tl_vr_wa_standort s ON s.id = t.pid ORDER BY title")->executeQuery();
|
|
| 363 | 367 |
|
| 364 | 368 |
if ($Slottypes->rowCount() > 0) |
| 365 | 369 |
{
|
| ... | ... |
@@ -367,7 +371,7 @@ class WeinanlieferungSlotAssistantController extends AbstractController |
| 367 | 371 |
{
|
| 368 | 372 |
$arrOptions[] = [ |
| 369 | 373 |
'value' => $option['id'], |
| 370 |
- 'label' => $option['title'].' ['.$option['standort'].']' |
|
| 374 |
+ 'label' => $option['title'].' ['.$this->translator->trans('MSC.wa_container', [], 'contao_tl_vr_wa_units').': '.$option['containers'].'] ['.$this->translator->trans('MSC.wa_duration', [], 'contao_tl_vr_wa_units').': '.$option['duration'].' '.($option['duration'] == 1 ? $this->translator->trans('MSC.wa_duration_minute', [], 'contao_tl_vr_wa_units') : $this->translator->trans('MSC.wa_duration_minutes', [], 'contao_tl_vr_wa_units')).'] ['.$option['standort'].']'
|
|
| 371 | 375 |
]; |
| 372 | 376 |
} |
| 373 | 377 |
} |
| ... | ... |
@@ -17,6 +17,7 @@ use Contao\DataContainer; |
| 17 | 17 |
use Contao\Date; |
| 18 | 18 |
use Contao\StringUtil; |
| 19 | 19 |
use Doctrine\DBAL\Connection; |
| 20 |
+use Symfony\Contracts\Translation\TranslatorInterface; |
|
| 20 | 21 |
use vonRotenberg\WeinanlieferungBundle\Model\WeinanlieferungLeseartModel; |
| 21 | 22 |
use vonRotenberg\WeinanlieferungBundle\Model\WeinanlieferungRebsorteModel; |
| 22 | 23 |
use vonRotenberg\WeinanlieferungBundle\Model\WeinanlieferungSlotsModel; |
| ... | ... |
@@ -26,9 +27,13 @@ class WeinanlieferungSlotContainerListener |
| 26 | 27 |
/** @var Connection */ |
| 27 | 28 |
protected $db; |
| 28 | 29 |
|
| 29 |
- public function __construct(Connection $db) |
|
| 30 |
+ /** @var TranslatorInterface */ |
|
| 31 |
+ protected $translator; |
|
| 32 |
+ |
|
| 33 |
+ public function __construct(Connection $db, TranslatorInterface $translator) |
|
| 30 | 34 |
{
|
| 31 | 35 |
$this->db = $db; |
| 36 |
+ $this->translator = $translator; |
|
| 32 | 37 |
} |
| 33 | 38 |
|
| 34 | 39 |
|
| ... | ... |
@@ -50,7 +55,9 @@ class WeinanlieferungSlotContainerListener |
| 50 | 55 |
} |
| 51 | 56 |
|
| 52 | 57 |
return sprintf('<div class="tl_content_left"><div class="row u-items-center">
|
| 53 |
- <div class="col-2 text-md">%s %s</div> |
|
| 58 |
+ <div class="col-2"> |
|
| 59 |
+ <div class="text-md">%s %s</div> |
|
| 60 |
+ </div> |
|
| 54 | 61 |
<div class="col-2"> |
| 55 | 62 |
<div class="t-label">Buchbar ab</div>%s |
| 56 | 63 |
<div class="t-label">Buchbar bis</div>%s |
| ... | ... |
@@ -59,9 +66,9 @@ class WeinanlieferungSlotContainerListener |
| 59 | 66 |
<div class="t-label">Behälterkapazität</div>%s |
| 60 | 67 |
</div> |
| 61 | 68 |
<div class="col-3"> |
| 62 |
- <div class="t-label">Sorten</div>%s |
|
| 69 |
+ <div class="t-label">Dauer</div>%s %s |
|
| 63 | 70 |
</div> |
| 64 |
- </div></div>',Date::parse(Date::getNumericDateFormat(),$row['date']), Date::parse(Date::getNumericTimeFormat(),$row['time']),Date::parse(Date::getNumericDatimFormat(),$row['buchbar_ab']),Date::parse(Date::getNumericDatimFormat(),$row['buchbar_bis']),$Slot->behaelter,implode(', ',$arrSorten));
|
|
| 71 |
+ </div></div>',Date::parse(Date::getNumericDateFormat(),$row['date']), Date::parse(Date::getNumericTimeFormat(),$row['time']), Date::parse(Date::getNumericDatimFormat(),$row['buchbar_ab']),Date::parse(Date::getNumericDatimFormat(),$row['buchbar_bis']),$Slot->behaelter,$row['duration'],($row['duration'] == 1 ? $this->translator->trans('MSC.wa_duration_minute', [], 'contao_tl_vr_wa_units') : $this->translator->trans('MSC.wa_duration_minutes', [], 'contao_tl_vr_wa_units')));
|
|
| 65 | 72 |
} |
| 66 | 73 |
|
| 67 | 74 |
/** |