Subversion Repositories wpShopGermany4

Rev

Rev 5439 | Rev 5748 | 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) { ?>
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
 
5720 daniel 28
                <a class="wpsg_icon wpsg_icon_remove" href="#" title="<?php echo __('Bestellvariable löschen', 'wpsg'); ?>" onclick="return wpsg_removeOV(<?php echo $ov['id']; ?>);"></a>
1422 daniel 29
 
5720 daniel 30
                <script type="text/javascript">
1422 daniel 31
 
5720 daniel 32
                    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', {
33
                        submitdata: {
34
                            field: 'name',
35
                            ov_id: '<?php echo $ov['id']; ?>'
36
                        },
37
                        submit: '<?php echo __('Speichern', 'wpsg'); ?>',
38
                        placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
39
                        indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
40
                        tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
41
                    });
1422 daniel 42
 
5720 daniel 43
                    jQuery('#wpsg_ov_pflicht_<?php echo $ov['id']; ?>').bind('change', function() {
1422 daniel 44
 
5720 daniel 45
                        jQuery.ajax( {
46
                            url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_ordervars&noheader=1&do=inlinedit',
47
                            data: {
48
                                field: 'pflicht',
49
                                ov_id: '<?php echo $ov['id']; ?>',
50
                                value: ((jQuery(this).attr("checked") == "checked")?'1':'0')
51
                            }
52
                        } );
1738 david 53
 
5720 daniel 54
                    } );
1422 daniel 55
 
5720 daniel 56
                    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', {
57
                        submitdata: {
58
                            field: 'typ',
59
                            ov_id: '<?php echo $ov['id']; ?>'
60
                        },
61
                        submit: '<?php echo __('Speichern', 'wpsg'); ?>',
62
                        data: '<?php echo json_encode($this->mod->arTypen); ?>',
63
                        type: 'select',
64
                        placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
65
                        indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
66
                        tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
67
                        callback: function(el) {
68
                            if (el == '<?php echo __('Auswahl', 'wpsg'); ?>')
69
                            {
70
                                jQuery('#wpsg_ov_auswahlrow_<?php echo $ov['id']; ?>').show();
71
                            }
72
                            else
73
                            {
74
                                jQuery('#wpsg_ov_auswahlrow_<?php echo $ov['id']; ?>').hide();
75
                            }
76
                        }
77
                    });
78
 
79
                    function wpsg_removeOV(id)
80
                    {
81
                        jQuery.ajax({
82
                            url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_ordervars&noheader=1&do=del',
83
                            data: {
84
                                ov_id: id
85
                            },
86
                            success: function(data){
87
                                if (data == 1)
88
                                {
89
                                    location.reload();
90
                                }
91
                            }
92
                        });
93
                    }
94
 
95
                </script>
96
 
97
            </td>
98
        </tr>
99
        <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;':''); ?>">
100
            <td	class="wpsg_id"></td>
101
            <td class="wpsg_select" colspan="4">
102
                <?php echo __('Auswahl', 'wpsg'); ?>:
103
                <span class="wpsg_editable" id="wpsg_ov_auswahl_<?php echo $ov['id']; ?>"><?php echo wpsg_hspc($ov['auswahl']); ?></span>
104
                <script type="text/javascript">
105
 
106
                    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', {
107
                        submitdata: {
108
                            field: 'auswahl',
109
                            ov_id: '<?php echo $ov['id']; ?>'
110
                        },
111
                        submit: '<?php echo __('Speichern', 'wpsg'); ?>',
112
                        placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
113
                        indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
114
                        tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
115
                    });
116
 
117
                </script>
118
            </td>
119
        </tr>
120
    </tbody>
1422 daniel 121
	<?php } ?>
122
</table>
5382 daniel 123
<p class="wpsg_hinweis"><?php echo __('Die Reihenfolge lässt sich mittels Drag&Drop verändern.', 'wpsg'); ?>
124
 
125
<script type="text/javascript">/* <![CDATA[ */
126
 
127
	jQuery(document).ready(function() {
128
 
129
		jQuery('.wpsg_ov_table').sortable( {
130
			helper: wpsg_Tablefix,
5720 daniel 131
			items: 'tbody',
5382 daniel 132
			handler: '.wpsg_id',
133
			update: function(event, ui) {
134
 
135
				var wpsg_reorder = jQuery(this).sortable('serialize');
136
 
137
				jQuery.ajax( {
138
					url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_ordervars&noheader=1&do=reorder',
139
					data: {
140
						wpsg_reorder: wpsg_reorder
141
					},
142
					success: function(data) {
143
 
144
						if (data !== "1") alert(data);
145
 
146
					}
147
				} );
148
 
149
			}
150
		} );
151
 
152
	} );
153
 
154
/* ]]> */</script>
155
 
1422 daniel 156
<?php } else { ?>
157
<?php echo __('Bisher noch keine Bestellvariablen angelegt.', 'wpsg'); ?>
158
<?php } ?>