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');
|
|
|
102 |
else echo __('Inaktiv', 'wpsg');
|
|
|
103 |
|
|
|
104 |
?></span>
|
|
|
105 |
<?php echo wpsg_drawForm_TextEnd(__('Wirkungsbereich', 'wpsg')); ?>
|
|
|
106 |
<script type="text/javascript">/* <![CDATA[ */
|
|
|
107 |
|
5934 |
hartmut |
108 |
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 |
109 |
type: 'select',
|
|
|
110 |
data: <?php echo wpsg_prepare_for_inlineEdit(array('0' => __('Inaktiv', 'wpsg'), '1' => __('Jede Bestellung', 'wpsg'), '2' => __('Bestimmte Produkte', 'wpsg'))); ?>,
|
5690 |
daniel |
111 |
submitdata: {
|
|
|
112 |
field: 'typ',
|
|
|
113 |
oc_id: '<?php echo $oc['id']; ?>'
|
|
|
114 |
}
|
|
|
115 |
});
|
|
|
116 |
|
|
|
117 |
/* ]]> */</script>
|
|
|
118 |
|
|
|
119 |
<?php echo wpsg_drawForm_TextStart(); ?>
|
|
|
120 |
<span class="wpsg_editable" id="oc_text_<?php echo $oc['id']; ?>"><?php echo wpsg_hspc($oc['text']); ?></span>
|
5877 |
hartmut |
121 |
<?php echo wpsg_drawForm_TextEnd(__('Bedingungstext', 'wpsg')); ?>
|
5690 |
daniel |
122 |
<script type="text/javascript">/* <![CDATA[ */
|
|
|
123 |
|
5934 |
hartmut |
124 |
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 |
125 |
submitdata: {
|
|
|
126 |
field: 'text',
|
|
|
127 |
oc_id: '<?php echo $oc['id']; ?>'
|
|
|
128 |
},
|
|
|
129 |
type: 'textarea'
|
|
|
130 |
});
|
|
|
131 |
|
|
|
132 |
/* ]]> */</script>
|
|
|
133 |
|
|
|
134 |
<?php echo wpsg_drawForm_TextStart(); ?>
|
|
|
135 |
<span class="wpsg_editable" id="oc_errortext_<?php echo $oc['id']; ?>"><?php echo wpsg_hspc($oc['errortext']); ?></span>
|
|
|
136 |
<?php echo wpsg_drawForm_TextEnd(__('Fehlertext', 'wpsg')); ?>
|
|
|
137 |
<script type="text/javascript">/* <![CDATA[ */
|
|
|
138 |
|
5934 |
hartmut |
139 |
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 |
140 |
submitdata: {
|
|
|
141 |
field: 'errortext',
|
|
|
142 |
oc_id: '<?php echo $oc['id']; ?>'
|
|
|
143 |
},
|
|
|
144 |
type: 'textarea'
|
|
|
145 |
});
|
|
|
146 |
|
|
|
147 |
/* ]]> */</script>
|
|
|
148 |
|
|
|
149 |
<?php if ($i == sizeof($this->view['wpsg_mod_ordercondition']['data'])) { ?><hr /><?php } ?>
|
1435 |
daniel |
150 |
|
1429 |
daniel |
151 |
</div>
|
|
|
152 |
|
|
|
153 |
<?php } ?>
|
|
|
154 |
<?php } ?>
|