Subversion Repositories wpShopGermany4

Rev

Rev 7851 | Rev 7987 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2595 daniel 1
<?php
2
 
3
	/**
4
	 * Template für die Einstellungen des Abo Moduls
5
	 */
6830 daniel 6
 
7816 daniel 7
	$arPaymentSelect = [
8
		'origin' => __('Wie ursprüngliche Zahlungsart', 'wpsg')
9
	];
10
 
6830 daniel 11
	foreach ($this->arPayment as $p) { $arPaymentSelect[$p['id']] = $p['name']; }
12
 
2595 daniel 13
?>
5255 thomas 14
<?php echo wpsg_drawForm_Input('wpsg_mod_abo_url', __('Standard URL für Ablauf/Verlängerung', 'wpsg'), $this->get_option('wpsg_mod_abo_url'), array ('help' => 'wpsg_mod_abo_url')); ?>
2595 daniel 15
<br />
7126 daniel 16
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_abo_wpsgmodabofirstbuy', __('Mail bei erstem Kauf eines Abos', 'wpsg'), $this->get_option('wpsg_mod_abo_wpsgmodabofirstbuy'), array('hint' => wpsg_translate(__('Mail wird bei Bezahlung der Abo Bestellung zusätzlich versendet. (mail_firstbuy.phtml) -> <a href="#1#">Konfiguration</a>', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=emailconf#wpsgmodabofirstbuy'), 'help' => 'wpsg_mod_abo_wpsgmodabofirstbuy')); ?>
17
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_abo_wpsgmodabrebuy', __('Mail bei Kauf einer Verlängerung', 'wpsg'), $this->get_option('wpsg_mod_abo_wpsgmodabrebuy'), array('hint' => wpsg_translate(__('Mail wird bei Bezahlung einer Abo Verlängerung versendet. (mail_rebuy.phtml) -> <a href="#1#">Konfiguration</a>', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=emailconf#wpsgmodabrebuy'), 'help' => 'wpsg_mod_abo_wpsgmodabrebuy')); ?>
6830 daniel 18
 
19
<br />
6855 thomas 20
 
7833 karl 21
<?php echo wpsg_drawForm_Input('wpsg_mod_abo_perpage', __('Abos pro Seite (Backend)', 'wpsg'), $this->get_option('wpsg_mod_abo_perpage'), array('help' => 'wpsg_mod_abo_perpage')); ?>
6855 thomas 22
 
23
<br />
6830 daniel 24
 
7833 karl 25
<?php echo wpsg_drawForm_Select('wpsg_mod_abo_expiremode', __('Bei Ablauf des Abos', 'wpsg'), Array(
7828 daniel 26
    wpsg_mod_abo::EXPIRE_NONE => __('Nichts', 'wpsg'),
6834 daniel 27
	wpsg_mod_abo::EXPIRE_MAIL => __('Mail versenden', 'wpsg'),
28
	wpsg_mod_abo::EXPIRE_AUTO => __('Automatisch verlängern', 'wpsg')
6830 daniel 29
), $this->get_option('wpsg_mod_abo_expiremode'), array('help' => 'wpsg_mod_abo_expiremode')); ?>
30
 
7823 daniel 31
<?php echo wpsg_drawForm_Select('wpsg_mod_abo_premode', __('X - Tage vor Ablauf des Abos', 'wpsg'), [
32
    wpsg_mod_abo::EXPIRE_NONE => __('Nichts', 'wpsg'),
33
    wpsg_mod_abo::EXPIRE_MAIL => __('Mail versenden', 'wpsg'),
34
    wpsg_mod_abo::EXPIRE_AUTO => __('Automatisch verlängern', 'wpsg')
35
], $this->get_option('wpsg_mod_abo_premode'), ['help' => 'wpsg_mod_abo_premode']); ?>
7811 daniel 36
 
7823 daniel 37
<div id="wpsg_mod_abo_premode_greater0" style="display:none;">
6830 daniel 38
 
7823 daniel 39
    <?php echo wpsg_drawForm_Input('wpsg_mod_abo_autoexpire_informationtime', __('Zeitspanne zum Versenden der Informationsmail in Tagen', 'wpsg'), $this->get_option('wpsg_mod_abo_autoexpire_informationtime'), [
40
        'help' => 'wpsg_mod_abo_autoexpire_informationtime'
41
    ]); ?>
6830 daniel 42
 
43
</div>
44
 
7823 daniel 45
<script>
46
 
47
    let wpsg_mod_abo_premodeSELECT = document.getElementById('wpsg_mod_abo_premode');
48
    let wpsg_mod_abo_premode_greater0DIV = document.getElementById('wpsg_mod_abo_premode_greater0');
49
 
50
    wpsg_mod_abo_premodeSELECT.addEventListener('change', () => {
51
 
52
        console.log(parseInt(wpsg_mod_abo_premodeSELECT.value));
53
 
54
        if (parseInt(wpsg_mod_abo_premodeSELECT.value) > 0 || (parseInt(wpsg_mod_abo_premodeSELECT.value) === -1 && <?php echo ((intval($this->get_option('wpsg_mod_abo_premode')) > 0)?'true':'false'); ?>)) {
55
 
56
            wpsg_mod_abo_premode_greater0DIV.style.display = 'block';
57
 
58
        } else {
59
 
60
            wpsg_mod_abo_premode_greater0DIV.style.display = 'none';
61
 
62
        }
63
 
64
    });
65
 
66
    wpsg_mod_abo_premodeSELECT.dispatchEvent(new Event('change'));
67
 
68
</script>
69
 
70
<br />
71
 
7851 daniel 72
<div id="wpsg_mod_abo_expiremode_auto_layer" style="display:none;">
6830 daniel 73
 
6841 thomas 74
	<?php /* TODO: Mehrfachauswahl von Zahlungsarten */ ?>
7124 thomas 75
	<?php echo wpsg_drawForm_Select('wpsg_mod_abo_autoexpire_payment', __('Zahlungsart für automatische Verlängerung', 'wpsg'), $arPaymentSelect, $this->get_option('wpsg_mod_abo_autoexpire_payment'), array('help' => 'wpsg_mod_abo_autoexpire_payment')); ?>
7811 daniel 76
 
77
	<?php echo wpsg_drawForm_Select('wpsg_mod_abo_autoexpire_customermail', __('Mail an Kunden', 'wpsg'), [
78
        '0' => __('Nein', 'wpsg'),
79
        '1' => __('Ja', 'wpsg')
80
    ], $this->get_option('wpsg_mod_abo_autoexpire_customermail'), ['help' => 'wpsg_mod_abo_autoexpire_customermail']); ?>
81
 
82
    <?php echo wpsg_drawForm_Select('wpsg_mod_abo_autoexpire_adminmail', __('Mail an Administrator', 'wpsg'), [
83
        '0' => __('Nein', 'wpsg'),
84
        '1' => __('Ja', 'wpsg')
85
    ], $this->get_option('wpsg_mod_abo_autoexpire_adminmail'), ['help' => 'wpsg_mod_abo_autoexpire_adminmail']); ?>
86
 
87
	<br />
6855 thomas 88
 
6830 daniel 89
</div>
90
 
7851 daniel 91
<script>
92
 
93
    let wpsg_mod_abo_expiremode_auto_layer = document.getElementById('wpsg_mod_abo_expiremode_auto_layer');
94
    let wpsg_mod_abo_expiremode = document.getElementById('wpsg_mod_abo_expiremode');
95
    let wpsg_mod_abo_premode = document.getElementById('wpsg_mod_abo_premode');
96
 
97
    function displayAutoRenewOptions() {
98
 
99
    	if (wpsg_mod_abo_expiremode.value === '<?php echo wpsg_mod_abo::EXPIRE_AUTO; ?>' || wpsg_mod_abo_premode.value === '<?php echo wpsg_mod_abo::EXPIRE_AUTO; ?>') {
100
 
101
    		wpsg_mod_abo_expiremode_auto_layer.style.display = 'block';
102
 
103
        } else {
104
 
105
    		wpsg_mod_abo_expiremode_auto_layer.style.display = 'none';
106
 
107
        }
108
 
109
    }
110
 
111
    wpsg_mod_abo_expiremode.addEventListener('change', displayAutoRenewOptions);
112
    wpsg_mod_abo_premode.addEventListener('change', displayAutoRenewOptions);
113
 
114
    displayAutoRenewOptions();
115
 
116
</script>
117
 
118
<?php echo wpsg_drawForm_Select('wpsg_mod_abo_autoexpire_customer', __('Kunde kann im Frontend', 'wpsg'), Array(
119
    wpsg_mod_abo::CUSTOMER_AUTO_NOTHING => __('Nichts', 'wpsg'),
120
    wpsg_mod_abo::CUSTOMER_AUTO_DIRECT => __('Verlängerung direkt stoppen', 'wpsg'),
121
    wpsg_mod_abo::CUSTOMER_AUTO_MAIL => __('Verlängerung über Mail an Administrator stoppen', 'wpsg')
122
), $this->get_option('wpsg_mod_abo_autoexpire_customer'), array('help' => 'wpsg_mod_abo_autoexpire_customer')); ?>
123
 
7845 karl 124
<?php echo wpsg_drawForm_Input(false, __('CRON URL', 'wpsg'), site_url().'/?wpsg_cron=1', ['readonly' => true]); ?>
7915 daniel 125
<?php echo wpsg_drawForm_Text(__('Letzter Cron Aufruf', 'wpsg'), wpsg_formatTimestamp($this->get_option('wpsg_mod_abo_cron_lastrun'), false, true)); ?>
7845 karl 126
 
6855 thomas 127
<br />
128
 
7851 daniel 129
<script>
6830 daniel 130
 
131
    jQuery(document).ready(function() {
132
 
133
    	jQuery('#wpsg_mod_abo_expiremode').on('change', function() {
134
 
135
    		jQuery('.wpsg_mod_expiremode').hide();
136
			jQuery('.wpsg_mod_expiremode_' + jQuery(this).val()).show();
137
 
138
		} );
6841 thomas 139
 
6830 daniel 140
	} );
141
 
7851 daniel 142
</script>