Skip to content

Commit

Permalink
added OpenImmo category parking
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasKrais committed Jan 16, 2019
1 parent 7b180a7 commit ed2f95e
Show file tree
Hide file tree
Showing 12 changed files with 79 additions and 16 deletions.
1 change: 1 addition & 0 deletions install.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
land_type varchar(255) collate utf8_general_ci default NULL,
office_type varchar(255) collate utf8_general_ci default NULL,
hall_warehouse_type varchar(255) collate utf8_general_ci default NULL,
parking_type varchar(255) collate utf8_general_ci default NULL,
other_type varchar(255) collate utf8_general_ci default NULL,
street varchar(100) collate utf8_general_ci default NULL,
house_number varchar(5) collate utf8_general_ci default NULL,
Expand Down
11 changes: 11 additions & 0 deletions lang/de_de.lang
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ d2u_immo_property_object_type_grundstueck = Grundstück
d2u_immo_property_object_type_hallen_lager_prod = Halle oder Lager
d2u_immo_property_object_type_haus = Haus
d2u_immo_property_object_type_land_und_forstwirtschaft = Land und Forstwirtschaft
d2u_immo_property_object_type_parken = Parken
d2u_immo_property_object_type_sonstige = Sonstige
d2u_immo_property_object_type_wohnung = Wohnung
d2u_immo_property_object_type_zimmer = Zimmer
Expand All @@ -246,6 +247,16 @@ d2u_immo_property_parking_space_duplex = Anzahl Duplex Parkplätze
d2u_immo_property_parking_space_garage = Anzahl Garagenparkplätze
d2u_immo_property_parking_space_simple = Anzahl Stellplätze
d2u_immo_property_parking_space_undergroundcarpark = Anzahl Tiefgaragenparkplätze
d2u_immo_property_parking_type_BOOTSLIEGEPLATZ = Bootsliegeplatz
d2u_immo_property_parking_type_CARPORT = Carport
d2u_immo_property_parking_type_DOPPELGARAGE = Doppelgarage
d2u_immo_property_parking_type_DUPLEX = Duplex
d2u_immo_property_parking_type_EINZELGARAGE = Einzelgarage
d2u_immo_property_parking_type_PARKHAUS = Parkhaus
d2u_immo_property_parking_type_PARKPLATZ_STROM = Parkplatz mit Ladestation für Elektrofahrzeuge
d2u_immo_property_parking_type_STELLPLATZ = Stellplatz
d2u_immo_property_parking_type_TIEFGARAGENSTELLPLATZ = Tiefgaragenstellplatz
d2u_immo_property_parking_type_TIEFGARAGE = Tiefgarage
d2u_immo_property_prices = Preise
d2u_immo_property_publish_address = Adresse anzeigen?
d2u_immo_property_purchase_price = Kaufpreis
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",
10);
11);
$modules[] = new D2UModule("70-2",
"D2U Immo Addon - Infobox Ansprechpartner",
2);
Expand Down
8 changes: 8 additions & 0 deletions lib/property.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ class Property implements \D2U_Helper\ITranslationHelper {
*/
var $hall_warehouse_type = "";

/**
* @var string Type of car parking places. Values are defined in OpenImmo definition
* of value "parken".
*/
var $parking_type = "";

/**
* @var string Type of office. Values are defined in OpenImmo definition
* of value "sonstige_typ".
Expand Down Expand Up @@ -491,6 +497,7 @@ public function __construct($property_id, $clang_id) {
$this->parking_space_garage = $result->getValue("parking_space_garage");
$this->parking_space_simple = $result->getValue("parking_space_simple");
$this->parking_space_undergroundcarpark = $result->getValue("parking_space_undergroundcarpark");
$this->parking_type = $result->getValue("parking_type");
$this->pictures = preg_grep('/^\s*$/s', explode(",", $result->getValue("pictures")), PREG_GREP_INVERT);
$this->priority = $result->getValue("priority");
$this->publish_address = $result->getValue("publish_address") == "1" ? TRUE : FALSE;
Expand Down Expand Up @@ -918,6 +925,7 @@ public function save() {
."parking_space_garage = ". $this->parking_space_garage .", "
."parking_space_simple = ". $this->parking_space_simple .", "
."parking_space_undergroundcarpark = ". $this->parking_space_undergroundcarpark .", "
."parking_type = '". $this->parking_type ."', "
."pictures = '". implode(",", $this->pictures) ."', "
."publish_address = ". ($this->publish_address ? 1 : 0) .", "
."purchase_price = ". $this->purchase_price .", "
Expand Down
6 changes: 5 additions & 1 deletion modules/70/1/install.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
<?php
print rex_view::warning(rex_i18n::msg('d2u_helper_modules_install_module_03_2'));
if(rex_be_controller::getCurrentPage() != "install/packages/update") {
if(D2UModule::isModuleIDInstalled("03-2") === FALSE) {
print rex_view::warning(rex_i18n::msg('d2u_helper_modules_install_module_03_2'));
}
}
2 changes: 1 addition & 1 deletion modules/70/1/output.php
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ function printImages($pics) {

print '<div class="col-12">&nbsp;</div>';

if($property->object_type != "grundstueck" && strlen($property->energy_pass) > 5) {
if(($property->object_type != "grundstueck" && $property->object_type != "parken") && strlen($property->energy_pass) > 5) {
if($print != "") { // Remove when https://github.com/twbs/bootstrap/issues/22753 is solved
print '<div class="row page-break-avoid">';
}
Expand Down
2 changes: 1 addition & 1 deletion pages/contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
</div>
</form>
<br>
<script type='text/javascript'>
<script>
jQuery(document).ready(function($) {
$('legend').each(function() {
$(this).addClass('open');
Expand Down
31 changes: 30 additions & 1 deletion pages/property.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
$property->parking_space_garage = $form['parking_space_garage'];
$property->parking_space_simple = $form['parking_space_simple'];
$property->parking_space_undergroundcarpark = $form['parking_space_undergroundcarpark'];
$property->parking_type = $form['parking_type'];
$property->pictures = preg_grep('/^\s*$/s', explode(",", $input_media_list[1]), PREG_GREP_INVERT);
$property->priority = $form['priority'];
$property->publish_address = array_key_exists('publish_address', $form);
Expand Down Expand Up @@ -239,6 +240,7 @@
// 'einzelhandel' => rex_i18n::msg('d2u_immo_property_object_type_einzelhandel'),
// 'gastgewerbe' => rex_i18n::msg('d2u_immo_property_object_type_gastgewerbe'),
'hallen_lager_prod' => rex_i18n::msg('d2u_immo_property_object_type_hallen_lager_prod'),
'parken' => rex_i18n::msg('d2u_immo_property_object_type_parken'),
// 'land_und_forstwirtschaft' => rex_i18n::msg('d2u_immo_property_object_type_land_und_forstwirtschaft'),
// 'freizeitimmobilie_gewerblich' => rex_i18n::msg('d2u_immo_property_object_type_freizeitimmobilie_gewerblich'),
// 'zinshaus_renditeobjekt' => rex_i18n::msg('d2u_immo_property_object_type_zinshaus_renditeobjekt'),
Expand Down Expand Up @@ -317,6 +319,17 @@
'FREIFLAECHEN' => rex_i18n::msg('d2u_immo_property_hall_warehouse_type_FREIFLAECHEN'),
'KUEHLHAUS' => rex_i18n::msg('d2u_immo_property_hall_warehouse_type_KUEHLHAUS')];
d2u_addon_backend_helper::form_select('d2u_immo_property_object_subtype', 'form[hall_warehouse_type]', $options_hall_warehouse_type, [$property->hall_warehouse_type], 1, FALSE, $readonly);
$options_parking_type = ['BOOTSLIEGEPLATZ' => rex_i18n::msg('d2u_immo_property_parking_type_BOOTSLIEGEPLATZ'),
'CARPORT' => rex_i18n::msg('d2u_immo_property_parking_type_CARPORT'),
'DOPPELGARAGE' => rex_i18n::msg('d2u_immo_property_parking_type_DOPPELGARAGE'),
'DUPLEX' => rex_i18n::msg('d2u_immo_property_parking_type_DUPLEX'),
'EINZELGARAGE' => rex_i18n::msg('d2u_immo_property_parking_type_EINZELGARAGE'),
'PARKHAUS' => rex_i18n::msg('d2u_immo_property_parking_type_PARKHAUS'),
'PARKPLATZ_STROM' => rex_i18n::msg('d2u_immo_property_parking_type_PARKPLATZ_STROM'),
'STELLPLATZ' => rex_i18n::msg('d2u_immo_property_parking_type_STELLPLATZ'),
'TIEFGARAGENSTELLPLATZ' => rex_i18n::msg('d2u_immo_property_parking_type_TIEFGARAGENSTELLPLATZ'),
'TIEFGARAGE' => rex_i18n::msg('d2u_immo_property_parking_type_TIEFGARAGE')];
d2u_addon_backend_helper::form_select('d2u_immo_property_object_subtype', 'form[parking_type]', $options_parking_type, [$property->parking_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'),
Expand Down Expand Up @@ -587,6 +600,7 @@ function object_type_changer(value) {
$("dl[id='form[land_type]']").hide();
$("dl[id='form[office_type]']").hide();
$("dl[id='form[other_type]']").hide();
$("dl[id='form[parking_type]']").hide();
}
else if (value === "haus") {
$("dl[id='form[apartment_type]']").hide();
Expand All @@ -595,6 +609,7 @@ function object_type_changer(value) {
$("dl[id='form[land_type]']").hide();
$("dl[id='form[office_type]']").hide();
$("dl[id='form[other_type]']").hide();
$("dl[id='form[parking_type]']").hide();
}
else if (value === "grundstueck") {
$("dl[id='form[apartment_type]']").hide();
Expand All @@ -603,6 +618,7 @@ function object_type_changer(value) {
$("dl[id='form[land_type]']").fadeIn();
$("dl[id='form[office_type]']").hide();
$("dl[id='form[other_type]']").hide();
$("dl[id='form[parking_type]']").hide();
}
else if (value === "buero_praxen") {
$("dl[id='form[apartment_type]']").hide();
Expand All @@ -611,6 +627,7 @@ function object_type_changer(value) {
$("dl[id='form[land_type]']").hide();
$("dl[id='form[office_type]']").fadeIn();
$("dl[id='form[other_type]']").hide();
$("dl[id='form[parking_type]']").hide();
}
else if (value === "hallen_lager_prod") {
$("dl[id='form[apartment_type]']").hide();
Expand All @@ -619,6 +636,16 @@ function object_type_changer(value) {
$("dl[id='form[land_type]']").hide();
$("dl[id='form[office_type]']").hide();
$("dl[id='form[other_type]']").hide();
$("dl[id='form[parking_type]']").hide();
}
else if (value === "parken") {
$("dl[id='form[apartment_type]']").hide();
$("dl[id='form[hall_warehouse_type]']").hide();
$("dl[id='form[house_type]']").hide();
$("dl[id='form[land_type]']").hide();
$("dl[id='form[office_type]']").hide();
$("dl[id='form[other_type]']").hide();
$("dl[id='form[parking_type]']").fadeIn();
}
else if (value === "sonstige") {
$("dl[id='form[apartment_type]']").hide();
Expand All @@ -627,9 +654,11 @@ function object_type_changer(value) {
$("dl[id='form[land_type]']").hide();
$("dl[id='form[office_type]']").hide();
$("dl[id='form[other_type]']").fadeIn();
$("dl[id='form[parking_type]']").hide();
};

if (value === "grundstueck") {
// If engery pass is not necessary
if (value === "grundstueck" || value === "parken") {
$("select[name='form[energy_pass]']").removeAttr('required');
$("input[name='form[energy_consumption]']").removeAttr('required');
$("input[name='form[energy_pass_valid_until]']").removeAttr('required');
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.8:</p>
<ul>
<li>Unterstützung von OpenImmo Objektart Parken (für Garagen, Stellplätze, ...).</li>
<li>Bei der Eingabe einer Adresse gibt es jetzt die Möglichkeit eine Adresse direkt zu geocodieren wenn im D2U Helper Addon ein Google Maps API Key mit Zugriff auf die Geocoding API hinterlegt ist.
Geocodierte Adressen werden auf der Karte schneller geladen und belasten das Budget des Google Kontos weniger.</li>
</ul>
Expand Down
18 changes: 9 additions & 9 deletions plugins/export/lib/immobilienscout24.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,19 +140,19 @@ function createXML() {
else if(strtoupper($property->object_type) == "HALLEN_LAGER_PROD") {
$objekttyp_wert = "HalleProduktion";
}
// Garagen
// Garage
else if(strtoupper($property->object_type) == "PARKEN" && strtoupper($property->other_type) == "PARKEN") {
if(strtoupper($property->market_type) == "KAUF") {
$objekttyp_wert = "GarageKauf";
}
else if(strtoupper($property->market_type) == "MIETE_PACHT" || strtoupper($property->market_type) == "ERBPACHT" || strtoupper($property->market_type) == "LEASING") {
$objekttyp_wert = "GarageMiete";
}
}
else if(strtoupper($property->object_type) == "SONSTIGE" && strtoupper($property->other_type) == "SONSTIGE") {
if(strtoupper($property->type_of_use) == "GEWERBE") {
$objekttyp_wert = "SonstigeGewerbe";
}
else {
if(strtoupper($property->market_type) == "KAUF") {
$objekttyp_wert = "GarageKauf";
}
else if(strtoupper($property->market_type) == "MIETE_PACHT" || strtoupper($property->market_type) == "ERBPACHT" || strtoupper($property->market_type) == "LEASING") {
$objekttyp_wert = "GarageMiete";
}
}
}

if($objekttyp_wert == "") {
Expand Down
4 changes: 4 additions & 0 deletions plugins/export/lib/openimmo.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ function createXML() {
$objektart_sub_typ = $xml->createAttribute("hallen_typ");
$objektart_sub_typ->appendChild($xml->createTextNode(strtoupper($property->hall_warehouse_type)));
}
else if(strtolower($property->object_type) == "parken") {
$objektart_sub_typ = $xml->createAttribute("parken_typ");
$objektart_sub_typ->appendChild($xml->createTextNode(strtoupper($property->parking_type)));
}
else if(strtolower($property->object_type) == "sonstige") {
$objektart_sub_typ = $xml->createAttribute("sonstige_typ");
$objektart_sub_typ->appendChild($xml->createTextNode(strtoupper($property->other_type)));
Expand Down
9 changes: 7 additions & 2 deletions update.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
if($sql->getRows() == 0) {
$sql->setQuery("ALTER TABLE `". \rex::getTablePrefix() ."d2u_immo_properties` ADD `hall_warehouse_type` TINYINT(1) NOT NULL DEFAULT 0 AFTER `office_type`;");
}
// 1.0.8
$sql->setQuery("SHOW COLUMNS FROM ". \rex::getTablePrefix() ."d2u_immo_properties LIKE 'parking_type';");
if($sql->getRows() == 0) {
$sql->setQuery("ALTER TABLE `". \rex::getTablePrefix() ."d2u_immo_properties` ADD `parking_type` TINYINT(1) NOT NULL DEFAULT 0 AFTER `hall_warehouse_type`;");
}

// Update language replacements
if(!class_exists('d2u_immo_lang_helper')) {
Expand All @@ -48,7 +53,7 @@
$modules = [];
$modules[] = new D2UModule("70-1",
"D2U Immo Addon - Hauptausgabe",
10);
11);
$modules[] = new D2UModule("70-2",
"D2U Immo Addon - Infobox Ansprechpartner",
2);
Expand All @@ -63,4 +68,4 @@
// remove default lang setting
if (!$this->hasConfig()) {
$this->removeConfig('default_lang');
}
}

0 comments on commit ed2f95e

Please sign in to comment.