Subversion Repositories wpShopGermany4

Rev

Rev 8135 | Details | Compare with Previous | Last modification | View Log | RSS feed

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