diff options
| author | daniel <noreply@maennchen1.de> | 2026-10-01 14:22:01 +0200 |
|---|---|---|
| committer | daniel <noreply@maennchen1.de> | 2026-10-01 14:22:01 +0200 |
| commit | 4e2875793d5e724363737e6ca40db87b8d43f0b5 (patch) | |
| tree | 55c183bce83eaa31c58888e86e73ff33debbd119 /views | |
| parent | 59c26c3384c4c5389a2123401c82b20a09db7906 (diff) | |
- Modul "Auftragsbestätigung" aufgeräumt
Diffstat (limited to 'views')
4 files changed, 194 insertions, 217 deletions
diff --git a/views/mods/mod_auftragsbestaetigung/auftragsbestaetigung.phtml b/views/mods/mod_auftragsbestaetigung/auftragsbestaetigung.phtml index 486d43a..b954bfb 100644 --- a/views/mods/mod_auftragsbestaetigung/auftragsbestaetigung.phtml +++ b/views/mods/mod_auftragsbestaetigung/auftragsbestaetigung.phtml @@ -1,151 +1,117 @@ -<?php echo __("Auftragsbestätigung", "wpsg"); ?>
-
-<?php echo __("Vielen Dank für Ihre Bestellung. Sie erhalten hiermit die Auftragsbestätigung mit allen wichtigen Informationen zu Ihrer Bestellung.", "wpsg"); ?>
-
-----------------------------------------------------------------------------
-
-<?php if ($this->hasMod('wpsg_mod_shippingadress') && $this->callMod('wpsg_mod_shippingadress', 'check_different_shippingadress', array('k_id' => $this->view['data']['k_id'], 'o_id' => $this->view['data']['id']))) { ?>
-<?php echo __('Rechnungsadresse:', 'wpsg'); ?>
-
-<?php echo wpsg_pad_right(__('Firma', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['firma']; ?>
-<?php echo wpsg_pad_right(__('Name', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['vname']; ?> <?php echo $this->view['basket']['checkout']['name']; ?>
-<?php echo wpsg_pad_right(__('Straße', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['strasse'].rtrim(' '.wpsg_getStr($this->view['basket']['checkout']['nr'])); ?>
-<?php echo wpsg_pad_right(__('Land', 'wpsg').':', 35); ?><?php echo $this->db->fetchOne("SELECT `name` FROM `".WPSG_TBL_LAND."` WHERE `id` = '".wpsg_q($this->view['basket']['checkout']['land'])."' "); ?>
-<?php if (trim($this->view['basket']['checkout']['ustidnr']) != "") { ?>
-<?php echo wpsg_pad_right(__('USt.IdNr.', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['ustidnr']; ?>
-<?php } ?>
-
-<?php echo wpsg_pad_right(__('Ort', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['plz']; ?> <?php echo $this->view['basket']['checkout']['ort']; ?>
-<?php echo wpsg_pad_right(__('Telefon', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['tel']; ?>
-<?php echo wpsg_pad_right(__('Fax', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['fax']; ?>
-<?php echo wpsg_pad_right(__('E-Mail Adresse', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['email']; ?>
-
-<?php echo __('Lieferadresse:', 'wpsg'); ?>
-
-<?php echo wpsg_pad_right(__('Firma', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['shipping_firma']; ?>
-<?php echo wpsg_pad_right(__('Name', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['shipping_vname']; ?> <?php echo $this->view['basket']['checkout']['name']; ?>
-<?php echo wpsg_pad_right(__('Straße', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['shipping_strasse']; ?>
-<?php echo wpsg_pad_right(__('Ort', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['shipping_plz']; ?> <?php echo $this->view['basket']['checkout']['shipping_ort']; ?>
-
-<?php echo wpsg_pad_right(__('Land', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['shipping_land']; ?>
-
-<?php } else { ?>
-<?php echo __('Rechnungs- /Lieferadresse:', 'wpsg'); ?>
-
-<?php echo wpsg_pad_right(__('Firma', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['firma']; ?>
-<?php echo wpsg_pad_right(__('Name', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['vname']; ?> <?php echo $this->view['basket']['checkout']['name']; ?>
-<?php echo wpsg_pad_right(__('Straße', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['strasse'].rtrim(' '.wpsg_getStr($this->view['basket']['checkout']['nr'])); ?>
-<?php echo wpsg_pad_right(__('Land', 'wpsg').':', 35); ?><?php echo $this->db->fetchOne("SELECT `name` FROM `".WPSG_TBL_LAND."` WHERE `id` = '".wpsg_q($this->view['basket']['checkout']['land'])."' "); ?>
-<?php if (trim($this->view['basket']['checkout']['ustidnr']) != "") { ?>
-<?php echo wpsg_pad_right(__('USt.IdNr.', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['ustidnr']; ?>
-<?php } ?>
-
-<?php echo wpsg_pad_right(__('Ort', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['plz']; ?> <?php echo $this->view['basket']['checkout']['ort']; ?>
-<?php echo wpsg_pad_right(__('Telefon', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['tel']; ?>
-<?php echo wpsg_pad_right(__('Fax', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['fax']; ?>
-<?php echo wpsg_pad_right(__('E-Mail Adresse', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['email']; ?>
-<?php } ?>
-
-<?php echo wpsg_pad_right(__('Kundennummer', 'wpsg').':', 35); ?><?php echo $this->view['customer']['knr']; ?>
-<?php echo wpsg_pad_right(__('Bestellnummer', 'wpsg').':', 35); ?><?php echo $this->view['order']['onr']; ?>
-<?php echo wpsg_pad_right(__('Bestelldatum', 'wpsg').':', 35); ?><?php echo date("d.m.Y H:i:s", strtotime($this->view['order']['cdate'])); ?>
-<?php echo wpsg_pad_right(__('Rechnungsbetrag', 'wpsg').':', 35); ?><?php echo wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'], $this->get_option('wpsg_currency')); ?>
-<?php if ($this->get_option('wpsg_kleinunternehmer')) { ?>
-<?php echo $this->get_option('wpsg_kleinunternehmer_text'); ?>
-<?php } else { ?>
-<?php echo wpsg_pad_right(__('Steueranteil', 'wpsg').':', 35); ?><?php echo wpsg_ff($this->view['basket']['sum']['mwst'], $this->get_option('wpsg_currency')); ?>
-<?php } ?>
-
-<?php echo wpsg_pad_right(__('Versandart', 'wpsg').':', 35); ?><?php echo $this->arShipping[$this->view['basket']['checkout']['shipping']]['name']; ?>
-<?php echo wpsg_pad_right(__('Zahlungsart', 'wpsg').':', 35); ?><?php echo $this->arPayment[$this->view['basket']['checkout']['payment']]['name']; ?>
-<?php $this->callMods('mail_payment'); ?>
-
-<?php if ($this->view['auftrag_note'] != '') { ?>
-<?php echo wpsg_pad_right(__('Kommentar Auftragsbestätigung', 'wpsg').':', 35); ?>
-<?php echo $this->view['auftrag_note'] ?>
-<?php }?>
-
-
-<?php echo __('Bestellung', 'wpsg'); ?>:
-<?php if (sizeof($this->view['basket']['mwst']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1') { $prod_col = 25; } else { $prod_col = 35; } ?>
-
-<?php echo wpsg_pad_right(__('Pos', 'wpsg'), 5); ?>
-<?php echo wpsg_pad_right(__('Produkt', 'wpsg'), $prod_col); ?>
-<?php echo wpsg_pad_left(__('Stückpreis', 'wpsg').' ', 15); ?>
-<?php if (sizeof($this->view['basket']['mwst']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1') { ?>
-<?php echo wpsg_pad_left(__('MwSt.', 'wpsg').' ', 10); ?>
-<?php } ?>
-<?php echo wpsg_pad_right(__('Anzahl', 'wpsg'), 6); ?>
-<?php echo wpsg_pad_left(__('Summe', 'wpsg'), 15); ?>
-----------------------------------------------------------------------------
-<?php $i = 0; foreach ((array)$this->view['basket']['produkte'] as $p) { $i ++; ?>
-<?php echo wpsg_pad_right($i.'.', 5); ?>
-<?php echo wpsg_pad_right($p['name'], $prod_col); ?>
-<?php echo wpsg_pad_left(wpsg_ff($p['preis'], $this->get_option('wpsg_currency')).' ', 15); ?>
-<?php if (sizeof($this->view['basket']['mwst']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1') { ?>
-<?php echo wpsg_pad_left(wpsg_ff($p['mwst_value'], '%').' ', 10); ?>
-<?php } ?>
-<?php echo wpsg_pad_left($p['menge'], 6); ?>
-<?php echo wpsg_pad_left(wpsg_ff($p['preis'] * $p['menge'], $this->get_option('wpsg_currency')), 15); ?>
-<?php $this->callMods('mail_row', array($i, $p)); ?>
-<?php } ?>
-<?php if (isset($this->view['basket']['gs'])) { ?>
-<?php echo wpsg_pad_right(($i + 1).'.', 5); ?>
-<?php echo wpsg_pad_right(wpsg_translate(__('Gutschein (#1#)', 'wpsg'), $this->view['basket']['gs']['code']), $prod_col); ?>
-<?php echo wpsg_pad_left(wpsg_ff($this->view['basket']['gs']['value'], (($this->view['basket']['gs']['calc'] == 'w')?$this->get_option('wpsg_currency'):'%')).' ', 15); ?>
-<?php if (sizeof($this->view['basket']['mwst']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1') { ?>
-<?php echo wpsg_pad_left(__('anteilig', 'wpsg').' ', 10); ?>
-<?php } ?>
-<?php echo wpsg_pad_left('1', 6); ?>
-<?php echo wpsg_pad_left(wpsg_ff($this->view['basket']['gs']['value'], $this->get_option('wpsg_currency')), 15); ?>
-<?php } ?>
- <?php echo wpsg_pad_right(__('Zwischensumme:', 'wpsg'), 40); ?>
-<?php echo wpsg_pad_left(wpsg_ff($this->view['basket']['sum']['preis'], $this->get_option('wpsg_currency')), 31); ?>
-<?php if ($this->view['basket']['sum']['preis_shipping'] != 0 || $this->get_option('wpsg_hideemptyshipping') != '1') { ?>
- <?php echo wpsg_pad_right(__('Versandkosten', 'wpsg'), 40); ?>
-<?php echo wpsg_pad_left(wpsg_ff($this->arShipping[$this->view['basket']['checkout']['shipping']]['mwst_value']??0,'% '), 10); ?>
-<?php echo wpsg_pad_left(wpsg_ff($this->view['basket']['sum']['preis_shipping'], $this->get_option('wpsg_currency')), 21); ?>
-<?php } ?>
-<?php if ($this->view['basket']['sum']['preis_payment'] != 0 || $this->get_option('wpsg_hideemptypayment') != '1') { ?>
- <?php echo wpsg_pad_right(__('Zahlungsart', 'wpsg'), 40); ?>
-<?php echo wpsg_pad_left(wpsg_ff($this->arPayment[$this->view['basket']['checkout']['payment']]['mwst_value']??0,'% '), 10); ?>
-<?php echo wpsg_pad_left(wpsg_ff($this->view['basket']['sum']['preis_payment'], $this->get_option('wpsg_currency')), 21); ?>
-<?php } ?>
-<?php //wpsg_debug($this->view['basket']['mwst']) ?>
-<?php if ($this->get_option('wpsg_kleinunternehmer') == '1') { ?>
-<?php echo $this->get_option('wpsg_kleinunternehmer_text'); ?>
-<?php } else { ?>
-<?php foreach ($this->view['basket']['mwst'] as $mwst_id => $mwst) { ?>
-<?php if ($this->getFrontendTaxview() == WPSG_NETTO) { ?>
- <?php echo wpsg_pad_right(wpsg_translate(__('zuzüglich MwSt. (#1#)', 'wpsg'), $mwst['name']), 47); ?>
-<?php } else { ?>
- <?php echo wpsg_pad_right(wpsg_translate(__('darin enthaltenes MwSt. (#1#)', 'wpsg'), $mwst['name']), 47); ?>
-<?php } ?>
-<?php echo wpsg_pad_left(wpsg_ff($mwst['sum'], $this->get_option('wpsg_currency')), 24); ?>
-<?php } ?>
-<?php }?>
-<?php echo wpsg_pad_left(' ', 61); ?>---------------
- <?php echo wpsg_pad_right(__('Gesamtpreis', 'wpsg'), 37); ?>
-<?php echo wpsg_pad_left(wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'], $this->get_option('wpsg_currency')), 34); ?>
-
-<?php $this->callMods('mail_aftercalculation', array(&$this->view['order']['id'])); ?>
-
-<?php echo __('Wir bedanken uns für Ihre Bestellung.', 'wpsg'); ?>
-
-<?php echo __('Es gelten unsere Allgemeinen Geschäftsbedingungen (AGB).', 'wpsg'); ?>
-
-<?php echo $this->getURL(wpsg_ShopController::URL_AGB); ?>
-
- -- <?php echo __("Widerrufsbelehrung", "wpsg"); ?> --
-
-<?php if (trim($this->get_option("wpsg_ps_mailwiderruf")) != "") { ?>
-<?php echo $this->get_option("wpsg_ps_mailwiderruf"); ?>
-<?php } else { ?>
-<?php echo __("...hier steht der Text zum Widerrufsrecht...", "wpsg"); ?>
-<?php } ?>
-
--- <?php echo __("Ende der Widerrufsbelehrung", "wpsg"); ?> --
-
-<?php echo __('Mit freundlichen Grüßen', 'wpsg'); ?>
-
-<?php echo __($this->get_option('wpsg_shopdata_name'), 'wpsg'); ?> - <?php echo __('Team', 'wpsg'); ?>
\ No newline at end of file +<?php
+
+ /**
+ * Textmail der Auftragsbestätigung an den Kunden
+ *
+ * Die Zeilenumbrüche werden ausdrücklich ausgegeben, weil PHP einen Zeilenumbruch direkt nach dem
+ * schließenden PHP-Tag verschluckt. Den Warenkorb liefert der Baustein mailtemplates/order.phtml des Kerns.
+ */
+
+ // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped -- Textmail ohne HTML-Kontext, HTML-Escaping würde den Text verfälschen
+
+ $this->htmlMail = false;
+
+ /** @var wpsg_order $oOrder */
+ $oOrder = $this->view['oOrder'];
+ $oCustomer = $oOrder->getCustomer();
+
+ $arCheckout = $this->view['basket']['checkout'];
+ $strCurrency = $this->get_option('wpsg_currency');
+ $strNote = (string)($this->view['auftrag_note']??'');
+ $strComment = (string)($arCheckout['comment']??'');
+ $strRevocation = trim((string)$this->get_option('wpsg_ps_mailwiderruf'));
+
+ $bShippingAdress = ($this->hasMod('wpsg_mod_shippingadress') && $this->callMod('wpsg_mod_shippingadress', 'check_different_shippingadress', [$oOrder->k_id, $oOrder->getId()]));
+
+ /**
+ * Eine Zeile "Bezeichnung: Wert"
+ */
+ $line = function($strLabel, $strValue) {
+
+ return wpsg_pad_right($strLabel.':', 35).$strValue."\n";
+
+ };
+
+ echo __('Auftragsbestätigung', 'wpsg')."\n\n";
+ echo __('Vielen Dank für Ihre Bestellung. Sie erhalten hiermit die Auftragsbestätigung mit allen wichtigen Informationen zu Ihrer Bestellung.', 'wpsg')."\n\n";
+ echo str_repeat('-', 76)."\n\n";
+
+ echo (($bShippingAdress)?__('Rechnungsadresse:', 'wpsg'):__('Rechnungs- /Lieferadresse:', 'wpsg'))."\n\n";
+
+ echo $line(__('Firma', 'wpsg'), $oOrder->getInvoiceCompany());
+ echo $line(__('Name', 'wpsg'), trim($oOrder->getInvoiceFirstName().' '.$oOrder->getInvoiceName()));
+ echo $line(__('Straße', 'wpsg'), $oOrder->getInvoiceStreet());
+ echo $line(__('Ort', 'wpsg'), trim($oOrder->getInvoiceZip().' '.$oOrder->getInvoiceCity()));
+ echo $line(__('Land', 'wpsg'), $oOrder->getInvoiceCountryName());
+
+ if (trim((string)($arCheckout['ustidnr']??'')) !== '') echo $line(__('USt.IdNr.', 'wpsg'), $arCheckout['ustidnr']);
+
+ echo $line(__('Telefon', 'wpsg'), $oOrder->getInvoicePhone());
+ echo $line(__('Fax', 'wpsg'), $oOrder->getInvoiceFax());
+ echo $line(__('E-Mail Adresse', 'wpsg'), $oCustomer->getEMail());
+
+ if ($bShippingAdress) {
+
+ echo "\n".__('Lieferadresse:', 'wpsg')."\n\n";
+
+ echo $line(__('Firma', 'wpsg'), $oOrder->getShippingCompany());
+ echo $line(__('Name', 'wpsg'), trim($oOrder->getShippingFirstName().' '.$oOrder->getShippingName()));
+ echo $line(__('Straße', 'wpsg'), trim($oOrder->getShippingStreet()));
+ echo $line(__('Ort', 'wpsg'), trim($oOrder->getShippingZip().' '.$oOrder->getShippingCity()));
+ echo $line(__('Land', 'wpsg'), $oOrder->getShippingCountryName());
+
+ }
+
+ echo "\n";
+ echo $line(__('Kundennummer', 'wpsg'), $oCustomer->knr);
+ echo $line(__('Bestellnummer', 'wpsg'), $oOrder->getNr());
+ echo $line(__('Bestelldatum', 'wpsg'), date('d.m.Y H:i:s', strtotime((string)$oOrder->cdate)));
+ echo $line(__('Rechnungsbetrag', 'wpsg'), wpsg_ff($this->view['basket']['arCalculation']['sum']['topay_brutto']??0, $strCurrency));
+
+ if ($this->get_option('wpsg_kleinunternehmer') == '1') {
+
+ echo $this->get_option('wpsg_kleinunternehmer_text')."\n";
+
+ } else {
+
+ echo $line(__('Steueranteil', 'wpsg'), wpsg_ff($this->view['basket']['sum']['mwst']??0, $strCurrency));
+
+ }
+
+ echo "\n";
+ echo $line(__('Versandart', 'wpsg'), $oOrder->getShippingLabel());
+
+ $this->callMods('mail_shipping');
+
+ echo $line(__('Zahlungsart', 'wpsg'), $oOrder->getPaymentLabel());
+
+ $this->callMods('mail_payment');
+
+ if ($strNote !== '') {
+
+ echo "\n".__('Kommentar Auftragsbestätigung', 'wpsg').":\n";
+ echo $strNote."\n";
+
+ }
+
+ echo "\n".__('Bestellung', 'wpsg').":\n";
+
+ // Positionen, Versand, Zahlungsart, Steuern, Gesamtpreis und mail_aftercalculation der Module
+ $this->render(WPSG_PATH_VIEW.'/mailtemplates/order.phtml');
+
+ if ($strComment !== '') {
+
+ echo "\n".__('Bestellkommentar', 'wpsg').': '.$strComment."\n";
+
+ }
+
+ echo "\n".__('Wir bedanken uns für Ihre Bestellung.', 'wpsg')."\n\n";
+ echo __('Es gelten unsere Allgemeinen Geschäftsbedingungen (AGB).', 'wpsg')."\n\n";
+ echo $this->getURL(wpsg_ShopController::URL_AGB)."\n\n";
+
+ echo '-- '.__('Widerrufsbelehrung', 'wpsg')." --\n\n";
+ echo (($strRevocation !== '')?$strRevocation:__('...hier steht der Text zum Widerrufsrecht...', 'wpsg'))."\n\n";
+ echo '-- '.__('Ende der Widerrufsbelehrung', 'wpsg')." --\n\n";
+
+ echo __('Mit freundlichen Grüßen', 'wpsg')."\n\n";
+ echo __($this->get_option('wpsg_shopdata_name'), 'wpsg').' - '.__('Team', 'wpsg');
diff --git a/views/mods/mod_auftragsbestaetigung/auftragsbestaetigung_html.phtml b/views/mods/mod_auftragsbestaetigung/auftragsbestaetigung_html.phtml index 5983aec..22b7b76 100644 --- a/views/mods/mod_auftragsbestaetigung/auftragsbestaetigung_html.phtml +++ b/views/mods/mod_auftragsbestaetigung/auftragsbestaetigung_html.phtml @@ -1,51 +1,58 @@ -<?php
+<?php
+
+ /**
+ * HTML-Mail der Auftragsbestätigung an den Kunden
+ */
/* Wichtig, da die Module sonst kein HTML zurückgeben */
$this->htmlMail = true;
- include(WPSG_PATH_VIEW . 'mailtemplates/html/logo.phtml');
+ include(WPSG_PATH_VIEW.'mailtemplates/html/logo.phtml');
+
+ $strNote = (string)($this->view['auftrag_note']??'');
+ $strComment = (string)($this->view['basket']['checkout']['comment']??'');
+ $strRevocation = (string)$this->get_option('wpsg_ps_mailwiderruf');
?><?php $this->render(WPSG_PATH_VIEW.'/mailtemplates/html/html_head.phtml'); ?>
-<h1><?php echo __("Auftragsbestätigung", "wpsg"); ?></h1>
-
-<p><?php echo __("Vielen Dank für Ihre Bestellung. Sie erhalten hiermit die Auftragsbestätigung mit allen wichtigen Informationen zu Ihrer Bestellung.", "wpsg"); ?></p>
+<h1><?php echo esc_html__('Auftragsbestätigung', 'wpsg'); ?></h1>
+
+<p><?php echo esc_html__('Vielen Dank für Ihre Bestellung. Sie erhalten hiermit die Auftragsbestätigung mit allen wichtigen Informationen zu Ihrer Bestellung.', 'wpsg'); ?></p>
-<?php if (wpsg_isSizedString($this->view['auftrag_note'])) { ?>
-<h2><?php echo __('Kommentar Auftragsbestätigung', 'wpsg'); ?></h2>
-<p><?php echo $this->view['auftrag_note'] ?></p>
-<?php }?>
+<?php if ($strNote !== '') { ?>
+<h2><?php echo esc_html__('Kommentar Auftragsbestätigung', 'wpsg'); ?></h2>
+<p><?php echo nl2br(esc_html($strNote)); ?></p>
+<?php } ?>
<?php $this->render(WPSG_PATH_VIEW.'/mailtemplates/html/customer.phtml'); ?>
-<h2><?php echo __('Warenkorb', 'wpsg'); ?>:</h2>
+<h2><?php echo esc_html__('Warenkorb', 'wpsg'); ?>:</h2>
-<?php $this->render(WPSG_PATH_VIEW.'/mailtemplates/html/order.phtml'); ?>
+<?php $this->render(WPSG_PATH_VIEW.'/mailtemplates/html/order.phtml'); ?>
-<?php $this->callMods('mail_aftercalculation', array(&$this->view['order']['id'])); ?>
+<?php $this->callMods('mail_aftercalculation', [&$this->view['order']['id']]); ?>
-<?php if (wpsg_isSizedString($this->view['basket']['checkout']['comment'])) { ?>
-<h2><?php echo __('Bestellkommentar', 'wpsg') ?></h2>
-<p><?php echo $this->view['basket']['checkout']['comment'] ?></p>
+<?php if ($strComment !== '') { ?>
+<h2><?php echo esc_html__('Bestellkommentar', 'wpsg'); ?></h2>
+<p><?php echo nl2br(esc_html($strComment)); ?></p>
<?php } ?>
<br />
-<p><?php echo __('Wir bedanken uns für Ihre Bestellung.', 'wpsg'); ?></p>
+<p><?php echo esc_html__('Wir bedanken uns für Ihre Bestellung.', 'wpsg'); ?></p>
+
+<p><?php echo wp_kses_post(wpsg_translate(__('Es gelten unsere <a href="#1#">Allgemeinen Geschäftsbedingungen</a> (<a href="#1#">AGB</a>).', 'wpsg'), esc_url($this->getURL(wpsg_ShopController::URL_AGB)))); ?></p>
-<p><?php echo wpsg_translate(__('Es gelten unsere <a href="#1#">Allgemeinen Geschäftsbedingungen</a> (<a href="#1#">AGB</a>).', 'wpsg'), $this->getURL(wpsg_ShopController::URL_AGB)); ?></p>
-
-<h3><?php echo __("Widerrufsbelehrung", "wpsg"); ?></h3>
+<h3><?php echo esc_html__('Widerrufsbelehrung', 'wpsg'); ?></h3>
-<?php if (wpsg_isSizedString($this->get_option("wpsg_ps_mailwiderruf"))) { ?>
-<p><?php echo $this->get_option("wpsg_ps_mailwiderruf"); ?></p>
+<?php if ($strRevocation !== '') { ?>
+<p><?php echo wp_kses_post($strRevocation); ?></p>
<?php } else { ?>
-<?php echo __("...hier steht der Text zum Widerrufsrecht...", "wpsg"); ?>
+<?php echo esc_html__('...hier steht der Text zum Widerrufsrecht...', 'wpsg'); ?>
<?php } ?>
-
-<h3><?php echo __("Ende der Widerrufsbelehrung", "wpsg"); ?></h3>
-<p><?php echo __('Mit freundlichen Grüßen', 'wpsg'); ?></p>
-<p><?php echo __($this->get_option('wpsg_shopdata_name'), 'wpsg'); ?> - <?php echo __('Team', 'wpsg'); ?></p>
+<h3><?php echo esc_html__('Ende der Widerrufsbelehrung', 'wpsg'); ?></h3>
+
+<p><?php echo esc_html__('Mit freundlichen Grüßen', 'wpsg'); ?></p>
+<p><?php echo esc_html(__($this->get_option('wpsg_shopdata_name'), 'wpsg')); ?> - <?php echo esc_html__('Team', 'wpsg'); ?></p>
<?php $this->render(WPSG_PATH_VIEW.'/mailtemplates/html/html_foot.phtml'); ?>
-
\ No newline at end of file diff --git a/views/mods/mod_auftragsbestaetigung/order_view.phtml b/views/mods/mod_auftragsbestaetigung/order_view.phtml index c792085..0069137 100644 --- a/views/mods/mod_auftragsbestaetigung/order_view.phtml +++ b/views/mods/mod_auftragsbestaetigung/order_view.phtml @@ -1,53 +1,49 @@ -<script type="text/javascript">
-
- jQuery(document).ready(function() {
-
- jQuery(".handlediv").bind("click", function() {
- if (jQuery(this.parentNode).hasClass("closed"))
- {
-
- jQuery.cookie("wpsg_ab_field", "0", { expires: 999999 } );
-
- }
- else
- {
-
- jQuery.cookie("wpsg_ab_field", "1", { expires: 999999 } );
-
- }
- } );
-
- if (jQuery.cookie("wpsg_ab_field") == "1")
- {
-
- jQuery("#wpsg_ab_postbox").removeClass("closed");
- }
-
- } );
-
-</script>
+<?php
+ /**
+ * Formular zum Senden der Auftragsbestätigung in der Bestellansicht
+ */
+
+ $order_id = (int)($this->view['data']['id']??0);
+ $bCanSetStatus = (($this->view['wpsg_mod_auftragsbestaetigung']['canSetStatus']??false) === true);
+ $bSetStatus = (($this->view['wpsg_mod_auftragsbestaetigung']['setstatus']??true) === true);
+
+?>
<?php echo wpsg_drawForm_AdminboxStart(__('Auftragsbestätigung', 'wpsg')); ?>
-
- <div class="inside">
+
+ <div class="inside">
<div class="inside" style="padding:5px;">
-
+
<p>
- <?php echo __('Die Auftragsbestätigung bestätigt dem Kunden die erfolgreiche Erfassung des Auftrages. Abweichungen vom Auftrag können mittels des Textfeldes mitgesendet werden.', 'wpsg'); ?>
- <?php echo __('Der Status ändert sich automatisch auf "Auftrag akzeptiert".', 'wpsg'); ?>
+ <?php echo esc_html__('Die Auftragsbestätigung bestätigt dem Kunden die erfolgreiche Erfassung des Auftrages. Abweichungen vom Auftrag können mittels des Textfeldes mitgesendet werden.', 'wpsg'); ?>
+ <?php if (!$bCanSetStatus) { ?>
+ <?php echo esc_html__('Der Status der Bestellung bleibt beim Senden erhalten.', 'wpsg'); ?>
+ <?php } ?>
</p>
-
+
<br />
-
- <form method="post" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_auftragsbestaetigung&edit_id=<?php echo $this->view['data']['id']; ?>&noheader=1">
+
+ <form method="post" action="<?php echo esc_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_auftragsbestaetigung&edit_id='.$order_id.'&noheader=1'); ?>">
+ <?php wp_nonce_field('wpsg-auftragsbestaetigung-order_ajax-'.$order_id); ?>
<div style="padding-left:5px;">
<textarea style="width:100%;" class="wpsg_order_view_auftragsbestaetigung" name="auftrag_note"></textarea>
</div>
- <input class="button" style="float:right; margin-right:10px;" type="submit" value="<?php echo __('Senden', 'wpsg'); ?>" /><br />
+ <?php if ($bCanSetStatus) { ?>
+ <div style="padding-left:5px;">
+ <input type="hidden" name="wpsg_mod_auftragsbestaetigung_setstatus" value="0" />
+ <label>
+ <input type="checkbox" name="wpsg_mod_auftragsbestaetigung_setstatus" value="1" <?php echo (($bSetStatus)?'checked="checked"':''); ?> />
+ <?php echo esc_html__('Status auf "Auftrag akzeptiert" setzen', 'wpsg'); ?>
+ </label>
+ </div>
+ <?php } else { ?>
+ <input type="hidden" name="wpsg_mod_auftragsbestaetigung_setstatus" value="0" />
+ <?php } ?>
+ <input class="button" style="float:right; margin-right:10px;" type="submit" value="<?php echo esc_attr__('Senden', 'wpsg'); ?>" /><br />
<input type="hidden" name="mod_auftragbestaetigung" value="1"/>
</form>
-
+
</div>
</div>
-
+
<?php echo wpsg_drawForm_AdminboxEnd(); ?>
\ No newline at end of file diff --git a/views/mods/mod_auftragsbestaetigung/settings_edit.phtml b/views/mods/mod_auftragsbestaetigung/settings_edit.phtml new file mode 100644 index 0000000..f0c147c --- /dev/null +++ b/views/mods/mod_auftragsbestaetigung/settings_edit.phtml @@ -0,0 +1,8 @@ +<?php + + /** + * Template für die Einstellungen des Moduls "Auftragsbestätigung" + */ + +?> +<?php echo wpsg_drawForm_Checkbox('wpsg_mod_auftragsbestaetigung_setstatus', __('Status beim Senden auf "Auftrag akzeptiert" setzen', 'wpsg'), $this->view['wpsg_mod_auftragsbestaetigung']['setstatus'], ['help' => 'wpsg_mod_auftragsbestaetigung_setstatus']); ?>
\ No newline at end of file |
