summaryrefslogtreecommitdiff
path: root/views/mods/mod_ordercondition
diff options
context:
space:
mode:
authorDaniel Schmitzer <noreply@maennchen1.de>2016-01-14 14:55:36 +0000
committerDaniel Schmitzer <noreply@maennchen1.de>2016-01-14 14:55:36 +0000
commitad405c7045c6e242080ec9d3ce4c9e586b517c4f (patch)
treeb41905f4d27f3eaaabd5bad3a39f8d3873540b46 /views/mods/mod_ordercondition
- Testweise 4
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@5261 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/mods/mod_ordercondition')
-rw-r--r--views/mods/mod_ordercondition/list.phtml121
-rw-r--r--views/mods/mod_ordercondition/overview_top.phtml25
-rw-r--r--views/mods/mod_ordercondition/produkt_edit_sidebar.phtml18
-rw-r--r--views/mods/mod_ordercondition/settings_edit.phtml168
4 files changed, 332 insertions, 0 deletions
diff --git a/views/mods/mod_ordercondition/list.phtml b/views/mods/mod_ordercondition/list.phtml
new file mode 100644
index 0000000..5594678
--- /dev/null
+++ b/views/mods/mod_ordercondition/list.phtml
@@ -0,0 +1,121 @@
+<?php
+
+ /**
+ * Template für die Liste der Bestellbedingungen im Backend
+ */
+
+?>
+<script type="text/javascript">/* <![CDATA[ */
+
+ jQuery(document).ready(function() {
+
+ jQuery('.wpsg_mod_ordercondition_edit_name').each(function() {
+
+ var oc_id = jQuery(this).attr("id").replace(/wpsg_mod_ordercondition_name_/, '');
+
+ jQuery(this).editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_ordercondition&do=inlinedit&noheader=1', {
+ submitdata: {
+ field: 'name',
+ oc_id: oc_id
+ },
+ submit: '<?php echo __('Speichern', 'wpsg'); ?>',
+ placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
+ indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
+ tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
+ } );
+
+ } );
+
+ jQuery('.wpsg_mod_ordercondition_edit_typ').bind('change', function() {
+
+ var oc_id = jQuery(this).attr("id").replace(/wpsg_mod_ordercondition_typ_/, '');
+ var value = jQuery(this).val();
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_ordercondition&do=inlinedit&noheader=1',
+ data: {
+ field: 'typ',
+ value: value,
+ oc_id: oc_id
+ }
+ } );
+
+ } );
+
+ jQuery('#wpsg_oc_list .wpsg_icon_remove').bind('click', function() {
+
+ if (!confirm('<?php echo __('Sind Sie sich sicher, dass sie diese Bestellbedingung entfernen möchten?', 'wpsg'); ?>')) return false;
+
+ jQuery('#wpsg_oc_list').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_ordercondition&do=remove&noheader=1',
+ data: {
+ oc_id: jQuery(this).parent().attr("id")
+ },
+ success: function(data)
+ {
+
+ jQuery('#wpsg_oc_list').html(data);
+
+ }
+ } );
+
+ } );
+
+ } );
+
+/* ]]> */</script>
+<?php if (!is_array($this->view['wpsg_mod_ordercondition']['data']) || sizeof($this->view['wpsg_mod_ordercondition']['data']) <= 0) { ?>
+<?php echo __('Bisher keine Bestellbedingungen angelegt.', 'wpsg'); ?>
+<?php } else { ?>
+<?php $i = 0; foreach ($this->view['wpsg_mod_ordercondition']['data'] as $oc) { $i ++; ?>
+
+ <div id="wpsg_mod_ordercondition_row_<?php echo $oc['id']; ?>">
+
+ <?php echo wpsg_drawForm_Input($oc['id'], __('ID', 'wpsg'), $oc['id'], array('text' => true, 'remove' => '1')); ?>
+ <?php echo wpsg_drawForm_Input('wpsg_mod_ordercondition_name_'.$oc['id'], __('Bezeichnung', 'wpsg'), $oc['name'], array('text' => true, 'class_text' => 'wpsg_mod_ordercondition_edit_name wpsg_editable')); ?>
+ <?php echo wpsg_drawForm_Select('wpsg_mod_ordercondition_typ_'.$oc['id'], __('Wirkungsbereich', 'wpsg'), array('0' => __('Inaktiv', 'wpsg'), '1' => __('Jede Bestellung', 'wpsg'), '2' => __('Bestimmte Produkte', 'wpsg')), $oc['typ'], array('class_select' => 'wpsg_editable wpsg_mod_ordercondition_edit_typ')); ?>
+
+ <div class="wpsg_form_field">
+ <div class="wpsg_form_left">
+ <label for="wpsg_mod_ordercondition_text_<?php echo $oc['id']; ?>"><?php echo __('Bedingungstext', 'wpsg'); ?>:</label>
+ </div>
+ <div class="wpsg_form_right">
+ <p>
+ <a href="#" onclick="return wpsg_showOCText(<?php echo $oc['id']; ?>);"><?php echo __('Editor anzeigen/verbergen', 'wpsg'); ?></a>
+ </p>
+ </div>
+ </div>
+ <div class="wpsg_clear"></div>
+
+ <div class="wpsg_form_field wpsg_mod_ordercondition_editor wpsg_mod_ordercondition_editor_<?php echo $oc['id']; ?>" style="display:none; width:745px; min-height:225px;">
+ <textarea class="wpsg_mod_ordercondition_text" id="oc_<?php echo $oc['id']; ?>" name="oc[<?php echo $oc['id']; ?>]"><?php echo wpsg_hspc($oc['text']); ?></textarea>
+ <div class="wpsg_clear"></div><br />
+ <input class="button" type="button" onclick="wpsg_saveOCText(<?php echo $oc['id']; ?>);" value="<?php echo __('Text speichern', 'wpsg'); ?>" /><br /><br />
+ </div>
+
+ <div class="wpsg_form_field">
+ <div class="wpsg_form_left">
+ <label for="wpsg_mod_ordercondition_errortext_<?php echo $oc['id']; ?>"><?php echo __('Fehlertext', 'wpsg'); ?>:</label>
+ </div>
+ <div class="wpsg_form_right">
+ <p>
+ <a href="#" onclick="return wpsg_showOCErrorText(<?php echo $oc['id']; ?>);"><?php echo __('Editor anzeigen/verbergen', 'wpsg'); ?></a>
+ </p>
+ </div>
+ </div>
+ <div class="wpsg_clear"></div>
+
+ <div class="wpsg_form_field wpsg_mod_ordercondition_editor wpsg_mod_ordercondition_editor_errortext_<?php echo $oc['id']; ?>" style="display:none; width:745px; min-height:225px;">
+ <textarea class="wpsg_mod_ordercondition_text" id="oc_errortext_<?php echo $oc['id']; ?>" name="oc[<?php echo $oc['id']; ?>]"><?php echo wpsg_hspc($oc['errortext']); ?></textarea>
+ <div class="wpsg_clear"></div><br />
+ <input class="button" type="button" onclick="wpsg_saveOCErrorText(<?php echo $oc['id']; ?>);" value="<?php echo __('Text speichern', 'wpsg'); ?>" /><br />
+ </div>
+
+ <?php if ($i < sizeof($this->view['wpsg_mod_ordercondition']['data'])) { ?><br /><hr /><?php } ?>
+
+ </div>
+
+<?php } ?>
+<?php } ?> \ No newline at end of file
diff --git a/views/mods/mod_ordercondition/overview_top.phtml b/views/mods/mod_ordercondition/overview_top.phtml
new file mode 100644
index 0000000..2ac9e44
--- /dev/null
+++ b/views/mods/mod_ordercondition/overview_top.phtml
@@ -0,0 +1,25 @@
+<?php
+
+ /**
+ * Template für die Integration der Bestellbedingungen in die Bestellzusammenfassung
+ */
+
+ // Die Mindestlänge, damit der Text in einer Scrollbox angezeigt wird
+ $minLength = 1000;
+
+?>
+<?php foreach ($this->view['wpsg_mod_ordercondition']['data'] as $oc) { ?>
+<div class="wpsg_agb">
+ <label>
+ <input type="checkbox" value="1" name="wpsg_mod_ordercondition[<?php echo $oc['id']; ?>]" />
+ <?php if (strlen($oc['text']) < $minLength) { ?>
+ <?php echo $oc['text']; ?>
+ <?php } else { ?>
+ <?php echo __($oc['name'], 'wpsg'); ?>
+ <?php } ?>
+ </label>
+ <?php if (strlen($oc['text']) >= $minLength) { ?>
+ <div class="wpsg_mod_ordercondition_hint"><?php echo $oc['text']; ?></div>
+ <?php } ?>
+</div>
+<?php } ?> \ No newline at end of file
diff --git a/views/mods/mod_ordercondition/produkt_edit_sidebar.phtml b/views/mods/mod_ordercondition/produkt_edit_sidebar.phtml
new file mode 100644
index 0000000..fc70b85
--- /dev/null
+++ b/views/mods/mod_ordercondition/produkt_edit_sidebar.phtml
@@ -0,0 +1,18 @@
+<?php
+
+ /**
+ * Template für die Integration der Bestellbedingungen in die Produktverwaltung
+ */
+
+?>
+<div class="postbox" id="wpsg_ordercondition">
+ <h3 class="wpsg_handlediv">
+ <span title="<?php echo __('Zum Ein/Ausklappen hier klicken', 'wpsg'); ?>" class="handlediv"><br /></span>
+ <span><?php echo __('Bestellbedingungen', 'wpsg'); ?></span>
+ </h3>
+ <div class="inside">
+ <?php foreach ($this->view['wpsg_mod_ordercondition']['data'] as $oc) { ?>
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_ordercondition['.$oc['id'].']', __($oc['name'], 'wpsg'), $oc['selected']); ?>
+ <?php } ?>
+ </div>
+</div> \ No newline at end of file
diff --git a/views/mods/mod_ordercondition/settings_edit.phtml b/views/mods/mod_ordercondition/settings_edit.phtml
new file mode 100644
index 0000000..4bef845
--- /dev/null
+++ b/views/mods/mod_ordercondition/settings_edit.phtml
@@ -0,0 +1,168 @@
+<?php
+
+ /**
+ * Template für die Einstellungen des Bestellbedingungsmoduls
+ */
+
+?>
+<script type="text/javascript">/* <![CDATA[ */
+
+ /**
+ * Wird beim Anlegen einer neuen Bestellbedingung aufgerufen
+ */
+ function wpsg_addOC()
+ {
+
+ jQuery('#wpsg_oc_list').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_ordercondition&noheader=1&do=add',
+ success: function(data) {
+ jQuery('#wpsg_oc_list').html(data);
+ }
+ } );
+
+ return false;
+
+ } // function wpsg_addZV()
+
+ /**
+ * Speichert den Text einer Bestellbedingung
+ */
+ function wpsg_saveOCText(oc_id)
+ {
+
+ var OCText = jQuery('#oc_' + oc_id).val();
+
+ window.setTimeout(function() {
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_ordercondition&do=inlinedit&noheader=1',
+ type: 'POST',
+ data: {
+ field: 'text',
+ value: OCText,
+ oc_id: oc_id
+ },
+ success: function(data) {
+
+ if (data != "1")
+ {
+
+ alert(data);
+
+ }
+ else
+ {
+
+ alert('<?php echo __('Text wurde erfolgreich gespeichert.', 'wpsg'); ?>');
+
+ }
+
+ }
+ } );
+
+
+
+ }, 10);
+
+ return false;
+
+ } // function wpsg_saveOCText(oc_id)
+
+ function wpsg_saveOCErrorText(oc_id)
+ {
+
+ var OCErrorText = jQuery('#oc_errortext_' + oc_id).val();
+
+ window.setTimeout(function() {
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_ordercondition&do=inlinedit&noheader=1',
+ type: 'POST',
+ data: {
+ field: 'errortext',
+ value: OCErrorText,
+ oc_id: oc_id
+ },
+ success: function(data) {
+
+ if (data != "1")
+ {
+
+ alert(data);
+
+ }
+
+ }
+ } );
+
+ }, 10);
+
+ return false;
+
+ } // function wpsg_saveOCErrorText(oc_id)
+
+ /**
+ * Blendet den Editor einer Bestellbedingung ein und die anderen aus
+ */
+ function wpsg_showOCText(oc_id)
+ {
+
+ jQuery('.wpsg_mod_ordercondition_editor').hide(500);
+
+ if (!jQuery('.wpsg_mod_ordercondition_editor_' + oc_id).is(':visible'))
+ {
+
+ jQuery('.wpsg_mod_ordercondition_editor_' + oc_id).show(500);
+
+ }
+
+ return false;
+
+ } // function wpsg_showOCText(oc_id)
+
+
+ /**
+ * Blendet den Editor einer Bestellbedingung ein und die anderen aus
+ */
+ function wpsg_showOCErrorText(oc_id)
+ {
+
+ jQuery('.wpsg_mod_ordercondition_editor').hide(500);
+
+ if (!jQuery('.wpsg_mod_ordercondition_editor_errortext_' + oc_id).is(':visible'))
+ {
+
+ jQuery('.wpsg_mod_ordercondition_editor_errortext_' + oc_id).show(500);
+
+ }
+
+ return false;
+
+ } // function wpsg_showOCErrorText(oc_id)
+
+/* ]]> */</script>
+
+<?php if ($this->hasMod('wpsg_mod_crefopay')) { ?>
+<p>
+ <span class="wpsg_error"><?php echo __('Aufgrund des für CrefoPay angepassten Bestellablaufs ist dieses Modul unwirksam.', 'wpsg'); ?></span>
+</p>
+<?php } ?>
+
+<div class="wpsg_admin_box">
+
+ <div class="head">
+ <div class="title">
+ <div class="fulltab">
+ <?php echo __('Bestellbedingungen', 'wpsg'); ?>
+ <a title="<?php echo __('Neue Bestellbedingung anlegen', 'wpsg'); ?>" href="" class="wpsg_icon wpsg_icon_right wpsg_icon_add" onclick="return wpsg_addOC();"></a>
+ </div>
+ </div>
+ </div>
+
+ <div class="content" id="wpsg_oc_list">
+ <?php echo $this->callMod('wpsg_mod_ordercondition', 'oc_list'); ?>
+ </div>
+
+</div> \ No newline at end of file