5896 |
daniel |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/**
|
|
|
4 |
* User: Daschmi (daschmi@daschmi.de)
|
|
|
5 |
* Date: 03.11.2016
|
|
|
6 |
* Time: 14:12
|
|
|
7 |
*/
|
|
|
8 |
|
|
|
9 |
$inlineEdit_url = WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_export&do=inlinedit&noheader=1&profil_id='.$this->view['profil']['id'];
|
|
|
10 |
|
|
|
11 |
?>
|
|
|
12 |
<table class="table table-body-striped" id="wpsg_mod_export_fieldtable">
|
|
|
13 |
<thead>
|
|
|
14 |
<tr>
|
|
|
15 |
<th class="wpsg_mod_export_col_name"><?php echo __('Spaltenname', 'wpsg'); ?></th>
|
|
|
16 |
<th class="wpsg_mod_export_col_value"><?php echo __('Wert', 'wpsg'); ?></th>
|
|
|
17 |
<th class="wpsg_mod_export_col_format"><?php echo __('Format', 'wpsg'); ?></th>
|
5911 |
daniel |
18 |
|
|
|
19 |
<th style="display:<?php echo (($this->view['profil']['format'] == wpsg_mod_export::FORMAT_XML)?'table-cell':'none'); ?>;" title="<?php echo __('Feld im XML als Attribut exportieren', 'wpsg'); ?>" class="wpsg_mod_export_format wpsg_mod_export_format_<?php echo wpsg_mod_export::FORMAT_XML; ?> wpsg_mod_export_col_att"><?php echo __('Att'); ?></th>
|
|
|
20 |
<th style="display:<?php echo (($this->view['profil']['format'] != wpsg_mod_export::FORMAT_XML)?'table-cell; padding:0px':'none'); ?>;" class="wpsg_mod_export_format wpsg_mod_export_format_<?php echo wpsg_mod_export::FORMAT_CSV; ?>"> </th>
|
|
|
21 |
|
5896 |
daniel |
22 |
<th class="wpsg_mod_export_col_remove">
|
|
|
23 |
|
|
|
24 |
<a style="float:right;" onclick="return wpsg_mod_export_addField(<?php echo $this->view['profil']['id']; ?>);" title="<?php echo __('Neues Feld einfügen', 'wpsg'); ?>" href="#" class="glyphicon glyphicon-plus"></a>
|
|
|
25 |
|
|
|
26 |
</th>
|
|
|
27 |
</tr>
|
|
|
28 |
</thead>
|
|
|
29 |
|
|
|
30 |
<?php $i = 0; foreach ((array)$this->view['profil']['fields'] as $f_id => $f) { $i ++; ?>
|
|
|
31 |
<tbody id="field_<?php echo $f_id; ?>">
|
|
|
32 |
<tr class="wpsg_tablerow wpsg_mod_export_row1 wpsg_mod_export_fieldrow_<?php echo $f_id; ?> <?php echo (($i % 2 == 0)?'odd':'even'); ?>">
|
|
|
33 |
|
|
|
34 |
<td class="wpsg_mod_export_col">
|
|
|
35 |
<div class="name wpsg_editable" id="field_name_<?php echo $f_id; ?>"><?php echo $f['name']; ?></div>
|
|
|
36 |
</td>
|
|
|
37 |
<td class="wpsg_mod_export_col_field"><div class="wpsg_editable" id="field_typ_<?php echo $f_id; ?>"><?php
|
|
|
38 |
|
|
|
39 |
foreach ($this->view['fields'] as $fieldgroup)
|
|
|
40 |
{
|
|
|
41 |
|
|
|
42 |
foreach ($fieldgroup['fields'] as $field_key => $field)
|
|
|
43 |
{
|
|
|
44 |
|
|
|
45 |
if ($field_key == $f['value_key'])
|
|
|
46 |
{
|
|
|
47 |
|
|
|
48 |
echo $field;
|
|
|
49 |
|
|
|
50 |
}
|
|
|
51 |
|
|
|
52 |
}
|
|
|
53 |
|
|
|
54 |
}
|
|
|
55 |
|
|
|
56 |
?></div></td>
|
|
|
57 |
<td class="wpsg_mod_export_col_format">
|
|
|
58 |
|
|
|
59 |
<div class="wpsg_editable" id="field_format_<?php echo $f_id; ?>"><?php echo $this->view['arFieldFormats'][$f['format']]; ?></div>
|
|
|
60 |
|
5911 |
daniel |
61 |
</td>
|
|
|
62 |
|
|
|
63 |
<td style="display:<?php echo (($this->view['profil']['format'] == wpsg_mod_export::FORMAT_XML)?'table-cell':'none'); ?>;" class="wpsg_mod_export_col_att wpsg_mod_export_format wpsg_mod_export_format_<?php echo wpsg_mod_export::FORMAT_XML; ?>">
|
|
|
64 |
|
|
|
65 |
<input type="checkbox" onchange="wpsg_mod_export_setAtt(this, <?php echo $f['id']; ?>);" value="1" <?php echo ((wpsg_isSizedInt($f['xml_att']))?'checked="checked"':''); ?> />
|
|
|
66 |
|
5896 |
daniel |
67 |
</td>
|
5911 |
daniel |
68 |
<td style="display:<?php echo (($this->view['profil']['format'] != wpsg_mod_export::FORMAT_XML)?'table-cell; padding:0px':'none'); ?>;" class="wpsg_mod_export_format wpsg_mod_export_format_<?php echo wpsg_mod_export::FORMAT_CSV; ?>"> </td>
|
|
|
69 |
|
5896 |
daniel |
70 |
<td>
|
|
|
71 |
|
|
|
72 |
<a style="float:right;" onclick="return wpsg_mod_export_removeField(<?php echo $f_id; ?>);" title="<?php echo __('Feld löschen', 'wpsg'); ?>" href="#" class="glyphicon glyphicon-trash"></a>
|
|
|
73 |
|
|
|
74 |
</td>
|
|
|
75 |
|
|
|
76 |
</tr>
|
|
|
77 |
<tr id="userformatrow_<?php echo $f_id; ?>" style="<?php echo (($f['format'] != 700)?'display:none;':''); ?>" class="wpsg_mod_export_row2 wpsg_tablerow wpsg_mod_export_fieldrow_<?php echo $f_id; ?> <?php echo (($i % 2 == 0)?'odd':'even'); ?>">
|
5911 |
daniel |
78 |
<td class="wpsg_mod_export_col_format_user" colspan="4">
|
5896 |
daniel |
79 |
|
|
|
80 |
<?php echo __('Format', 'wpsg'); ?>:
|
|
|
81 |
|
|
|
82 |
<div class="wpsg_editable" id="field_userformat_<?php echo $f_id; ?>"><?php echo wpsg_hspc(wpsg_getStr($f['userformat'])); ?></div>
|
|
|
83 |
|
|
|
84 |
</td>
|
|
|
85 |
<td style="position:relative;">
|
|
|
86 |
|
|
|
87 |
<a rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_export_userformat" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_export_userformat" data-wpsg-tip="mod_export_userformat" class="glyphicon glyphicon-info-sign" style="float:right;"></a>
|
|
|
88 |
|
|
|
89 |
<script type="text/javascript">/* <![CDATA[ */
|
|
|
90 |
|
|
|
91 |
jQuery(document).ready(function() {
|
|
|
92 |
|
5934 |
hartmut |
93 |
jQuery('#field_name_<?php echo $f_id; ?>').wpsg_editable('<?php echo $inlineEdit_url; ?>', { } );
|
5896 |
daniel |
94 |
|
5934 |
hartmut |
95 |
jQuery('#field_typ_<?php echo $f_id; ?>').wpsg_editable('<?php echo $inlineEdit_url; ?>', {
|
5896 |
daniel |
96 |
'type': 'multiarray',
|
|
|
97 |
'data': '<?php echo json_encode($this->view['fields']); ?>'
|
|
|
98 |
} );
|
|
|
99 |
|
5934 |
hartmut |
100 |
jQuery('#field_format_<?php echo $f_id; ?>').wpsg_editable('<?php echo $inlineEdit_url; ?>', {
|
5896 |
daniel |
101 |
'type': 'select',
|
5911 |
daniel |
102 |
'data': <?php echo wpsg_prepare_for_inlineEdit($this->view['arFieldFormats']); ?>,
|
5896 |
daniel |
103 |
'callback': function(response, newValue) {
|
|
|
104 |
|
|
|
105 |
if (newValue === "700") jQuery('#userformatrow_<?php echo $f_id; ?>').show();
|
|
|
106 |
else jQuery('#userformatrow_<?php echo $f_id; ?>').hide();
|
|
|
107 |
|
|
|
108 |
}
|
|
|
109 |
} );
|
|
|
110 |
|
5934 |
hartmut |
111 |
jQuery('#field_userformat_<?php echo $f_id; ?>').wpsg_editable('<?php echo $inlineEdit_url; ?>', { } );
|
5896 |
daniel |
112 |
|
|
|
113 |
} );
|
|
|
114 |
|
|
|
115 |
/* ]]> */</script>
|
|
|
116 |
|
|
|
117 |
</td>
|
|
|
118 |
</tr>
|
|
|
119 |
</tbody>
|
|
|
120 |
<?php } ?>
|
|
|
121 |
|
|
|
122 |
</table>
|
|
|
123 |
|
|
|
124 |
<script type="text/javascript">/* <![CDATA[ */
|
5911 |
daniel |
125 |
|
5896 |
daniel |
126 |
wpsg_ajaxBind();
|
|
|
127 |
|
|
|
128 |
jQuery("#wpsg_mod_export_fieldtable").sortable( {
|
|
|
129 |
helper: wpsg_Tablefix,
|
|
|
130 |
items: 'tbody',
|
|
|
131 |
handler: '.wpsg_id',
|
|
|
132 |
update: function(event, ui) {
|
|
|
133 |
|
|
|
134 |
var wpsg_reorder = jQuery(this).sortable('serialize');
|
|
|
135 |
|
|
|
136 |
jQuery.ajax( {
|
|
|
137 |
url: '<?php echo WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_export&do=wpsg_mod_export_reorder&noheader=1&profil_id='.$this->view['profil']['id']; ?>',
|
|
|
138 |
data: {
|
|
|
139 |
wpsg_reorder: wpsg_reorder
|
|
|
140 |
},
|
|
|
141 |
success: function(data) {
|
|
|
142 |
|
|
|
143 |
if (data !== "1") alert(data);
|
|
|
144 |
|
|
|
145 |
}
|
|
|
146 |
} );
|
|
|
147 |
|
|
|
148 |
}}
|
|
|
149 |
).disableSelection();
|
|
|
150 |
|
|
|
151 |
/* ]]> */</script>
|