From ddf2914b1c02eaa70d2971aa221f34b6db956b09 Mon Sep 17 00:00:00 2001
From: Stefan Galinski <stefan@sgalinski.de>
Date: Tue, 5 Jul 2022 18:07:39 +0200
Subject: [PATCH] [FEATURE] Only filter 100% remote jobs with the overview
 filter

---
 Classes/Domain/Repository/JobRepository.php | 5 ++++-
 Resources/Private/Language/de.locallang.xlf | 4 ++--
 Resources/Private/Language/locallang.xlf    | 2 +-
 Resources/Private/Language/zh.locallang.xlf | 6 +++---
 4 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/Classes/Domain/Repository/JobRepository.php b/Classes/Domain/Repository/JobRepository.php
index 1f58b20c..5ca9ee8a 100644
--- a/Classes/Domain/Repository/JobRepository.php
+++ b/Classes/Domain/Repository/JobRepository.php
@@ -226,7 +226,10 @@ class JobRepository extends Repository {
 		}
 
 		if (isset($filters['filterRemote']) && $filters['filterRemote'] !== '') {
-			$constraints[] = $query->equals('telecommutePossible', TRUE);
+			$constraints[] = $query->logicalAnd([
+				$query->equals('telecommutePossible', TRUE),
+				$query->equals('office_work_possible', FALSE)
+			]);
 		}
 
 		if (isset($filters['filterLocation']) && $filters['filterLocation'] !== '0') {
diff --git a/Resources/Private/Language/de.locallang.xlf b/Resources/Private/Language/de.locallang.xlf
index 08e91559..284f4a23 100644
--- a/Resources/Private/Language/de.locallang.xlf
+++ b/Resources/Private/Language/de.locallang.xlf
@@ -371,8 +371,8 @@
 				<target><![CDATA[Standort]]></target>
 			</trans-unit>
 			<trans-unit id="frontend.filter.remote" approved="yes">
-				<source><![CDATA[Show only home office jobs]]></source>
-				<target><![CDATA[Zeige nur Home-Office-Stellen]]></target>
+				<source><![CDATA[Show fully remote jobs only]]></source>
+				<target><![CDATA[Zeige nur Stellen komplett im Homeoffice]]></target>
 			</trans-unit>
 			<trans-unit id="frontend.filter.selections.all" approved="yes">
 				<source><![CDATA[All]]></source>
diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf
index 402eb702..109d061f 100644
--- a/Resources/Private/Language/locallang.xlf
+++ b/Resources/Private/Language/locallang.xlf
@@ -280,7 +280,7 @@
 				<source><![CDATA[Location]]></source>
 			</trans-unit>
 			<trans-unit id="frontend.filter.remote">
-				<source><![CDATA[Show only home office jobs]]></source>
+				<source><![CDATA[Show fully remote jobs only]]></source>
 			</trans-unit>
 			<trans-unit id="frontend.filter.selections.all">
 				<source><![CDATA[All]]></source>
diff --git a/Resources/Private/Language/zh.locallang.xlf b/Resources/Private/Language/zh.locallang.xlf
index 9d00e50a..ec633834 100644
--- a/Resources/Private/Language/zh.locallang.xlf
+++ b/Resources/Private/Language/zh.locallang.xlf
@@ -214,8 +214,8 @@
 				<target><![CDATA[地点]]></target>
 			</trans-unit>
 			<trans-unit id="frontend.filter.remote" approved="yes">
-				<source><![CDATA[Show only home office jobs]]></source>
-				<target><![CDATA[Show only jobs that can be executed remotely.]]></target>
+				<source><![CDATA[Show fully remote jobs only]]></source>
+				<target><![CDATA[Show fully remote jobs only]]></target>
 			</trans-unit>
 			<trans-unit id="frontend.filter.selections.all" approved="yes">
 				<source><![CDATA[All]]></source>
@@ -239,4 +239,4 @@
 			</trans-unit>
 		</body>
 	</file>
-</xliff>
\ No newline at end of file
+</xliff>
-- 
GitLab