1067 |
daniel |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/**
|
|
|
4 |
* Template für die Verwaltung der Versandzonen
|
|
|
5 |
*/
|
|
|
6 |
|
|
|
7 |
?>
|
|
|
8 |
|
5532 |
daniel |
9 |
<div class="wpsg_admin_submenu">
|
|
|
10 |
|
|
|
11 |
<div class="list-group">
|
|
|
12 |
<span class="list-group-head list-group-item"><?php echo __('Konfiguration'); ?></span>
|
|
|
13 |
<?php foreach ($this->view['arSubAction'] as $k => $v) { ?>
|
|
|
14 |
<a class="list-group-item <?php echo (($k == $this->view['subAction'])?'active':''); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=<?php echo $k; ?>"><?php echo $v['Menutext']; ?></a>
|
|
|
15 |
<?php } ?>
|
|
|
16 |
</div>
|
|
|
17 |
|
|
|
18 |
</div>
|
|
|
19 |
|
|
|
20 |
<div class="wpsg_admin_content form-horizontal">
|
|
|
21 |
|
|
|
22 |
<?php echo wpsg_drawForm_AdminboxStart(__('Versandzonen', 'wpsg')); ?>
|
|
|
23 |
|
|
|
24 |
<span id="wpsg_vz_list"><?php $this->view['adminController']->vz_listAction(); ?></span>
|
|
|
25 |
|
6306 |
hartmut |
26 |
<a href="#" onclick="return wpsg_addVZ();"><span class="wpsg-glyphicon glyphicon glyphicon-plus"></span><?php echo __('Neue Versandzone anlegen.', 'wpsg'); ?></a><br />
|
|
|
27 |
<br />
|
5532 |
daniel |
28 |
<a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=laender"><span class="wpsg-glyphicon glyphicon glyphicon-wrench"></span><?php echo __('Zur Länderverwaltung', 'wpsg'); ?></a>
|
|
|
29 |
|
|
|
30 |
<?php echo wpsg_drawForm_AdminboxEnd(); ?>
|
|
|
31 |
|
|
|
32 |
</div>
|
|
|
33 |
|
7560 |
daniel |
34 |
<script>
|
5532 |
daniel |
35 |
|
1067 |
daniel |
36 |
/**
|
6306 |
hartmut |
37 |
* Wird aufgerufen um einen neuen Satz hinzu zufügen und die Liste neu zu laden.
|
1067 |
daniel |
38 |
*/
|
|
|
39 |
function wpsg_addVZ()
|
|
|
40 |
{
|
|
|
41 |
|
6306 |
hartmut |
42 |
jQuery('#wpsg_vz_list').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" /><br />');
|
1067 |
daniel |
43 |
|
|
|
44 |
jQuery.ajax( {
|
7560 |
daniel |
45 |
url: '<?php
|
|
|
46 |
|
|
|
47 |
echo html_entity_decode(wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=vz&do=add&noheader=1', 'wpsg-admin-versandzonen-add'));
|
|
|
48 |
|
|
|
49 |
?>',
|
1067 |
daniel |
50 |
success: function(data) {
|
|
|
51 |
jQuery('#wpsg_vz_list').html(data);
|
|
|
52 |
}
|
|
|
53 |
} );
|
|
|
54 |
|
|
|
55 |
return false;
|
|
|
56 |
|
|
|
57 |
} // function wpsg_addVZ()
|
|
|
58 |
|
|
|
59 |
/**
|
|
|
60 |
* Wird aufgerufen wenn eine Versandzone gelöscht werden soll
|
|
|
61 |
*/
|
|
|
62 |
function wpsg_removeVZ(vz_id)
|
|
|
63 |
{
|
|
|
64 |
|
6306 |
hartmut |
65 |
if (!confirm('<?php echo __('Sind Sie sich sicher, dass Sie diese Versandzone löschen möchten?', 'wpsg'); ?>')) return false;
|
1067 |
daniel |
66 |
|
6306 |
hartmut |
67 |
jQuery('#wpsg_vz_list').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" /><br />');
|
1067 |
daniel |
68 |
|
|
|
69 |
jQuery.ajax( {
|
7560 |
daniel |
70 |
url: '<?php
|
|
|
71 |
|
|
|
72 |
echo html_entity_decode(wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=vz&do=remove&noheader=1', 'wpsg-admin-versandzonen-delete'));
|
|
|
73 |
|
|
|
74 |
?>',
|
1067 |
daniel |
75 |
data: {
|
|
|
76 |
vz_id: vz_id
|
|
|
77 |
},
|
|
|
78 |
success: function(data) {
|
|
|
79 |
jQuery('#wpsg_vz_list').html(data);
|
|
|
80 |
}
|
|
|
81 |
} );
|
|
|
82 |
|
|
|
83 |
return false;
|
|
|
84 |
|
|
|
85 |
} // function wpsg_removeVZ(vz_id)
|
|
|
86 |
|
7560 |
daniel |
87 |
function wpsg_editPLZ(vz_id) {
|
|
|
88 |
|
2946 |
david |
89 |
jQuery('#vz_' + vz_id + '_plz').attr('style', 'display:display');
|
|
|
90 |
|
|
|
91 |
return false;
|
|
|
92 |
}
|
|
|
93 |
|
7560 |
daniel |
94 |
function wpsg_savePLZ(vz_id) {
|
2946 |
david |
95 |
|
|
|
96 |
jQuery.ajax( {
|
7560 |
daniel |
97 |
url: '<?php
|
|
|
98 |
|
|
|
99 |
echo html_entity_decode(wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=vz&do=save_plz&noheader=1', 'wpsg-admin-versandzonen-save_plz'));
|
|
|
100 |
|
|
|
101 |
?>',
|
2946 |
david |
102 |
data: {
|
|
|
103 |
vz_id: vz_id,
|
2949 |
daniel |
104 |
textarea: jQuery('#vz_' + vz_id + '_plz textarea').val()
|
2946 |
david |
105 |
},
|
|
|
106 |
success: function(data) {
|
2949 |
daniel |
107 |
jQuery('#vz_' + vz_id + '_plz').attr('style', 'display:none');
|
2946 |
david |
108 |
}
|
|
|
109 |
} );
|
|
|
110 |
|
|
|
111 |
return false;
|
2949 |
daniel |
112 |
|
2946 |
david |
113 |
}
|
|
|
114 |
|
7560 |
daniel |
115 |
function wpsg_loadStandard() {
|
2656 |
daniel |
116 |
|
|
|
117 |
if (!confirm('<?php echo __('Sind Sie sich sicher, dass sie die Standard Versandzonen und Länder laden möchten? Die alten Versandzonen und Länder gehen verloren.', 'wpsg'); ?>')) return false;
|
|
|
118 |
|
|
|
119 |
jQuery('#wpsg_vz_list').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
|
|
|
120 |
|
|
|
121 |
jQuery.ajax( {
|
7560 |
daniel |
122 |
url: '<?php
|
|
|
123 |
|
|
|
124 |
echo html_entity_decode(wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=vz&do=loadStandard&noheader=1', 'wpsg-admin-versandzonen-loadStandard'));
|
|
|
125 |
|
|
|
126 |
?>',
|
2656 |
daniel |
127 |
success: function(data) {
|
|
|
128 |
jQuery('#wpsg_vz_list').html(data);
|
|
|
129 |
}
|
|
|
130 |
} );
|
|
|
131 |
|
|
|
132 |
return false;
|
|
|
133 |
|
|
|
134 |
} // function wpsg_loadStandard()
|
|
|
135 |
|
7560 |
daniel |
136 |
</script>
|