1067 |
daniel |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/**
|
|
|
4 |
* Template für die erweiteren Kundendaten
|
|
|
5 |
*/
|
|
|
6 |
|
|
|
7 |
?>
|
5439 |
daniel |
8 |
|
4194 |
daniel |
9 |
<?php if (wpsg_isSizedArray($this->view['pflicht']['custom'])) { ?>
|
5439 |
daniel |
10 |
<div id="wpsg_kv_code_dialog" style="display:none;"><div class="wpsg_dialog"></div></div>
|
1126 |
daniel |
11 |
|
5439 |
daniel |
12 |
<table class="wpsg_customfields table">
|
|
|
13 |
<thead>
|
|
|
14 |
<tr>
|
|
|
15 |
<th class="col0"><?php echo __('Index', 'wpsg'); ?></th>
|
|
|
16 |
<th class="col1"><?php echo __('Kundenvariablen', 'wpsg'); ?></th>
|
|
|
17 |
<th class="col2"><?php echo __('Pflichtfeld', 'wpsg'); ?></th>
|
|
|
18 |
<th class="col3"><?php echo __('Typ', 'wpsg'); ?></th>
|
|
|
19 |
<th class="col4"></th>
|
|
|
20 |
<th class="col5">
|
|
|
21 |
<a href="#" title="<?php echo __('Neue Kundenvariable anlegen', 'wpsg'); ?>" onclick="return wpsg_addCustomField();" class="customer_variable_add"><span class="glyphicon glyphicon-plus"></span></a>
|
|
|
22 |
</th>
|
|
|
23 |
</tr>
|
|
|
24 |
</thead>
|
|
|
25 |
<tbody>
|
|
|
26 |
<?php foreach ($this->view['pflicht']['custom'] as $c_id => $c) { ?>
|
|
|
27 |
<tr class="wpsg_customervar_row_<?php echo $c_id; ?>">
|
|
|
28 |
<td class="col0"><?php echo $c_id; ?></td>
|
|
|
29 |
<td class="col2"><span class="wpsg_editable" id="kundenvariable_name_<?php echo $c_id; ?>"><?php echo wpsg_hspc($c['name']); ?></span></td>
|
|
|
30 |
<td class="col3">
|
|
|
31 |
<select class="form-control wpsg-sm" name="pflicht[custom][<?php echo $c_id; ?>][show]">
|
|
|
32 |
<option <?php echo (($c['show'] == '0')?'selected="selected"':''); ?> value="0"><?php echo __('Ja', 'wpsg'); ?></option>
|
|
|
33 |
<option <?php echo (($c['show'] == '1')?'selected="selected"':''); ?> value="1"><?php echo __('Nein', 'wpsg'); ?></option>
|
|
|
34 |
<option <?php echo (($c['show'] == '2')?'selected="selected"':''); ?> value="2"><?php echo __('Nicht zeigen', 'wpsg'); ?></option>
|
|
|
35 |
</select>
|
|
|
36 |
</td>
|
|
|
37 |
<td class="col3">
|
|
|
38 |
<select class="form-control wpsg-sm" onchange="if (jQuery(this).val() == '1') jQuery('#row_auswahl_<?php echo $c_id; ?>').show(); else jQuery('#row_auswahl_<?php echo $c_id; ?>').hide();" name="pflicht[custom][<?php echo $c_id; ?>][typ]">
|
|
|
39 |
<option <?php echo (($c['typ'] == '0')?'selected="selected"':''); ?> value="0"><?php echo __('Textfeld', 'wpsg'); ?></option>
|
|
|
40 |
<option <?php echo (($c['typ'] == '1')?'selected="selected"':''); ?> value="1"><?php echo __('Auswahlfeld', 'wpsg'); ?></option>
|
|
|
41 |
<option <?php echo (($c['typ'] == '2')?'selected="selected"':''); ?> value="2"><?php echo __('Checkbox', 'wpsg'); ?></option>
|
|
|
42 |
</select>
|
|
|
43 |
</td>
|
|
|
44 |
<td class="col4">
|
|
|
45 |
<a href="#" title="<?php echo __('HTML Code generieren', 'wpsg'); ?>" onclick="return wpsg_genKVCode(<?php echo $c_id; ?>);"><span class="glyphicon glyphicon-modal-window"></span></a>
|
|
|
46 |
</td>
|
|
|
47 |
<td class="col5">
|
|
|
48 |
|
|
|
49 |
<a href="#" title="<?php echo __('Kundenvariable löschen', 'wpsg'); ?>" onclick="return wpsg_removeCustomField(<?php echo $c_id; ?>);"><span class="glyphicon glyphicon-trash"></span></a>
|
|
|
50 |
|
|
|
51 |
<script type="text/javascript">
|
1126 |
daniel |
52 |
|
5439 |
daniel |
53 |
jQuery('#kundenvariable_name_<?php echo $c_id; ?>').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=kundendaten&do=inlinedit&noheader=1', {
|
|
|
54 |
submitdata: {
|
|
|
55 |
field: 'name',
|
|
|
56 |
field_id: '<?php echo $c_id; ?>'
|
|
|
57 |
},
|
|
|
58 |
submit : '<?php echo __('Speichern', 'wpsg'); ?>',
|
|
|
59 |
placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
|
|
|
60 |
indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
|
|
|
61 |
tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
|
|
|
62 |
});
|
|
|
63 |
|
|
|
64 |
|
|
|
65 |
</script>
|
|
|
66 |
|
|
|
67 |
</td>
|
|
|
68 |
</tr>
|
|
|
69 |
<tr class="wpsg_customervar_row_<?php echo $c_id; ?>" id="row_auswahl_<?php echo $c_id; ?>" style="<?php echo (($c['typ'] == '1')?'':'display:none;'); ?>">
|
|
|
70 |
<td class="col0"></td>
|
|
|
71 |
<td class="col1"><?php echo __('Auswahlmöglichkeiten ("|" als Trenner)', 'wpsg'); ?></td>
|
|
|
72 |
<td class="col2345" colspan="4">
|
|
|
73 |
<input type="text" class="form-control wpsg-sm" name="pflicht[custom][<?php echo $c_id; ?>][auswahl]" value="<?php echo wpsg_hspc($c['auswahl']); ?>" />
|
|
|
74 |
</td>
|
|
|
75 |
</tr>
|
|
|
76 |
<?php } ?>
|
|
|
77 |
</tbody>
|
|
|
78 |
</table>
|
|
|
79 |
|
|
|
80 |
|
|
|
81 |
<script type="text/javascript">/* <![CDATA[ */
|
|
|
82 |
|
1126 |
daniel |
83 |
/**
|
|
|
84 |
* Zeigt den HTML Code, der die gewählte Kundenvariablen in die Templates einbaut
|
|
|
85 |
*/
|
1606 |
daniel |
86 |
function wpsg_genKVCode(kv_id)
|
1126 |
daniel |
87 |
{
|
1606 |
daniel |
88 |
|
|
|
89 |
jQuery("#wpsg_kv_code_dialog").dialog( {
|
1126 |
daniel |
90 |
'dialogClass': 'wp-dialog',
|
|
|
91 |
'modal': true,
|
1667 |
daniel |
92 |
'width': 700,
|
|
|
93 |
'height': 300,
|
1126 |
daniel |
94 |
'title': '<?php echo __('HTML Code Block', 'wpsg'); ?>',
|
|
|
95 |
open: function(event, ui) {
|
|
|
96 |
|
1606 |
daniel |
97 |
jQuery('#wpsg_kv_code_dialog .wpsg_dialog').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
|
|
|
98 |
|
1126 |
daniel |
99 |
jQuery.ajax( {
|
1606 |
daniel |
100 |
url: 'admin.php?page=wpsg-Admin&subaction=kundendaten&noheader=1&show=code',
|
1126 |
daniel |
101 |
data: {
|
1606 |
daniel |
102 |
'kv_id': kv_id
|
1126 |
daniel |
103 |
},
|
|
|
104 |
success: function(data)
|
|
|
105 |
{
|
1606 |
daniel |
106 |
|
|
|
107 |
jQuery('#wpsg_kv_code_dialog .wpsg_dialog').html(data);
|
1594 |
david |
108 |
|
1126 |
daniel |
109 |
}
|
|
|
110 |
} );
|
|
|
111 |
|
|
|
112 |
}
|
|
|
113 |
} );
|
|
|
114 |
|
|
|
115 |
return false;
|
|
|
116 |
|
|
|
117 |
} // function wpsg_genPACode(pa_id)
|
|
|
118 |
|
5439 |
daniel |
119 |
/* ]]> */</script>
|
1126 |
daniel |
120 |
|
1067 |
daniel |
121 |
<br />
|
5439 |
daniel |
122 |
<?php echo wpsg_drawForm_Checkbox('wpsg_kundenvariablen_show', __('Kundenvariablen direkt abfragen', 'wpsg'), $this->get_option('wpsg_kundenvariablen_show'), array('fullWidth' => true)); ?>
|
1067 |
daniel |
123 |
<?php } else { ?>
|
|
|
124 |
<p><?php echo __('Keine benutzerdefinierten Kundenfelder angelegt.', 'wpsg'); ?>
|
|
|
125 |
<?php } ?>
|