diff options
| -rw-r--r-- | views/admin/form/checkbox.phtml | 29 | ||||
| -rw-r--r-- | views/admin/form/text.phtml | 5 | ||||
| -rw-r--r-- | views/admin/form/upload.phtml | 31 | ||||
| -rw-r--r-- | views/js/admin.js | 47 | ||||
| -rw-r--r-- | views/js/editable.js | 19 | ||||
| -rw-r--r-- | views/mods/mod_export/fields.phtml | 139 | ||||
| -rw-r--r-- | views/mods/mod_export/order_index_tab.phtml | 4 | ||||
| -rw-r--r-- | views/mods/mod_export/profil.phtml | 338 | ||||
| -rw-r--r-- | views/mods/mod_export/settings_edit.phtml | 42 | ||||
| -rw-r--r-- | views/order/index.phtml | 2 |
10 files changed, 346 insertions, 310 deletions
diff --git a/views/admin/form/checkbox.phtml b/views/admin/form/checkbox.phtml index fcf63e6..b1f7bda 100644 --- a/views/admin/form/checkbox.phtml +++ b/views/admin/form/checkbox.phtml @@ -17,7 +17,11 @@ <label>
<div class="wpsg_field_wrap">
+
+ <?php if (!isset($this->view['field_config']['noHidden'])) { ?>
<input type="hidden" name="<?php echo $this->view['field_name']; ?>" value="0" />
+ <?php } ?>
+
<input type="checkbox" id="<?php echo $this->view['field_id']; ?>" name="<?php echo $this->view['field_name']; ?>" value="<?php echo wpsg_getStr($this->view['field_config']['value'], '1'); ?>" <?php echo (($this->view['field_checked'] > 0)?'checked="checked"':''); ?> />
<?php echo $this->view['field_label']; ?>
@@ -33,6 +37,31 @@ </div>
+ <?php if (wpsg_isTrue($this->view['field_config']['inlineEdit'])) { ?>
+ <script type="text/javascript">/* <![CDATA[ */
+
+ jQuery(document).ready(function() {
+
+ jQuery('#<?php echo $this->view['field_id']; ?>').on('change', function() {
+
+ var value = '0';
+ if (jQuery(this).prop('checked')) value = '1';
+
+ jQuery.ajax( {
+ url: '<?php echo $this->view['field_config']['inlineEdit_url']; ?>',
+ data: {
+ 'name': '<?php echo $this->view['field_name']; ?>',
+ 'value': value
+ }
+ } );
+
+ } );
+
+ } );
+
+ /* ]]> */</script>
+ <?php } ?>
+
<div class="clearfix wpsg_clear"></div>
</div>
\ No newline at end of file diff --git a/views/admin/form/text.phtml b/views/admin/form/text.phtml index 450c2ea..90a2b4c 100644 --- a/views/admin/form/text.phtml +++ b/views/admin/form/text.phtml @@ -17,7 +17,7 @@ </div>
</div>
- <?php if (isset($this->view['field_config']['inlineEdit']) && $this->view['field_config']['inlineEdit']) { ?>
+ <?php if (wpsg_isTrue($this->view['field_config']['inlineEdit'])) { ?>
<script type="text/javascript">/* <![CDATA[ */
jQuery(document).ready(function() {
@@ -27,6 +27,9 @@ 'type': '<?php echo $this->view['field_config']['inlineEdit_type']; ?>',
'placement': 'bottom'
<?php } ?>
+ <?php if (wpsg_isSizedArray($this->view['field_config']['inlineEdit_source'])) { ?>
+ ,'data': <?php echo json_encode($this->view['field_config']['inlineEdit_source']); ?>
+ <?php } ?>
} );
} );
diff --git a/views/admin/form/upload.phtml b/views/admin/form/upload.phtml index dd0591b..8e3c47e 100644 --- a/views/admin/form/upload.phtml +++ b/views/admin/form/upload.phtml @@ -28,6 +28,37 @@ </div>
+ <?php if (wpsg_isTrue($this->view['field_config']['ajax_upload'])) { ?>
+ <script type="text/javascript">/* <![CDATA[ */
+
+ jQuery(document).ready(function() {
+
+ jQuery('#<?php echo $this->view['field_id']; ?>').on('change', function() {
+
+ var data = new FormData();
+ data.append('file', this.files[0]);
+
+ jQuery.ajax( {
+ url: '<?php echo $this->view['field_config']['ajax_upload_url']; ?>',
+ data: data,
+ type: 'POST',
+ processData: false,
+ contentType: false,
+ success: function(data) {
+
+ <?php if (wpsg_isSizedString($this->view['field_config']['ajax_success'])) { ?>
+ <?php echo $this->view['field_config']['ajax_success']; ?>(data);
+ <?php } ?>
+
+ }
+ } );
+ } );
+
+ } );
+
+ /* ]]> */</script>
+ <?php } ?>
+
<div class="clearfix wpsg_clear"></div>
</div>
diff --git a/views/js/admin.js b/views/js/admin.js index c7e9276..c0143ce 100644 --- a/views/js/admin.js +++ b/views/js/admin.js @@ -147,27 +147,13 @@ function wpsg_in_array(needle, haystack) }
- jQuery(document).ready(function() {
-
- // Sortierung
- jQuery('th.wpsg_order').bind('click', function() {
-
- var direction = "ASC";
- if (jQuery(this).hasClass('wpsg_order_asc') && jQuery('#wpsg_order').val() == jQuery(this).attr("data-order")) direction = "DESC";
-
- jQuery('#wpsg_ascdesc').val(direction);
- jQuery('#wpsg_order').val(jQuery(this).attr("data-order"));
-
- jQuery('#filter_form').submit();
-
- return false;
-
- } );
-
+ function wpsg_ajaxBind()
+ {
+
// Hilfe Tooltips
- jQuery('*[data-wpsg-tip]').bind('click', function() {
+ jQuery('*[data-wpsg-tip]').on('click', function() {
- jQuery(this).unbind('click');
+ jQuery(this).off('click').on('click', function() { return false; } );
var po = this;
@@ -197,7 +183,26 @@ function wpsg_in_array(needle, haystack) return false;
} );
-
+
+ }
+
+ jQuery(document).ready(function() {
+
+ // Sortierung
+ jQuery('th.wpsg_order').bind('click', function() {
+
+ var direction = "ASC";
+ if (jQuery(this).hasClass('wpsg_order_asc') && jQuery('#wpsg_order').val() == jQuery(this).attr("data-order")) direction = "DESC";
+
+ jQuery('#wpsg_ascdesc').val(direction);
+ jQuery('#wpsg_order').val(jQuery(this).attr("data-order"));
+
+ jQuery('#filter_form').submit();
+
+ return false;
+
+ } );
+
jQuery('.wpsg_showhide_filter').bind('click', function() {
if (jQuery(this).hasClass('active'))
@@ -216,5 +221,7 @@ function wpsg_in_array(needle, haystack) }
} );
+
+ wpsg_ajaxBind();
} );
diff --git a/views/js/editable.js b/views/js/editable.js index 9717064..353c576 100644 --- a/views/js/editable.js +++ b/views/js/editable.js @@ -47,6 +47,23 @@ opt.value = value;
}
+ else if (options.type == "select" && typeof options.data == "object")
+ {
+
+ var value = 0;
+ var strValue = jQuery(this).html();
+
+ for (var i in options.data)
+ {
+
+ if (options.data[i] == strValue) value = i;
+
+ }
+
+ opt.source = options.data;
+ opt.value = value
+
+ }
else if (options.type == 'multiarray')
{
@@ -72,7 +89,7 @@ opt.source = ar;
opt.type = 'select';
- }
+ }
else if (options.type == 'string' && typeof options.data == "string")
{
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>
diff --git a/views/mods/mod_export/order_index_tab.phtml b/views/mods/mod_export/order_index_tab.phtml index 870b23f..096f2e2 100644 --- a/views/mods/mod_export/order_index_tab.phtml +++ b/views/mods/mod_export/order_index_tab.phtml @@ -5,13 +5,13 @@ */
?>
-<form class="container-fluid form-horizontal" method="post" action="<?php echo WPSG_URL_WP ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_export&noheader=1" onsubmit="wpsg_mod_export_serializefilter();">
+<form class="container-fluid form-horizontal" method="post" action="<?php echo WPSG_URL_WP ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_export&do=handleExport&noheader=1" onsubmit="wpsg_mod_export_serializefilter();">
<div class="row">
<div class="col-lg-4">
<?php foreach ($this->view['wpsg_mod_export']['arProfile'] as $p) { ?>
- <?php echo wpsg_drawForm_Checkbox('wpsg_mod_export_profile[]', $p['name'], false, array('value' => $p['id'])); ?>
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_export_profile[]', $p['name'], false, array('value' => $p['id'], 'noHidden' => true)); ?>
<?php } ?>
<br /><?php echo wpsg_drawForm_SubmitButton(__('Export starten')); ?>
diff --git a/views/mods/mod_export/profil.phtml b/views/mods/mod_export/profil.phtml index 32ecc0c..98329c8 100644 --- a/views/mods/mod_export/profil.phtml +++ b/views/mods/mod_export/profil.phtml @@ -4,294 +4,82 @@ * Template für die Einstellungen eines Profils
*/
+ $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'];
+ $upload_url = WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_export&do=musterupload&noheader=1&profil_id='.$this->view['profil']['id'];
+
?>
<?php echo $this->writeBackendMessage(); ?>
-<div class="wpsg_form_field">
- <div class="wpsg_form_left">
- <label for="wpsg_mod_export[name]"><?php echo __('Profilname', 'wpsg'); ?>:</label>
- </div>
- <div style="width:350px;" class="wpsg_form_right wpsg_editable" id="wpsg_mod_export_profilname"><?php echo $this->view['profil']['name']; ?></div>
- <a style="float:right;" onclick="return wpsg_mod_export_removeProfil(<?php echo $this->view['profil']['id']; ?>);" title="<?php echo __('Profil löschen', 'wpsg'); ?>" href="#" class="wpsg_icon wpsg_icon_remove"></a>
- <div class="wpsg_clear"></div>
-</div>
-<script type="text/javascript">
-
- jQuery('#wpsg_mod_export_profilname').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_export&do=inlinedit&noheader=1', {
- submitdata: {
- field: 'name',
- profil_id: '<?php echo $this->view['profil']['id']; ?>'
- },
- submit : '<?php echo __('Speichern', 'wpsg'); ?>',
- placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
- indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
- tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
- });
-
-</script>
-<div class="wpsg_form_field">
- <div class="wpsg_form_left">
- <label for="wpsg_mod_export[filename]"><?php echo __('Dateiname', 'wpsg'); ?>:</label>
- </div>
- <div class="wpsg_form_right wpsg_editable" id="wpsg_mod_export_filename"><?php echo @$this->view['profil']['data']['filename']; ?></div>
- <div class="wpsg_clear"></div>
-</div>
-<script type="text/javascript">
-
- jQuery('#wpsg_mod_export_filename').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_export&do=inlinedit&noheader=1', {
- submitdata: {
- field: 'filename',
- profil_id: '<?php echo $this->view['profil']['id']; ?>'
- },
- submit : '<?php echo __('Speichern', 'wpsg'); ?>',
- placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
- indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
- tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
- });
-
-</script>
-<div class="wpsg_form_field">
- <div class="wpsg_form_left">
- <label for="wpsg_mod_export[separator]"><?php echo __('Trennzeichen', 'wpsg'); ?>:</label>
- </div>
- <div class="wpsg_form_right wpsg_editable" id="wpsg_mod_export_separator"><?php echo @$this->view['profil']['data']['separator']; ?></div>
- <div class="wpsg_clear"></div>
-</div>
-<script type="text/javascript">
-
- jQuery('#wpsg_mod_export_separator').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_export&do=inlinedit&noheader=1', {
- submitdata: {
- field: 'separator',
- profil_id: '<?php echo $this->view['profil']['id']; ?>'
- },
- submit : '<?php echo __('Speichern', 'wpsg'); ?>',
- placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
- indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
- tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
- });
-
-</script>
-<div class="wpsg_form_field">
- <div class="wpsg_form_left">
- <label for="wpsg_mod_export_oneline"><?php echo __('Eine Zeile pro Bestellung', 'wpsg'); ?>:</label>
- </div>
- <div class="wpsg_form_right">
- <input style="width:auto;" type="checkbox" <?php echo ((@$this->view['profil']['data']['oneline'] == '1')?'checked="checked"':''); ?> value="1" onchange="" id="wpsg_mod_export_oneline" /></div>
- <div class="wpsg_clear"></div>
-</div>
-<script type="text/javascript">
-
- jQuery('#wpsg_mod_export_oneline').bind('change', function() {
- jQuery.ajax( {
- url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_export&do=inlinedit&noheader=1',
- data: {
- field: 'oneline',
- value: ((jQuery('#wpsg_mod_export_oneline').attr("checked") == 'checked')?'1':'0'),
- profil_id: '<?php echo $this->view['profil']['id']; ?>'
- }
- } );
- } );
-
-</script>
-<div class="wpsg_form_field">
- <div class="wpsg_form_left">
- <label for="wpsg_mod_export_firstlinecolname"><?php echo __('Spaltennamen in erster Spalte', 'wpsg'); ?>:</label>
- </div>
- <div class="wpsg_form_right">
- <input style="width:auto;" type="checkbox" <?php echo ((@$this->view['profil']['data']['firstlinecolname'] == '1')?'checked="checked"':''); ?> value="1" onchange="" id="wpsg_mod_export_firstlinecolname" id="wpsg_mod_export_firstlinecolname" /></div>
- <div class="wpsg_clear"></div>
-</div>
-<script type="text/javascript">
-
- jQuery('#wpsg_mod_export_firstlinecolname').bind('change', function() {
- jQuery.ajax( {
- url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_export&do=inlinedit&noheader=1',
- data: {
- field: 'firstlinecolname',
- value: ((jQuery('#wpsg_mod_export_firstlinecolname').attr("checked") == 'checked')?'1':'0'),
- profil_id: '<?php echo $this->view['profil']['id']; ?>'
- }
- } );
- } );
-
-</script>
-<div class="wpsg_form_field">
- <div class="wpsg_form_left">
- <label for="wpsg_mod_export_iso"><?php echo __('Dateiformat (Import wie Export)', 'wpsg'); ?>:</label>
- </div>
- <div class="wpsg_form_right">
- <select name="wpsg_mod_export_iso" id="wpsg_mod_export_iso">
- <option value="0" <?php echo ((@$this->view['profil']['data']['iso'] != '1')?'selected="selected"':''); ?>><?php echo __('UTF-8', 'wpsg'); ?></option>
- <option value="1" <?php echo ((@$this->view['profil']['data']['iso'] == '1')?'selected="selected"':''); ?>><?php echo __('ISO-8859-1', 'wpsg'); ?></option>
- </select>
- </div>
- <div class="wpsg_clear"></div>
+<div id="wpsg_mod_export_profil_tab">
+ <ul class="nav nav-tabs" role="tablist">
+ <li role="presentation" class="active"><a href="#tab1" aria-controls="home" role="tab" data-toggle="tab"><?php echo __('Profiloptionen', 'wpsg'); ?></a></li>
+ <li role="presentation"><a href="#tab2" aria-controls="profile" role="tab" data-toggle="tab"><?php echo __('Feldkonfiguration', 'wpsg'); ?></a></li>
+ <li role=""
+ </ul>
+ <div class="tab-content">
+ <div id="tab1" role="tabpanel" class="tab-pane active" >
+
+ <?php echo wpsg_drawForm_Text(__('Profilname', 'wpsg'), $this->view['profil']['name'], 'name', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
+ <?php echo wpsg_drawForm_Text(__('Dateiname', 'wpsg'), $this->view['profil']['filename'], 'filename', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
+ <?php echo wpsg_drawForm_Text(__('Encoding', 'wpsg'), $this->view['arFileEncoding'][$this->view['profil']['file_encoding']], 'file_encoding', array('inlineEdit' => true, 'inlineEdit_type' => 'select', 'inlineEdit_source' => $this->view['arFileEncoding'], 'inlineEdit_url' => $inlineEdit_url)); ?>
+ <?php echo wpsg_drawForm_Text(__('Dateiformat', 'wpsg'), $this->view['arExportFormats'][$this->view['profil']['format']], 'format', array('inlineEdit' => true, 'inlineEdit_type' => 'select', 'inlineEdit_source' => $this->view['arExportFormats'], 'inlineEdit_url' => $inlineEdit_url)); ?>
+
+ <?php /* CSV */ ?>
+ <div class="wpsg_mod_export_format wpsg_mod_export_format_<?php echo wpsg_mod_export::FORMAT_CSV; ?>" style="display:<?php echo (($this->view['profil']['format'] == wpsg_mod_export::FORMAT_CSV)?'block':'none'); ?>;">
+
+ <?php echo wpsg_drawForm_Text('Feld-Trennzeichen', $this->view['profil']['field_delimiter'], 'field_delimiter', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
+ <?php echo wpsg_drawForm_Text('Feld-Begrenzungs', $this->view['profil']['field_enclosure'], 'field_enclosure', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
+ <?php echo wpsg_drawForm_Text('Maskierungs-Zeichen', $this->view['profil']['field_escape'], 'field_escape', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
+
+ </div>
+
+ <div class="wpsg_mod_export_format wpsg_mod_export_format_<?php echo wpsg_mod_export::FORMAT_CSV; ?>" style="display:<?php echo (($this->view['profil']['format'] == wpsg_mod_export::FORMAT_CSV)?'block':'none'); ?>">
+ <?php echo wpsg_drawForm_Upload('samplefile', __('Muster Vorlage', 'wpsg'), false, '50', '100000', array('ajax_upload' => true, 'ajax_upload_url' => $upload_url, 'ajax_success' => 'samplefile_success')); ?>
+ </div>
+
+ <?php echo wpsg_drawForm_Checkbox('order_online', __('Eine Zeile pro Bestellung', 'wpsg'), $this->view['profil']['order_online'], array('label' => __('Optionen', 'wpsg'), 'inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
+ <?php echo wpsg_drawForm_Checkbox('order_onetime', __('Bestellungen nur einmalig exportieren', 'wpsg'), $this->view['profil']['order_onetime'], array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
+
+ <div class="wpsg_mod_export_format wpsg_mod_export_format_<?php echo wpsg_mod_export::FORMAT_CSV; ?>" style="display:<?php echo (($this->view['profil']['format'] == wpsg_mod_export::FORMAT_CSV)?'block':'none'); ?>">
+
+ <?php echo wpsg_drawForm_Checkbox('csv_fieldnames', __('Spaltennamen in erster Spalte', 'wpsg'), $this->view['profil']['csv_fieldnames'], array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
+
+ </div>
+
+ </div>
+
+ <div id="tab2" role="tabpanel" class="tab-pane" >
+
+ <div id="wpsg_mod_export_fields"><?php echo $this->view['strFields']; ?></div>
+
+ </div>
+ </div>
</div>
<br />
-<script type="text/javascript">
+<a onclick="return wpsg_mod_export_removeProfil(<?php echo $this->view['profil']['id']; ?>);" href="#"><span class="glyphicon glyphicon-trash wpsg-glyphicon"></span><?php echo __('Profil löschen', 'wpsg'); ?></a>
- jQuery('#wpsg_mod_export_iso').bind('change', function() {
+<script type="text/javascript">/* <![CDATA[ */
- var ckbVal = '0';
- if (jQuery('#wpsg_mod_export_onetime').prop('checked') == true) ckbVal = '1';
-
- jQuery.ajax( {
- url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_export&do=inlinedit&noheader=1',
- data: {
- field: 'iso',
- value: ckbVal,
- profil_id: '<?php echo $this->view['profil']['id']; ?>'
- }
- } );
- } );
-
-</script>
-<div class="wpsg_form_field">
- <div class="wpsg_form_left">
- <label for="wpsg_mod_export_iso"><?php echo __('Muster Vorlage (csv Datei)', 'wpsg'); ?>:</label>
- </div>
- <div class="wpsg_form_right">
- <iframe name="wpsg_mod_export_upload_frame" style="display:none;"></iframe>
- <form action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_export&do=musterupload&noheader=1&profil_id=<?php echo $this->view['profil']['id']; ?>" target="wpsg_mod_export_upload_frame" method="post" enctype="multipart/form-data">
- <input style="float:left; width:auto;" type="file" name="wpsg_mod_export_muster" />
- <input style="float:right; width:auto;" type="submit" value="<?php echo __('Hochladen', 'wpsg'); ?>" />
- </form>
- </div>
- <div class="wpsg_clear"></div>
-</div>
-<br />
-<table class="table table-body-striped">
- <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"></th>
- </tr>
- </thead>
-
- <?php $i = 0; foreach ((array)$this->view['profil']['data']['fields'] as $f_key => $f) { $i ++; ?>
- <tbody>
- <tr class="wpsg_tablerow wpsg_mod_export_row1 wpsg_mod_export_fieldrow_<?php echo $f_key; ?> <?php echo (($i % 2 == 0)?'odd':'even'); ?>">
- <td class="wpsg_mod_export_col"><div class="name wpsg_editable" id="field_name_<?php echo $f_key; ?>"><?php echo $f['name']; ?></div></td>
- <td class="wpsg_mod_export_col_field"><div class="wpsg_editable" id="field_typ_<?php echo $f_key; ?>"><?php
-
- foreach ($this->view['fields'] as $fieldgroup)
- {
-
- foreach ($fieldgroup['fields'] as $field_key => $field)
- {
-
- if ($field_key == $f['value'])
- {
- echo $field;
- }
-
- }
-
- }
-
- ?></div></td>
- <td class="wpsg_mod_export_col_format"><div class="wpsg_editable" id="field_format_<?php echo $f_key; ?>"><?php echo $this->view['arFormats'][$f['format']]; ?></div></td>
- <td>
- <a style="float:right;" onclick="return wpsg_mod_export_removeField(<?php echo $this->view['profil']['id']; ?>, <?php echo $f_key; ?>);" title="<?php echo __('Profil löschen', 'wpsg'); ?>" href="#" class="wpsg_icon wpsg_icon_remove"></a>
- </td>
- </tr>
- <tr id="userformatrow_<?php echo $f_key; ?>" style="<?php echo (($f['format'] != 700)?'display:none;':''); ?>" class="wpsg_mod_export_row2 wpsg_tablerow wpsg_mod_export_fieldrow_<?php echo $f_key; ?> <?php echo (($i % 2 == 0)?'odd':'even'); ?>">
- <td class="wpsg_mod_export_col_name"></td>
- <td class="wpsg_mod_export_col_field_user"><?php echo __('Format:', 'wpsg'); ?></td>
- <td class="wpsg_mod_export_col_format_user"><div class="wpsg_editable" id="field_userformat_<?php echo $f_key; ?>"><?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" class="wpsg_form_help" style="float:right; position:relative;"></a>
- <script type="text/javascript">
+ function samplefile_success(data)
+ {
+
+ jQuery('#wpsg_mod_export_fields').html(data);
+ jQuery('#samplefile').val('');
+
+ }
+
+ jQuery(document).ready(function() {
+
+ jQuery('#format').on('save', function(e, params) {
- jQuery('#field_userformat_<?php echo $f_key; ?>').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_export&do=inlinedit&noheader=1', {
- submitdata: {
- field: 'fielduserformat_<?php echo $f_key; ?>',
- profil_id: '<?php echo $this->view['profil']['id']; ?>'
- },
- submit: '<?php echo __('Speichern', 'wpsg'); ?>',
- placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
- indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
- tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
- });
-
- jQuery('#field_format_<?php echo $f_key; ?>').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_export&do=inlinedit&noheader=1', {
- submitdata: {
- field: 'fieldformat_<?php echo $f_key; ?>',
- profil_id: '<?php echo $this->view['profil']['id']; ?>'
- },
- submit: '<?php echo __('Speichern', 'wpsg'); ?>',
- data: '<?php echo json_encode($this->view['arFormats']); ?>',
- type: 'select',
- placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
- indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
- tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
- callback: function(el) {
-
- if (el == '<?php echo $this->view['arFormats'][700]; ?>')
- {
- jQuery('#userformatrow_<?php echo $f_key; ?>').show();
- }
- else
- {
- jQuery('#userformatrow_<?php echo $f_key; ?>').hide();
- }
-
- }
- });
-
- jQuery('#field_name_<?php echo $f_key; ?>').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_export&do=inlinedit&noheader=1', {
- submitdata: {
- field: 'fieldname_<?php echo $f_key; ?>',
- profil_id: '<?php echo $this->view['profil']['id']; ?>'
- },
- submit: '<?php echo __('Speichern', 'wpsg'); ?>',
- placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
- indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
- tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
- });
-
- jQuery('#field_typ_<?php echo $f_key; ?>').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_export&do=inlinedit&noheader=1', {
- submitdata: {
- field: 'fieldtyp_<?php echo $f_key; ?>',
- profil_id: '<?php echo $this->view['profil']['id']; ?>'
- },
- submit: '<?php echo __('Speichern', 'wpsg'); ?>',
- data: '<?php echo json_encode($this->view['fields']); ?>',
- type: 'multiarray',
- placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
- indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
- tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
- });
-
- </script>
- </td>
- </tr>
- </tbody>
- <?php } ?>
-
-</table>
-
-<script type="text/javascript">
-
- jQuery(document).ready(function() {
-
- jQuery('.wpsg_mod_export_row1').bind('mouseover', function() {
- jQuery(this).next().addClass('wpsg_tablerow_hover');
- } ).bind('mouseout', function() {
- jQuery(this).next().removeClass('wpsg_tablerow_hover');
- } );
+ jQuery('.wpsg_mod_export_format').hide();
+ jQuery('.wpsg_mod_export_format_' + params.newValue).show();
- jQuery('.wpsg_mod_export_row2').bind('mouseover', function() {
- jQuery(this).prev().addClass('wpsg_tablerow_hover');
- } ).bind('mouseout', function() {
- jQuery(this).prev().removeClass('wpsg_tablerow_hover');
} );
} );
-</script>
\ No newline at end of file +/* ]]> */</script>
\ No newline at end of file diff --git a/views/mods/mod_export/settings_edit.phtml b/views/mods/mod_export/settings_edit.phtml index 263dd47..9a80ba6 100644 --- a/views/mods/mod_export/settings_edit.phtml +++ b/views/mods/mod_export/settings_edit.phtml @@ -26,32 +26,54 @@ } // function wpsg_mod_export_profilSwitch()
- function wpsg_mod_export_removeField(profil_id, field_key)
+ function wpsg_mod_export_addField(profil_id)
+ {
+
+ jQuery('#wpsg_mod_export_fields').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+
+ 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_addField&noheader=1',
+ data: {
+ profil_id: profil_id
+ },
+ success: function(data) {
+
+ jQuery('#wpsg_mod_export_fields').html(data);
+
+ }
+ } );
+
+ return false;
+
+ }
+
+ function wpsg_mod_export_removeField(field_id)
{
- if (!confirm('<?php echo __('Sind Sie sich sicher?', 'wpsg'); ?>')) return false;
+ if (!confirm('<?php echo __('Sind Sie sich sicher, dass das Feld gelöscht werden soll?', 'wpsg'); ?>')) return false;
+
+ jQuery('tr.wpsg_mod_export_fieldrow_' + field_id).parent().remove();
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_removeField&noheader=1',
data: {
- profil: profil_id,
- field_key: field_key
+ field_id: field_id
},
success: function(data) {
- if (data == '1')
- {
- jQuery('tr.wpsg_mod_export_fieldrow_' + field_key).remove();
- }
- else
+
+ if (data != '1')
{
+
alert(data);
+
}
+
}
} );
return false;
- } // function wpsg_mod_export_removeField(profil_id, field_key)
+ } // function wpsg_mod_export_removeField(field_id)
function wpsg_mod_export_removeProfil(profil_id)
{
diff --git a/views/order/index.phtml b/views/order/index.phtml index 2db5227..b6dc7bd 100644 --- a/views/order/index.phtml +++ b/views/order/index.phtml @@ -18,7 +18,7 @@ <li role="presentation" class="wpsg-order-tab-a active"><a href="#" onclick="return false;"><?php echo __("Bestellübersicht", "wpsg"); ?></a></li>
<li role="presentation" class="wpsg_showhide_filter wpsg-order-tab-a <?php echo (($this->view['hasFilter'] === true)?'active':''); ?>" id="wpsg-order-tab-0"><a href="#" onclick="return false;"><span class="glyphicon glyphicon-search"></span><?php echo __("Suche", "wpsg"); ?></a></li>
<?php foreach ($this->view['tabs']['left'] as $k => $tab) { ?>
- <li role="presentation" class="wpsg-order-tab-a" id="wpsg-order-tab-<?php echo $k; ?>"><a href="#" onclick="return false;"><span class="<?php echo $tab['tab_icon']; ?>"></span><?php echo $tab['tab_title']; ?></a></li>
+ <li role="presentation" class="wpsg-order-tab-a wpsg-order-tab-mods" id="wpsg-order-tab-<?php echo $k; ?>"><a href="#" onclick="return false;"><span class="<?php echo $tab['tab_icon']; ?>"></span><?php echo $tab['tab_title']; ?></a></li>
<?php } ?>
</ul>
<ul class="nav navbar-nav navbar-right">
|
