Subversion Repositories wpShopGermany4

Rev

Rev 7807 | Rev 7811 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7807 Rev 7809
Line 8... Line 8...
8
    
8
    
9
?>
9
?>
10
       
10
       
11
<?php foreach ($this->view['arOrderedAboProducts'] as $oOrderProduct) {
11
<?php foreach ($this->view['arOrderedAboProducts'] as $oOrderProduct) {
12
 
12
 
-
 
13
	try {
-
 
14
    
13
    $oAbo = wpsg_abo::getFromOrderAndProduct($view['oOrder']->getId(), $oOrderProduct->getId());
15
		$oAbo = wpsg_abo::getFromOrderAndProduct($view['oOrder']->getId(), $oOrderProduct->getId());
-
 
16
		
-
 
17
		?>
14
	
18
	
15
	?>
-
 
16
 
-
 
17
    <?php echo wpsg_drawForm_AdminboxStart($oOrderProduct->getProduct()->getProductName()); ?>
19
		<?php echo wpsg_drawForm_AdminboxStart($oOrderProduct->getProduct()->getProductName()); ?>
18
 
-
 
19
        <?php $tExpire = strtotime($this->callMod('wpsg_mod_abo', 'getOrderAboExpiration', Array($_REQUEST['edit_id'], $oOrderProduct->getProductKey()))); ?>
-
 
20
		<?php echo wpsg_drawForm_Text(__('Laufzeit', 'wpsg'), wpsg_formatTimestamp($tExpire), 'wpsg_mod_abo_duration', Array('class_content_wrap' => 'wpsg_abo_state wpsg_abo_state_class_'.$oAbo->getState())); ?>
-
 
21
	
20
	
-
 
21
			<?php $tExpire = strtotime($this->callMod('wpsg_mod_abo', 'getOrderAboExpiration', Array($_REQUEST['edit_id'], $oOrderProduct->getProductKey()))); ?>
-
 
22
			<?php echo wpsg_drawForm_Text(__('Laufzeit', 'wpsg'), wpsg_formatTimestamp($tExpire), 'wpsg_mod_abo_duration', Array('class_content_wrap' => 'wpsg_abo_state wpsg_abo_state_class_'.$oAbo->getState())); ?>
-
 
23
		
22
		<script>
24
			<script>
23
 
25
	
24
            moment.locale('de');
26
				moment.locale('de');
-
 
27
				
-
 
28
				jQuery('#wpsg_mod_abo_duration').editable({
-
 
29
					type: 'combodate',
-
 
30
					display: function(value) {
-
 
31
						
-
 
32
						jQuery(this).html(value.format('DD.MM.YYYY HH:mm:ss'));
-
 
33
						
-
 
34
					},
-
 
35
					success: function(response, newValue) {
-
 
36
						
-
 
37
						jQuery.ajax({
-
 
38
							url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_abo&subaction=admin_inlineEdit&noheader=1',
-
 
39
							data: {
-
 
40
								field: 'duration',
-
 
41
								product_key: '<?php echo $oOrderProduct->getProductKey(); ?>',
-
 
42
								order_id: '<?php echo $view['oOrder']->getId() ?>',
-
 
43
								date: newValue.format()
-
 
44
							},
-
 
45
							success: function(response) {
-
 
46
	 
-
 
47
								jQuery('.wpsg_abo_state').attr("class", "col-sm-6 wpsg_abo_state_class_" + response.state)
-
 
48
															
-
 
49
							}
-
 
50
						})
-
 
51
						
-
 
52
					},
-
 
53
					format: 'DD.MM.YYYY HH:mm:ss',
-
 
54
					viewformat: 'DD.MM.YYYY HH:mm:ss',
-
 
55
					template: 'D MMM YYYY  HH:mm:ss',
-
 
56
					combodate: {
-
 
57
						minYear: 2000,
-
 
58
						maxYear: <?php echo (intval(date('Y')) + 1); ?>,
-
 
59
						minuteStep: 1
-
 
60
					}
-
 
61
				}); 
-
 
62
				
-
 
63
			</script>
-
 
64
	
-
 
65
			<?php echo wpsg_drawForm_Text(wpsg_translate(__('Preis (#1# Tage):', 'wpsg'), $oOrderProduct->getProduct()->wpsg_mod_abo_durration), wpsg_ff($oOrderProduct->getProduct()->wpsg_mod_abo_price, $this->get_option('wpsg_currency'))); ?>
-
 
66
			<?php
-
 
67
		
-
 
68
				$strURL = $this->callMod('wpsg_mod_abo', 'getRebuyLink', [$view['oOrder']->getId(), $oOrderProduct->getProductKey()]);
-
 
69
				$strURL = '<a href="'.$strURL.'">'.$strURL.'</a>';
-
 
70
		
-
 
71
				echo wpsg_drawForm_Text(__('URL für den Kauf einer Verlängerung', 'wpsg'), $strURL); 
-
 
72
				
-
 
73
			?>
-
 
74
		
-
 
75
			<?php echo wpsg_drawForm_TextStart(); ?>
25
			
76
			
26
            jQuery('#wpsg_mod_abo_duration').editable({
-
 
27
				type: 'combodate',
-
 
28
                display: function(value) {
-
 
29
				    
-
 
30
                    jQuery(this).html(value.format('DD.MM.YYYY HH:mm:ss'));
-
 
31
				    
-
 
32
				},
-
 
33
                success: function(response, newValue) {
-
 
34
				    
-
 
35
					jQuery.ajax({
-
 
36
                        url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_abo&subaction=admin_inlineEdit&noheader=1',
-
 
37
						data: {
-
 
38
                            field: 'duration',
-
 
39
							product_key: '<?php echo $oOrderProduct->getProductKey(); ?>',
77
				<?php $abo_product_status = $this->callMod('wpsg_mod_abo', 'getAboProductStatus', Array($_REQUEST['edit_id'], $oOrderProduct->getProductKey())); ?>
40
							order_id: '<?php echo $view['oOrder']->getId() ?>',
-
 
41
							date: newValue.format()
-
 
42
                        },
-
 
43
						success: function(response) {
-
 
44
 
-
 
45
                            jQuery('.wpsg_abo_state').attr("class", "col-sm-6 wpsg_abo_state_class_" + response.state)
-
 
46
                                                        
-
 
47
						}
-
 
48
					})
-
 
49
				    
78
		
50
                },
-
 
51
                format: 'DD.MM.YYYY HH:mm:ss',
-
 
52
                viewformat: 'DD.MM.YYYY HH:mm:ss',
-
 
53
                template: 'D MMM YYYY  HH:mm:ss',
-
 
54
                combodate: {
-
 
55
                    minYear: 2000,
-
 
56
                    maxYear: <?php echo (intval(date('Y')) + 1); ?>,
79
				<?php if ($abo_product_status['status'] === wpsg_mod_abo::STATUS_ACTIVE) { ?>
57
                    minuteStep: 1
-
 
58
                }
-
 
59
            }); 
-
 
60
			
80
			
61
		</script>
81
					<?php echo __('Aktiv', 'wpsg'); ?>
62
 
82
			
63
        <?php echo wpsg_drawForm_Text(wpsg_translate(__('Preis (#1# Tage):', 'wpsg'), $oOrderProduct->getProduct()->wpsg_mod_abo_durration), wpsg_ff($oOrderProduct->getProduct()->wpsg_mod_abo_price, $this->get_option('wpsg_currency'))); ?>
83
					&nbsp;[&nbsp;<a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_abo&edit_id=<?php echo $_REQUEST['edit_id'] ?>&product_key=<?php echo $oOrderProduct->getProductKey(); ?>&do=stop&noheader=1"><?php echo __('Deaktivieren'); ?></a>&nbsp;]
64
		<?php
-
 
65
	
84
			
66
			$strURL = $this->callMod('wpsg_mod_abo', 'getRebuyLink', [$view['oOrder']->getId(), $oOrderProduct->getProductKey()]);
85
				<?php } else if ($abo_product_status['status'] === wpsg_mod_abo::STATUS_STOPPED) { ?>
-
 
86
			
67
			$strURL = '<a href="'.$strURL.'">'.$strURL.'</a>';
87
					<?php echo __('Inaktiv', 'wpsg'); ?>
68
	
88
	
69
			echo wpsg_drawForm_Text(__('URL für den Kauf einer Verlängerung', 'wpsg'), $strURL); 
89
					&nbsp;[&nbsp;<a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_abo&edit_id=<?php echo $_REQUEST['edit_id'] ?>&product_key=<?php echo $oOrderProduct->getProductKey(); ?>&do=run&noheader=1"><?php echo __('Aktivieren'); ?></a>&nbsp;]
70
			
90
			
71
		?>
91
				<?php } ?>
72
    
92
		
73
        <?php echo wpsg_drawForm_TextStart(); ?>
93
			<?php echo wpsg_drawForm_TextEnd(__('Verlängerung')); ?>
74
        
-
 
75
            <?php $abo_product_status = $this->callMod('wpsg_mod_abo', 'getAboProductStatus', Array($_REQUEST['edit_id'], $oOrderProduct->getProductKey())); ?>
-
 
76
    
-
 
77
            <?php if ($abo_product_status['status'] === wpsg_mod_abo::STATUS_ACTIVE) { ?>
-
 
78
        
94
			  
79
                <?php echo __('Aktiv', 'wpsg'); ?>
95
		<?php echo wpsg_drawForm_AdminboxEnd(); ?>
80
        
96
		
81
                &nbsp;[&nbsp;<a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_abo&edit_id=<?php echo $_REQUEST['edit_id'] ?>&product_key=<?php echo $oOrderProduct->getProductKey(); ?>&do=stop&noheader=1"><?php echo __('Deaktivieren'); ?></a>&nbsp;]
97
	<?php } catch (\Exception $e) { ?>
82
        
98
 
83
            <?php } else if ($abo_product_status['status'] === wpsg_mod_abo::STATUS_STOPPED) { ?>
99
        <?php echo wpsg_drawForm_AdminboxStart($oOrderProduct->getProduct()->getProductName()); ?>
84
        
100
		
85
                <?php echo __('Inaktiv', 'wpsg'); ?>
101
			<p><?php echo __('Abo wurde gelöscht.', 'wpsg'); ?></p>
86
 
102
		
87
                &nbsp;[&nbsp;<a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_abo&edit_id=<?php echo $_REQUEST['edit_id'] ?>&product_key=<?php echo $oOrderProduct->getProductKey(); ?>&do=run&noheader=1"><?php echo __('Aktivieren'); ?></a>&nbsp;]
103
		<?php echo wpsg_drawForm_AdminboxEnd(); ?>
88
        
104
		
89
            <?php } ?>
105
	<?php } ?>
90
    
-
 
91
        <?php echo wpsg_drawForm_TextEnd(__('Verlängerung')); ?>
-
 
92
          
-
 
93
    <?php echo wpsg_drawForm_AdminboxEnd(); ?>
-
 
94
    
106
    
95
<?php } ?>
107
<?php } ?>
96
108