summaryrefslogtreecommitdiff
path: root/views/mods/mod_revocation/settings_edit.phtml
diff options
context:
space:
mode:
authorDaniel Schmitzer <noreply@maennchen1.de>2026-05-28 04:16:42 +0000
committerDaniel Schmitzer <noreply@maennchen1.de>2026-05-28 04:16:42 +0000
commitfe1b43a2645ee78032acffc581d52609a6d1698a (patch)
tree3d7b0bb74c67a9bac23ea2fb513b8012f4e13dbc /views/mods/mod_revocation/settings_edit.phtml
parentfd9122e4359db02258da7f6a0460c0fc962e5420 (diff)
- Widerrufsformular
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@8520 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/mods/mod_revocation/settings_edit.phtml')
-rw-r--r--views/mods/mod_revocation/settings_edit.phtml121
1 files changed, 121 insertions, 0 deletions
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 @@
+<?php
+
+ declare(strict_types=1);
+
+ /**
+ * @author: Daniel Schmitzer
+ * @date: 14.04.26
+ * @time: 06:32
+ */
+
+ $arReason = \wpsgRevocation\Revocation::getReasons();
+
+?>
+
+<div id="wpsg_mod_revocation_reason_wrap">
+ <div id="wpsg_mod_revocation_reason_app">
+
+ <ul class="nav nav-tabs" role="tablist">
+ <li role="presentation" :class="{ 'active': tab === 1 }"><a href="#tab1" @click.prevent.stop="tab = 1"><?php echo __('Einstellungen', 'wpsgRevocation'); ?></a></li>
+ <li role="presentation" :class="{ 'active': tab === 2 }"><a href="#tab2" @click.prevent.stop="tab = 2"><?php echo __('Gründe für Retouren', 'wpsgRevocation'); ?></a></li>
+ </ul>
+
+ <input type="hidden" name="wpsg_mod_revocation_reason" v-model="jsonString" />
+
+ <div class="tab-content">
+ <div v-show="tab === 1" class="tab-pane active">
+
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_revocation_view_order', __('An Produkten im Kundenfrontend an den Bestellungen anzeigen.', 'wpsgRevocation'), wpsg_ShopController::getShop()->get_option('wpsg_mod_revocation_view_order'), ['fullWidth' => true]); ?>
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_revocation_view_flyout', __('Auf allen Seiten ein Widerrufs-Flyout anzeigen.', 'wpsgRevocation'), wpsg_ShopController::getShop()->get_option('wpsg_mod_revocation_view_flyout'), ['fullWidth' => true]); ?>
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_revocation_view_product', __('Im Produkt neben "In den Warenkorb" anzeigen.', 'wpsgRevocation'), wpsg_ShopController::getShop()->get_option('wpsg_mod_revocation_view_product'), ['fullWidth' => true]); ?>
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_revocation_view_customer_mail', __('Widerruflink in Bestellbestätigungsmail an Kunden.', 'wpsgRevocation'), wpsg_ShopController::getShop()->get_option('wpsg_mod_revocation_view_customer_mail'), ['fullWidth' => true]); ?>
+
+ <p class="wpsg_note">
+ <?php echo wpsg_translate(
+ __('Einstellungen zu den E-Mails finden Sie in der <a href="#1#">E-Mail Konfiguration</a>.', 'wpsgRevocation'),
+ WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=emailconf'
+ ); ?><br />
+ <?php echo __('Das Modul setzt eindeutige Artikelnummern voraus.', 'wpsgRevocation'); ?>
+ </p>
+
+ </div>
+ <div v-show="tab === 2" class="tab-pane active">
+ <div class="reason_wrap" v-if="arReason.length > 0">
+ <template v-for="r of arReason">
+ <div class="wpsg_form_field">
+ <label class="label"><?php echo __('ID', 'wpsgRevocation'); ?></label>
+ <div class="value">
+ {{r.id}}
+ <a data-id="1" class="removeReason" @click.prevent.stop="removeReason(r)" href="#"><span class="wpsg-glyphicon glyphicon glyphicon-trash"></span></a>
+ </div>
+ </div>
+ <div class="wpsg_form_field">
+ <label class="label"><?php echo __('Text', 'wpsgRevocation'); ?></label>
+ <div class="value">
+ <input type="text" v-model="r.text" />
+ </div>
+ </div>
+ <hr />
+ </template>
+ </div>
+ <p v-else><?php echo __('Keine Gründe definiert', 'wpsgRevocation'); ?></p>
+
+ <a href="#" @click.prevent.stop="addReason" class="addReason"><span class="wpsg-glyphicon glyphicon glyphicon-plus"></span><?php echo __('Neuen Grund anlegen', 'wpsgRevocation'); ?></a>
+ </div>
+ </div>
+
+ </div>
+</div>
+
+<style>
+
+ #wpsg_mod_revocation_reason_wrap {
+ .wpsg_note { margin-top:1rem; font-style:italic; }
+ .addReason { margin-top:1rem; display:block; }
+ .removeReason { position:absolute; right:0; top:7px; font-size:1.4rem; }
+ .wpsg_form_field { display:grid; grid-template-columns:100px 1fr; column-gap:2rem; row-gap:1rem; width:100%; align-items:center; position:relative; min-height:30px;
+ & > .label { font-weight:bold; display:block; padding:0; margin:0; color:black; font-size:100%; text-align:left; }
+ & > .value {
+ input { width:100%; }
+ }
+ }
+ }
+
+</style>
+
+<script type="module">
+
+ import { createApp, computed, ref } from '<?php echo wpsg_ShopController::getShop()->getRessourceURL('js/vue.esm-browser.prod.3.5.32.js'); ?>';
+
+ createApp({
+ setup() {
+
+ const tab = ref(1);
+ const arReason = ref(<?php echo json_encode($arReason); ?>);
+
+ const addReason = () => {
+
+ const id = Date.now().toString(36) + Math.random().toString(36).slice(2);
+ arReason.value.push({ text: '', id: id });
+
+ };
+ const removeReason = r => {
+
+ if (confirm('<?php echo __('Sind Sie sich sicher?', 'wpsgRevocation'); ?>')) {
+
+ arReason.value = arReason.value.filter(v => v !== r);
+
+ }
+
+ }
+
+ const jsonString = computed(() => JSON.stringify(arReason.value));
+
+ return {
+ addReason, removeReason,
+ arReason, jsonString, tab
+ };
+ }
+ }).mount('#wpsg_mod_revocation_reason_app');
+
+</script> \ No newline at end of file