Subversion Repositories wpShopGermany4

Rev

Rev 8135 | Rev 8244 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8135 Rev 8136
1
<?php
1
<?php
2
 
2
 
3
	/**
3
	/**
4
	 * Template für die Liste der Versandzonen
4
	 * Template für die Liste der Versandzonen
5
	 */
5
	 */
6
 
6
 
7
    $arShipping = $this->arShippingAll;
7
    $arShipping = $this->arShippingAll;
8
        
8
        
9
    $arShippingPreset = [
9
    $arShippingPreset = [
10
        '0' => __('Kundenvoreinstellung', 'wpsg'),
10
        '0' => __('Kundenvoreinstellung', 'wpsg'),
11
        '-1' => __('günstigste Versandart', 'wpsg'),
11
        '-1' => __('günstigste Versandart', 'wpsg'),
12
    ]; 
12
    ]; 
13
    
13
    
14
    foreach ($arShipping as $s_key => $s) {
14
    foreach ($arShipping as $s_key => $s) {
15
        
15
        
16
        if (intval($s['deleted']) !== 1 && intval($s['active']) === 1) {
16
        if (intval($s['deleted']) !== 1 && intval($s['active']) === 1) {
17
        
17
        
18
            $arShippingPreset[$s_key] = $s['name'];
18
            $arShippingPreset[$s_key] = $s['name'];
19
 
19
 
20
        }
20
        }
21
        
21
        
22
    }
22
    }
23
    
23
    
24
?>
24
?>
25
<?php if (!is_array($this->view['data']) || sizeof($this->view['data']) <= 0) { ?>
25
<?php if (!is_array($this->view['data']) || sizeof($this->view['data']) <= 0) { ?>
26
<?php echo __('Bisher keine Versandzonen hinterlegt.', 'wpsg'); ?>
26
<?php echo __('Bisher keine Versandzonen hinterlegt.', 'wpsg'); ?>
27
<?php } else { ?>
27
<?php } else { ?>
28
<table class="table wpsg_table_vz">
28
<table class="table wpsg_table_vz">
29
	<thead>
29
	<thead>
30
	<tr>
30
	<tr>
31
		<th class="col_name"><?php echo __('Bezeichnung', 'wpsg'); ?></th>
31
		<th class="col_name"><?php echo __('Bezeichnung', 'wpsg'); ?></th>
32
		<th class="col_innereu"><?php echo __('Inner- gemeinschaftlich', 'wpsg'); ?></th>
32
		<th class="col_innereu"><?php echo __('Inner- gemeinschaftlich', 'wpsg'); ?></th>
33
		<th class="col_shippingpreset"><?php echo __('Standardversandart', 'wpsg'); ?></th>
33
		<th class="col_shippingpreset"><?php echo __('Standardversandart', 'wpsg'); ?></th>
34
		<th class="col_aktion"></th>
34
		<th class="col_aktion"></th>
35
	</tr>
35
	</tr>
36
	</thead>
36
	</thead>
37
	<tbody>
37
	<tbody>
38
	<?php foreach ($this->view['data'] as $vz) { ?>
38
	<?php foreach ($this->view['data'] as $vz) { ?>
39
	<tr>
39
	<tr>
40
		<td class="wpsg_editable col_name">
40
		<td class="wpsg_editable col_name">
41
			<span  id="vz_<?php echo $vz['id']; ?>_name" ><?php echo wpsg_hspc($vz['name']); ?></span> 
41
			<span  id="vz_<?php echo $vz['id']; ?>_name" ><?php echo wpsg_hspc($vz['name']); ?></span> 
42
			<br />
42
			<br />
43
			<div id="vz_<?php echo $vz['id']; ?>_plz" style="display:none" class="wpsg_plz_div">
43
			<div id="vz_<?php echo $vz['id']; ?>_plz" style="display:none" class="wpsg_plz_div">
44
				<textarea><?php echo wpsg_hspc($vz['param']); ?></textarea>
44
				<textarea><?php echo wpsg_hspc($vz['param']); ?></textarea>
45
				<input type="submit" class="button" name="wpsg_mod_vz_submitsave" value="<?php echo __('Speichern', 'wpsg'); ?>" onclick="return wpsg_savePLZ(<?php echo $vz['id']; ?>);" />
45
				<input type="submit" class="button" name="wpsg_mod_vz_submitsave" value="<?php echo __('Speichern', 'wpsg'); ?>" onclick="return wpsg_savePLZ(<?php echo $vz['id']; ?>);" />
46
			</div>
46
			</div>
47
		</td>
47
		</td>
48
		<td class="col_innereu">		 
48
		<td class="col_innereu">		 
49
			<input class="wpsg_innereu"
49
			<input class="wpsg_innereu"
50
                data-url="<?php echo html_entity_decode(wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=vz&do=inlinedit&noheader=1', 'wpsg-admin-versandzonen-inline_edit-'.$vz['id'])); ?>"
50
                data-url="<?php echo html_entity_decode(wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=vz&do=inlinedit&noheader=1', 'wpsg-admin-versandzonen-inline_edit-'.$vz['id'])); ?>"
51
                <?php echo (($vz['innereu'] == '1')?'checked="checked"':''); ?> type="checkbox" value="1" name="innereu_<?php echo $vz['id']; ?>" id="innereu_<?php echo $vz['id']; ?>" />
51
                <?php echo (($vz['innereu'] == '1')?'checked="checked"':''); ?> type="checkbox" value="1" name="innereu_<?php echo $vz['id']; ?>" id="innereu_<?php echo $vz['id']; ?>" />
52
		</td>
52
		</td>
53
        <td class="col_shippingpreset">
53
        <td class="col_shippingpreset">
54
            <span id="vz_<?php echo $vz['id']; ?>_shippingpreset"><?php echo wpsg_hspc(wpsg_getStr($arShippingPreset[$vz['shippingpreset']], __('Kundenvoreinstellung', 'wpsg'))); ?></span>
54
            <span id="vz_<?php echo $vz['id']; ?>_shippingpreset"><?php echo $arShippingPreset[$vz['shippingpreset']]; ?></span>
55
            <script>
55
            <script>
56
                
56
                
57
                jQuery('#vz_<?php echo $vz['id']; ?>_shippingpreset').wpsg_editable('<?php
57
                jQuery('#vz_<?php echo $vz['id']; ?>_shippingpreset').wpsg_editable('<?php
58
					
58
					
59
						echo html_entity_decode(wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=vz&do=inlinedit&noheader=1', 'wpsg-admin-versandzonen-inline_edit-'.$vz['id']));
59
						echo html_entity_decode(wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=vz&do=inlinedit&noheader=1', 'wpsg-admin-versandzonen-inline_edit-'.$vz['id']));
60
					
60
					
61
					?>', {
61
					?>', {
62
					submitdata: { 
62
					submitdata: { 
63
			    		field: 'shippingpreset',
63
			    		field: 'shippingpreset',
64
			    		vz_id: '<?php echo $vz['id']; ?>'
64
			    		vz_id: '<?php echo $vz['id']; ?>'
65
					}, 				
65
					}, 				
66
                    data: <?php echo wpsg_prepare_for_inlineEdit($arShippingPreset); ?>,               
66
                    data: <?php echo wpsg_prepare_for_inlineEdit($arShippingPreset); ?>,               
67
                    type: 'select',
67
                    type: 'select',
68
					submit: '<?php echo __('Speichern', 'wpsg'); ?>',
68
					submit: '<?php echo __('Speichern', 'wpsg'); ?>',
69
					placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
69
					placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
70
					indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
70
					indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
71
			    	tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
71
			    	tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
72
                });
72
                });
73
                
73
                
74
            </script>
74
            </script>
75
        </td>
75
        </td>
76
		<td class="col_aktion">
76
		<td class="col_aktion">
77
						
77
						
78
			<a class="wpsg_icon_plzedit" href="#" title="<?php echo __('Versandzonen PLZ bearbeiten', 'wpsg'); ?>" onclick="return wpsg_editPLZ(<?php echo $vz['id']; ?>);">[ PLZ ]</a>
78
			<a class="wpsg_icon_plzedit" href="#" title="<?php echo __('Versandzonen PLZ bearbeiten', 'wpsg'); ?>" onclick="return wpsg_editPLZ(<?php echo $vz['id']; ?>);">[ PLZ ]</a>
79
			<a class="glyphicon glyphicon-trash" href="#" title="<?php echo __('Versandzone löschen', 'wpsg'); ?>" onclick="return wpsg_removeVZ(<?php echo $vz['id']; ?>);"></a>
79
			<a class="glyphicon glyphicon-trash" href="#" title="<?php echo __('Versandzone löschen', 'wpsg'); ?>" onclick="return wpsg_removeVZ(<?php echo $vz['id']; ?>);"></a>
80
			
80
			
81
			<script>
81
			<script>
82
 
82
 
83
				jQuery('#vz_<?php echo $vz['id']; ?>_name').wpsg_editable('<?php
83
				jQuery('#vz_<?php echo $vz['id']; ?>_name').wpsg_editable('<?php
84
					
84
					
85
						echo html_entity_decode(wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=vz&do=inlinedit&noheader=1', 'wpsg-admin-versandzonen-inline_edit-'.$vz['id']));
85
						echo html_entity_decode(wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=vz&do=inlinedit&noheader=1', 'wpsg-admin-versandzonen-inline_edit-'.$vz['id']));
86
					
86
					
87
					?>', {
87
					?>', {
88
					submitdata: { 
88
					submitdata: { 
89
			    		field: 'name',
89
			    		field: 'name',
90
			    		vz_id: '<?php echo $vz['id']; ?>'
90
			    		vz_id: '<?php echo $vz['id']; ?>'
91
					}, 					
91
					}, 					
92
					submit: '<?php echo __('Speichern', 'wpsg'); ?>',
92
					submit: '<?php echo __('Speichern', 'wpsg'); ?>',
93
					placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
93
					placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
94
					indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
94
					indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
95
			    	tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
95
			    	tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
96
				});
96
				});
97
			
97
			
98
				jQuery('#vz_<?php echo $vz['id']; ?>_value').wpsg_editable('<?php 
98
				jQuery('#vz_<?php echo $vz['id']; ?>_value').wpsg_editable('<?php 
99
					
99
					
100
						echo html_entity_decode(wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=vz&do=inlinedit&noheader=1', 'wpsg-admin-versandzonen-inline_edit-'.$vz['id'])); 
100
						echo html_entity_decode(wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=vz&do=inlinedit&noheader=1', 'wpsg-admin-versandzonen-inline_edit-'.$vz['id'])); 
101
										
101
										
102
					?>', {
102
					?>', {
103
					submitdata: { 
103
					submitdata: { 
104
			    		field: 'value',
104
			    		field: 'value',
105
			    		vz_id: '<?php echo $vz['id']; ?>'
105
			    		vz_id: '<?php echo $vz['id']; ?>'
106
					}, 					
106
					}, 					
107
					submit: '<?php echo __('Speichern', 'wpsg'); ?>',
107
					submit: '<?php echo __('Speichern', 'wpsg'); ?>',
108
					placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
108
					placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
109
					indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
109
					indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
110
			    	tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
110
			    	tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
111
				});
111
				});
112
 
112
 
113
			</script>
113
			</script>
114
		</td>
114
		</td>
115
	</tr>
115
	</tr>
116
	<?php } ?>
116
	<?php } ?>
117
	</tbody>
117
	</tbody>
118
</table>
118
</table>
119
 
119
 
120
<script type="text/javascript">/* <![CDATA[ */
120
<script type="text/javascript">/* <![CDATA[ */
121
 
121
 
122
	jQuery(document).ready(function() {
122
	jQuery(document).ready(function() {
123
 
123
 
124
		jQuery('.wpsg_innereu').bind('click', function() {
124
		jQuery('.wpsg_innereu').bind('click', function() {
125
 
125
 
126
			var checked = "0"; if (jQuery(this).prop("checked")) checked = "1";
126
			var checked = "0"; if (jQuery(this).prop("checked")) checked = "1";
127
 
127
 
128
			jQuery.ajax( {
128
			jQuery.ajax( {
129
				url: jQuery(this).data('url'),
129
				url: jQuery(this).data('url'),
130
				data: {
130
				data: {
131
					field: 'innereu',
131
					field: 'innereu',
132
					vz_id: jQuery(this).attr("id").substr(8),
132
					vz_id: jQuery(this).attr("id").substr(8),
133
					value: checked					
133
					value: checked					
134
				}
134
				}
135
			} ); 
135
			} ); 
136
			
136
			
137
		} );
137
		} );
138
		
138
		
139
	} );
139
	} );
140
 
140
 
141
/* ]]> */</script>
141
/* ]]> */</script>
142
 
142
 
143
<?php } ?>
143
<?php } ?>