From cdf2c2fa44daaf3f7ff023493509da176bd91786 Mon Sep 17 00:00:00 2001
From: Torsten Oppermann <torsten@sgalinski.de>
Date: Thu, 26 Jul 2018 10:18:43 +0200
Subject: [PATCH] [TASK] New version, adding street field to contact model

---
 Classes/Domain/Model/Contact.php              | 19 +++++++++++++++++++
 .../TCA/tx_sgjobs_domain_model_contact.php    | 15 ++++++++++++---
 .../Private/Language/de.locallang_db.xlf      |  4 ++++
 Resources/Private/Language/locallang_db.xlf   |  3 +++
 composer.json                                 |  2 +-
 ext_emconf.php                                |  2 +-
 ext_tables.sql                                |  1 +
 7 files changed, 41 insertions(+), 5 deletions(-)

diff --git a/Classes/Domain/Model/Contact.php b/Classes/Domain/Model/Contact.php
index 1546df72..0696ce7c 100644
--- a/Classes/Domain/Model/Contact.php
+++ b/Classes/Domain/Model/Contact.php
@@ -47,6 +47,11 @@ class Contact extends AbstractEntity {
 	 */
 	protected $lastName = '';
 
+	/**
+	 * @var string $street
+	 */
+	protected $street = '';
+
 	/**
 	 * @var string $city
 	 */
@@ -183,4 +188,18 @@ class Contact extends AbstractEntity {
 	public function setTitle($title) {
 		$this->title = $title;
 	}
+
+	/**
+	 * @return string
+	 */
+	public function getStreet() {
+		return $this->street;
+	}
+
+	/**
+	 * @param string $street
+	 */
+	public function setStreet($street) {
+		$this->street = $street;
+	}
 }
diff --git a/Configuration/TCA/tx_sgjobs_domain_model_contact.php b/Configuration/TCA/tx_sgjobs_domain_model_contact.php
index 704484e4..571705b1 100644
--- a/Configuration/TCA/tx_sgjobs_domain_model_contact.php
+++ b/Configuration/TCA/tx_sgjobs_domain_model_contact.php
@@ -8,7 +8,7 @@ return [
 		'crdate' => 'crdate',
 		'cruser_id' => 'cruser_id',
 		'dividers2tabs' => TRUE,
-		'searchFields' => 'title, first_name, last_name, city, zip, email, phone, hide_in_frontend',
+		'searchFields' => 'title, first_name, last_name, street, city, zip, email, phone, hide_in_frontend',
 		'versioningWS' => 2,
 		'versioning_followPages' => TRUE,
 		'origUid' => 't3_origuid',
@@ -26,12 +26,12 @@ return [
 			'Resources/Public/Icons/tx_sgjobs_domain_model_contact.svg'
 	],
 	'interface' => [
-		'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, pid, title, first_name, last_name, city, zip, email, phone, hide_in_frontend',
+		'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, pid, title, first_name, last_name, street, city, zip, email, phone, hide_in_frontend',
 	],
 	'types' => [
 		'1' => [
 			'showitem' => '--palette--;;sysLanguageAndHidden,
-				hide_in_frontend, title, first_name, last_name, city, zip, email, phone;;;richtext[*]:rte_transform[mode=ts],
+				hide_in_frontend, title, first_name, last_name, street, city, zip, email, phone;;;richtext[*]:rte_transform[mode=ts],
 				--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime',
 		],
 	],
@@ -154,6 +154,15 @@ return [
 				'eval' => 'trim, required'
 			],
 		],
+		'street' => [
+			'exclude' => 0,
+			'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_contact.street',
+			'config' => [
+				'type' => 'input',
+				'size' => 30,
+				'eval' => 'trim'
+			],
+		],
 		'city' => [
 			'exclude' => 0,
 			'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_contact.city',
diff --git a/Resources/Private/Language/de.locallang_db.xlf b/Resources/Private/Language/de.locallang_db.xlf
index 928efc61..85c245bb 100644
--- a/Resources/Private/Language/de.locallang_db.xlf
+++ b/Resources/Private/Language/de.locallang_db.xlf
@@ -121,6 +121,10 @@
 				<source><![CDATA[Phone]]></source>
 				<target><![CDATA[Telefon]]></target>
 			</trans-unit>
+			<trans-unit id="tx_sgjobs_domain_model_contact.street" approved="yes">
+				<source><![CDATA[Street]]></source>
+				<target><![CDATA[Straße]]></target>
+			</trans-unit>
 			<trans-unit id="tx_sgjobs_domain_model_contact.title" approved="yes">
 				<source><![CDATA[Title]]></source>
 				<target><![CDATA[Titel]]></target>
diff --git a/Resources/Private/Language/locallang_db.xlf b/Resources/Private/Language/locallang_db.xlf
index bb4a5638..49e9f0da 100644
--- a/Resources/Private/Language/locallang_db.xlf
+++ b/Resources/Private/Language/locallang_db.xlf
@@ -96,6 +96,9 @@
 			<trans-unit id="tx_sgjobs_domain_model_contact.phone">
 				<source><![CDATA[Phone]]></source>
 			</trans-unit>
+			<trans-unit id="tx_sgjobs_domain_model_contact.street">
+				<source><![CDATA[Street]]></source>
+			</trans-unit>
 			<trans-unit id="tx_sgjobs_domain_model_contact.title">
 				<source><![CDATA[Title]]></source>
 			</trans-unit>
diff --git a/composer.json b/composer.json
index 31fe3a00..d6e2fcf2 100644
--- a/composer.json
+++ b/composer.json
@@ -6,7 +6,7 @@
 	"license": [
 		"GPL-2.0-or-later"
 	],
-	"version": "1.14.8",
+	"version": "1.14.9",
 	"support": {
 		"issues": "https://gitlab.sgalinski.de/typo3/sg_jobs"
 	},
diff --git a/ext_emconf.php b/ext_emconf.php
index c77f6e4f..106c9dd6 100644
--- a/ext_emconf.php
+++ b/ext_emconf.php
@@ -4,7 +4,7 @@ $EM_CONF[$_EXTKEY] = array (
 	'title' => 'Jobs',
 	'description' => 'Manage and display your Job offers.',
 	'category' => 'plugin',
-	'version' => '1.14.8',
+	'version' => '1.14.9',
 	'state' => 'stable',
 	'uploadfolder' => FALSE,
 	'createDirs' => '',
diff --git a/ext_tables.sql b/ext_tables.sql
index 9a2b5529..51f2b621 100644
--- a/ext_tables.sql
+++ b/ext_tables.sql
@@ -105,6 +105,7 @@ CREATE TABLE tx_sgjobs_domain_model_contact (
 	title varchar(255) DEFAULT '' NOT NULL,
 	first_name varchar(255) DEFAULT '' NOT NULL,
 	last_name varchar(255) DEFAULT '' NOT NULL,
+	street varchar(255) DEFAULT '' NOT NULL,
 	city varchar(255) DEFAULT '' NOT NULL,
 	zip varchar(255) DEFAULT '' NOT NULL,
 	email varchar(255) DEFAULT '' NOT NULL,
-- 
GitLab