Skip to content

Commit

Permalink
GDPR adaptions and moved CSS from template to modules
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasKrais committed Apr 19, 2018
1 parent 87c927b commit 83a0e97
Show file tree
Hide file tree
Showing 11 changed files with 212 additions and 16 deletions.
4 changes: 4 additions & 0 deletions lib/d2u_immo_lang_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class d2u_immo_lang_helper {
'd2u_immo_form_message' => 'Comments',
'd2u_immo_form_name' => 'Name',
'd2u_immo_form_phone' => 'Phone',
'd2u_immo_form_privacy_policy' => 'I have read the Privacy Policy and accept them.',
'd2u_immo_form_required' => 'Required',
'd2u_immo_form_send' => 'Send',
'd2u_immo_form_thanks' => 'Thank you for your message. Your request will be processed as quickly as possible.',
Expand All @@ -116,6 +117,7 @@ class d2u_immo_lang_helper {
'd2u_immo_form_validate_email_false' => 'Please correct email address.',
'd2u_immo_form_validate_name' => 'Please enter your full name.',
'd2u_immo_form_validate_phone' => 'Please enter your phone number.',
'd2u_immo_form_validate_privacy_policy' => 'It\'s necessary to accept the privacy policy.',
'd2u_immo_form_validate_title' => 'Failure sending message:',
'd2u_immo_form_zip' => 'ZIP code',
'd2u_immo_ground_plans' => 'Ground plans',
Expand Down Expand Up @@ -275,6 +277,7 @@ class d2u_immo_lang_helper {
'd2u_immo_form_message' => 'Bemerkungen',
'd2u_immo_form_name' => 'Name',
'd2u_immo_form_phone' => 'Telefon',
'd2u_immo_form_privacy_policy' => 'Ich habe die Datenschutzerklärung gelesen und akzeptiere sie.',
'd2u_immo_form_required' => 'Pflichtfelder',
'd2u_immo_form_send' => 'Abschicken',
'd2u_immo_form_thanks' => 'Danke für Ihre Nachricht. Wir kümmern uns schnellst möglich um Ihr Anliegen.',
Expand All @@ -284,6 +287,7 @@ class d2u_immo_lang_helper {
'd2u_immo_form_validate_email_false' => 'Bitte prüfen Sie die E-Mail Adresse auf Korrektheit.',
'd2u_immo_form_validate_name' => 'Um Sie korrekt ansprechen zu können, geben Sie bitte Ihren vollständigen Namen an.',
'd2u_immo_form_validate_phone' => 'Bitte geben Sie Ihre Telefonnummer ein.',
'd2u_immo_form_validate_privacy_policy' => 'Der Datenschutzerklärung muss zugestimmt werden.',
'd2u_immo_form_validate_title' => 'Fehler beim Senden:',
'd2u_immo_form_zip' => 'PLZ',
'd2u_immo_ground_plans' => 'Grundrisse',
Expand Down
2 changes: 1 addition & 1 deletion lib/d2u_immo_module_manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static function getModules() {
$modules = [];
$modules[] = new D2UModule("70-1",
"D2U Immo Addon - Hauptausgabe",
6);
7);
$modules[] = new D2UModule("70-2",
"D2U Immo Addon - Infobox Ansprechpartner",
2);
Expand Down
4 changes: 4 additions & 0 deletions modules/70/1/output.php
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,8 @@ function recalc() {
print '<div id="tab_request" class="tab-pane immo-tab fade">'; // START tab request
print '<div class="col-12">';
print '<fieldset><legend>'. $tag_open .'d2u_immo_form_title'. $tag_close .'</legend>';
$privacy_policy_article = rex_article::get(rex_config::get('d2u_helper', 'article_id_privacy_policy', 0));
$privacy_policy_article_name = $privacy_policy_article instanceof rex_article ? $privacy_policy_article->getName() : '';
$form_data = 'hidden|immo_name|'. $property->name .'|REQUEST
text|name|'. $tag_open .'d2u_immo_form_name'. $tag_close .' *
Expand All @@ -956,6 +958,7 @@ function recalc() {
text|phone|'. $tag_open .'d2u_immo_form_phone'. $tag_close .' *
text|email|'. $tag_open .'d2u_immo_form_email'. $tag_close .' *
textarea|message|'. $tag_open .'d2u_immo_form_message'. $tag_close .'
'. ($privacy_policy_article_name != '' ? 'checkbox|privacy_policy_accepted|<a href="'. $privacy_policy_article->getUrl() .'" target="_blank">'. $tag_open .'d2u_immo_form_privacy_policy'. $tag_close .'</a> *|no,yes|no' : '') .'
html||<br>* '. $tag_open .'d2u_immo_form_required'. $tag_close .'<br><br>
captcha|'. $tag_open .'d2u_immo_form_captcha'. $tag_close .'|'. $tag_open .'d2u_immo_form_validate_captcha'. $tag_close .'|'. rex_getUrl('', '', ['property_id' => $property->property_id]) .'
Expand All @@ -966,6 +969,7 @@ function recalc() {
validate|empty|phone|'. $tag_open .'d2u_immo_form_validate_phone'. $tag_close .'
validate|empty|email|'. $tag_open .'d2u_immo_form_validate_email'. $tag_close .'
validate|email|email|'. $tag_open .'d2u_immo_form_validate_email_false'. $tag_close .'
'. ($privacy_policy_article_name != '' ? 'validate|empty|privacy_policy_accepted|'. $tag_open .'d2u_guestbook_form_validate_privacy_policy'. $tag_close .'' : '') .'
action|tpl2email|d2u_immo_request|emaillabel|'. $property->contact->email;

Expand Down
183 changes: 183 additions & 0 deletions modules/70/1/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
.tab-content {
border: 1px solid navi_color_bg;
margin-bottom: 1em;
padding: 1em
}
.tab-content ul {
margin-bottom: 0;
margin-left: -1.25em;
}
.tab-content h1, .tab-content h2 {
font-size: 1.25em;
font-weight: bold;
}

.expose {
border-left: 1px solid navi_color_bg;
border-bottom: 1px solid navi_color_bg;
margin-bottom: 2em;
padding-left: 1em;
}
.expose a, .expose a:hover {
text-decoration: none;
}
.expose img {
margin-bottom: 1em;
}

.expose-navi {
padding-top: 2px;
padding-bottom: 1em;
}
.expose-navi ul {
padding-left: 0px;
}
.expose-navi li {
float: left;
list-style: none;
margin-bottom: 1em;
padding-right: 1em;
}
.expose-navi li a {
padding: 5px;
}

.nolink {
color: #3c3c3c;
}

.nav-item {
margin-right: 1px;
}
.nav-item a, .nav-item a:focus, .nav-item a:visited {
background-color: navi_color_font;
border-left: 1px solid navi_color_bg;
border-right: 1px solid navi_color_bg;
border-top: 1px solid navi_color_bg;
color: #3c3c3c;
font-size: 0.9em;
font-weight: bold;
padding: 0.3em 0.75em;
}
.nav-pills .nav-item .nav-link.active, .nav-item a:hover {
background-color: navi_color_bg;
color: navi_color_font;
text-decoration: none;
}
.nav-pills .nav-link {
border-radius: 0px !important;
}
.nav-item a span.icon {
font-size: 1em;
font-weight: normal;
}

.energy-scale-container {
height: 35px;
margin-top: 10px;
position: relative;
}
.energy-scale {
min-width: 400px;
}

.icon {
color: #3c3c3c;
font-family: FontAwesome;
font-weight: normal;
line-height: 1em;
}
.back:before {
color: slategrey;
content: "\f060";
}
.forward:before {
content: "\f064";
}
.home:before {
content: "\f015";
}
.mail:before {
color: goldenrod;
content: "\f003";
}
.map:before {
content: "\f041";
}
.money:before {
content: "\f0d6";
}
.pdf:before {
color: darkred;
content: "\f1c1";
}
.pic:before {
content: "\f03e";
}
.print:before {
color: slategrey;
content: "\f02f";
}
.reload:before {
content: "\f0e2";
}
.request:before {
content: "\f29c";
}
.reserved {
position: relative;
}
.reserved span {
background-color: white;
bottom: 0px;
color: red;
font-weight: bold;
left: 0px;
opacity: 0.75;
padding: 0.5em 0;
position: absolute;
text-align: center;
width: 100%;
}
.expose .reserved span {
padding-bottom: 1.5em;
}

@media print {
body {
width: 950px;
}

input {
border: none;
}
.listpic {
width: 50mm;
}
.overviewpic {
max-width: 80mm;
}
.page-break-avoid {
page-break-inside: avoid;
}
.print-border {
border-left: 0.5mm solid navi_color_bg;
margin-left: 15px;
padding-left: 2.8em !important;
}
.print-border-h {
border-left: 2em solid navi_color_bg;
margin-left: 15px;
margin-top: 0.75em;
}
.print-no-border {
margin-left: -15px;
}
.tab-content {
border: none;
padding: 0;
}
.col-6 ul {
margin-bottom: 0;
}
}
2 changes: 1 addition & 1 deletion package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ page:

requires:
packages:
d2u_helper: '>=1.4.0'
d2u_helper: '>=1.4.1'
media_manager: '>=2.2'
sprog: '>=1.0.0'
url: '>=1.0.1'
Expand Down
2 changes: 1 addition & 1 deletion pages/category.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
$options_translations["yes"] = rex_i18n::msg('d2u_helper_translation_needs_update');
$options_translations["no"] = rex_i18n::msg('d2u_helper_translation_is_uptodate');
$options_translations["delete"] = rex_i18n::msg('d2u_helper_translation_delete');
d2u_addon_backend_helper::form_select('d2u_helper_translation', 'form[lang]['. $rex_clang->getId() .'][translation_needs_update]', $options_translations, array($category->translation_needs_update), 1, FALSE, $readonly_lang);
d2u_addon_backend_helper::form_select('d2u_helper_translation', 'form[lang]['. $rex_clang->getId() .'][translation_needs_update]', $options_translations, [$category->translation_needs_update], 1, FALSE, $readonly_lang);
}
else {
print '<input type="hidden" name="form[lang]['. $rex_clang->getId() .'][translation_needs_update]" value="">';
Expand Down
4 changes: 4 additions & 0 deletions pages/index.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?php
echo rex_view::title($this->i18n('d2u_immo'));

if (rex_config::get('d2u_helper', 'article_id_privacy_policy', 0) == 0) {
print rex_view::warning(rex_i18n::msg('d2u_helper_gdpr_warning'));
}

rex_be_controller::includeCurrentPageSubPath();
22 changes: 11 additions & 11 deletions pages/property.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
$options_translations["yes"] = rex_i18n::msg('d2u_helper_translation_needs_update');
$options_translations["no"] = rex_i18n::msg('d2u_helper_translation_is_uptodate');
$options_translations["delete"] = rex_i18n::msg('d2u_helper_translation_delete');
d2u_addon_backend_helper::form_select('d2u_helper_translation', 'form[lang]['. $rex_clang->getId() .'][translation_needs_update]', $options_translations, array($property->translation_needs_update), 1, FALSE, $readonly_lang);
d2u_addon_backend_helper::form_select('d2u_helper_translation', 'form[lang]['. $rex_clang->getId() .'][translation_needs_update]', $options_translations, [$property->translation_needs_update], 1, FALSE, $readonly_lang);
}
else {
print '<input type="hidden" name="form[lang]['. $rex_clang->getId() .'][translation_needs_update]" value="">';
Expand Down Expand Up @@ -223,12 +223,12 @@
'GEWERBE' => rex_i18n::msg('d2u_immo_property_type_of_use_GEWERBE'),
'ANLAGE' => rex_i18n::msg('d2u_immo_property_type_of_use_ANLAGE'),
'WAZ' => rex_i18n::msg('d2u_immo_property_type_of_use_WAZ')];
d2u_addon_backend_helper::form_select('d2u_immo_property_type_of_use', 'form[type_of_use]', $options_type_of_use, array($property->type_of_use), 1, FALSE, $readonly);
d2u_addon_backend_helper::form_select('d2u_immo_property_type_of_use', 'form[type_of_use]', $options_type_of_use, [$property->type_of_use], 1, FALSE, $readonly);
$options_market_type = ['KAUF' => rex_i18n::msg('d2u_immo_property_market_type_KAUF'),
// 'ERBPACHT' => rex_i18n::msg('d2u_immo_property_market_type_ERBPACHT'),
// 'LEASING' => rex_i18n::msg('d2u_immo_property_market_type_LEASING'),
'MIETE_PACHT' => rex_i18n::msg('d2u_immo_property_market_type_MIETE_PACHT')];
d2u_addon_backend_helper::form_select('d2u_immo_property_market_type', 'form[market_type]', $options_market_type, array($property->market_type), 1, FALSE, $readonly);
d2u_addon_backend_helper::form_select('d2u_immo_property_market_type', 'form[market_type]', $options_market_type, [$property->market_type], 1, FALSE, $readonly);
$options_object_type = ['wohnung' => rex_i18n::msg('d2u_immo_property_object_type_wohnung'),
// 'zimmer' => rex_i18n::msg('d2u_immo_property_object_type_zimmer'),
'haus' => rex_i18n::msg('d2u_immo_property_object_type_haus'),
Expand All @@ -241,7 +241,7 @@
// 'freizeitimmobilie_gewerblich' => rex_i18n::msg('d2u_immo_property_object_type_freizeitimmobilie_gewerblich'),
// 'zinshaus_renditeobjekt' => rex_i18n::msg('d2u_immo_property_object_type_zinshaus_renditeobjekt'),
'sonstige' => rex_i18n::msg('d2u_immo_property_object_type_sonstige')];
d2u_addon_backend_helper::form_select('d2u_immo_property_object_type', 'form[object_type]', $options_object_type, array($property->object_type), 1, FALSE, $readonly);
d2u_addon_backend_helper::form_select('d2u_immo_property_object_type', 'form[object_type]', $options_object_type, [$property->object_type], 1, FALSE, $readonly);
$options_apartment_type = ['KEINE_ANGABE' => rex_i18n::msg('d2u_immo_property_type_KEINE_ANGABE'),
'DACHGESCHOSS' => rex_i18n::msg('d2u_immo_property_apartment_type_DACHGESCHOSS'),
'MAISONETTE' => rex_i18n::msg('d2u_immo_property_apartment_type_MAISONETTE'),
Expand All @@ -251,7 +251,7 @@
'WETAGE' => rex_i18n::msg('d2u_immo_property_apartment_type_WETAGE'),
'ERDGESCHOSS' => rex_i18n::msg('d2u_immo_property_apartment_type_ERDGESCHOSS'),
'SOUTERRAIN' => rex_i18n::msg('d2u_immo_property_apartment_type_SOUTERRAIN')];
d2u_addon_backend_helper::form_select('d2u_immo_property_apartment_type', 'form[apartment_type]', $options_apartment_type, array($property->apartment_type), 1, FALSE, $readonly);
d2u_addon_backend_helper::form_select('d2u_immo_property_apartment_type', 'form[apartment_type]', $options_apartment_type, [$property->apartment_type], 1, FALSE, $readonly);
$options_house_type = ['KEINE_ANGABE' => rex_i18n::msg('d2u_immo_property_type_KEINE_ANGABE'),
'APARTMENTHAUS' => rex_i18n::msg('d2u_immo_property_house_type_APARTMENTHAUS'),
'BAUERNHAUS' => rex_i18n::msg('d2u_immo_property_house_type_BAUERNHAUS'),
Expand Down Expand Up @@ -280,7 +280,7 @@
'STRANDHAUS' => rex_i18n::msg('d2u_immo_property_house_type_STRANDHAUS'),
'VILLA' => rex_i18n::msg('d2u_immo_property_house_type_VILLA'),
'ZWEIFAMILIENHAUS' => rex_i18n::msg('d2u_immo_property_house_type_ZWEIFAMILIENHAUS')];
d2u_addon_backend_helper::form_select('d2u_immo_property_house_type', 'form[house_type]', $options_house_type, array($property->house_type), 1, FALSE, $readonly);
d2u_addon_backend_helper::form_select('d2u_immo_property_house_type', 'form[house_type]', $options_house_type, [$property->house_type], 1, FALSE, $readonly);
$options_land_type = ['WOHNEN' => rex_i18n::msg('d2u_immo_property_land_type_WOHNEN'),
'GEWERBE' => rex_i18n::msg('d2u_immo_property_land_type_GEWERBE'),
'INDUSTRIE' => rex_i18n::msg('d2u_immo_property_land_type_INDUSTRIE'),
Expand All @@ -290,7 +290,7 @@
'GEWERBEPARK' => rex_i18n::msg('d2u_immo_property_land_type_GEWERBEPARK'),
'SEELIEGENSCHAFT' => rex_i18n::msg('d2u_immo_property_land_type_SEELIEGENSCHAFT'),
'SONDERNUTZUNG' => rex_i18n::msg('d2u_immo_property_land_type_SONDERNUTZUNG')];
d2u_addon_backend_helper::form_select('d2u_immo_property_land_type', 'form[land_type]', $options_land_type, array($property->land_type), 1, FALSE, $readonly);
d2u_addon_backend_helper::form_select('d2u_immo_property_land_type', 'form[land_type]', $options_land_type, [$property->land_type], 1, FALSE, $readonly);
$options_office_type = ['BUEROFLAECHE' => rex_i18n::msg('d2u_immo_property_office_type_BUEROFLAECHE'),
'BUEROHAUS' => rex_i18n::msg('d2u_immo_property_office_type_BUEROHAUS'),
'BUEROZENTRUM' => rex_i18n::msg('d2u_immo_property_office_type_BUEROZENTRUM'),
Expand All @@ -301,12 +301,12 @@
'PRAXISHAUS' => rex_i18n::msg('d2u_immo_property_office_type_PRAXISHAUS'),
'SHARED_OFFICE' => rex_i18n::msg('d2u_immo_property_office_type_SHARED_OFFICE'),
'AUSSTELLUNGSFLAECHE' => rex_i18n::msg('d2u_immo_property_office_type_AUSSTELLUNGSFLAECHE')];
d2u_addon_backend_helper::form_select('d2u_immo_property_office_type', 'form[office_type]', $options_office_type, array($property->office_type), 1, FALSE, $readonly);
d2u_addon_backend_helper::form_select('d2u_immo_property_office_type', 'form[office_type]', $options_office_type, [$property->office_type], 1, FALSE, $readonly);
$options_other_type = ['PARKHAUS' => rex_i18n::msg('d2u_immo_property_other_type_PARKHAUS'),
'TANKSTELLE' => rex_i18n::msg('d2u_immo_property_other_type_TANKSTELLE'),
'KRANKENHAUS' => rex_i18n::msg('d2u_immo_property_other_type_KRANKENHAUS'),
'SONSTIGE' => rex_i18n::msg('d2u_immo_property_other_type_SONSTIGE')];
d2u_addon_backend_helper::form_select('d2u_immo_property_other_type', 'form[other_type]', $options_other_type, array($property->other_type), 1, FALSE, $readonly);
d2u_addon_backend_helper::form_select('d2u_immo_property_other_type', 'form[other_type]', $options_other_type, [$property->other_type], 1, FALSE, $readonly);
$options_condition_type = ['ABRISSOBJEKT' => rex_i18n::msg('d2u_immo_property_condition_type_ABRISSOBJEKT'),
'BAUFAELLIG' => rex_i18n::msg('d2u_immo_property_condition_type_BAUFAELLIG'),
'ENTKERNT' => rex_i18n::msg('d2u_immo_property_condition_type_ENTKERNT'),
Expand Down Expand Up @@ -343,7 +343,7 @@
'CHE' => rex_i18n::msg('d2u_immo_property_country_code_CHE'),
'SWE' => rex_i18n::msg('d2u_immo_property_country_code_SWE'),
'ESP' => rex_i18n::msg('d2u_immo_property_country_code_ESP')];
d2u_addon_backend_helper::form_select('d2u_immo_property_country_code', 'form[country_code]', $options_country_code, array($property->country_code), 1, FALSE, $readonly);
d2u_addon_backend_helper::form_select('d2u_immo_property_country_code', 'form[country_code]', $options_country_code, [$property->country_code], 1, FALSE, $readonly);
d2u_addon_backend_helper::form_input('d2u_immo_property_longitude', 'form[longitude]', $property->longitude, FALSE, $readonly, 'text');
d2u_addon_backend_helper::form_input('d2u_immo_property_latitude', 'form[latitude]', $property->latitude, FALSE, $readonly, 'text');
d2u_addon_backend_helper::form_input('d2u_immo_property_floor', 'form[floor]', $property->floor, FALSE, $readonly, 'number');
Expand Down Expand Up @@ -436,7 +436,7 @@
$options_currency_code = ['EUR' => rex_i18n::msg('d2u_immo_property_currency_code_EUR'),
'CHF' => rex_i18n::msg('d2u_immo_property_currency_code_CHF'),
'USD' => rex_i18n::msg('d2u_immo_property_currency_code_USD')];
d2u_addon_backend_helper::form_select('d2u_immo_property_currency_code', 'form[currency_code]', $options_currency_code, array($property->currency_code), 1, FALSE, $readonly);
d2u_addon_backend_helper::form_select('d2u_immo_property_currency_code', 'form[currency_code]', $options_currency_code, [$property->currency_code], 1, FALSE, $readonly);
d2u_addon_backend_helper::form_input('d2u_immo_property_purchase_price', 'form[purchase_price]', $property->purchase_price, FALSE, $readonly, 'number');
d2u_addon_backend_helper::form_input('d2u_immo_property_purchase_price_m2', 'form[purchase_price_m2]', $property->purchase_price_m2, FALSE, $readonly, 'number');
d2u_addon_backend_helper::form_input('d2u_immo_property_cold_rent', 'form[cold_rent]', $property->cold_rent, FALSE, $readonly, 'number');
Expand Down
1 change: 1 addition & 0 deletions pages/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<h2>Changelog</h2>
<p>1.0.4-DEV:</p>
<ul>
<li>Feld Datenschutzerklärung akzeptiert im Frontend Formular hinzugefügt.</li>
<li>Fehler beim Speichern von einfachen Anführungszeichen behoben.</li>
<li>YRewrite Multidomain Anpassungen.</li>
<li>Export Plugin: Portale können offline geschaltet werden.</li>
Expand Down
2 changes: 1 addition & 1 deletion plugins/window_advertising/pages/advertisement.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
$options_translations["yes"] = rex_i18n::msg('d2u_helper_translation_needs_update');
$options_translations["no"] = rex_i18n::msg('d2u_helper_translation_is_uptodate');
$options_translations["delete"] = rex_i18n::msg('d2u_helper_translation_delete');
d2u_addon_backend_helper::form_select('d2u_helper_translation', 'form[lang]['. $rex_clang->getId() .'][translation_needs_update]', $options_translations, array($advertisement->translation_needs_update), 1, FALSE, $readonly_lang);
d2u_addon_backend_helper::form_select('d2u_helper_translation', 'form[lang]['. $rex_clang->getId() .'][translation_needs_update]', $options_translations, [$advertisement->translation_needs_update], 1, FALSE, $readonly_lang);
}
else {
print '<input type="hidden" title="form[lang]['. $rex_clang->getId() .'][translation_needs_update]" value="">';
Expand Down
2 changes: 1 addition & 1 deletion update.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
$modules = [];
$modules[] = new D2UModule("70-1",
"D2U Immo Addon - Hauptausgabe",
5);
7);
$modules[] = new D2UModule("70-2",
"D2U Immo Addon - Infobox Ansprechpartner",
2);
Expand Down

0 comments on commit 83a0e97

Please sign in to comment.