... | ... |
@@ -12,6 +12,8 @@ declare(strict_types=1); |
12 | 12 |
|
13 | 13 |
use vossmedien\AloxBundle\Controller\Frontend\Module\JoblistModuleController; |
14 | 14 |
use vossmedien\AloxBundle\Controller\Frontend\Module\JobSearchModuleController; |
15 |
+use vossmedien\AloxBundle\Controller\Frontend\Module\JobReaderModuleController; |
|
15 | 16 |
|
16 |
-$GLOBALS['TL_DCA']['tl_module']['palettes'][JoblistModuleController::TYPE] = '{title_legend},name,type;{alox_legend},perPage;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID'; |
|
17 |
+$GLOBALS['TL_DCA']['tl_module']['palettes'][JoblistModuleController::TYPE] = '{title_legend},name,type;{alox_legend},jumpTo,perPage;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID'; |
|
17 | 18 |
$GLOBALS['TL_DCA']['tl_module']['palettes'][JobSearchModuleController::TYPE] = '{title_legend},name,type;{aloxSearch_legend},jumpTo;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID'; |
19 |
+$GLOBALS['TL_DCA']['tl_module']['palettes'][JobReaderModuleController::TYPE] = '{title_legend},name,type;{aloxReader_legend},overviewPage;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID'; |
... | ... |
@@ -12,8 +12,11 @@ declare(strict_types=1); |
12 | 12 |
|
13 | 13 |
use vossmedien\AloxBundle\Controller\Frontend\Module\JoblistModuleController; |
14 | 14 |
use vossmedien\AloxBundle\Controller\Frontend\Module\JobSearchModuleController; |
15 |
+use vossmedien\AloxBundle\Controller\Frontend\Module\JobReaderModuleController; |
|
15 | 16 |
|
16 | 17 |
$GLOBALS['TL_LANG']['FMD'][JoblistModuleController::TYPE][0] = 'Alox Job Liste'; |
17 | 18 |
$GLOBALS['TL_LANG']['FMD'][JoblistModuleController::TYPE][1] = 'Gibt eine Liste mit Jobs aus.'; |
18 | 19 |
$GLOBALS['TL_LANG']['FMD'][JobSearchModuleController::TYPE][0] = 'Alox Job Suchmaske'; |
19 | 20 |
$GLOBALS['TL_LANG']['FMD'][JobSearchModuleController::TYPE][1] = 'Gibt eine Suchmaske aus, die auf eine Joblistenseite verlinkt werden kann.'; |
21 |
+$GLOBALS['TL_LANG']['FMD'][JobReaderModuleController::TYPE][0] = 'Alox Job Reader'; |
|
22 |
+$GLOBALS['TL_LANG']['FMD'][JobReaderModuleController::TYPE][1] = 'Gibt Details zu einem Stellenangebot aus.'; |
... | ... |
@@ -13,3 +13,4 @@ declare(strict_types=1); |
13 | 13 |
|
14 | 14 |
$GLOBALS['TL_LANG']['tl_module']['alox_legend'] = 'Listen-Konfiguration'; |
15 | 15 |
$GLOBALS['TL_LANG']['tl_module']['aloxSearch_legend'] = 'Such-Konfiguration'; |
16 |
+$GLOBALS['TL_LANG']['tl_module']['aloxReader_legend'] = 'Detailkonfiguration'; |
... | ... |
@@ -87,7 +87,13 @@ |
87 | 87 |
<dt>Eintrag vom:</dt><dd>{{ job.DatumAb ? job.DatumAb|date("d.m.Y") : '' }}</dd> |
88 | 88 |
</dl> |
89 | 89 |
</div> |
90 |
- <p class="details-link"><a href="https://alox-personal.europersonal.com/stelle/{{ job.LinkSlug }}-{{ job.StelleUuid }}">Details</a></p> |
|
90 |
+ <p class="details-link"> |
|
91 |
+ {% if detailsLink is defined %} |
|
92 |
+ <a href="{{ detailsLink }}?id={{ job.StelleUuid }}">Details</a> |
|
93 |
+ {% else %} |
|
94 |
+ <a href="https://alox-personal.europersonal.com/stelle/{{ job.LinkSlug }}-{{ job.StelleUuid }}">Details</a> |
|
95 |
+ {% endif %} |
|
96 |
+ </p> |
|
91 | 97 |
</li> |
92 | 98 |
{% endfor %} |
93 | 99 |
</ul> |
94 | 100 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,27 @@ |
1 |
+{% extends '@Contao/block_unsearchable' %} |
|
2 |
+ |
|
3 |
+{% block content %} |
|
4 |
+ {% if job is not defined %} |
|
5 |
+ <p>Die gewünschte Stellenanzeige wurde nicht gefunden!</p> |
|
6 |
+ {% else %} |
|
7 |
+ <h2>{{ job.Bezeichnung }}</h2> |
|
8 |
+ <div class="meta"> |
|
9 |
+ <dl> |
|
10 |
+ <dt>Einsatzort:</dt><dd>{{ job.EinsatzortPlz }} {{ job.EinsatzortOrt }}</dd> |
|
11 |
+ <dt>Vertragsart:</dt><dd>{{ job.Vertragsart }}</dd> |
|
12 |
+ <dt>Beginn:</dt><dd>{{ job.BeginnAbSofort ? 'ab sofort' : (job.Beginn ? job.Beginn|date("d.m.Y") : '') }}</dd> |
|
13 |
+ <dt>Arbeitszeit:</dt><dd>{{ job.Arbeitsstunden }} - {{ job.ArbeitsstundenBis }} Stunden {{ job.ArbeitsstundenZeitraumLookup.Bezeichnung }}</dd> |
|
14 |
+ <dt>Eintrag vom:</dt><dd>{{ job.DatumAb ? job.DatumAb|date("d.m.Y") : '' }}</dd> |
|
15 |
+ </dl> |
|
16 |
+ </div> |
|
17 |
+ <div class="job_description"> |
|
18 |
+ {{ job.Stellenziel|raw }} |
|
19 |
+ </div> |
|
20 |
+ {% endif %} |
|
21 |
+ |
|
22 |
+ {% if listUrl is defined %} |
|
23 |
+ <p class="back"><a href="{{ listUrl }}">{{ 'MSC.goBack'|trans({}, 'contao_default') }}</a></p> |
|
24 |
+ {% endif %} |
|
25 |
+ |
|
26 |
+ |
|
27 |
+{% endblock %} |
... | ... |
@@ -16,6 +16,7 @@ use Contao\System; |
16 | 16 |
use Symfony\Component\Serializer\SerializerInterface; |
17 | 17 |
use Symfony\Contracts\HttpClient\HttpClientInterface; |
18 | 18 |
use vossmedien\AloxBundle\Model\KatalogModel; |
19 |
+use vossmedien\AloxBundle\Model\StelleModel; |
|
19 | 20 |
use vossmedien\AloxBundle\Model\StellenModel; |
20 | 21 |
|
21 | 22 |
class Zvoove |
... | ... |
@@ -97,6 +98,37 @@ class Zvoove |
97 | 98 |
return null; |
98 | 99 |
} |
99 | 100 |
|
101 |
+ public function getStelleById(string $uuid, array $params=[]): ?StelleModel |
|
102 |
+ { |
|
103 |
+ $options = [ |
|
104 |
+ 'headers' => $this->getAuthorizeRequestHeader(), |
|
105 |
+ 'query' => [ |
|
106 |
+ 'stelleUuid' => $uuid |
|
107 |
+ ] |
|
108 |
+ ]; |
|
109 |
+ |
|
110 |
+ if (count($params)) |
|
111 |
+ { |
|
112 |
+ $options['query'] = array_merge($options['query'],$params); |
|
113 |
+ } |
|
114 |
+ |
|
115 |
+ $response = $this->sendRequest('Stelle/GetStelleById',$options); |
|
116 |
+ |
|
117 |
+ |
|
118 |
+ |
|
119 |
+ if ($response->getStatusCode() == 200) |
|
120 |
+ { |
|
121 |
+ $content = $response->getContent(); |
|
122 |
+ |
|
123 |
+ /** @var StelleModel $model */ |
|
124 |
+ $model = $this->serializer->deserialize($content,StelleModel::class,'json'); |
|
125 |
+ |
|
126 |
+ return $model; |
|
127 |
+ } |
|
128 |
+ |
|
129 |
+ return null; |
|
130 |
+ } |
|
131 |
+ |
|
100 | 132 |
public function getKatalogByRelationName(string $entityName, string $relationName): ?KatalogModel |
101 | 133 |
{ |
102 | 134 |
$options = [ |
103 | 135 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,66 @@ |
1 |
+<?php |
|
2 |
+ |
|
3 |
+declare(strict_types=1); |
|
4 |
+ |
|
5 |
+/* |
|
6 |
+ * This file is part of alox bundle for Contao. |
|
7 |
+ * |
|
8 |
+ * (c) Benjamin Roth |
|
9 |
+ * |
|
10 |
+ * @license commercial |
|
11 |
+ */ |
|
12 |
+ |
|
13 |
+namespace vossmedien\AloxBundle\Controller\Frontend\Module; |
|
14 |
+ |
|
15 |
+use Contao\Config; |
|
16 |
+use Contao\CoreBundle\Controller\FrontendModule\AbstractFrontendModuleController; |
|
17 |
+use Contao\CoreBundle\ServiceAnnotation\FrontendModule; |
|
18 |
+use Contao\Input; |
|
19 |
+use Contao\ModuleModel; |
|
20 |
+use Contao\PageModel; |
|
21 |
+use Contao\Template; |
|
22 |
+use Symfony\Component\HttpFoundation\Request; |
|
23 |
+use Symfony\Component\HttpFoundation\Response; |
|
24 |
+use vossmedien\AloxBundle\API\Zvoove; |
|
25 |
+ |
|
26 |
+/** |
|
27 |
+ * @FrontendModule(JobReaderModuleController::TYPE, category="miscellaneous") |
|
28 |
+ */ |
|
29 |
+class JobReaderModuleController extends AbstractFrontendModuleController |
|
30 |
+{ |
|
31 |
+ public const TYPE = 'alox_jobreader'; |
|
32 |
+ |
|
33 |
+ /** |
|
34 |
+ * @var Zvoove |
|
35 |
+ */ |
|
36 |
+ protected $api; |
|
37 |
+ |
|
38 |
+ public function __construct(Zvoove $api) |
|
39 |
+ { |
|
40 |
+ $this->api = $api; |
|
41 |
+ } |
|
42 |
+ |
|
43 |
+ |
|
44 |
+ protected function getResponse(Template $template, ModuleModel $model, Request $request): ?Response |
|
45 |
+ { |
|
46 |
+ if ($request->get('id')) |
|
47 |
+ { |
|
48 |
+ $job = $this->api->getStelleById($request->get('id')); |
|
49 |
+ } |
|
50 |
+ |
|
51 |
+ // Populate template vars |
|
52 |
+ if ($job !== null) |
|
53 |
+ { |
|
54 |
+ $template->job = $job->getData(); |
|
55 |
+ } |
|
56 |
+ |
|
57 |
+ // Back link if overview page is defined |
|
58 |
+ if ($model->overviewPage && ($overviewPage = PageModel::findByPk($model->overviewPage)) !== null) |
|
59 |
+ { |
|
60 |
+ $template->listUrl = $overviewPage->getFrontendUrl(); |
|
61 |
+ } |
|
62 |
+ |
|
63 |
+ return $template->getResponse(); |
|
64 |
+ } |
|
65 |
+ |
|
66 |
+} |
... | ... |
@@ -17,6 +17,7 @@ use Contao\CoreBundle\Controller\FrontendModule\AbstractFrontendModuleController |
17 | 17 |
use Contao\CoreBundle\ServiceAnnotation\FrontendModule; |
18 | 18 |
use Contao\Input; |
19 | 19 |
use Contao\ModuleModel; |
20 |
+use Contao\PageModel; |
|
20 | 21 |
use Contao\Template; |
21 | 22 |
use Symfony\Component\HttpFoundation\Request; |
22 | 23 |
use Symfony\Component\HttpFoundation\Response; |
... | ... |
@@ -168,6 +169,12 @@ class JoblistModuleController extends AbstractFrontendModuleController |
168 | 169 |
$template->filterAbteilung = $filterAbteilung; |
169 | 170 |
} |
170 | 171 |
|
172 |
+ // Details link if jumpto page is defined |
|
173 |
+ if ($model->jumpTo && ($jumpTo = PageModel::findByPk($model->jumpTo)) !== null) |
|
174 |
+ { |
|
175 |
+ $template->detailsLink = $jumpTo->getFrontendUrl(); |
|
176 |
+ } |
|
177 |
+ |
|
171 | 178 |
$template->formSubmit = $strFormId; |
172 | 179 |
$template->formSetFilters = $arrSetFilters; |
173 | 180 |
$template->pagination = $pagination; |
174 | 181 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,69 @@ |
1 |
+<?php |
|
2 |
+ |
|
3 |
+declare(strict_types=1); |
|
4 |
+ |
|
5 |
+/* |
|
6 |
+ * This file is part of alox bundle for Contao. |
|
7 |
+ * |
|
8 |
+ * (c) Benjamin Roth |
|
9 |
+ * |
|
10 |
+ * @license commercial |
|
11 |
+ */ |
|
12 |
+ |
|
13 |
+namespace vossmedien\AloxBundle\Model; |
|
14 |
+ |
|
15 |
+use \DateTime; |
|
16 |
+ |
|
17 |
+class StelleModel |
|
18 |
+{ |
|
19 |
+ /** |
|
20 |
+ * @var array |
|
21 |
+ */ |
|
22 |
+ private array $arrData; |
|
23 |
+ |
|
24 |
+ public function __get($name) |
|
25 |
+ { |
|
26 |
+ return $this->get($name); |
|
27 |
+ } |
|
28 |
+ |
|
29 |
+ public function __set($name, $value) |
|
30 |
+ { |
|
31 |
+ $this->set($name,$value); |
|
32 |
+ } |
|
33 |
+ |
|
34 |
+ |
|
35 |
+ public function __call($name, $arguments) |
|
36 |
+ { |
|
37 |
+ if (strncmp($name, 'get', 3) === 0) |
|
38 |
+ { |
|
39 |
+ $name = lcfirst(substr($name, 3)); |
|
40 |
+ |
|
41 |
+ return $this->get($name); |
|
42 |
+ } else if (strncmp($name, 'set', 3) === 0) |
|
43 |
+ { |
|
44 |
+ $name = lcfirst(substr($name, 3)); |
|
45 |
+ |
|
46 |
+ $this->set($name,$arguments[0]); |
|
47 |
+ } |
|
48 |
+ } |
|
49 |
+ |
|
50 |
+ public function get(string $name): mixed |
|
51 |
+ { |
|
52 |
+ if (isset($this->arrData[$name])) |
|
53 |
+ { |
|
54 |
+ return $this->arrData[$name]; |
|
55 |
+ } |
|
56 |
+ |
|
57 |
+ return null; |
|
58 |
+ } |
|
59 |
+ |
|
60 |
+ public function set(string $name, mixed $value): void |
|
61 |
+ { |
|
62 |
+ $this->arrData[$name] = $value; |
|
63 |
+ } |
|
64 |
+ |
|
65 |
+ public function getData(): ?array |
|
66 |
+ { |
|
67 |
+ return $this->arrData; |
|
68 |
+ } |
|
69 |
+} |