From fe1b43a2645ee78032acffc581d52609a6d1698a Mon Sep 17 00:00:00 2001 From: Daniel Schmitzer Date: Thu, 28 May 2026 04:16:42 +0000 Subject: - Widerrufsformular git-svn-id: https://[internal]/wordpress/plugins/wpsg4@8520 0d5edaf7-2b12-4e95-93f4-047927463d4b --- views/mods/mod_revocation/ajaxDialogContent.phtml | 148 +++++++++ views/mods/mod_revocation/mail_row.phtml | 15 + views/mods/mod_revocation/mail_row_html.phtml | 24 ++ .../mod_revocation/mails/mail_admin_html.phtml | 80 +++++ .../mod_revocation/mails/mail_admin_text.phtml | 44 +++ .../mod_revocation/mails/mail_customer_html.phtml | 75 +++++ .../mod_revocation/mails/mail_customer_text.phtml | 53 ++++ views/mods/mod_revocation/order_view_row.phtml | 19 ++ .../mod_revocation/produkt_edit_allgemein.phtml | 16 + views/mods/mod_revocation/settings_edit.phtml | 121 ++++++++ views/mods/mod_revocation/wp_footer.phtml | 331 +++++++++++++++++++++ ...mod_kundenverwaltung_order_after_products.phtml | 49 +++ .../wpsg_producttemplate_afterButton.phtml | 25 ++ views/mods/mod_revocation/wpsg_revocation.css | 58 ++++ views/mods/mod_revocation/wpsg_revocation.js | 0 15 files changed, 1058 insertions(+) create mode 100644 views/mods/mod_revocation/ajaxDialogContent.phtml create mode 100755 views/mods/mod_revocation/mail_row.phtml create mode 100755 views/mods/mod_revocation/mail_row_html.phtml create mode 100644 views/mods/mod_revocation/mails/mail_admin_html.phtml create mode 100644 views/mods/mod_revocation/mails/mail_admin_text.phtml create mode 100644 views/mods/mod_revocation/mails/mail_customer_html.phtml create mode 100644 views/mods/mod_revocation/mails/mail_customer_text.phtml create mode 100644 views/mods/mod_revocation/order_view_row.phtml create mode 100644 views/mods/mod_revocation/produkt_edit_allgemein.phtml create mode 100644 views/mods/mod_revocation/settings_edit.phtml create mode 100644 views/mods/mod_revocation/wp_footer.phtml create mode 100644 views/mods/mod_revocation/wpsg_mod_kundenverwaltung_order_after_products.phtml create mode 100644 views/mods/mod_revocation/wpsg_producttemplate_afterButton.phtml create mode 100644 views/mods/mod_revocation/wpsg_revocation.css create mode 100644 views/mods/mod_revocation/wpsg_revocation.js (limited to 'views') diff --git a/views/mods/mod_revocation/ajaxDialogContent.phtml b/views/mods/mod_revocation/ajaxDialogContent.phtml new file mode 100644 index 0000000..e833a00 --- /dev/null +++ b/views/mods/mod_revocation/ajaxDialogContent.phtml @@ -0,0 +1,148 @@ +callMod('wpsg_mod_kundenverwaltung', 'isLoggedIn')); + + if ($customer_login_id > 0) { + + $oCustomer = \wpsg_customer::getInstance($customer_login_id); + + $contact_email = $oCustomer->getEmail(); + + } + +?> + +
+ +
+ + 0) { ?> + + isLoaded() || !$oOrderProduct->isLoaded()) continue; + + $key = $order_id.'_'.$order_product_id; + + ?> + +
+ getProduct()->getProductName(); ?> +
+ + + +
+
+
+ + +
+
+ +
+
+
+ +
+
+ +
+
+
+ +
+
+ +
+
+ + + + + +
+ +
+
+
+ +
+
+ +
+
+
+ + +
+
+ +
+
+
+ +
+
+ +
+
+
+ +
+
+ +
+ + + +
+
+
+ + /> +
+
+ +
\ No newline at end of file diff --git a/views/mods/mod_revocation/mail_row.phtml b/views/mods/mod_revocation/mail_row.phtml new file mode 100755 index 0000000..8a54f89 --- /dev/null +++ b/views/mods/mod_revocation/mail_row.phtml @@ -0,0 +1,15 @@ +view['order_id']); + $order_nr = $this->view['wpsg_mod_revocation']['order_nr']; + $product_nr = $this->view['wpsg_mod_revocation']['product_nr']; + $amount = $this->view['wpsg_mod_revocation']['amount']; + $order_product_id = intval($this->view['order_product_id']); + + $revo_url = get_home_url('/', '', 'http').'?wpsg_revo_order='.urlencode($order_nr).'&wpsg_revo_product='.urlencode($product_nr).'&wpsg_revo_amount='.urlencode($amount); + +?> \ No newline at end of file diff --git a/views/mods/mod_revocation/mail_row_html.phtml b/views/mods/mod_revocation/mail_row_html.phtml new file mode 100755 index 0000000..e7f2945 --- /dev/null +++ b/views/mods/mod_revocation/mail_row_html.phtml @@ -0,0 +1,24 @@ +view['i']); + + $order_id = intval($this->view['order_id']); + $order_nr = $this->view['wpsg_mod_revocation']['order_nr']; + $product_nr = $this->view['wpsg_mod_revocation']['product_nr']; + $amount = $this->view['wpsg_mod_revocation']['amount']; + $order_product_id = intval($this->view['order_product_id']); + + $revo_url = get_home_url('/', '', 'http').'?wpsg_revo_order='.urlencode($order_nr).'&wpsg_revo_product='.urlencode($product_nr).'&wpsg_revo_amount='.urlencode($amount); + +?> + +   + : + + + + diff --git a/views/mods/mod_revocation/mails/mail_admin_html.phtml b/views/mods/mod_revocation/mails/mail_admin_html.phtml new file mode 100644 index 0000000..57920b5 --- /dev/null +++ b/views/mods/mod_revocation/mails/mail_admin_html.phtml @@ -0,0 +1,80 @@ +view['arSubmitData'] ?? []; + $arReason = Revocation::getReasons(); + +?> +

+ +

+ +

+ : %kunde_anrede% %kunde_vname% %kunde_name%
+ : %kunde_email% +

+ +
+ + $d): + + $oOrder = $d['oOrder']; + $oOrderProduct = $d['oOrderProduct']; + + $reasonText = array_values(array_filter( + $arReason, + function($item) use ($d) { + return $item['id'] === $d['reason']; + } + ))[0]['text'] ?? ''; +?> + +
+

+ : + getNr(); ?> +

+ +

+ : + x getProduct()->getProductName(true); ?> + / : + getProduct()->getNr(); ?> +

+ +

+ : + +

+ +

+ : + +

+
+ + + +

+ : + +

+ +

+ +

+ +

+
+ get_option('wpsg_shopdata_name'), 'wpsgRevocation'); ?> + - +

\ No newline at end of file diff --git a/views/mods/mod_revocation/mails/mail_admin_text.phtml b/views/mods/mod_revocation/mails/mail_admin_text.phtml new file mode 100644 index 0000000..8ce601a --- /dev/null +++ b/views/mods/mod_revocation/mails/mail_admin_text.phtml @@ -0,0 +1,44 @@ +view['arSubmitData'] ?? []; + $arReason = Revocation::getReasons(); + +?> + + + + %kunde_anrede% %kunde_vname% %kunde_name% + %kunde_email% + + $d) { + + /** @var \wpsg_order $oOrder */ + $oOrder = $d['oOrder']; + + /** @var \wpsg_order_product $oOrderProduct */ + $oOrderProduct = $d['oOrderProduct']; + +?> + getNr(); ?> + x getProduct()->getProductName(true); ?> / : getProduct()->getNr(); ?> + + + + + + + + + + +get_option('wpsg_shopdata_name'), 'wpsgRevocation'); ?> - \ No newline at end of file diff --git a/views/mods/mod_revocation/mails/mail_customer_html.phtml b/views/mods/mod_revocation/mails/mail_customer_html.phtml new file mode 100644 index 0000000..f946efa --- /dev/null +++ b/views/mods/mod_revocation/mails/mail_customer_html.phtml @@ -0,0 +1,75 @@ +view['arSubmitData'] ?? []; + $arReason = Revocation::getReasons(); + +?> +

%kunde_anrede% %kunde_name%,

+ +

+ +

+ + $d): + + $oOrder = $d['oOrder']; + $oOrderProduct = $d['oOrderProduct']; + + $reasonText = array_values(array_filter( + $arReason, + function($item) use ($d) { + return $item['id'] === $d['reason']; + } + ))[0]['text'] ?? ''; +?> + +
+

+ : + getNr(); ?> +

+ +

+ : + x getProduct()->getProductName(true); ?> + / : + getProduct()->getNr(); ?> +

+ +

+ : + +

+ + +

+ : + +

+ +
+ + + +

+ : + +

+ +

+ +

+
+ get_option('wpsg_shopdata_name'); ?> + - +

\ No newline at end of file diff --git a/views/mods/mod_revocation/mails/mail_customer_text.phtml b/views/mods/mod_revocation/mails/mail_customer_text.phtml new file mode 100644 index 0000000..0608fc5 --- /dev/null +++ b/views/mods/mod_revocation/mails/mail_customer_text.phtml @@ -0,0 +1,53 @@ +view['arSubmitData'] ?? []; + $arReason = Revocation::getReasons(); + +?> %kunde_anrede% %kunde_name%, + + + + + + $d): + + $oOrder = $d['oOrder']; + $oOrderProduct = $d['oOrderProduct']; + + $reasonText = array_values(array_filter( + $arReason, + function($item) use ($d) { + return $item['id'] === $d['reason']; + } + ))[0]['text'] ?? ''; +?> + + getNr(); ?> + + x getProduct()->getProductName(true); ?> / : getProduct()->getNr(); ?> + + + + + + + + + + + + + + + +get_option('wpsg_shopdata_name'); ?> - \ No newline at end of file diff --git a/views/mods/mod_revocation/order_view_row.phtml b/views/mods/mod_revocation/order_view_row.phtml new file mode 100644 index 0000000..8c95b5b --- /dev/null +++ b/views/mods/mod_revocation/order_view_row.phtml @@ -0,0 +1,19 @@ +view['wpsg_mod_revocation']['row']??null; + + if ($row === null) return; + +?> + + + : + + + \ No newline at end of file diff --git a/views/mods/mod_revocation/produkt_edit_allgemein.phtml b/views/mods/mod_revocation/produkt_edit_allgemein.phtml new file mode 100644 index 0000000..42ff8ff --- /dev/null +++ b/views/mods/mod_revocation/produkt_edit_allgemein.phtml @@ -0,0 +1,16 @@ +view['data']['id'])); + + echo wpsg_drawForm_Checkbox('wpsg_mod_revocation_disable', __('Widerrufsbutton nicht anzeigen', 'wpsg'), $oProduct->getMeta('wpsg_mod_revocation_disable', false, 0)); ?> + \ No newline at end of file diff --git a/views/mods/mod_revocation/settings_edit.phtml b/views/mods/mod_revocation/settings_edit.phtml new file mode 100644 index 0000000..fbab6a1 --- /dev/null +++ b/views/mods/mod_revocation/settings_edit.phtml @@ -0,0 +1,121 @@ + + +
+
+ + + + + +
+
+ + get_option('wpsg_mod_revocation_view_order'), ['fullWidth' => true]); ?> + get_option('wpsg_mod_revocation_view_flyout'), ['fullWidth' => true]); ?> + get_option('wpsg_mod_revocation_view_product'), ['fullWidth' => true]); ?> + get_option('wpsg_mod_revocation_view_customer_mail'), ['fullWidth' => true]); ?> + +

+ E-Mail Konfiguration.', 'wpsgRevocation'), + WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=emailconf' + ); ?>
+ +

+ +
+
+
+ +
+

+ + +
+
+ +
+
+ + + + \ No newline at end of file diff --git a/views/mods/mod_revocation/wp_footer.phtml b/views/mods/mod_revocation/wp_footer.phtml new file mode 100644 index 0000000..3c0f225 --- /dev/null +++ b/views/mods/mod_revocation/wp_footer.phtml @@ -0,0 +1,331 @@ + + +get_option('wpsg_mod_revocation_view_flyout') === '1') { ?> + +
+ + +
+ + + + + + + + +
+
+
+ + + + +
+
+ +
+ <?php echo __('Bitte warten ...', 'wpsgRevocation'); ?> +
+
+
+ + \ No newline at end of file diff --git a/views/mods/mod_revocation/wpsg_mod_kundenverwaltung_order_after_products.phtml b/views/mods/mod_revocation/wpsg_mod_kundenverwaltung_order_after_products.phtml new file mode 100644 index 0000000..841da99 --- /dev/null +++ b/views/mods/mod_revocation/wpsg_mod_kundenverwaltung_order_after_products.phtml @@ -0,0 +1,49 @@ +view; + + /** @var \wpsg_order_product $oOrderProduct */ + $oOrderProduct = $view['oOrderProduct']; + + /** @var \wpsg_order $oOrder */ + $oOrder = $view['oOrder']; + + /** @var int $amount */ + $amount = $view['amount']; + +?> + + + + + getId(), $oOrderProduct->getId())) { ?> +
+ + + +
+ + +

+ + + + \ No newline at end of file diff --git a/views/mods/mod_revocation/wpsg_producttemplate_afterButton.phtml b/views/mods/mod_revocation/wpsg_producttemplate_afterButton.phtml new file mode 100644 index 0000000..241357e --- /dev/null +++ b/views/mods/mod_revocation/wpsg_producttemplate_afterButton.phtml @@ -0,0 +1,25 @@ +view['data']); + +?> + +get_option('wpsg_mod_revocation_view_product') === '1') { ?> + +
+ +
+ + \ No newline at end of file diff --git a/views/mods/mod_revocation/wpsg_revocation.css b/views/mods/mod_revocation/wpsg_revocation.css new file mode 100644 index 0000000..9ee5d0f --- /dev/null +++ b/views/mods/mod_revocation/wpsg_revocation.css @@ -0,0 +1,58 @@ +#wpsg_revocation_button { position:fixed; right:0; top:25%; display:flex; gap:1rem; align-items:center; justify-content:flex-start; flex-wrap:nowrap; transform:translateX(calc(100% - (50px + 1rem + 0.5rem))); cursor:pointer; z-index:10; + background-color:white; border:1px solid black; border-radius:0.5rem; padding:0.5rem 1rem 0.5rem 0.5rem; transition:all 0.4s; + svg { width:50px; fill:black; } + span { white-space:nowrap; } + &:hover { transform:translateX(0.5rem); } +} + +#wpsg_revocation_dialog { + z-index:10; opacity:0; pointer-events:none; transition:all 0.4s; + position:fixed; left:0; top:0; height:100vh; width:100vw; + background-color:rgba(0,0,0,0.5); display:flex; align-items:center; justify-content:center; + &.visible { opacity:1; pointer-events:all; } + .inner { width:calc(100% - 3rem); height:auto; max-width:800px; max-height:800px; + border:1px solid black; position:relative; + background-color:white; border-radius:0.5rem; padding:1rem; display:flex; flex-direction:column; + & > .loading { transition:all 0.2s; opacity:0; pointer-events:none; background-color:rgba(0, 0, 0, 0.25); position:absolute; z-index:2; left:0; top:0; height:100%; width:100%; display:flex; align-items:center; justify-content:center; } + & > .header { height:50px; flex-shrink:0; flex-grow:0; + display:flex; align-items:center; justify-content:space-between; font-size:2rem; font-weight:bold; + .close { width:30px; height:30px; cursor:pointer; display:flex; align-items:center; justify-content:center; } + } + & > .content { flex-grow:0.2; overflow-y:auto; margin-top:1rem; margin-bottom:1rem; } + & > .footer { flex-shrink:0; flex-grow:0; display:flex; align-items:center; justify-content:start; height: 35px; margin-bottom: 2rem;} + #wpsg_error { padding-left:5px; color:red; } + } + &.loading > .inner > .loading { opacity:1; pointer-events:all; } +} + +.wpsg_revocation_product_button { + flex-shrink:0; padding:0.25rem; width:35px; height:35px; + border:1px solid black; display:flex; cursor:pointer; + svg { width:auto; } +} + +#wpsg_revocation_form { display:flex; flex-direction:column; gap:0.5rem; width:100%; + .wpsg_revocation_order_product > div { width:100%; } + .form_field { display:flex; width:100%; flex-direction:column; gap:0.125rem; + .label { color: black; font-size: 1.25rem; } + .value { display:flex; justify-content:stretch; gap:0.25rem; + input, textarea, select { width:auto; flex-grow:1; min-height:30px; text-indent:0.25rem; flex-shrink:1; } + textarea { min-height:90px; padding:0.25rem; } + select { height:36px; } + input[type="number"] { flex-shrink:2; flex-grow:0; } + } + } +} + +.wpsg_mod_kundenverwaltung_order { + .wpsg_revocation_order_product { display:inline-flex; align-items:center; gap:0.5rem; border:1px solid black; border-radius:0.5rem; padding:0.5rem; + margin-bottom:1rem; user-select:none; flex-direction: row; + & > svg { height:30px; width:30px; } + & > input { width:25px; height:25px; flex-shrink:0; } + & > .inner { cursor:pointer; } + } +} + +.wpsg_amount_label { + word-break: normal; +} \ No newline at end of file diff --git a/views/mods/mod_revocation/wpsg_revocation.js b/views/mods/mod_revocation/wpsg_revocation.js new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3