Subversion Repositories wpShopGermany4

Rev

Rev 6244 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1429 daniel 1
<?php
2
 
3
	/**
4
	 * Template für die Liste der Bestellbedingungen im Backend
5
	 */
6
 
7
?>
1435 daniel 8
<script type="text/javascript">/* <![CDATA[ */
9
 
10
	jQuery(document).ready(function() {
5690 daniel 11
	/*
1435 daniel 12
		jQuery('.wpsg_mod_ordercondition_edit_name').each(function() {
13
 
14
			var oc_id = jQuery(this).attr("id").replace(/wpsg_mod_ordercondition_name_/, '');
15
 
5934 hartmut 16
			jQuery(this).wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_ordercondition&do=inlinedit&noheader=1', {
1435 daniel 17
				submitdata: {
18
		    		field: 'name',
19
		    		oc_id: oc_id
20
				},
21
				submit: '<?php echo __('Speichern', 'wpsg'); ?>',
22
				placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
23
				indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
24
		    	tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
25
			} );
26
 
27
		} );
28
 
29
		jQuery('.wpsg_mod_ordercondition_edit_typ').bind('change', function() {
30
 
31
			var oc_id = jQuery(this).attr("id").replace(/wpsg_mod_ordercondition_typ_/, '');
32
			var value = jQuery(this).val();
33
 
34
			jQuery.ajax( {
35
				url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_ordercondition&do=inlinedit&noheader=1',
36
				data: {
37
					field: 'typ',
38
					value: value,
39
					oc_id: oc_id
40
				}
41
			} );
42
 
43
		} );
5690 daniel 44
	*/
45
 
46
		jQuery('.wpsg_oc_removeLink').bind('click', function() {
1435 daniel 47
 
48
			if (!confirm('<?php echo __('Sind Sie sich sicher, dass sie diese Bestellbedingung entfernen möchten?', 'wpsg'); ?>')) return false;
49
 
50
			jQuery('#wpsg_oc_list').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
51
 
52
			jQuery.ajax( {
53
				url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_ordercondition&do=remove&noheader=1',
54
				data: {
5690 daniel 55
					oc_id: jQuery(this).attr("data-id")
1435 daniel 56
				},
57
				success: function(data)
58
				{
59
 
60
					jQuery('#wpsg_oc_list').html(data);
61
 
62
				}
63
			} );
64
 
65
		} );
66
 
67
	} );
68
 
69
/* ]]> */</script>
1429 daniel 70
<?php if (!is_array($this->view['wpsg_mod_ordercondition']['data']) || sizeof($this->view['wpsg_mod_ordercondition']['data']) <= 0) { ?>
71
<?php echo __('Bisher keine Bestellbedingungen angelegt.', 'wpsg'); ?>
72
<?php } else { ?>
73
<?php $i = 0; foreach ($this->view['wpsg_mod_ordercondition']['data'] as $oc) { $i ++; ?>
5690 daniel 74
 
75
    <hr />
76
 
1435 daniel 77
	<div id="wpsg_mod_ordercondition_row_<?php echo $oc['id']; ?>">
1429 daniel 78
 
5690 daniel 79
        <?php echo wpsg_drawForm_TextStart(); ?>
80
        <?php echo $oc['id']; ?><a data-id="<?php echo $oc['id']; ?>" class="wpsg_oc_removeLink" href="#"><span class="wpsg-glyphicon glyphicon glyphicon-trash"></span></a>
81
        <?php echo wpsg_drawForm_TextEnd(__('ID', 'wpsg')); ?>
82
 
83
        <?php echo wpsg_drawForm_TextStart(); ?>
84
        <span id="oc_name_<?php echo $oc['id']; ?>"><?php echo $oc['name']; ?></span>
85
        <?php echo wpsg_drawForm_TextEnd(__('Bezeichnung', 'wpsg')); ?>
86
        <script type="text/javascript">/* <![CDATA[ */
87
 
5934 hartmut 88
            jQuery('#oc_name_<?php echo $oc['id']; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_ordercondition&do=inlinedit&noheader=1', {
5690 daniel 89
                submitdata: {
90
                    field: 'name',
91
                    oc_id: '<?php echo $oc['id']; ?>'
92
                }
93
            });
94
 
95
        /* ]]> */</script>
96
 
97
        <?php echo wpsg_drawForm_TextStart(); ?>
98
        <span id="oc_typ_<?php echo $oc['id']; ?>"><?php
99
 
100
            if ($oc['typ'] == '1') echo __('Jede Bestellung', 'wpsg');
101
            else if ($oc['typ'] == '2') echo __('Bestimmte Produkte', 'wpsg');
6244 daniel 102
            else if ($oc['typ'] == '3') echo __('Bestimmte Versandarten', 'wpsg');
5690 daniel 103
            else echo __('Inaktiv', 'wpsg');
104
 
105
        ?></span>
106
        <?php echo wpsg_drawForm_TextEnd(__('Wirkungsbereich', 'wpsg')); ?>
107
        <script type="text/javascript">/* <![CDATA[ */
108
 
5934 hartmut 109
            jQuery('#oc_typ_<?php echo $oc['id']; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_ordercondition&do=inlinedit&noheader=1', {
5997 hartmut 110
                type: 'select',
6244 daniel 111
                data: <?php echo wpsg_prepare_for_inlineEdit(array('0' => __('Inaktiv', 'wpsg'), '1' => __('Jede Bestellung', 'wpsg'), '2' => __('Bestimmte Produkte', 'wpsg'), '3' => __('Bestimmte Versandarten'))); ?>,
5690 daniel 112
                submitdata: {
113
                    field: 'typ',
114
                    oc_id: '<?php echo $oc['id']; ?>'
6244 daniel 115
                },
116
                callback: function(e, params) {
117
 
118
                    if (params == 3) jQuery('.wpsg_mod_ordercondition_shipping_<?php echo $oc['id']; ?>').show();
119
                    else jQuery('.wpsg_mod_ordercondition_shipping_<?php echo $oc['id']; ?>').hide();
120
 
5690 daniel 121
                }
122
            });
123
 
124
        /* ]]> */</script>
125
 
126
        <?php echo wpsg_drawForm_TextStart(); ?>
127
        <span class="wpsg_editable" id="oc_text_<?php echo $oc['id']; ?>"><?php echo wpsg_hspc($oc['text']); ?></span>
5877 hartmut 128
        <?php echo wpsg_drawForm_TextEnd(__('Bedingungstext', 'wpsg')); ?>
5690 daniel 129
        <script type="text/javascript">/* <![CDATA[ */
130
 
5934 hartmut 131
            jQuery('#oc_text_<?php echo $oc['id']; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_ordercondition&do=inlinedit&noheader=1', {
5690 daniel 132
                submitdata: {
133
                    field: 'text',
134
                    oc_id: '<?php echo $oc['id']; ?>'
135
                },
136
                type: 'textarea'
137
            });
138
 
139
        /* ]]> */</script>
140
 
141
        <?php echo wpsg_drawForm_TextStart(); ?>
142
        <span class="wpsg_editable" id="oc_errortext_<?php echo $oc['id']; ?>"><?php echo wpsg_hspc($oc['errortext']); ?></span>
143
        <?php echo wpsg_drawForm_TextEnd(__('Fehlertext', 'wpsg')); ?>
144
        <script type="text/javascript">/* <![CDATA[ */
145
 
5934 hartmut 146
            jQuery('#oc_errortext_<?php echo $oc['id']; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_ordercondition&do=inlinedit&noheader=1', {
5690 daniel 147
                submitdata: {
148
                    field: 'errortext',
149
                    oc_id: '<?php echo $oc['id']; ?>'
150
                },
151
                type: 'textarea'
152
            });
153
 
154
        /* ]]> */</script>
6244 daniel 155
 
6267 hartmut 156
        <div class="wpsg_mod_ordercondition_shipping_<?php echo $oc['id']; ?>" style="display:<?php echo (($oc['typ'] === '3')?'block':'none'); ?>;">
6244 daniel 157
            <?php echo wpsg_drawForm_TextStart(); ?>
158
            <span class="wpsg_editable" id="oc_shipping_<?php echo $oc['id']; ?>"><?php
159
 
160
                foreach (wpsg_trim(explode(',', $oc['shipping'])) as $shipping_id)
161
                {
162
 
163
                    if (array_key_exists($shipping_id, $this->view['arShipping'])) echo $this->view['arShipping'][$shipping_id].'<br />';
164
 
165
                }
166
 
167
            ?></span>
168
            <?php echo wpsg_drawForm_TextEnd(__('Versandartenauswahl', 'wpsg')); ?>
169
            <script type="text/javascript">/* <![CDATA[ */
170
 
171
                jQuery('#oc_shipping_<?php echo $oc['id']; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_ordercondition&do=inlinedit&noheader=1', {
172
                    submitdata: {
173
                        field: 'shipping',
174
                        oc_id: '<?php echo $oc['id']; ?>'
175
                    },
176
                    data: <?php echo json_encode($this->view['arShipping']); ?>,
177
                    value: <?php echo json_encode(wpsg_trim(explode(',', $oc['shipping']))); ?>,
178
                    type: 'checklist'
179
                });
180
 
181
            /* ]]> */</script>
182
        </div>
183
 
5690 daniel 184
		<?php if ($i == sizeof($this->view['wpsg_mod_ordercondition']['data'])) { ?><hr /><?php } ?>
1435 daniel 185
 
1429 daniel 186
	</div>
187
 
188
<?php } ?>
189
<?php } ?>