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