summaryrefslogtreecommitdiff
path: root/views/mods/mod_export
diff options
context:
space:
mode:
Diffstat (limited to 'views/mods/mod_export')
-rw-r--r--views/mods/mod_export/product_index_tab.phtml57
-rw-r--r--views/mods/mod_export/profil.phtml45
-rw-r--r--views/mods/mod_export/profillist.phtml11
-rw-r--r--views/mods/mod_export/settings_edit.phtml15
4 files changed, 116 insertions, 12 deletions
diff --git a/views/mods/mod_export/product_index_tab.phtml b/views/mods/mod_export/product_index_tab.phtml
new file mode 100644
index 0000000..493198d
--- /dev/null
+++ b/views/mods/mod_export/product_index_tab.phtml
@@ -0,0 +1,57 @@
+<?php
+
+ /**
+ * Template für die Integration der Profilauswahl in die Produktverwaltung (Übersicht)
+ */
+
+ $arProfile = $this->callMod('wpsg_mod_export', 'getProfile', array(wpsg_mod_export::TYPE_PRODUCT));
+
+?>
+
+<?php if (wpsg_isSizedArray($arProfile)) { ?>
+<div class="wpsg-export container-fluid form-horizontal" style="display:none;">
+
+ <form class="container-fluid form-horizontal" target="_blank" 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 ($arProfile as $p) { ?>
+ <?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')); ?>
+
+ </div>
+ </div>
+
+ <input type="hidden" name="filter" id="wpsg_mod_export_filter" value="" />
+
+</form>
+
+</div>
+
+<script type="text/javascript">/* <![CDATA[ */
+
+ function wpsg_mod_export_serializefilter()
+ {
+
+ jQuery('#wpsg_mod_export_filter').val(jQuery('#filter_form').serialize());
+
+ }
+
+ jQuery(document).ready(function() {
+
+ jQuery('.wpsg_showhide_export').off('click').on('click', function() {
+
+ jQuery(this).toggleClass('active');
+ jQuery('.wpsg-export').toggle(250);
+
+ return false;
+
+ } );
+
+ } );
+
+/* ]]> */</script>
+<?php } ?> \ No newline at end of file
diff --git a/views/mods/mod_export/profil.phtml b/views/mods/mod_export/profil.phtml
index b0375ec..b703055 100644
--- a/views/mods/mod_export/profil.phtml
+++ b/views/mods/mod_export/profil.phtml
@@ -38,8 +38,12 @@
<div class="wpsg_mod_export_format wpsg_mod_export_format_<?php echo wpsg_mod_export::FORMAT_XML; ?>" style="display:<?php echo (($this->view['profil']['format'] == wpsg_mod_export::FORMAT_XML)?'block':'none'); ?>;">
<?php echo wpsg_drawForm_Text('Root-Tagname', $this->view['profil']['xml_roottag'], 'xml_roottag', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
- <?php echo wpsg_drawForm_Text('Bestellung-Tagname', $this->view['profil']['xml_ordertag'], 'xml_ordertag', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
- <?php echo wpsg_drawForm_Text('Produkt-Root-Tagname', $this->view['profil']['xml_productroottag'], 'xml_productroottag', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
+
+ <?php if ($this->view['profil']['export_type'] === wpsg_mod_export::TYPE_ORDER) { ?>
+ <?php echo wpsg_drawForm_Text('Bestellung-Tagname', $this->view['profil']['xml_ordertag'], 'xml_ordertag', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
+ <?php echo wpsg_drawForm_Text('Produkt-Root-Tagname', $this->view['profil']['xml_productroottag'], 'xml_productroottag', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
+ <?php } ?>
+
<?php echo wpsg_drawForm_Text('Produkt-Tagname', $this->view['profil']['xml_producttag'], 'xml_producttag', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
</div>
@@ -49,12 +53,16 @@
</div>
<br />
-
- <?php echo wpsg_drawForm_Checkbox('order_onetime', __('Bestellungen nur einmalig exportieren', 'wpsg'), $this->view['profil']['order_onetime'], array('label' => __('Optionen', 'wpsg'), '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('order_online', __('Eine Zeile pro Bestellung', 'wpsg'), $this->view['profil']['order_online'], array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
- </div>
+ <?php if ($this->view['profil']['export_type'] === wpsg_mod_export::TYPE_ORDER) { ?>
+
+ <?php echo wpsg_drawForm_Checkbox('order_onetime', __('Bestellungen nur einmalig exportieren', 'wpsg'), $this->view['profil']['order_onetime'], array('label' => __('Optionen', 'wpsg'), '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('order_online', __('Eine Zeile pro Bestellung', 'wpsg'), $this->view['profil']['order_online'], array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
+ </div>
+
+ <?php } ?>
<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'); ?>">
@@ -81,6 +89,7 @@
<?php echo wpsg_drawForm_Text(__('Cron Pfad', 'wpsg'), WPSG_PATH.DIRECTORY_SEPARATOR.'cron.php', false, array('noP' => false)); ?>
<?php echo wpsg_drawForm_Text(__('Cron URL', 'wpsg'), '<a href="'.WPSG_PLUGIN_URL.'wpshopgermany/cron.php">'.WPSG_PLUGIN_URL.'wpshopgermany/cron.php</a>', false, array('noP' => false)); ?>
+ <?php if ($this->view['profil']['export_type'] === wpsg_mod_export::TYPE_ORDER) { ?>
<fieldset id="wpsg_mod_export_orderfilter">
<legend><div class="col-sm-offset-6"><?php echo __('Bestellfilter', 'wpsg'); ?></div></legend>
@@ -173,6 +182,28 @@
</form>
</fieldset>
+ <?php } else if ($this->view['profil']['export_type'] === wpsg_mod_export::TYPE_PRODUCT) { ?>
+ <fieldset id="wpsg_mod_export_productfilter">
+
+ <legend><div class="col-sm-offset-6"><?php echo __('Produktfilter', 'wpsg'); ?></div></legend>
+
+ <form id="wpsg_mod_export_searchfilter">
+
+ <?php echo wpsg_drawForm_Text(__('Suchfeld', 'wpsg'), wpsg_getStr($this->view['profil']['orderfilter']['s']), 'orderfilter_s', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
+
+ <?php if ($this->hasMod('wpsg_mod_productgroups')) { $arProductGroupSelect = array('-1' => __('Alle Produktgruppen', 'wpsg')) + wpsg_productgroup::getProductgroupSelect(); ?>
+ <?php echo wpsg_drawForm_Text(__('Produktgruppe', 'wpsg'), $arProductGroupSelect[wpsg_getStr($this->view['profil']['orderfilter']['productgroup_ids'], '-1')], 'orderfilter_productgroup_ids', array('inlineEdit' => true, 'inlineEdit_type' => 'select', 'inlineEdit_url' => $inlineEdit_url, 'inlineEdit_source' => $arProductGroupSelect)); ?>
+ <?php } ?>
+
+ <?php if ($this->hasMod('wpsg_mod_produktartikel')) { $temp = $this->callMod('wpsg_mod_produktartikel', 'getProductcategorySelect', array()); ?>
+ <?php $arProductCategorySelect = array(); foreach ($temp as $k => $v) $arProductCategorySelect[$v['term_id']] = $v['label']; ?>
+ <?php echo wpsg_drawForm_Text(__('Produktkategorie', 'wpsg'), $arProductCategorySelect[wpsg_getStr($this->view['profil']['orderfilter']['productcategory_ids'], '-1')], 'orderfilter_productcategory_ids', array('inlineEdit' => true, 'inlineEdit_type' => 'select', 'inlineEdit_url' => $inlineEdit_url, 'inlineEdit_source' => $arProductCategorySelect)); ?>
+ <?php } ?>
+
+ </form>
+
+ </fieldset>
+ <?php } ?>
</div>
diff --git a/views/mods/mod_export/profillist.phtml b/views/mods/mod_export/profillist.phtml
index f73903f..4f5e039 100644
--- a/views/mods/mod_export/profillist.phtml
+++ b/views/mods/mod_export/profillist.phtml
@@ -5,7 +5,16 @@
*/
$arProfilSelect = array();
- foreach ($this->view['arProfile'] as $p) $arProfilSelect[$p['id']] = $p['name'];
+
+ foreach ($this->view['arProfile'] as $p)
+ {
+
+ $arProfilSelect[$p['id']] = $p['name'];
+
+ if ($p['export_type'] === wpsg_mod_export::TYPE_ORDER) $arProfilSelect[$p['id']] .= ' ('.__('Bestellexport', 'wpsg').')';
+ else if ($p['export_type'] === wpsg_mod_export::TYPE_PRODUCT) $arProfilSelect[$p['id']] .= ' ('.__('Produktexport', 'wpsg').')';
+
+ }
?>
diff --git a/views/mods/mod_export/settings_edit.phtml b/views/mods/mod_export/settings_edit.phtml
index 1c8fa18..39c0c16 100644
--- a/views/mods/mod_export/settings_edit.phtml
+++ b/views/mods/mod_export/settings_edit.phtml
@@ -96,15 +96,20 @@
} // function wpsg_mod_export_removeProfil(profil_id)
- function wpsg_mod_export_addProfil()
+ function wpsg_mod_export_addProfil(type)
{
jQuery('#wpsg_profil_list').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_addProfil&noheader=1',
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_export&do=wpsg_mod_export_addProfil&noheader=1',
+ data: {
+ type: type
+ },
success: function(data) {
+
jQuery("#wpsg_profil_list").html(data);
+
}
} );
@@ -126,7 +131,7 @@
},
success: function(data) {
- if (data != '1')
+ if (data != '1' && data != '0')
{
alert(data);
@@ -140,7 +145,9 @@
</script>
-<a title="<?php echo __('Neuens Exportprofil anlegen', 'wpsg'); ?>" href="#" class="" onclick="return wpsg_mod_export_addProfil();"><span class="wpsg-glyphicon glyphicon glyphicon-plus"></span><?php echo __('Neues Exportprofil anlegen', 'wpsg'); ?></a>
+<a title="<?php echo __('Neuens Exportprofil anlegen', 'wpsg'); ?>" href="#" class="" onclick="return wpsg_mod_export_addProfil(<?php echo wpsg_mod_export::TYPE_ORDER; ?>);"><span class="wpsg-glyphicon glyphicon glyphicon-plus"></span><?php echo __('Neues Exportprofil für Bestellungen anlegen', 'wpsg'); ?></a><br />
+<a title="<?php echo __('Neuens Exportprofil anlegen', 'wpsg'); ?>" href="#" class="" onclick="return wpsg_mod_export_addProfil(<?php echo wpsg_mod_export::TYPE_PRODUCT; ?>);"><span class="wpsg-glyphicon glyphicon glyphicon-plus"></span><?php echo __('Neues Exportprofil für Produkte anlegen', 'wpsg'); ?></a>
+
<br /><br />
<div id="wpsg_profil_list"><?php echo $this->callMod('wpsg_mod_export', 'profilList'); ?></div> \ No newline at end of file