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

[TASK] Adding company model, starting work on fluid

parent 959b52cd
No related branches found
No related tags found
No related merge requests found
Showing
with 432 additions and 99 deletions
<?php
namespace SGalinski\SgAjax\Controller\Ajax;
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (https://www.sgalinski.de)
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use SGalinski\SgAjax\Controller\Ajax\AbstractAjaxController;
/**
* Ajax Controller
*/
class JoblistAjaxController extends AbstractAjaxController {
}
\ No newline at end of file
<?php
namespace SGalinski\SgJobs\Controller;
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (https://www.sgalinski.de)
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use SGalinski\SgJobs\Service\BackendService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
/**
* The joblist plugin controller
*/
class JoblistController extends ActionController {
/**
* @var \SGalinski\SgJobs\Domain\Repository\LocationRepository
* @inject
*/
private $locationRepository;
/**
* @var \SGalinski\SgJobs\Domain\Repository\JobRepository
* @inject
*/
private $jobRepository;
/**
* 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 = []) {
$pageUid = (int) GeneralUtility::_GP('id');
// get all jobs for the next root page
$jobs = $this->jobRepository->findJobs(BackendService::getRootUidByPageUid($pageUid), $filters);
$this->view->assign('jobs', $jobs);
$this->view->assign('filters', $filters);
debug(BackendService::getRootUidByPageUid($pageUid));
debug($jobs);
}
}
<?php
namespace SGalinski\SgJobs\Domain\Model;
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (https://www.sgalinski.de)
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
/**
* The Company model
*/
class Company extends AbstractEntity {
/**
* @var string $city
*/
protected $city = '';
/**
* @var string $name
*/
protected $name = '';
/**
* @var string $country
*/
protected $country = '';
/**
* @var string $description
*/
protected $description = '';
/**
* @return string
*/
public function getCity() {
return $this->city;
}
/**
* @param string $city
*/
public function setCity(string $city) {
$this->city = $city;
}
/**
* @return string
*/
public function getCountry() {
return $this->country;
}
/**
* @param string $country
*/
public function setCountry(string $country) {
$this->country = $country;
}
/**
* @return string
*/
public function getDescription() {
return $this->description;
}
/**
* @param string $description
*/
public function setDescription(string $description) {
$this->description = $description;
}
/**
* @return string
*/
public function getName(): string {
return $this->name;
}
/**
* @param string $name
*/
public function setName(string $name) {
$this->name = $name;
}
}
<?php
return [
'ctrl' => [
'title' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_company',
'label' => 'name',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'dividers2tabs' => TRUE,
'searchFields' => 'city, country, description, name',
'versioningWS' => 2,
'versioning_followPages' => TRUE,
'origUid' => 't3_origuid',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'transOrigDiffSourceField' => 'l10n_diffsource',
'delete' => 'deleted',
'enablecolumns' => [
'disabled' => 'hidden',
'starttime' => 'starttime',
'endtime' => 'endtime',
],
'sortby' => 'sorting',
'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('sg_jobs') .
'Resources/Public/Icons/tx_sgjobs_domain_model_company.svg'
],
'interface' => [
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, pid, city, name, country, description',
],
'types' => [
'1' => [
'showitem' => '--palette--;;sysLanguageAndHidden,
city, name, country, description;;;richtext[*]:rte_transform[mode=ts],
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime',
],
],
'palettes' => [
'sysLanguageAndHidden' => [
'showitem' => 'sys_language_uid;;;;1-1-1, l10n_diffsource, hidden;;1, ',
'canNotCollapse' => 1,
]
],
'columns' => [
'sys_language_uid' => [
'exclude' => 1,
'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xml:LGL.language',
'config' => [
'type' => 'select',
'special' => 'languages',
],
],
'l10n_parent' => [
'displayCond' => 'FIELD:sys_language_uid:>:0',
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.l18n_parent',
'config' => [
'type' => 'select',
'items' => [
['', 0],
],
'foreign_table' => 'tx_sgjobs_domain_model_company',
'foreign_table_where' => 'AND tx_sgjobs_domain_model_company.pid=###CURRENT_PID### AND tx_sgjobs_domain_model_company.sys_language_uid IN (-1,0)',
],
],
'l10n_diffsource' => [
'config' => [
'type' => 'passthrough',
],
],
't3ver_label' => [
'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.versionLabel',
'config' => [
'type' => 'input',
'size' => 30,
'max' => 255,
]
],
'pid' => [
'exclude' => 0,
'label' => 'PID',
'config' => [
'type' => 'none',
]
],
'hidden' => [
'exclude' => 1,
'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xml:LGL.hidden',
'config' => [
'type' => 'check',
],
],
'starttime' => [
'exclude' => 1,
'l10n_mode' => 'mergeIfNotBlank',
'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xml:LGL.starttime',
'config' => [
'type' => 'input',
'size' => 13,
'max' => 20,
'eval' => 'datetime',
'checkbox' => 0,
'default' => 0,
'range' => [
'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
],
],
],
'endtime' => [
'exclude' => 1,
'l10n_mode' => 'mergeIfNotBlank',
'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xml:LGL.endtime',
'config' => [
'type' => 'input',
'size' => 13,
'max' => 20,
'eval' => 'datetime',
'checkbox' => 0,
'default' => 0,
'range' => [
'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
],
],
],
'city' => [
'exclude' => 0,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_company.city',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'name' => [
'exclude' => 0,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_company.name',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'country' => [
'exclude' => 0,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_company.country',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'description' => [
'exclude' => 0,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_company.description',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
],
];
\ No newline at end of file
{namespace sg=SGalinski\SgJobs\ViewHelpers}
{namespace sgAjax=SGalinski\SgAjax\ViewHelpers}
<f:layout name="Default" />
<f:section name="iconButtons">
</f:section>
<f:section name="headline">
<f:translate key="backend.list.header" />
</f:section>
<f:section name="content">
<div>
<div class="form-group">
<a href="#" class="btn btn-default" onclick="{sg:backend.editOnClick(table: 'tx_sgjobs_domain_model_base', uid: pageUid, new: 1)}">
<span class="t3js-icon icon icon-size-small icon-state-default icon-actions-document-new">
<span class="icon-markup">
<img src="/typo3/sysext/core/Resources/Public/Icons/T3Icons/actions/actions-document-new.svg" width="16" height="16">
</span>
</span>
<f:translate key="backend.button_create" />
</a>
</div>
<f:if condition="{items}">
<div class="panel panel-default recordlist">
<div class="table-fit">
<table data-table="tx_sgjobs_domain_model_base" class="table table-striped table-hover">
<sg:backend.widget.paginate objects="{items}" as="paginatedItems" configuration="{insertAbove: 1, itemsPerPage: 20}">
<tbody>
<f:for each="{paginatedItems}" as="item">
{sg:backend.editOnClick(table: 'tx_sgjobs_domain_model_base', uid: item.uid) -> sg:set(name: 'editOnClick')}
<tr data-uid="{item.uid}">
<td nowrap="nowrap" class="col-icon">
<sg:backend.icon table="tx_sgjobs_domain_model_base" row="{item}" />
</td>
<td nowrap="nowrap">
<a href="#" onclick="{editOnClick}">
<span>{item.text_field}</span>
</a>
</td>
<td nowrap="nowrap" class="col-control">
<sg:backend.control table="tx_sgjobs_domain_model_base" row="{item}" />
</td>
</tr>
</f:for>
</tbody>
</sg:backend.widget.paginate>
</table>
</div>
</div>
</f:if>
<f:render partial="SomeStuff" />
</div>
</f:section>
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
</header> </header>
<body> <body>
<trans-unit id="listPlugin" approved="yes"> <trans-unit id="listPlugin" approved="yes">
<source>[SgJobs] List</source> <source>[SgJobs] Joblist</source>
<target>[SgJobs] Liste</target> <target>[SgJobs] Stellenangebote</target>
</trans-unit> </trans-unit>
<trans-unit id="mlang_labels_tabdescr" approved="yes"> <trans-unit id="mlang_labels_tabdescr" approved="yes">
<source>Job Offers</source> <source>Job Offers</source>
......
...@@ -41,6 +41,26 @@ ...@@ -41,6 +41,26 @@
<source>Text Field</source> <source>Text Field</source>
<target>Textfeld</target> <target>Textfeld</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_sgjobs_domain_model_company" approved="yes">
<source>Company</source>
<target>Unternehmen</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_company.city" approved="yes">
<source>City</source>
<target>Stadt</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_company.country" approved="yes">
<source>Country</source>
<target>Land</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_company.description" approved="yes">
<source>Description</source>
<target>Beschreibung</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_company.name" approved="yes">
<source>Name</source>
<target>Name</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_contact" approved="yes"> <trans-unit id="tx_sgjobs_domain_model_contact" approved="yes">
<source>Contact</source> <source>Contact</source>
<target>Kontakt</target> <target>Kontakt</target>
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</header> </header>
<body> <body>
<trans-unit id="listPlugin"> <trans-unit id="listPlugin">
<source>[SgJobs] List</source> <source>[SgJobs] Joblist</source>
</trans-unit> </trans-unit>
<trans-unit id="mlang_labels_tabdescr"> <trans-unit id="mlang_labels_tabdescr">
<source>Job Offers</source> <source>Job Offers</source>
......
...@@ -33,6 +33,21 @@ ...@@ -33,6 +33,21 @@
<trans-unit id="tx_sgjobs_domain_model_base.text_field"> <trans-unit id="tx_sgjobs_domain_model_base.text_field">
<source>Text Field</source> <source>Text Field</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_sgjobs_domain_model_company">
<source>Company</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_company.city">
<source>City</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_company.country">
<source>Country</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_company.description">
<source>Description</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_company.name">
<source>Name</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_contact"> <trans-unit id="tx_sgjobs_domain_model_contact">
<source>Contact</source> <source>Contact</source>
</trans-unit> </trans-unit>
......
<f:layout name="Default" />
<f:section name="main">
<f:for each="{jobs}" as="job">
<div>
<h3>{job.title}</h3>
<h3><f:format.date date="{job.startDate}" format="d.m.Y"/> - {job.company}</h3>
</div>
</f:for>
</f:section>
<f:layout name="Default" />
<f:section name="main">
<h1>
<f:translate key="frontend.detail.header" />
</h1>
<p>
{itemDetails}
</p>
<f:link.action action="listAll">
<f:form.button type="button">
<f:translate key="frontend.detail.back" />
</f:form.button>
</f:link.action>
</f:section>
<f:layout name="Default" />
<f:section name="main">
<ul>
<f:for each="{someData}" as="item" key="itemUid">
<li>
<f:link.action action="detail" arguments="{itemUid : '{itemUid}'}">
<f:render partial="ListEntry" arguments="{item : item}" />
</f:link.action>
</li>
</f:for>
</ul>
</f:section>
<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg"><title>module-extensionmanager</title><g fill="none" fill-rule="evenodd"><path d="M0 0h64v64H0z" fill="#F08D34"/><path d="M33.018 27.928l10.897-3.8c.518-.194 1.094.068 1.288.585.194.517-.068 1.093-.585 1.287L34 29.703V42.93c0 .59-.448 1.066-1 1.066s-1-.477-1-1.066V29.687l-10.67-3.815c-.517-.194-.78-.77-.585-1.287.194-.518.77-.78 1.287-.586l10.986 3.928zm.454-12c-.26-.083-.687-.082-.944 0l-16.056 5.12c-.26.085-.472.366-.472.644v20.633c0 .27.215.56.472.642l16.056 5.122c.26.082.687.08.944 0l16.056-5.123c.26-.083.472-.364.472-.642V21.692c0-.272-.215-.56-.472-.643l-16.056-5.122z" fill="#FFF"/></g></svg>
\ No newline at end of file
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
// Configure frontend plugins // Configure frontend plugins
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'SGalinski.sg_jobs', 'SGalinski.sg_jobs',
'List', 'Joblist',
[ [
// Cacheable actions // Cacheable actions
'List' => 'listAll, detail' 'Joblist' => 'index'
], ],
[ [
// Uncacheable actions // Uncacheable actions
'List' => '' 'Joblist' => ''
] ]
); );
......
...@@ -8,14 +8,14 @@ ...@@ -8,14 +8,14 @@
// Register frontend plugins // Register frontend plugins
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'sg_jobs', 'sg_jobs',
'List', 'Joblist',
'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_backend.xlf:listPlugin' 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_backend.xlf:listPlugin'
); );
if (TYPO3_MODE === 'BE') { if (TYPO3_MODE === 'BE') {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_sgjobs_domain_model_job'); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_sgjobs_domain_model_job');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_sgjobs_domain_model_contact'); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_sgjobs_domain_model_contact');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_sgjobs_domain_model_location'); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_sgjobs_domain_model_company');
// Register backend modules // Register backend modules
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule( \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
......
...@@ -46,12 +46,13 @@ CREATE TABLE tx_sgjobs_domain_model_job ( ...@@ -46,12 +46,13 @@ CREATE TABLE tx_sgjobs_domain_model_job (
KEY language (l10n_parent,sys_language_uid) KEY language (l10n_parent,sys_language_uid)
); );
CREATE TABLE tx_sgjobs_domain_model_location ( CREATE TABLE tx_sgjobs_domain_model_company (
uid int(11) NOT NULL auto_increment, uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL, pid int(11) DEFAULT '0' NOT NULL,
-- Custom fields -- Custom fields
city varchar(255) DEFAULT '' NOT NULL, city varchar(255) DEFAULT '' NOT NULL,
name varchar(255) DEFAULT '' NOT NULL,
country varchar(255) DEFAULT '' NOT NULL, country varchar(255) DEFAULT '' NOT NULL,
description text DEFAULT '' NOT NULL, description text DEFAULT '' NOT NULL,
......
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