Subversion Repositories wpShopGermany4

Rev

Rev 5382 | Rev 5720 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1422 daniel 1
<?php
2
 
3
	/**
4
	 * Template für die Liste der Bestellvariablen
5
	 */
6
 
7
?>
8
<?php if (is_array($this->view['data']) && sizeof($this->view['data']) > 0) { ?>
9
<table class="wpsg_ov_table">
10
	 <tr>
5382 daniel 11
	 	<th><?php echo __('ID', 'wpsg'); ?></th>
1422 daniel 12
    	<th class="wpsg_label"><?php echo __('Name', 'wpsg'); ?></th>
13
    	<th class="wpsg_typ"><?php echo __('Typ', 'wpsg'); ?></th>
14
    	<th class="wpsg_pflicht"><?php echo __('Pflicht', 'wpsg'); ?></th>
15
    	<th class="wpsg_delcol"></th>
16
  	</tr>
17
  	<?php $i = 0; foreach ($this->view['data'] as $ov) { $i ++; ?>
5382 daniel 18
	<tr class="wpsg_table wpsg_tablerow <?php echo (($i % 2 == 0)?'odd':'even'); ?>" id="ov_<?php echo $ov['id']; ?>">
1422 daniel 19
		<td class="wpsg_id"><?php echo $ov['id']; ?></td>
20
		<td id="wpsg_ov_name_<?php echo $ov['id']; ?>" class="wpsg_label wpsg_editable"><?php echo wpsg_hspc(__($ov['name'], 'wpsg')); ?></td>
21
		<td id="wpsg_ov_typ_<?php echo $ov['id']; ?>" class="wpsg_typ wpsg_editable"><?php echo $this->mod->arTypen[$ov['typ']]; ?></td>
22
		<td class="wpsg_pflicht"><input type="checkbox" <?php echo (($ov['pflicht'] == '1')?'checked="checked"':''); ?> id="wpsg_ov_pflicht_<?php echo $ov['id']; ?>" /></td>
23
		<td class="wpsg_delcol">
24
 
25
			<a class="wpsg_icon wpsg_icon_remove" href="#" title="<?php echo __('Bestellvariable löschen', 'wpsg'); ?>" onclick="return wpsg_removeOV(<?php echo $ov['id']; ?>);"></a>
26
 
27
			<script type="text/javascript">
28
 
5439 daniel 29
				jQuery('#wpsg_ov_name_<?php echo $ov['id']; ?>').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_ordervars&do=inlinedit&noheader=1', {
1422 daniel 30
					submitdata: {
31
						field: 'name',
32
						ov_id: '<?php echo $ov['id']; ?>'
33
					},
1598 daniel 34
					submit: '<?php echo __('Speichern', 'wpsg'); ?>',
1422 daniel 35
					placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
36
					indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
37
			    	tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
38
				});
39
 
40
				jQuery('#wpsg_ov_pflicht_<?php echo $ov['id']; ?>').bind('change', function() {
41
 
42
					jQuery.ajax( {
43
						url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_ordervars&noheader=1&do=inlinedit',
44
						data: {
45
							field: 'pflicht',
46
							ov_id: '<?php echo $ov['id']; ?>',
47
							value: ((jQuery(this).attr("checked") == "checked")?'1':'0')
48
						}
49
					} );
50
 
51
				} );
52
 
5439 daniel 53
				jQuery('#wpsg_ov_typ_<?php echo $ov['id']; ?>').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_ordervars&do=inlinedit&noheader=1', {
1422 daniel 54
					submitdata: {
55
						field: 'typ',
56
						ov_id: '<?php echo $ov['id']; ?>'
57
					},
1598 daniel 58
					submit: '<?php echo __('Speichern', 'wpsg'); ?>',
1422 daniel 59
					data: '<?php echo json_encode($this->mod->arTypen); ?>',
60
					type: 'select',
61
					placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
62
					indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
63
			    	tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
64
			    	callback: function(el) {
65
				    	if (el == '<?php echo __('Auswahl', 'wpsg'); ?>')
66
				    	{
67
					    	jQuery('#wpsg_ov_auswahlrow_<?php echo $ov['id']; ?>').show();
68
				    	}
69
				    	else
70
				    	{
71
				    		jQuery('#wpsg_ov_auswahlrow_<?php echo $ov['id']; ?>').hide();
72
				    	}
73
			    	}
74
				});
1738 david 75
 
76
				function wpsg_removeOV(id)
77
				{
78
					jQuery.ajax({
79
						url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_ordervars&noheader=1&do=del',
80
						data: {
81
							ov_id: id
82
						},
83
						success: function(data){
84
							if (data == 1)
85
							{
86
								location.reload();
87
							}
88
						}
89
					});
90
				}
1422 daniel 91
 
92
			</script>
93
 
94
		</td>
95
	</tr>
96
	<tr class="wpsg_tablerow <?php echo (($i % 2 == 0)?'odd':'even'); ?>" id="wpsg_ov_auswahlrow_<?php echo $ov['id']; ?>" style="<?php echo (($ov['typ'] != '1')?'display:none;':''); ?>">
97
		<td	class="wpsg_id"></td>
98
		<td class="wpsg_select" colspan="4">
99
			<?php echo __('Auswahl', 'wpsg'); ?>:
100
			<span class="wpsg_editable" id="wpsg_ov_auswahl_<?php echo $ov['id']; ?>"><?php echo wpsg_hspc($ov['auswahl']); ?></span>
101
			<script type="text/javascript">
102
 
5439 daniel 103
				jQuery('#wpsg_ov_auswahl_<?php echo $ov['id']; ?>').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_ordervars&do=inlinedit&noheader=1', {
1422 daniel 104
					submitdata: {
105
						field: 'auswahl',
106
						ov_id: '<?php echo $ov['id']; ?>'
107
					},
1598 daniel 108
					submit: '<?php echo __('Speichern', 'wpsg'); ?>',
1422 daniel 109
					placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
110
					indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
111
			    	tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
112
				});
113
 
114
			</script>
115
		</td>
116
	</tr>
117
	<?php } ?>
118
</table>
5382 daniel 119
<p class="wpsg_hinweis"><?php echo __('Die Reihenfolge lässt sich mittels Drag&Drop verändern.', 'wpsg'); ?>
120
 
121
<script type="text/javascript">/* <![CDATA[ */
122
 
123
	jQuery(document).ready(function() {
124
 
125
		jQuery('.wpsg_ov_table').sortable( {
126
			helper: wpsg_Tablefix,
127
			items: 'tr.wpsg_tablerow',
128
			handler: '.wpsg_id',
129
			update: function(event, ui) {
130
 
131
				var wpsg_reorder = jQuery(this).sortable('serialize');
132
 
133
				jQuery.ajax( {
134
					url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_ordervars&noheader=1&do=reorder',
135
					data: {
136
						wpsg_reorder: wpsg_reorder
137
					},
138
					success: function(data) {
139
 
140
						if (data !== "1") alert(data);
141
 
142
					}
143
				} );
144
 
145
			}
146
		} );
147
 
148
	} );
149
 
150
/* ]]> */</script>
151
 
1422 daniel 152
<?php } else { ?>
153
<?php echo __('Bisher noch keine Bestellvariablen angelegt.', 'wpsg'); ?>
154
<?php } ?>