summaryrefslogtreecommitdiff
path: root/views/mods/mod_export/fields.phtml
diff options
context:
space:
mode:
Diffstat (limited to 'views/mods/mod_export/fields.phtml')
-rw-r--r--views/mods/mod_export/fields.phtml139
1 files changed, 139 insertions, 0 deletions
diff --git a/views/mods/mod_export/fields.phtml b/views/mods/mod_export/fields.phtml
new file mode 100644
index 0000000..abb1034
--- /dev/null
+++ b/views/mods/mod_export/fields.phtml
@@ -0,0 +1,139 @@
+<?php
+
+ /**
+ * User: Daschmi (daschmi@daschmi.de)
+ * Date: 03.11.2016
+ * Time: 14:12
+ */
+
+ $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'];
+
+?>
+<table class="table table-body-striped" id="wpsg_mod_export_fieldtable">
+ <thead>
+ <tr>
+ <th class="wpsg_mod_export_col_name"><?php echo __('Spaltenname', 'wpsg'); ?></th>
+ <th class="wpsg_mod_export_col_value"><?php echo __('Wert', 'wpsg'); ?></th>
+ <th class="wpsg_mod_export_col_format"><?php echo __('Format', 'wpsg'); ?></th>
+ <th class="wpsg_mod_export_col_remove">
+
+ <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>
+
+ </th>
+ </tr>
+ </thead>
+
+ <?php $i = 0; foreach ((array)$this->view['profil']['fields'] as $f_id => $f) { $i ++; ?>
+ <tbody id="field_<?php echo $f_id; ?>">
+ <tr class="wpsg_tablerow wpsg_mod_export_row1 wpsg_mod_export_fieldrow_<?php echo $f_id; ?> <?php echo (($i % 2 == 0)?'odd':'even'); ?>">
+
+ <td class="wpsg_mod_export_col">
+ <div class="name wpsg_editable" id="field_name_<?php echo $f_id; ?>"><?php echo $f['name']; ?></div>
+ </td>
+ <td class="wpsg_mod_export_col_field"><div class="wpsg_editable" id="field_typ_<?php echo $f_id; ?>"><?php
+
+ foreach ($this->view['fields'] as $fieldgroup)
+ {
+
+ foreach ($fieldgroup['fields'] as $field_key => $field)
+ {
+
+ if ($field_key == $f['value_key'])
+ {
+
+ echo $field;
+
+ }
+
+ }
+
+ }
+
+ ?></div></td>
+ <td class="wpsg_mod_export_col_format">
+
+ <div class="wpsg_editable" id="field_format_<?php echo $f_id; ?>"><?php echo $this->view['arFieldFormats'][$f['format']]; ?></div>
+
+ </td>
+ <td>
+
+ <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>
+
+ </td>
+
+ </tr>
+ <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'); ?>">
+ <td class="wpsg_mod_export_col_format_user" colspan="3">
+
+ <?php echo __('Format', 'wpsg'); ?>:
+
+ <div class="wpsg_editable" id="field_userformat_<?php echo $f_id; ?>"><?php echo wpsg_hspc(wpsg_getStr($f['userformat'])); ?></div>
+
+ </td>
+ <td style="position:relative;">
+
+ <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>
+
+ <script type="text/javascript">/* <![CDATA[ */
+
+ jQuery(document).ready(function() {
+
+ jQuery('#field_name_<?php echo $f_id; ?>').wspg_editable('<?php echo $inlineEdit_url; ?>', { } );
+
+ jQuery('#field_typ_<?php echo $f_id; ?>').wspg_editable('<?php echo $inlineEdit_url; ?>', {
+ 'type': 'multiarray',
+ 'data': '<?php echo json_encode($this->view['fields']); ?>'
+ } );
+
+ jQuery('#field_format_<?php echo $f_id; ?>').wspg_editable('<?php echo $inlineEdit_url; ?>', {
+ 'type': 'select',
+ 'data': <?php echo json_encode($this->view['arFieldFormats']); ?>,
+ 'callback': function(response, newValue) {
+
+ if (newValue === "700") jQuery('#userformatrow_<?php echo $f_id; ?>').show();
+ else jQuery('#userformatrow_<?php echo $f_id; ?>').hide();
+
+ }
+ } );
+
+ jQuery('#field_userformat_<?php echo $f_id; ?>').wspg_editable('<?php echo $inlineEdit_url; ?>', { } );
+
+ } );
+
+ /* ]]> */</script>
+
+ </td>
+ </tr>
+ </tbody>
+ <?php } ?>
+
+</table>
+
+<script type="text/javascript">/* <![CDATA[ */
+
+ wpsg_ajaxBind();
+
+ jQuery("#wpsg_mod_export_fieldtable").sortable( {
+ helper: wpsg_Tablefix,
+ items: 'tbody',
+ handler: '.wpsg_id',
+ update: function(event, ui) {
+
+ var wpsg_reorder = jQuery(this).sortable('serialize');
+
+ jQuery.ajax( {
+ 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']; ?>',
+ data: {
+ wpsg_reorder: wpsg_reorder
+ },
+ success: function(data) {
+
+ if (data !== "1") alert(data);
+
+ }
+ } );
+
+ }}
+ ).disableSelection();
+
+/* ]]> */</script>