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