Skip to content

Commit

Permalink
yform 3 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasKrais committed Jan 30, 2019
1 parent 538b57b commit b028d6f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion install.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
$sql->setQuery("SELECT * FROM ". \rex::getTablePrefix() ."yform_email_template WHERE name = 'd2u_immo_request'");
if($sql->getRows() == 0) {
$sql->setQuery("INSERT INTO ". \rex::getTablePrefix() ."yform_email_template (`name`, `mail_from`, `mail_from_name`, `subject`, `body`, `body_html`, `attachments`) VALUES
('d2u_immo_request', 'REX_YFORM_DATA[field=\"email\"]', 'REX_YFORM_DATA[field=\"name\"]', 'Immobilienanfrage', 'Immobilienanfrage von Internetseite:\r\nImmobilie: REX_YFORM_DATA[field=\"immo_name\"]\r\n\r\nEs fragt an:\r\nName: REX_YFORM_DATA[field=\"name\"]\r\nAnschrift: REX_YFORM_DATA[field=\"address\"]\r\nPLZ/Ort: REX_YFORM_DATA[field=\"zip\"] REX_YFORM_DATA[field=\"city\"]\r\nTelefon: REX_YFORM_DATA[field=\"phone\"]\r\nTelefon Anrufe gestattet: REX_YFORM_DATA[field=\"phone_calls\"]\r\nEmail: REX_YFORM_DATA[field=\"email\"]\r\nDatenschutzerklärung zugestimmt: REX_YFORM_DATA[field=\"privacy_policy_accepted\"]\r\n\r\nNachricht: REX_YFORM_DATA[field=\"message\"]\r\n', '', '')");
('d2u_immo_request', 'REX_YFORM_DATA[field=\"email\"]', 'REX_YFORM_DATA[field=\"name\"]', 'Immobilienanfrage', 'Immobilienanfrage von Internetseite:\r\nImmobilie: REX_YFORM_DATA[field=\"immo_name\"]\r\n\r\nEs fragt an:\r\nName: REX_YFORM_DATA[field=\"name\"]\r\nAnschrift: REX_YFORM_DATA[field=\"address\"]\r\nPLZ/Ort: REX_YFORM_DATA[field=\"zip\"] REX_YFORM_DATA[field=\"city\"]\r\nTelefon: REX_YFORM_DATA[field=\"phone\"]\r\nTelefon Anrufe gestattet: <?php print REX_YFORM_DATA[field=\"phone_calls\"] == 1 ? \"Ja\" : \"Nein\"; ?>\r\nEmail: REX_YFORM_DATA[field=\"email\"]\r\nDatenschutzerklärung zugestimmt: <?php print REX_YFORM_DATA[field=\"privacy_policy_accepted\"] == 1 ? \"Ja\" : \"Nein\"; ?>\r\n\r\nNachricht: REX_YFORM_DATA[field=\"message\"]\r\n', '', '')");
}

// Insert frontend translations
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",
12);
13);
$modules[] = new D2UModule("70-2",
"D2U Immo Addon - Infobox Ansprechpartner",
2);
Expand Down
4 changes: 2 additions & 2 deletions modules/70/1/output.php
Original file line number Diff line number Diff line change
Expand Up @@ -960,8 +960,8 @@ 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 .'
checkbox|privacy_policy_accepted|'. $tag_open .'d2u_immo_form_privacy_policy'. $tag_close .' *|'. $tag_open .'d2u_immo_no'. $tag_close .','. $tag_open .'d2u_immo_yes'. $tag_close .'|'. $tag_open .'d2u_immo_no'. $tag_close .'
checkbox|phone_calls|'. $tag_open .'d2u_immo_form_phone_calls'. $tag_close .'|'. $tag_open .'d2u_immo_no'. $tag_close .','. $tag_open .'d2u_immo_yes'. $tag_close .'|'. $tag_open .'d2u_immo_no'. $tag_close .'
checkbox|privacy_policy_accepted|'. $tag_open .'d2u_immo_form_privacy_policy'. $tag_close .' *|0,1|0
checkbox|phone_calls|'. $tag_open .'d2u_immo_form_phone_calls'. $tag_close .'|0,1|0
php|validate_timer|Spamprotection|<input name="validate_timer" type="hidden" value="'. microtime(true) .'" />|
html||<br>* '. $tag_open .'d2u_immo_form_required'. $tag_close .'<br><br>
Expand Down
2 changes: 1 addition & 1 deletion pages/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<h2>Changelog</h2>
<p>1.1.0:</p>
<ul>
<li>...</li>
<li>Anpassungen an YForm 3.</li>
</ul>
<p>1.0.9:</p>
<ul>
Expand Down
11 changes: 9 additions & 2 deletions update.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@
}
// 1.0.9
$sql->setQuery("ALTER TABLE `". \rex::getTablePrefix() ."d2u_immo_properties` CHANGE `deposit` `deposit` INT(10) NOT NULL DEFAULT 0;");


// 1.1.0 YForm e-mail template
$sql->setQuery("SELECT * FROM ". \rex::getTablePrefix() ."yform_email_template WHERE name = 'd2u_immo_request'");
if($sql->getRows() == 0) {
$sql->setQuery("INSERT INTO ". \rex::getTablePrefix() ."yform_email_template (`name`, `mail_from`, `mail_from_name`, `subject`, `body`, `body_html`, `attachments`) VALUES
('d2u_immo_request', 'REX_YFORM_DATA[field=\"email\"]', 'REX_YFORM_DATA[field=\"name\"]', 'Immobilienanfrage', 'Immobilienanfrage von Internetseite:\r\nImmobilie: REX_YFORM_DATA[field=\"immo_name\"]\r\n\r\nEs fragt an:\r\nName: REX_YFORM_DATA[field=\"name\"]\r\nAnschrift: REX_YFORM_DATA[field=\"address\"]\r\nPLZ/Ort: REX_YFORM_DATA[field=\"zip\"] REX_YFORM_DATA[field=\"city\"]\r\nTelefon: REX_YFORM_DATA[field=\"phone\"]\r\nTelefon Anrufe gestattet: <?php print REX_YFORM_DATA[field=\"phone_calls\"] == 1 ? \"Ja\" : \"Nein\"; ?>\r\nEmail: REX_YFORM_DATA[field=\"email\"]\r\nDatenschutzerklärung zugestimmt: <?php print REX_YFORM_DATA[field=\"privacy_policy_accepted\"] == 1 ? \"Ja\" : \"Nein\"; ?>\r\n\r\nNachricht: REX_YFORM_DATA[field=\"message\"]\r\n', '', '')");
}

// Update language replacements
if(!class_exists('d2u_immo_lang_helper')) {
// Load class in case addon is deactivated
Expand All @@ -55,7 +62,7 @@
$modules = [];
$modules[] = new D2UModule("70-1",
"D2U Immo Addon - Hauptausgabe",
12);
13);
$modules[] = new D2UModule("70-2",
"D2U Immo Addon - Infobox Ansprechpartner",
2);
Expand Down

0 comments on commit b028d6f

Please sign in to comment.