Skip to content
Snippets Groups Projects
Commit ec987f5f authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Start work on ajax functioniality

parent 3f71964c
No related branches found
No related tags found
No related merge requests found
<?php
namespace SGalinski\SgAjax\Controller\Ajax;
namespace SGalinski\SgJobs\Controller\Ajax;
/***************************************************************
* Copyright notice
......@@ -24,11 +25,25 @@ namespace SGalinski\SgAjax\Controller\Ajax;
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use SGalinski\SgAjax\Controller\Ajax\AbstractAjaxController;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Ajax Controller
*/
class JoblistAjaxController extends AbstractAjaxController {
/**
* Show all job offers and options to manage them
*
* @param array $filters
* @return void
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException
* @throws \InvalidArgumentException
*/
public function filterAction($filters = '') {
$pageUid = (int) GeneralUtility::_GP('id');
$this->view->assign('filters', $filters);
}
}
\ No newline at end of file
......@@ -50,20 +50,17 @@ class JoblistController extends ActionController {
/**
* Show all job offers and options to manage them
*
* @param array $filters
* @return void
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException
* @throws \InvalidArgumentException
*/
public function indexAction($filters = []) {
public function indexAction() {
$pageUid = (int) GeneralUtility::_GP('id');
// get all jobs for the next root page
$jobs = $this->jobRepository->findJobs(BackendService::getRootUidByPageUid($pageUid), $filters);
$jobs = $this->jobRepository->findJobs(BackendService::getRootUidByPageUid($pageUid));
$this->view->assign('jobs', $jobs);
$this->view->assign('filters', $filters);
debug(BackendService::getRootUidByPageUid($pageUid));
debug($jobs);
}
......
......@@ -70,6 +70,10 @@
<source>Apply online now</source>
<target>Jetzt online bewerben</target>
</trans-unit>
<trans-unit id="frontend.apply_by_mail" approved="yes">
<source>Appy by mail</source>
<target>Bewerbung per Post</target>
</trans-unit>
<trans-unit id="frontend.area" approved="yes">
<source>Area</source>
<target>Bereich</target>
......
......@@ -54,6 +54,9 @@
<trans-unit id="frontend.applyNow">
<source>Apply online now</source>
</trans-unit>
<trans-unit id="frontend.apply_by_mail">
<source>Appy by mail</source>
</trans-unit>
<trans-unit id="frontend.area">
<source>Area</source>
</trans-unit>
......
<f:form id="sgjobs-filter" action="index" controller="Joblist" method="post" objectName="filters" object="{filters}">
<f:form.select class="sgjobs-select form-control" multiple="0" size="1" property="filterCountry" optionValueField="key" options="{countries}" id="filter-countries" />
<f:form.select class="sgjobs-select form-control" multiple="0" size="1" property="filterLocation" optionValueField="key" options="{locations}" id="filter-locations" />
<f:form.select class="sgjobs-select form-control" multiple="0" size="1" property="filterCompany" optionValueField="key" options="{companies}" id="filter-companies" />
<f:form.select class="sgjobs-select form-control" multiple="0" size="1" property="filterArea" optionValueField="key" options="{areas}" id="filter-areas" />
<f:form.select class="sgjobs-select form-control" multiple="0" size="1" property="filterFunction" optionValueField="key" options="{functions}" id="filter-functions" />
</f:form>
<div>
<h3>{job.title}</h3>
<h4>
<f:format.date date="{job.startDate}" format="d.m.Y" />
- {job.company.0.city}
</h4>
</div>
<div>
<table>
<tr>
<td>
<f:translate key="frontend.location" />
</td>
<td>
{job.company.0.country} - {job.company.0.city}
</td>
</tr>
<tr>
<td>
<f:translate key="frontend.function" />
</td>
<td>
{job.function}
</td>
</tr>
<tr>
<td>
<f:translate key="frontend.area" />
</td>
<td>
{job.area}
</td>
</tr>
<tr>
<td>
<f:translate key="frontend.organisation" />
</td>
<td>
{job.company.0.name}
</td>
</tr>
<tr>
<td>
<f:translate key="frontend.entry_date" />
</td>
<td>
<f:format.date date="{job.startDate}" format="d.m.Y" />
</td>
</tr>
</table>
</div>
<div>
<f:translate key="frontend.task" />
<f:format.raw>
{job.task}
</f:format.raw>
</div>
<div>
<f:translate key="frontend.qualification" />
<f:format.raw>
{job.qualification}
</f:format.raw>
</div>
<div>
<f:form action="apply" controller="Joblist">
<f:form.submit value="{f:translate(key:'frontend.applyNow')}" />
</f:form>
</div>
<div>
<h3><f:translate key="frontend.email" /></h3>
<p>
{job.contact.0.email}
</p>
</div>
<div>
<h3><f:translate key="frontend.apply_by_mail" /></h3>
{job.company.0.name}
<br />
{job.contact.0.firstName} {job.contact.0.lastName}
<br />
{job.company.0.street}
<br />
{job.company.0.city}
<br />
{job.contact.0.email}
<br />
{job.contact.0.phone}
</div>
\ No newline at end of file
<f:layout name="Default" />
<f:section name="main">
</f:section>
<f:layout name="Default" />
<f:section name="main">
<f:for each="{jobs}" as="job">
<div>
<h3>{job.title}</h3>
<h4>
<f:format.date date="{job.startDate}" format="d.m.Y" />
- {job.company.0.city}
</h4>
</div>
<div>
<table>
<tr>
<td>
<f:translate key="frontend.location" />
</td>
<td>
{job.company.0.country} - {job.company.0.city}
</td>
</tr>
<tr>
<td>
<f:translate key="frontend.function" />
</td>
<td>
{job.function}
</td>
</tr>
<tr>
<td>
<f:translate key="frontend.area" />
</td>
<td>
{job.area}
</td>
</tr>
<tr>
<td>
<f:translate key="frontend.organisation" />
</td>
<td>
{job.company.0.name}
</td>
</tr>
<tr>
<td>
<f:translate key="frontend.entry_date" />
</td>
<td>
<f:format.date date="{job.startDate}" format="d.m.Y" />
</td>
</tr>
</table>
</div>
<f:render partial="Filter" arguments="{filters: filters}" />
<div>
<f:translate key="frontend.task" />
<f:format.raw>
{job.task}
</f:format.raw>
</div>
<div>
<f:translate key="frontend.qualification" />
<f:format.raw>
{job.qualification}
</f:format.raw>
</div>
<div>
<f:form action="apply" controller="Joblist">
<f:form.submit value="{f:translate(key:'frontend.applyNow')}" />
</f:form>
</div>
<div>
<h3><f:translate key="frontend.email" /></h3>
<p>
{job.contact.0.email}
</p>
</div>
<div>
<h3><f:translate key="frontend.apply_by_mail" /></h3>
{job.company.0.name}
<br />
{job.contact.0.firstName} {job.contact.0.lastName}
<br />
{job.company.0.street}
<br />
{job.company.0.city}
<br />
{job.contact.0.email}
<br />
{job.contact.0.phone}
</div>
</f:for>
<div id="job-offer">
<f:for each="{jobs}" as="job">
<f:render partial="Job" arguments="{job: job}" />
</f:for>
</div>
</f:section>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment