diff options
| -rw-r--r-- | views/admin/form/checkbox.phtml | 2 | ||||
| -rw-r--r-- | views/admin/form/input.phtml | 2 | ||||
| -rw-r--r-- | views/admin/form/select.phtml | 2 | ||||
| -rw-r--r-- | views/admin/includes.phtml | 1 | ||||
| -rw-r--r-- | views/admin/wpml.phtml | 91 | ||||
| -rw-r--r-- | views/mods/mod_discount/settings_edit.phtml | 3 | ||||
| -rw-r--r-- | views/mods/mod_productvariants/admin_edit.phtml | 1174 | ||||
| -rw-r--r-- | views/mods/mod_productvariants/settings_edit.phtml | 97 | ||||
| -rw-r--r-- | views/mods/mod_produktartikel/settings_edit.phtml | 315 |
9 files changed, 835 insertions, 852 deletions
diff --git a/views/admin/form/checkbox.phtml b/views/admin/form/checkbox.phtml index 12e184a..5dcee75 100644 --- a/views/admin/form/checkbox.phtml +++ b/views/admin/form/checkbox.phtml @@ -37,7 +37,7 @@ <?php } ?>
<?php if (wpsg_isSizedString($this->view['field_config']['hint'])) { ?>
- <div class="hint info"><?php echo $this->view['field_config']['hint']; ?></div>
+ <div class="hint info"><?php echo preg_replace('/^nohspc_/', '', $this->view['field_config']['hint']); ?></div>
<?php } ?>
</div>
diff --git a/views/admin/form/input.phtml b/views/admin/form/input.phtml index cad903c..60482d1 100644 --- a/views/admin/form/input.phtml +++ b/views/admin/form/input.phtml @@ -51,7 +51,7 @@ <?php } ?>
<?php if (wpsg_isSizedString($this->view['field_config']['hint'])) { ?>
- <small id="emailHelp" class="form-text text-muted"><?php echo $this->view['field_config']['hint']; ?></small>
+ <small id="emailHelp" class="form-text text-muted"><?php echo preg_replace('/^nohspc_/', '', $this->view['field_config']['hint']); ?></small>
<?php } ?>
</div>
diff --git a/views/admin/form/select.phtml b/views/admin/form/select.phtml index ed142e3..d29158d 100644 --- a/views/admin/form/select.phtml +++ b/views/admin/form/select.phtml @@ -101,7 +101,7 @@ </div>
<?php if (wpsg_isSizedString($this->view['field_config']['hint'])) { ?>
- <div class="hint info"><?php echo $this->view['field_config']['hint']; ?></div>
+ <div class="hint info"><?php echo preg_replace('/^nohspc_/', '', $this->view['field_config']['hint']); ?></div>
<?php } ?>
</div>
diff --git a/views/admin/includes.phtml b/views/admin/includes.phtml index de0f5a0..9dc5701 100644 --- a/views/admin/includes.phtml +++ b/views/admin/includes.phtml @@ -41,7 +41,6 @@ <br />
- <?php echo wpsg_drawForm_Checkbox('wpsg_load_bootstrap_glyphfont_css', __('Bootstrap Glyphfont CSS im Frontend laden', 'wpsg'), $this->get_option('wpsg_load_bootstrap_glyphfont_css'), array('help' => 'wpsg_load_bootstrap_glyphfont_css')); ?>
<br />
diff --git a/views/admin/wpml.phtml b/views/admin/wpml.phtml index df2c08c..efad07f 100644 --- a/views/admin/wpml.phtml +++ b/views/admin/wpml.phtml @@ -1,48 +1,43 @@ -<?php
-
- /**
- * User: Daschmi (https://daschmi.de)
- * Date: 01.06.2017
- * Time: 13:53
- */
-
- namespace wpsg;
-
-?>
-
-<div class="wpsg_admin_submenu">
-
- <div class="list-group">
- <span class="list-group-head list-group-item"><?php echo __('Konfiguration', 'wpsg'); ?></span>
- <?php foreach ($this->view['arSubAction'] as $k => $v) { ?>
- <a class="list-group-item <?php echo (($k == $this->view['subAction'])?'active':''); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=<?php echo $k; ?>"><?php echo $v['Menutext']; ?></a>
- <?php } ?>
- </div>
-
-</div>
-
-<div class="wpsg_admin_content form-horizontal">
- <form name="form1" method="post" enctype="multipart/form-data" action="<?php echo wpsg_hspc(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=wpml&noheader=1'); ?>">
-
- <div class="panel panel-default">
- <div class="panel-heading clearfix">
- <h3 class="panel-title"><?php echo __('WPML Einstellungen', 'wpsg'); ?></h3>
- </div>
- <div class="panel-body">
-
- <?php /* ?>
- <?php echo wpsg_drawForm_Checkbox('clear', __('Nicht verwendete String-Übersetzungen entfernen', 'wpsg'), false, array('fullWidth' => true)); ?>
-
- <br /> */ ?>
-
- <p class="info"><?php echo __('Fügt dynamische Inhalte wie Ländernamen, Namen von Varianten etc. zu den String-Übersetzungen von WPML hinzu und ermöglicht unter WPML -> String-Übersetzung die Übersetzung von diesen Inhalten.', 'wpsg'); ?></p>
-
- <input type="submit" name="wpsg_set_string_translation" class="button" value="<?php echo __('String-Übersetzung füllen', 'wpsg'); ?>" />
-
- </div>
- </div>
-
- </form>
-</div>
-
-
+<?php + + /** + * User: Daschmi (https://daschmi.de) + * Date: 01.06.2017 + * Time: 13:53 + */ + + namespace wpsg; + +?> + +<div class="wpsg_admin_submenu"> + + <div class="list-group"> + <span class="list-group-head list-group-item"><?php echo __('Konfiguration', 'wpsg'); ?></span> + <?php foreach ($this->view['arSubAction'] as $k => $v) { ?> + <a class="list-group-item <?php echo (($k == $this->view['subAction'])?'active':''); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=<?php echo $k; ?>"><?php echo $v['Menutext']; ?></a> + <?php } ?> + </div> + +</div> + +<div class="wpsg_admin_content form-horizontal"> + <form name="form1" method="post" enctype="multipart/form-data" action="<?php echo wpsg_hspc(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=wpml&noheader=1'); ?>"> + + <div class="panel panel-default"> + <div class="panel-heading clearfix"> + <h3 class="panel-title"><?php echo __('WPML Einstellungen', 'wpsg'); ?></h3> + </div> + <div class="panel-body"> + + <p class="info"><?php echo __('Fügt Ländernamen, Versandzonen, die Anredeauswahl und den Widerrufstext der Bestellbestätigung zu den String-Übersetzungen von WPML hinzu. Übersetzen Sie diese Einträge danach unter WPML -> String-Übersetzung. Zuvor automatisch angelegte Einträge werden dabei samt Übersetzung ersetzt.', 'wpsg'); ?></p> + + <input type="submit" name="wpsg_set_string_translation" class="button" value="<?php echo __('String-Übersetzung füllen', 'wpsg'); ?>" /> + + </div> + </div> + + </form> +</div> + + diff --git a/views/mods/mod_discount/settings_edit.phtml b/views/mods/mod_discount/settings_edit.phtml index d2b645c..248262b 100644 --- a/views/mods/mod_discount/settings_edit.phtml +++ b/views/mods/mod_discount/settings_edit.phtml @@ -44,7 +44,6 @@ <?php foreach ($this->view['wpsg_mod_discount']['hierarchie'] as $discount_typ) { ?>
<li class="<?php echo $discount_typ; ?>">
<input type="hidden" name="wpsg_mod_discount_hierarchie[]" value="<?php echo $discount_typ; ?>" />
- <input type="checkbox" value="<?php echo $discount_typ; ?>" <?php echo ((in_array($discount_typ, (array)explode(',', $this->get_option('wpsg_mod_discount_hierarchie'))))?'checked="checked"':''); ?> name="wpsg_mod_discount_hierarchie[]" />
<?php echo $this->callMod('wpsg_mod_discount', 'getNameFromType', array($discount_typ)); ?>
</li>
<?php } ?>
@@ -201,7 +200,7 @@ function wpsg_switchUniversalDiscount()
{
- if (jQuery('#wpsg_mod_discount_universal').attr("checked") == "checked")
+ if (jQuery('#wpsg_mod_discount_universal').prop('checked'))
{
jQuery('#wpsg_mod_discount_universal_layer').show();
}
diff --git a/views/mods/mod_productvariants/admin_edit.phtml b/views/mods/mod_productvariants/admin_edit.phtml index c68ad4f..eaeb4c3 100644 --- a/views/mods/mod_productvariants/admin_edit.phtml +++ b/views/mods/mod_productvariants/admin_edit.phtml @@ -1,591 +1,583 @@ -<?php
-
- /**
- * Template um eine Variante zu bearbeiten
- */
-
-?>
-
-<input type="hidden" id="wpsg_mod_productvariants_product_id" value="<?php echo $this->view['product_id']; ?>" />
-<input type="hidden" id="wpsg_mod_productvariants_var_id" value="<?php echo $this->view['variant']['id']; ?>" />
-
-<script>
-
- var wpframe; var wpsg_mod_productvariants_vari_id = 0;
- var metaBox = jQuery('#meta-box-id.postbox');
-
- var addImgLink = metaBox.find('.upload-custom-img');
- var delImgLink = metaBox.find('.delete-custom-img');
- var imgContainer = metaBox.find('.custom-img-container');
- var imgIdInput = metaBox.find('.custom-img-id');
-
-</script>
-
-<?php if (wpsg_isSizedArray($this->view['arVariation'])) { ?>
-
- <table class="table wpsg_mod_productvariants_table_variation">
- <thead>
- <tr>
-
- <?php $colspan = 0; if (wpsg_isSizedInt($this->view['product_id'])) { ?>
- <th class="col_active"><?php echo __('Aktiv', 'wpsg'); ?></th>
- <?php } ?>
-
- <th class="col_id"><?php echo __('Id', 'wpsg'); ?></th>
- <th class="col1"><?php echo __('Name', 'wpsg'); ?></th>
- <th class="col_shortname"><?php echo __('Kurzname', 'wpsg'); ?></th>
- <?php $colspan += 3; ?>
-
- <?php if (wpsg_isSizedInt($this->view['product_id'])) { $colspan += 2; ?>
- <!--<th class="col_artnr"><?php echo __('Artikelnummer', 'wpsg'); ?></th>-->
- <th class="col_price"><?php echo __('Preis', 'wpsg'); ?></th>
-
- <?php if ($this->hasMod('wpsg_mod_stock')) { ?>
- <th class="col_stock"><?php echo __('Lagerbestand', 'wpsg'); $colspan ++; ?></th>
- <th class="col_stock col_min_stock"><?php echo __('Minimallagerbestand', 'wpsg'); $colspan ++; ?></th>
- <?php } ?>
-
- <?php if ($this->hasMod('wpsg_mod_weight')) { ?>
- <th class="col_stock"><?php echo __('Gewicht', 'wpsg'); $colspan ++; ?></th>
- <?php } ?>
-
- <?php if ($this->hasMod('wpsg_mod_fuellmenge')) { ?>
- <th class="col_stock"><?php echo __('Füllmenge', 'wpsg'); $colspan ++; ?></th>
- <?php } ?>
-
- <?php } ?>
-
- <?php if (!wpsg_isSizedInt($this->view['product_id']) || wpsg_isSizedInt($this->view['variant']['product_id'])) { $colspan ++; ?>
- <th class="col_action"></th>
- <?php } ?>
-
- </tr>
- </thead>
- <?php $i = 0; foreach ($this->view['arVariation'] as $vari) { $i ++;
-
- $vari_id = intval($vari['id']);
-
- ?>
- <tbody id="vari_<?php echo $vari['id']; ?>">
- <tr>
-
- <?php if (wpsg_isSizedInt($this->view['product_id'])) { ?>
- <td class="col_active">
- <input type="checkbox" id="productvariation_active_<?php echo $vari['id']; ?>" name="active" value="1" <?php echo ((wpsg_isSizedString($vari['active'], '1'))?'checked="checked"':''); ?> />
- </td>
- <?php } ?>
-
- <td class="col_id">
- <?php echo $vari['id']; ?>
- <script type="text/javascript">/* <![CDATA[ */
-
- <?php if (!wpsg_isSizedInt($this->view['product_id']) || wpsg_isSizedInt($this->view['variant']['product_id'])) { ?>
- jQuery('#productvariation_name_<?php echo $vari['id']; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', {
- submitdata: {
- field: 'vari_name',
- field_id: '<?php echo $vari['id']; ?>'
- }
- });
-
- jQuery('#productvariation_shortname_<?php echo $vari['id']; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', {
- submitdata: {
- field: 'vari_shortname',
- field_id: '<?php echo $vari['id']; ?>'
- }
- });
- <?php } ?>
-
- jQuery('#productvariation_active_<?php echo $vari['id']; ?>').bind('change', function() {
-
- var value = '0';
- if (jQuery(this).prop('checked') === true) value = '1';
-
- jQuery.ajax( {
- url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1',
- data: {
- field: 'vari_active',
- field_id: '<?php echo $vari['id']; ?>',
- product_id: jQuery('#wpsg_mod_productvariants_product_id').val(),
- value: value
- }
- } );
-
- } );
-
- jQuery('#productvariation_anr_<?php echo $vari['id']; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', {
- submitdata: {
- field: 'vari_anr',
- product_id: jQuery('#wpsg_mod_productvariants_product_id').val(),
- field_id: '<?php echo $vari['id']; ?>'
- }
- });
-
- jQuery('#productvariation_price_<?php echo $vari['id']; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', {
- submitdata: {
- field: 'vari_price',
- product_id: jQuery('#wpsg_mod_productvariants_product_id').val(),
- field_id: '<?php echo $vari['id']; ?>'
- }
- });
-
- jQuery('#productvariation_stock_<?php echo $vari['id']; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', {
- submitdata: {
- field: 'vari_stock',
- product_id: jQuery('#wpsg_mod_productvariants_product_id').val(),
- field_id: '<?php echo $vari['id']; ?>'
- }
- });
-
- jQuery('#productvariation_min_stock_<?php echo $vari['id']; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', {
- submitdata: {
- field: 'vari_min_stock',
- product_id: jQuery('#wpsg_mod_productvariants_product_id').val(),
- field_id: '<?php echo $vari['id']; ?>'
- }
- });
-
- jQuery('#productvariation_weight_<?php echo $vari['id']; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', {
- submitdata: {
- field: 'vari_weight',
- product_id: jQuery('#wpsg_mod_productvariants_product_id').val(),
- field_id: '<?php echo $vari['id']; ?>'
- }
- });
-
- jQuery('#productvariation_fmenge_<?php echo $vari['id']; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', {
- submitdata: {
- field: 'vari_fmenge',
- product_id: jQuery('#wpsg_mod_productvariants_product_id').val(),
- field_id: '<?php echo $vari['id']; ?>'
- }
- });
-
-
- /* ]]> */</script>
- </td>
- <td class="col1"><span class="wpsg_editable" id="productvariation_name_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc($vari['name']); ?></span>
- <?php if (!isset($vari['iid'])) $vari['iid'] = $vari['id']; ?>
- <input type="hidden" id="productvariation_iid_<?php echo $vari['id']; ?>" value="<?php echo wpsg_getStr($vari['iid']); ?>" />
- </td>
- <td class="col_shortname"><span class="wpsg_editable" id="productvariation_shortname_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc($vari['shortname']); ?></span></td>
-
- <?php if (wpsg_isSizedInt($this->view['product_id'])) { ?>
- <!--<td class="col_artnr"><span class="wpsg_editable" id="productvariation_anr_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc($vari['anr']); ?></span></td>-->
- <td class="col_price"><span class="wpsg_editable" id="productvariation_price_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc(wpsg_ff($vari['price'], $this->get_option('wpsg_currency'))); ?></span></td>
-
- <?php if ($this->hasMod('wpsg_mod_stock')) { ?>
- <td class="col_stock"><span class="wpsg_editable" id="productvariation_stock_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc($vari['stock']); ?></span></td>
- <td class="col_stock"><span class="wpsg_editable" id="productvariation_min_stock_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc($vari['min_stock']); ?></span></td>
- <?php } ?>
-
- <?php if ($this->hasMod('wpsg_mod_weight')) { ?>
- <td class="col_stock"><span class="wpsg_editable" id="productvariation_weight_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc(wpsg_ff($vari['weight'])); ?></span></td>
- <?php } ?>
- <?php if ($this->hasMod('wpsg_mod_fuellmenge')) { ?>
- <td class="col_stock"><span class="wpsg_editable" id="productvariation_fmenge_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc(wpsg_ff($vari['fmenge'])); ?></span></td>
- <?php } ?>
-
- <?php } ?>
-
- <?php if (!wpsg_isSizedInt($this->view['product_id']) || wpsg_isSizedInt($this->view['variant']['product_id'])) { ?>
- <td class="col_action">
-
- <a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Variation löschen', 'wpsg'); ?>" onclick="return wpsg_mod_productvariation_del(<?php echo $this->view['product_id'].','.$vari['id']; ?>);"><span class="glyphicon glyphicon-trash"></span></a>
-
- </td>
- <?php } ?>
-
- </tr>
-
- <tr class="wpsg_mod_productvariants_productimage_row">
- <td class="col_active"> </td>
- <?php
-
- $has_global_images = false;
-
- if (wpsg_isSizedInt($this->view['product_id'])) {
-
- $global_images = wpsg_explode(',', $this->db->fetchOne("SELECT `images` FROM `".WPSG_TBL_VARIANTS_VARI."` WHERE `id` = '".wpsg_q($vari['id'])."' "));
-
- if (wpsg_isSizedArray($global_images)) {
-
- $arAttachmentIDs = $global_images;
- $has_global_images = true;
-
- } else $arAttachmentIDs = $this->imagehandler->getAttachmentIDs($this->view['product_id'], $vari['id'], true, false);
-
- } else {
-
- $arAttachmentIDs = $vari['images'];
-
- }
-
- ?>
- <td class="ui-sortable" colspan="<?php echo $colspan; ?>" id="wpsg_images_productimage_<?php echo $this->view['variant']['id']; ?>_<?php echo $vari['id']; ?>" >
-
- <div class="d-flex justify-content-between w-100">
-
- <div>
- <?php foreach ($arAttachmentIDs as $attachment_id) { $attachment_id = intval($attachment_id); ?>
-
- <?php if (wpsg_isSizedInt($this->view['product_id'])) { ?>
-
- <?php if ($has_global_images) { ?>
-
- <?php echo wp_get_attachment_image($attachment_id, array(25, 25), true); ?>
-
- <?php } else { ?>
-
- <a href="#" class="<?php echo ((in_array($attachment_id, explode(",", $vari['images_set'])) && !$has_global_images)?'mark':''); ?> pic" id="<?php echo $attachment_id; ?>" onclick="return wpsg_vp_vari_setPic(this, <?php echo $this->view['variant']['id']; ?>, <?php echo $vari['id'] ?>, '<?php echo $attachment_id; ?>', <?php echo $this->view['product_id']; ?>);">
- <?php echo wp_get_attachment_image($attachment_id, array(25, 25), true); ?>
- </a>
-
- <?php } ?>
-
- <?php } else { ?>
-
- <a href="#" class="pic wpsg_mod_productvariants_remove_global_vari_image"
- data-variant_id="<?php echo intval($_REQUEST['variant_id']); ?>"
- data-variation_id="<?php echo $vari['id']; ?>"
- data-attachment_id="<?php echo $attachment_id; ?>"
- >
- <?php echo wp_get_attachment_image($attachment_id, array(25, 25), true); ?>
- <span><span class="glyphicon glyphicon-trash"></span></span>
- </a>
-
- <?php } ?>
-
- <?php } ?>
- </div>
-
- <?php if (!wpsg_isSizedInt($this->view['product_id'])) { ?>
- <div>
-
- <input id="media_upload_<?php echo $vari['id']; ?>" value="<?php echo __('Mediathek', 'wpsg'); ?>" class="button" type="button" />
-
- </div>
- <?php } ?>
-
- </div>
-
- <?php if ($this->hasMod('wpsg_mod_downloadplus')) { ?>
- <div>
-
- <?php
-
- $arTemplates = $this->callMod('wpsg_mod_downloadplus', 'getTemplate', []);
- $arTemplatesLabel = [
- 0 => __('Unverändert', 'wpsg')
- ];
-
- foreach ($arTemplates as $t) $arTemplatesLabel[intval($t['id'])] = $t['name'];
-
- ?>
-
- <span title="<?php echo __('Templatevorgabe für PDF Anpassungen mit DownloadPlus', 'wpsg'); ?>" class="wpsg_editable" id="productvariation_template_<?php echo $vari['id']; ?>"><?php
-
- $template_id = intval($vari['template_id']);
-
- if ($template_id > 0 && isset($arTemplatesLabel[$template_id])) echo $arTemplatesLabel[$template_id];
- else __('Unverändert', 'wpsg');
-
- ?></span>
-
- <script>
-
- jQuery('#productvariation_template_<?php echo $vari['id']; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', {
- submitdata: {
- field: 'template_id',
- field_id: '<?php echo $vari['id']; ?>'
- },
- data: <?php echo wpsg_prepare_for_inlineEdit($arTemplatesLabel); ?>,
- type: 'select'
- });
-
- </script>
-
- <?php if (intval($this->view['product_id']) <= 0) { ?>
- <span style="padding-left:15px;">
- <span style="display:inline-block; margin-right:5px;"><?php echo __('Für alle Downloadplus Produkte:', 'wpsg'); ?></span>
- <a onclick="return wpsg_mod_downloadplus_setProducts(<?php echo $vari['id']; ?>, '1');" href="#" style="display:inline-block;"><?php echo __('aktivieren', 'wpsg'); ?></a>
- <span style="margin:0 3px; text-align:center;">/</span>
- <a onclick="return wpsg_mod_downloadplus_setProducts(<?php echo $vari['id']; ?>, '0');" href="#" style="display:inline-block;"><?php echo __('deaktivieren', 'wpsg'); ?></a>
- </span>
- <?php } ?>
-
- </div>
- <?php } ?>
-
- <?php /* if (wpsg_isSizedInt($this->view['product_id'])) { ?>
- <div style="margin-top:0.25rem;">
- <span>EAN:
- <span title="<?php echo __('EAN der Produktvariation', 'wpsg'); ?>" class="wpsg_editable" id="productvariation_ean_<?php echo $vari['id']; ?>"><?php echo $vari['ean']??''; ?></span>
- </span>
- <script>
-
- jQuery('#productvariation_ean_<?php echo $vari['id']; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', {
- submitdata: {
- field: 'ean',
- product_id: <?php echo $this->view['product_id']; ?>,
- field_id: '<?php echo $vari['id']; ?>'
- }
- });
-
- </script>
- </div>
- <?php } */ ?>
-
- <script>
-
- function wpsg_mod_downloadplus_setProducts(vari_id, active) {
-
- jQuery.ajax( {
- url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_wpsg_mod_downloadplus_setProducts&noheader=1',
- async: false,
- data: {
- vari_id: vari_id,
- active: active
- },
- success: function(data) {
-
- if (data != '1') alert(data);
-
- }
- } );
-
- return false;
-
- }
-
- jQuery(document).ready(function() {
-
- <?php if (intval($this->view['product_id']) <= 0) { ?>
- document.getElementById('media_upload_<?php echo $vari['id']; ?>').addEventListener('click', (event) => {
-
- event.preventDefault();
-
- wpsg_mod_productvariants_vari_id = <?php echo $vari['id']; ?>;
-
- if (wpframe !== undefined) { wpframe.open(); return; }
-
- wpframe = wp.media.frames.file_frame = wp.media({
- title: "<?php echo __('Auswählen oder Hochladen von Medien', 'wpsg'); ?>",
- button: { text: "<?php echo __('Medien benutzen', 'wpsg'); ?>" },
- multiple: true
- });
-
- wpframe.on('select', () => {
-
- let arAtt = [];
- let attachments = wpframe.state().get('selection').map((attachment) => {
-
- attachment.toJSON();
-
- arAtt.push(attachment.id);
-
- return attachment;
-
- });
-
- jQuery('#wpsg_mod_productvariants_dialog_modal .modal-body').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_productvariants&subaction=admin_upload&noheader=1',
- async: true,
- data: {
- product_id: '<?php echo intval($_REQUEST['product_id']); ?>',
- variant_id: '<?php echo intval($_REQUEST['variant_id']); ?>',
- vari_id: wpsg_mod_productvariants_vari_id,
- arAtt: arAtt
- },
- success: function(data) {
-
- jQuery('#wpsg_mod_productvariants_dialog_modal .modal-body').html(data);
-
- }
- });
-
- });
-
- wpframe.open();
-
- });
- <?php } ?>
-
- <?php if (intval($this->view['product_id']) > 0) { ?>
- jQuery('#wpsg_images_productimage_<?php echo $this->view['variant']['id']; ?>_<?php echo $vari['id']; ?>').sortable( {
- items: 'a',
- helper : 'clone',
- update: function(event, ui) {
-
- wpsg_vp_ajaxloading_show();
-
- var wpsg_reorder = jQuery(this).sortable('toArray');
-
- jQuery.ajax( {
- url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt&action=ajax&mod=wpsg_mod_productvariants&cmd=wpsg_var_setImageOrder&noheader=1&edit_id=<?php echo $this->view['product_id']; ?>',
- async: false,
- data: {
- 'var_id': <?php echo $this->view['variant']['id']; ?>,
- 'vari_id': <?php echo $vari['id']; ?>,
- 'wpsg_reorder': wpsg_reorder
- },
- success: function(data) {
-
- if (data != '1') alert(data);
-
- wpsg_vp_ajaxloading_hide();
-
- }
- } );
-
- }
- } ).disableSelection();
- <?php } ?>
-
- } );
-
- </script>
-
- </td>
-
- </tr>
-
- </tbody>
- <?php } ?>
-
- </table>
-
- <script>
-
- function wpsg_vp_vari_setPic(htmlElement, var_id, vari_id, attachment_id, product_id)
- {
-
- <?php if (!isset($_REQUEST['wpsg_lang'])) { ?>
-
- wpsg_vp_ajaxloading_show();
-
- jQuery.ajax( {
- url: "<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt&action=ajax&mod=wpsg_mod_productvariants&cmd=wpsg_vp_vari_setPic&noheader=1&edit_id=<?php echo $this->view['product_id']; ?>",
- async: false,
- data: {
- var_id: var_id,
- vari_id: vari_id,
- product_id: product_id,
- attachment_id: attachment_id
- },
- success: function(data) {
-
- jQuery(htmlElement).toggleClass('mark');
-
- wpsg_vp_ajaxloading_hide();
-
- }
- } );
-
- <?php } ?>
-
- return false;
-
- }
-
- function wpsg_vp_ajaxloading_show()
- {
-
- jQuery('.wpsg_mod_productvariants_ajaxloading').show();
-
- }
-
- function wpsg_vp_ajaxloading_hide()
- {
-
- jQuery('.wpsg_mod_productvariants_ajaxloading').hide();
-
- }
-
-
- <?php
- $b1 = wpsg_isSizedInt($this->view['product_id']);
- $b2 = wpsg_isSizedInt($this->view['variant']['product_id']);
- if (!wpsg_isSizedInt($this->view['product_id']) || wpsg_isSizedInt($this->view['variant']['product_id'])) {
- ?>
- <?php
- $p1 = wpsg_getInt($this->view['product_id']);
- $p2 = ($this->view['variant']['product_id']);
- ?>
-
- jQuery('.wpsg_mod_productvariants_table_variation').sortable( {
- items: 'tbody',
- helper: wpsg_Tablefix,
- update: function(event, ui) {
-
- var wpsg_reorder = jQuery(this).sortable('toArray');
- var product_id = jQuery('#wpsg_mod_productvariants_product_id').val();
-
- jQuery.ajax( {
- url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1',
- data: {
- 'field': 'vari_pos',
- 'value': jQuery(this).sortable('toArray'),
- 'product_id': product_id
- },
- success: function(data) { }
- } );
-
- }
- } ).disableSelection();
-
- <?php } ?>
-
- <?php if (wpsg_isSizedInt($this->view['variant']['product_id']) || !wpsg_isSizedInt($this->view['product_id'])) { ?>
- jQuery('#wpsg_mod_productvariants_variation_add_button').show();
- <?php } else { ?>
- jQuery('#wpsg_mod_productvariants_variation_add_button').hide();
- <?php } ?>
-
- jQuery('.wpsg_mod_productvariants_remove_global_vari_image').on('click', function() {
-
- let el = jQuery(this);
-
- event.preventDefault();
-
- if (!confirm('<?php echo __('Sind Sie sich sicher?', 'wpsg'); ?>')) return;
-
- el.remove();
-
- jQuery.ajax({
- url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_removeImage&noheader=1',
- async: true,
- data: {
- product_id: 0,
- variant_id: el.data('variant_id'),
- vari_id: el.data('variation_id'),
- attachment_id: el.data('attachment_id')
- },
- success: function(data) { }
- });
-
- });
-
- </script>
-
- <?php if (!wpsg_isSizedInt($this->view['product_id'])) { ?>
- <p class="wpsg_hinweis"><?php echo __('Reihenfolge kann mittels Drag&Drop verändert werden.', 'wpsg'); ?></p>
- <?php } ?>
-
-<?php } else { ?>
-
- <?php echo __('Bisher keine Variationen der Variante angelegt.', 'wpsg'); ?>
-
- <script>
-
- <?php if (wpsg_isSizedInt($this->view['variant']['product_id']) || !wpsg_isSizedInt($this->view['product_id'])) { ?>
- jQuery('.wpsg_mod_productvariants_variation_add_button').show();
- <?php } else { ?>
- jQuery('.wpsg_mod_productvariants_variation_add_button').hide();
- <?php } ?>
-
- </script>
-
-<?php } ?>
-
+<?php + + /** + * Template um eine Variante zu bearbeiten + */ + +?> + +<input type="hidden" id="wpsg_mod_productvariants_product_id" value="<?php echo $this->view['product_id']; ?>" /> +<input type="hidden" id="wpsg_mod_productvariants_var_id" value="<?php echo $this->view['variant']['id']; ?>" /> + +<script> + + var wpframe; var wpsg_mod_productvariants_vari_id = 0; + var metaBox = jQuery('#meta-box-id.postbox'); + + var addImgLink = metaBox.find('.upload-custom-img'); + var delImgLink = metaBox.find('.delete-custom-img'); + var imgContainer = metaBox.find('.custom-img-container'); + var imgIdInput = metaBox.find('.custom-img-id'); + +</script> + +<?php if (wpsg_isSizedArray($this->view['arVariation'])) { ?> + + <table class="table wpsg_mod_productvariants_table_variation"> + <thead> + <tr> + + <?php $colspan = 0; if (wpsg_isSizedInt($this->view['product_id'])) { ?> + <th class="col_active"><?php echo __('Aktiv', 'wpsg'); ?></th> + <?php } ?> + + <th class="col_id"><?php echo __('Id', 'wpsg'); ?></th> + <th class="col1"><?php echo __('Name', 'wpsg'); ?></th> + <th class="col_shortname"><?php echo __('Kurzname', 'wpsg'); ?></th> + <?php $colspan += 3; ?> + + <?php if (wpsg_isSizedInt($this->view['product_id'])) { $colspan += 2; ?> + <!--<th class="col_artnr"><?php echo __('Artikelnummer', 'wpsg'); ?></th>--> + <th class="col_price"><?php echo __('Preis', 'wpsg'); ?></th> + + <?php if ($this->hasMod('wpsg_mod_stock')) { ?> + <th class="col_stock"><?php echo __('Lagerbestand', 'wpsg'); $colspan ++; ?></th> + <th class="col_stock col_min_stock"><?php echo __('Minimallagerbestand', 'wpsg'); $colspan ++; ?></th> + <?php } ?> + + <?php if ($this->hasMod('wpsg_mod_weight')) { ?> + <th class="col_stock"><?php echo __('Gewicht', 'wpsg'); $colspan ++; ?></th> + <?php } ?> + + <?php if ($this->hasMod('wpsg_mod_fuellmenge')) { ?> + <th class="col_stock"><?php echo __('Füllmenge', 'wpsg'); $colspan ++; ?></th> + <?php } ?> + + <?php } ?> + + <?php if (!wpsg_isSizedInt($this->view['product_id']) || wpsg_isSizedInt($this->view['variant']['product_id'])) { $colspan ++; ?> + <th class="col_action"></th> + <?php } ?> + + </tr> + </thead> + <?php $i = 0; foreach ($this->view['arVariation'] as $vari) { $i ++; + + $vari_id = intval($vari['id']); + + ?> + <tbody id="vari_<?php echo $vari['id']; ?>"> + <tr> + + <?php if (wpsg_isSizedInt($this->view['product_id'])) { ?> + <td class="col_active"> + <input type="checkbox" id="productvariation_active_<?php echo $vari['id']; ?>" name="active" value="1" <?php echo ((wpsg_isSizedString($vari['active'], '1'))?'checked="checked"':''); ?> /> + </td> + <?php } ?> + + <td class="col_id"> + <?php echo $vari['id']; ?> + <script type="text/javascript">/* <![CDATA[ */ + + <?php if (!wpsg_isSizedInt($this->view['product_id']) || wpsg_isSizedInt($this->view['variant']['product_id'])) { ?> + jQuery('#productvariation_name_<?php echo $vari['id']; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', { + submitdata: { + field: 'vari_name', + field_id: '<?php echo $vari['id']; ?>' + } + }); + + jQuery('#productvariation_shortname_<?php echo $vari['id']; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', { + submitdata: { + field: 'vari_shortname', + field_id: '<?php echo $vari['id']; ?>' + } + }); + <?php } ?> + + jQuery('#productvariation_active_<?php echo $vari['id']; ?>').bind('change', function() { + + var value = '0'; + if (jQuery(this).prop('checked') === true) value = '1'; + + jQuery.ajax( { + url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', + data: { + field: 'vari_active', + field_id: '<?php echo $vari['id']; ?>', + product_id: jQuery('#wpsg_mod_productvariants_product_id').val(), + value: value + } + } ); + + } ); + + jQuery('#productvariation_price_<?php echo $vari['id']; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', { + submitdata: { + field: 'vari_price', + product_id: jQuery('#wpsg_mod_productvariants_product_id').val(), + field_id: '<?php echo $vari['id']; ?>' + } + }); + + jQuery('#productvariation_stock_<?php echo $vari['id']; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', { + submitdata: { + field: 'vari_stock', + product_id: jQuery('#wpsg_mod_productvariants_product_id').val(), + field_id: '<?php echo $vari['id']; ?>' + } + }); + + jQuery('#productvariation_min_stock_<?php echo $vari['id']; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', { + submitdata: { + field: 'vari_min_stock', + product_id: jQuery('#wpsg_mod_productvariants_product_id').val(), + field_id: '<?php echo $vari['id']; ?>' + } + }); + + jQuery('#productvariation_weight_<?php echo $vari['id']; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', { + submitdata: { + field: 'vari_weight', + product_id: jQuery('#wpsg_mod_productvariants_product_id').val(), + field_id: '<?php echo $vari['id']; ?>' + } + }); + + jQuery('#productvariation_fmenge_<?php echo $vari['id']; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', { + submitdata: { + field: 'vari_fmenge', + product_id: jQuery('#wpsg_mod_productvariants_product_id').val(), + field_id: '<?php echo $vari['id']; ?>' + } + }); + + + /* ]]> */</script> + </td> + <td class="col1"><span class="wpsg_editable" id="productvariation_name_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc($vari['name']); ?></span> + <?php if (!isset($vari['iid'])) $vari['iid'] = $vari['id']; ?> + <input type="hidden" id="productvariation_iid_<?php echo $vari['id']; ?>" value="<?php echo wpsg_getStr($vari['iid']); ?>" /> + </td> + <td class="col_shortname"><span class="wpsg_editable" id="productvariation_shortname_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc($vari['shortname']); ?></span></td> + + <?php if (wpsg_isSizedInt($this->view['product_id'])) { ?> + <!--<td class="col_artnr"><span class="wpsg_editable" id="productvariation_anr_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc($vari['anr']); ?></span></td>--> + <td class="col_price"><span class="wpsg_editable" id="productvariation_price_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc(wpsg_ff($vari['price'], $this->get_option('wpsg_currency'))); ?></span></td> + + <?php if ($this->hasMod('wpsg_mod_stock')) { ?> + <td class="col_stock"><span class="wpsg_editable" id="productvariation_stock_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc($vari['stock']); ?></span></td> + <td class="col_stock"><span class="wpsg_editable" id="productvariation_min_stock_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc($vari['min_stock']); ?></span></td> + <?php } ?> + + <?php if ($this->hasMod('wpsg_mod_weight')) { ?> + <td class="col_stock"><span class="wpsg_editable" id="productvariation_weight_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc(wpsg_ff($vari['weight'])); ?></span></td> + <?php } ?> + <?php if ($this->hasMod('wpsg_mod_fuellmenge')) { ?> + <td class="col_stock"><span class="wpsg_editable" id="productvariation_fmenge_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc(wpsg_ff($vari['fmenge'])); ?></span></td> + <?php } ?> + + <?php } ?> + + <?php if (!wpsg_isSizedInt($this->view['product_id']) || wpsg_isSizedInt($this->view['variant']['product_id'])) { ?> + <td class="col_action"> + + <a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Variation löschen', 'wpsg'); ?>" onclick="return wpsg_mod_productvariation_del(<?php echo $this->view['product_id'].','.$vari['id']; ?>);"><span class="glyphicon glyphicon-trash"></span></a> + + </td> + <?php } ?> + + </tr> + + <tr class="wpsg_mod_productvariants_productimage_row"> + <td class="col_active"> </td> + <?php + + $has_global_images = false; + + if (wpsg_isSizedInt($this->view['product_id'])) { + + $global_images = wpsg_explode(',', $this->db->fetchOne("SELECT `images` FROM `".WPSG_TBL_VARIANTS_VARI."` WHERE `id` = '".wpsg_q($vari['id'])."' ")); + + if (wpsg_isSizedArray($global_images)) { + + $arAttachmentIDs = $global_images; + $has_global_images = true; + + } else $arAttachmentIDs = $this->imagehandler->getAttachmentIDs($this->view['product_id'], $vari['id'], true, false); + + } else { + + $arAttachmentIDs = $vari['images']; + + } + + ?> + <td class="ui-sortable" colspan="<?php echo $colspan; ?>" id="wpsg_images_productimage_<?php echo $this->view['variant']['id']; ?>_<?php echo $vari['id']; ?>" > + + <div class="d-flex justify-content-between w-100"> + + <div> + <?php foreach ($arAttachmentIDs as $attachment_id) { $attachment_id = intval($attachment_id); ?> + + <?php if (wpsg_isSizedInt($this->view['product_id'])) { ?> + + <?php if ($has_global_images) { ?> + + <?php echo wp_get_attachment_image($attachment_id, array(25, 25), true); ?> + + <?php } else { ?> + + <a href="#" class="<?php echo ((in_array($attachment_id, explode(",", $vari['images_set'])) && !$has_global_images)?'mark':''); ?> pic" id="<?php echo $attachment_id; ?>" onclick="return wpsg_vp_vari_setPic(this, <?php echo $this->view['variant']['id']; ?>, <?php echo $vari['id'] ?>, '<?php echo $attachment_id; ?>', <?php echo $this->view['product_id']; ?>);"> + <?php echo wp_get_attachment_image($attachment_id, array(25, 25), true); ?> + </a> + + <?php } ?> + + <?php } else { ?> + + <a href="#" class="pic wpsg_mod_productvariants_remove_global_vari_image" + data-variant_id="<?php echo intval($_REQUEST['variant_id']); ?>" + data-variation_id="<?php echo $vari['id']; ?>" + data-attachment_id="<?php echo $attachment_id; ?>" + > + <?php echo wp_get_attachment_image($attachment_id, array(25, 25), true); ?> + <span><span class="glyphicon glyphicon-trash"></span></span> + </a> + + <?php } ?> + + <?php } ?> + </div> + + <?php if (!wpsg_isSizedInt($this->view['product_id'])) { ?> + <div> + + <input id="media_upload_<?php echo $vari['id']; ?>" value="<?php echo __('Mediathek', 'wpsg'); ?>" class="button" type="button" /> + + </div> + <?php } ?> + + </div> + + <?php if ($this->hasMod('wpsg_mod_downloadplus')) { ?> + <div> + + <?php + + $arTemplates = $this->callMod('wpsg_mod_downloadplus', 'getTemplate', []); + $arTemplatesLabel = [ + 0 => __('Unverändert', 'wpsg') + ]; + + foreach ($arTemplates as $t) $arTemplatesLabel[intval($t['id'])] = $t['name']; + + ?> + + <span title="<?php echo __('Templatevorgabe für PDF Anpassungen mit DownloadPlus', 'wpsg'); ?>" class="wpsg_editable" id="productvariation_template_<?php echo $vari['id']; ?>"><?php + + $template_id = intval($vari['template_id']); + + if ($template_id > 0 && isset($arTemplatesLabel[$template_id])) echo $arTemplatesLabel[$template_id]; + else __('Unverändert', 'wpsg'); + + ?></span> + + <script> + + jQuery('#productvariation_template_<?php echo $vari['id']; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', { + submitdata: { + field: 'template_id', + field_id: '<?php echo $vari['id']; ?>' + }, + data: <?php echo wpsg_prepare_for_inlineEdit($arTemplatesLabel); ?>, + type: 'select' + }); + + </script> + + <?php if (intval($this->view['product_id']) <= 0) { ?> + <span style="padding-left:15px;"> + <span style="display:inline-block; margin-right:5px;"><?php echo __('Für alle Downloadplus Produkte:', 'wpsg'); ?></span> + <a onclick="return wpsg_mod_downloadplus_setProducts(<?php echo $vari['id']; ?>, '1');" href="#" style="display:inline-block;"><?php echo __('aktivieren', 'wpsg'); ?></a> + <span style="margin:0 3px; text-align:center;">/</span> + <a onclick="return wpsg_mod_downloadplus_setProducts(<?php echo $vari['id']; ?>, '0');" href="#" style="display:inline-block;"><?php echo __('deaktivieren', 'wpsg'); ?></a> + </span> + <?php } ?> + + </div> + <?php } ?> + + <?php /* if (wpsg_isSizedInt($this->view['product_id'])) { ?> + <div style="margin-top:0.25rem;"> + <span>EAN: + <span title="<?php echo __('EAN der Produktvariation', 'wpsg'); ?>" class="wpsg_editable" id="productvariation_ean_<?php echo $vari['id']; ?>"><?php echo $vari['ean']??''; ?></span> + </span> + <script> + + jQuery('#productvariation_ean_<?php echo $vari['id']; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', { + submitdata: { + field: 'ean', + product_id: <?php echo $this->view['product_id']; ?>, + field_id: '<?php echo $vari['id']; ?>' + } + }); + + </script> + </div> + <?php } */ ?> + + <script> + + function wpsg_mod_downloadplus_setProducts(vari_id, active) { + + jQuery.ajax( { + url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_wpsg_mod_downloadplus_setProducts&noheader=1', + async: false, + data: { + vari_id: vari_id, + active: active + }, + success: function(data) { + + if (data != '1') alert(data); + + } + } ); + + return false; + + } + + jQuery(document).ready(function() { + + <?php if (intval($this->view['product_id']) <= 0) { ?> + document.getElementById('media_upload_<?php echo $vari['id']; ?>').addEventListener('click', (event) => { + + event.preventDefault(); + + wpsg_mod_productvariants_vari_id = <?php echo $vari['id']; ?>; + + if (wpframe !== undefined) { wpframe.open(); return; } + + wpframe = wp.media.frames.file_frame = wp.media({ + title: "<?php echo __('Auswählen oder Hochladen von Medien', 'wpsg'); ?>", + button: { text: "<?php echo __('Medien benutzen', 'wpsg'); ?>" }, + multiple: true + }); + + wpframe.on('select', () => { + + let arAtt = []; + let attachments = wpframe.state().get('selection').map((attachment) => { + + attachment.toJSON(); + + arAtt.push(attachment.id); + + return attachment; + + }); + + jQuery('#wpsg_mod_productvariants_dialog_modal .modal-body').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_productvariants&subaction=admin_upload&noheader=1', + async: true, + data: { + product_id: '<?php echo intval($_REQUEST['product_id']); ?>', + variant_id: '<?php echo intval($_REQUEST['variant_id']); ?>', + vari_id: wpsg_mod_productvariants_vari_id, + arAtt: arAtt + }, + success: function(data) { + + jQuery('#wpsg_mod_productvariants_dialog_modal .modal-body').html(data); + + } + }); + + }); + + wpframe.open(); + + }); + <?php } ?> + + <?php if (intval($this->view['product_id']) > 0) { ?> + jQuery('#wpsg_images_productimage_<?php echo $this->view['variant']['id']; ?>_<?php echo $vari['id']; ?>').sortable( { + items: 'a', + helper : 'clone', + update: function(event, ui) { + + wpsg_vp_ajaxloading_show(); + + var wpsg_reorder = jQuery(this).sortable('toArray'); + + jQuery.ajax( { + url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt&action=ajax&mod=wpsg_mod_productvariants&cmd=wpsg_var_setImageOrder&noheader=1&edit_id=<?php echo $this->view['product_id']; ?>', + async: false, + data: { + 'var_id': <?php echo $this->view['variant']['id']; ?>, + 'vari_id': <?php echo $vari['id']; ?>, + 'wpsg_reorder': wpsg_reorder + }, + success: function(data) { + + if (data != '1') alert(data); + + wpsg_vp_ajaxloading_hide(); + + } + } ); + + } + } ).disableSelection(); + <?php } ?> + + } ); + + </script> + + </td> + + </tr> + + </tbody> + <?php } ?> + + </table> + + <script> + + function wpsg_vp_vari_setPic(htmlElement, var_id, vari_id, attachment_id, product_id) + { + + <?php if (!isset($_REQUEST['wpsg_lang'])) { ?> + + wpsg_vp_ajaxloading_show(); + + jQuery.ajax( { + url: "<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt&action=ajax&mod=wpsg_mod_productvariants&cmd=wpsg_vp_vari_setPic&noheader=1&edit_id=<?php echo $this->view['product_id']; ?>", + async: false, + data: { + var_id: var_id, + vari_id: vari_id, + product_id: product_id, + attachment_id: attachment_id + }, + success: function(data) { + + jQuery(htmlElement).toggleClass('mark'); + + wpsg_vp_ajaxloading_hide(); + + } + } ); + + <?php } ?> + + return false; + + } + + function wpsg_vp_ajaxloading_show() + { + + jQuery('.wpsg_mod_productvariants_ajaxloading').show(); + + } + + function wpsg_vp_ajaxloading_hide() + { + + jQuery('.wpsg_mod_productvariants_ajaxloading').hide(); + + } + + + <?php + $b1 = wpsg_isSizedInt($this->view['product_id']); + $b2 = wpsg_isSizedInt($this->view['variant']['product_id']); + if (!wpsg_isSizedInt($this->view['product_id']) || wpsg_isSizedInt($this->view['variant']['product_id'])) { + ?> + <?php + $p1 = wpsg_getInt($this->view['product_id']); + $p2 = ($this->view['variant']['product_id']); + ?> + + jQuery('.wpsg_mod_productvariants_table_variation').sortable( { + items: 'tbody', + helper: wpsg_Tablefix, + update: function(event, ui) { + + var wpsg_reorder = jQuery(this).sortable('toArray'); + var product_id = jQuery('#wpsg_mod_productvariants_product_id').val(); + + jQuery.ajax( { + url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', + data: { + 'field': 'vari_pos', + 'value': jQuery(this).sortable('toArray'), + 'product_id': product_id + }, + success: function(data) { } + } ); + + } + } ).disableSelection(); + + <?php } ?> + + <?php if (wpsg_isSizedInt($this->view['variant']['product_id']) || !wpsg_isSizedInt($this->view['product_id'])) { ?> + jQuery('#wpsg_mod_productvariants_variation_add_button').show(); + <?php } else { ?> + jQuery('#wpsg_mod_productvariants_variation_add_button').hide(); + <?php } ?> + + jQuery('.wpsg_mod_productvariants_remove_global_vari_image').on('click', function() { + + let el = jQuery(this); + + event.preventDefault(); + + if (!confirm('<?php echo __('Sind Sie sich sicher?', 'wpsg'); ?>')) return; + + el.remove(); + + jQuery.ajax({ + url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_removeImage&noheader=1', + async: true, + data: { + product_id: 0, + variant_id: el.data('variant_id'), + vari_id: el.data('variation_id'), + attachment_id: el.data('attachment_id') + }, + success: function(data) { } + }); + + }); + + </script> + + <?php if (!wpsg_isSizedInt($this->view['product_id'])) { ?> + <p class="wpsg_hinweis"><?php echo __('Reihenfolge kann mittels Drag&Drop verändert werden.', 'wpsg'); ?></p> + <?php } ?> + +<?php } else { ?> + + <?php echo __('Bisher keine Variationen der Variante angelegt.', 'wpsg'); ?> + + <script> + + <?php if (wpsg_isSizedInt($this->view['variant']['product_id']) || !wpsg_isSizedInt($this->view['product_id'])) { ?> + jQuery('.wpsg_mod_productvariants_variation_add_button').show(); + <?php } else { ?> + jQuery('.wpsg_mod_productvariants_variation_add_button').hide(); + <?php } ?> + + </script> + +<?php } ?> + diff --git a/views/mods/mod_productvariants/settings_edit.phtml b/views/mods/mod_productvariants/settings_edit.phtml index 2fc3585..63c17c2 100644 --- a/views/mods/mod_productvariants/settings_edit.phtml +++ b/views/mods/mod_productvariants/settings_edit.phtml @@ -1,50 +1,49 @@ -<?php
-
- /*
- * Template für die Einstellungen des Moduls
- */
-
-?>
-
-<br />
-
-<div>
- <ul class="nav nav-tabs">
- <li role="presentation" class="active"><a href="#tab1" role="tab" data-toggle="tab"><?php echo __('Globale Produktvarianten', 'wpsg'); ?></a></li>
- <li role="presentation"><a href="#tab2" role="tab" data-toggle="tab"><?php echo __('Einstellungen', 'wpsg'); ?></a></li>
- </ul>
- <div class="tab-content">
- <div id="tab1" role="tabpanel" class="tab-pane active">
- <?php echo $this->view['wpsg_mod_productvariants']['html']; ?>
- </div>
- <div id="tab2" role="tabpanel" class="tab-pane">
-
- <?php echo wpsg_drawForm_Checkbox('wpsg_mod_productvariants_price', __('Preis der Variation direkt anzeigen', 'wpsg'), $this->get_option('wpsg_mod_productvariants_price')); ?>
- <?php echo wpsg_drawForm_Checkbox('wpsg_vp_detailview', __('Erweiterte Variantenanzeige aktivieren', 'wpsg'), $this->get_option('wpsg_vp_detailview'), array('help' => 'wpsg_vp_detailview')); ?>
- <?php echo wpsg_drawForm_Checkbox('wpsg_vp_replaceanr', __('Produktartikelnummer ersetzen', 'wpsg'), $this->get_option('wpsg_vp_replaceanr'), array('hint' => __('Ersetzt die Produktartikelnummer durch die zusammengesetzte Artikelnummern der Varianten.', 'wpsg'), 'help' => 'wpsg_vp_replaceanr')); ?>
- <?php echo wpsg_drawForm_Checkbox('wpsg_vp_product_stock_nocalc', __('Produktbestand nach Kauf nicht berechnen', 'wpsg'), $this->get_option('wpsg_vp_product_stock_nocalc'), [
- 'hint' => __('Ist diese Option aktiv, so bildet sich der Bestand im Produkt bei Variantenprodukten nicht aus den Varianten neu sondern wird einfach reduziert.', 'wpsg'), 'help' => 'wpsg_vp_product_stock_nocalc'
- ]); ?>
-
- <?php echo wpsg_drawForm_Checkbox('wpsg_vp_product_stock_varinotchange', __('Produktbestand in Varianten nicht verringern', 'wpsg'), $this->get_option('wpsg_vp_product_stock_varinotchange'), [
- 'hint' => __('Ist diese Option aktiv, so wird bei Kauf der Bestand in den Varianten nicht verringert.', 'wpsg'), 'help' => 'wpsg_vp_product_stock_varinotchange'
- ]); ?>
-
- <?php echo wpsg_drawForm_Checkbox('wpsg_vp_product_stock_display', __('Produktbestand statt Variantenbestand anzeigen', 'wpsg'), $this->get_option('wpsg_vp_product_stock_display'), [
- 'hint' => __('Ist diese Option aktiv, so wird nur der Produktbestand im Produkttemplate (Frontend) angezeigt.', 'wpsg'), 'help' => 'wpsg_vp_product_stock_display'
- ]); ?>
-
- </div>
-</div>
-
-
-<script type="text/javascript">/* <![CDATA[ */
-
- jQuery(document).ready(function() {
-
- wpsg_mod_productvariants_show(0);
-
- } );
-
-/* ]]> */</script>
+<?php + + /* + * Template für die Einstellungen des Moduls + */ + +?> + +<br /> + +<div> + <ul class="nav nav-tabs"> + <li role="presentation" class="active"><a href="#tab1" role="tab" data-toggle="tab"><?php echo __('Globale Produktvarianten', 'wpsg'); ?></a></li> + <li role="presentation"><a href="#tab2" role="tab" data-toggle="tab"><?php echo __('Einstellungen', 'wpsg'); ?></a></li> + </ul> + <div class="tab-content"> + <div id="tab1" role="tabpanel" class="tab-pane active"> + <?php echo $this->view['wpsg_mod_productvariants']['html']; ?> + </div> + <div id="tab2" role="tabpanel" class="tab-pane"> + + <?php echo wpsg_drawForm_Checkbox('wpsg_mod_productvariants_price', __('Preis der Variation direkt anzeigen', 'wpsg'), $this->get_option('wpsg_mod_productvariants_price')); ?> + <?php echo wpsg_drawForm_Checkbox('wpsg_vp_detailview', __('Erweiterte Variantenanzeige aktivieren', 'wpsg'), $this->get_option('wpsg_vp_detailview'), array('help' => 'wpsg_vp_detailview')); ?> + <?php echo wpsg_drawForm_Checkbox('wpsg_vp_product_stock_nocalc', __('Produktbestand nach Kauf nicht berechnen', 'wpsg'), $this->get_option('wpsg_vp_product_stock_nocalc'), [ + 'hint' => __('Ist diese Option aktiv, so bildet sich der Bestand im Produkt bei Variantenprodukten nicht aus den Varianten neu sondern wird einfach reduziert.', 'wpsg'), 'help' => 'wpsg_vp_product_stock_nocalc' + ]); ?> + + <?php echo wpsg_drawForm_Checkbox('wpsg_vp_product_stock_varinotchange', __('Produktbestand in Varianten nicht verringern', 'wpsg'), $this->get_option('wpsg_vp_product_stock_varinotchange'), [ + 'hint' => __('Ist diese Option aktiv, so wird bei Kauf der Bestand in den Varianten nicht verringert.', 'wpsg'), 'help' => 'wpsg_vp_product_stock_varinotchange' + ]); ?> + + <?php echo wpsg_drawForm_Checkbox('wpsg_vp_product_stock_display', __('Produktbestand statt Variantenbestand anzeigen', 'wpsg'), $this->get_option('wpsg_vp_product_stock_display'), [ + 'hint' => __('Ist diese Option aktiv, so wird nur der Produktbestand im Produkttemplate (Frontend) angezeigt.', 'wpsg'), 'help' => 'wpsg_vp_product_stock_display' + ]); ?> + + </div> +</div> + + +<script type="text/javascript">/* <![CDATA[ */ + + jQuery(document).ready(function() { + + wpsg_mod_productvariants_show(0); + + } ); + +/* ]]> */</script>
\ No newline at end of file diff --git a/views/mods/mod_produktartikel/settings_edit.phtml b/views/mods/mod_produktartikel/settings_edit.phtml index 5d2eb3c..8c52414 100644 --- a/views/mods/mod_produktartikel/settings_edit.phtml +++ b/views/mods/mod_produktartikel/settings_edit.phtml @@ -1,158 +1,157 @@ -<?php
-
- /**
- * Template für die Einstellungsseite des Produktartikel Moduls
- */
-
-?>
-
-<?php echo wpsg_drawForm_Input('wpsg_mod_produktartikel_pathkey', __('URL-Präfix (Produkte)', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_pathkey'), array('maxlength' => 20, 'help' => 'wpsg_mod_produktartikel_pathkey')); ?>
-<?php echo wpsg_drawForm_Input('wpsg_mod_produktartikel_pathkey_cat', __('URL-Präfix (Kategorien)', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_pathkey_cat'), array('maxlength' => 20, 'help' => 'wpsg_mod_produktartikel_pathkey_cat')); ?>
-
-<?php echo wpsg_drawForm_Checkbox('wpsg_mod_produktartikel_showui', __('Beitragstyp im WordPress-Menü sichtbar', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_showui'), array('help' => 'wpsg_mod_produktartikel_showui'))?>
-
-<?php echo wpsg_drawForm_Checkbox('wpsg_mod_produktartikel_postthumbnail', __('Produktbild als Beitragsbild übergeben', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_postthumbnail'), array('help' => 'wpsg_mod_produktartikel_postthumbnail')); ?>
-
-<?php echo wpsg_drawForm_Checkbox('wpsg_mod_produktartikel_showHome', __('Direkt auf Startseitenansicht anzeigen', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_showHome'), array('help' => 'wpsg_mod_produktartikel_showHome')); ?>
-<?php echo wpsg_drawForm_Checkbox('wpsg_mod_produktartikel_showCategory', __('Direkt in den Kategorieansichten anzeigen', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_showCategory'), array('help' => 'wpsg_mod_produktartikel_showCategory')); ?>
-<?php echo wpsg_drawForm_Checkbox('wpsg_mod_produktartikel_showSearch', __('Direkt in den Suchergebnissen anzeigen', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_showSearch'), array('help' => 'wpsg_mod_produktartikel_showSearch')); ?>
-<?php echo wpsg_drawForm_Checkbox('wpsg_mod_produktartikel_showFeed', __('Direkt in den Feeds anzeigen', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_showFeed'), array('help' => 'wpsg_mod_produktartikel_showFeed')); ?>
-<?php echo wpsg_drawForm_Checkbox('wpsg_mod_produktartikel_onlyMainQuery', __('Nur Hauptabfrage berücksichtigen', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_onlyMainQuery'), array('help' => 'wpsg_mod_produktartikel_onlyMainQuery')); ?>
-
-<br />
-
-<?php echo wpsg_drawForm_Checkbox('wpsg_mod_produktartikel_cat', __('Kategorie in Produktübersicht (Backend) anzeigen', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_cat'), array('help' => 'wpsg_mod_produktartikel_cat')); ?>
-<div id="wpsg_mod_produktartikel_cat_1">
- <?php echo wpsg_drawForm_Checkbox('wpsg_mod_produktartikel_cat_first_level', __('Nur erste Ebene', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_cat_first_level'), array('help' => 'wpsg_mod_produktartikel_cat_first_level')); ?>
- <?php echo wpsg_drawForm_Input('wpsg_mod_produktartikel_cat_ignore', __('Titelformen (Kommagetrennt) von Kategorien die ignoriert werden sollen', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_cat_ignore'), ['help' => 'wpsg_mod_produktartikel_cat_ignore']); ?>
-</div>
-
-<script>
-
- let el_wpsg_mod_produktartikel_cat = document.getElementById('wpsg_mod_produktartikel_cat');
- let el_wpsg_mod_produktartikel_cat_1 = document.getElementById('wpsg_mod_produktartikel_cat_1');
-
- el_wpsg_mod_produktartikel_cat.addEventListener('change', () => {
-
- if (el_wpsg_mod_produktartikel_cat.checked) {
-
- el_wpsg_mod_produktartikel_cat_1.style.display = 'block';
-
- } else {
-
- el_wpsg_mod_produktartikel_cat_1.style.display = 'none';
-
- }
-
- });
-
- el_wpsg_mod_produktartikel_cat.dispatchEvent(new Event('change'));
-
-</script>
-
-<br />
-
-<?php /* echo wpsg_drawForm_Checkbox('wpsg_mod_produktartikel_positionnumber', __('Positionsnummer in Produktverwaltung anzeigen', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_positionnumber'), array('help' => 'wpsg_mod_produktartikel_positionnumber')); */ ?>
-
-<br />
-
-<?php echo wpsg_drawForm_Select('wpsg_mod_produktartikel_comment', __('Kommentarfunktion', 'wpsg'), array(
- '0' => __('Produktspezifisch', 'wpsg'),
- '1' => __('Global aktiviert', 'wpsg'),
- '2' => __('Global deaktiviert', 'wpsg')
-), $this->get_option('wpsg_mod_produktartikel_comment')); ?>
-
-<?php if (!is_array($this->view['arTemplates']) || sizeof($this->view['arTemplates']) <= 0) { ?>
-<?php echo wpsg_drawForm_Text(__('Produkttemplate für Ansicht auf Startseite', 'wpsg'), __('Keine Templatedateien gefunden!', 'wpsg'), array('class_content_wrap' => 'wpsg_error')); ?>
-<?php } else { ?>
-<?php echo wpsg_drawForm_Select('wpsg_mod_produktartikel_hometemplate', __('Produkttemplate für Ansicht auf Startseite', 'wpsg'), wpsg_array_merge(array('-1' => __('Wie Produkttemplate', 'wpsg')), $this->view['arTemplates']), wpsg_getStr($this->get_option('wpsg_mod_produktartikel_hometemplate')), array('help' => 'mod_produktartikel_hometemplate', 'noKeys1' => true)); ?>
-<?php } ?>
-
-<?php if (!is_array($this->view['arTemplates']) || sizeof($this->view['arTemplates']) <= 0) { ?>
-<?php echo wpsg_drawForm_Text(__('Produkttemplate für Listenansicht', 'wpsg'), __('Keine Templatedateien gefunden!', 'wpsg'), array('class_content_wrap' => 'wpsg_error')); ?>
-<?php } else { ?>
-<?php echo wpsg_drawForm_Select('wpsg_mod_produktartikel_listtemplate', __('Produkttemplate für Listenansicht', 'wpsg'), wpsg_array_merge(array('-1' => __('Wie Produkttemplate', 'wpsg')), $this->view['arTemplates']), wpsg_getStr($this->get_option('wpsg_mod_produktartikel_listtemplate')), array('help' => 'mod_produktartikel_listtemplate', 'noKeys1' => true)); ?>
-<?php } ?>
-
-<?php if (!is_array($this->view['arTemplates']) || sizeof($this->view['arTemplates']) <= 0) { ?>
-<?php echo wpsg_drawForm_Text(__('Produkttemplate für Suchansicht', 'wpsg'), __('Keine Templatedateien gefunden!', 'wpsg'), array('class_content_wrap' => 'wpsg_error')); ?>
-<?php } else { ?>
-<?php echo wpsg_drawForm_Select('wpsg_mod_produktartikel_searchtemplate', __('Produkttemplate für Suchansicht', 'wpsg'), wpsg_array_merge(array('-1' => __('Wie Produkttemplate', 'wpsg')), $this->view['arTemplates']), wpsg_getStr($this->get_option('wpsg_mod_produktartikel_searchtemplate')), array('help' => 'mod_produktartikel_searchtemplate', 'noKeys1' => true)); ?>
-<?php } ?>
-<?php echo wpsg_drawForm_Input('wpsg_mod_produktartikel_rating', __('Anzahl Bewertungen im Frontend', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_rating'), array('help' => 'wpsg_mod_produktartikel_rating')); ?>
-
-<br />
-
-<?php echo wpsg_drawForm_TextStart(); ?>
-
- <?php $temp = @$this->view['ToRebuild']['product_ids']; ?>
- <?php $proz_done = 1; if (wpsg_isSizedArray($temp)) {
-
- $proz_done = 1 - (sizeof($this->view['ToRebuild']['product_ids']) / $this->view['ToRebuild']['max']);
-
- ?>
-
- <span id="wpsg_mod_produktartikel_rebuild">
- <p><?php echo __('Wird derzeit aufgebaut, bitte warten ...', 'wpsg'); ?></p>
-
- <div class="progress">
- <div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="<?php echo $proz_done * 100; ?>" aria-valuemax="100" style="width:<?php echo $proz_done * 100; ?>%">
- <span><span class="value"><?php echo round($proz_done * 100); ?></span>% <?php echo __('Komplett', 'wpsg'); ?></span>
- </div>
- </div>
- </span>
-
- <?php } ?>
- <p>
- <a href="<?php echo WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_produktartikel&noheader=1&do=index_rebuild'; ?>"><?php echo __('Neu aufbauen', 'wpsg'); ?></a>
- </p>
-
- <?php echo wpsg_drawForm_TextEnd(__('Zuordnung Produkt zu Artikel', 'wpsg'), array('noP' => true)); ?>
-
- <?php if ($proz_done < 1) { ?>
- <script type="text/javascript">/* <![CDATA[ */
-
- var proz_done = <?php echo $proz_done; ?>;
-
- function wpsg_mod_produktartikel_rebuild()
- {
-
- if (proz_done >= 1) return;
-
- jQuery.ajax( {
- url: '<?php echo WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_produktartikel&noheader=1&do=rebuild'; ?>',
- error: function(data) {
-
- jQuery('#wpsg_mod_produktartikel_rebuild').html('<p><?php echo __('Neuaufbau abgeschlossen.', 'wpsg'); ?></p>');
-
- },
- success: function(data) {
-
- if (typeof data.done == "undefined") return;
-
- proz_done = parseFloat(data.done);
- console.log(proz_done);
- if (proz_done >= 1)
- {
-
- jQuery('#wpsg_mod_produktartikel_rebuild').html('<p><?php echo __('Neuaufbau abgeschlossen.', 'wpsg'); ?></p>');
-
- }
- else
- {
-
- jQuery('#wpsg_mod_produktartikel_rebuild').find('.progress-bar').attr("aria-valuemin", proz_done * 100).css('width', (proz_done * 100) + '%').find('span.value').html(Math.round(proz_done * 100));
-
- wpsg_mod_produktartikel_rebuild();
-
- }
-
- }
- } );
-
- }
-
- wpsg_mod_produktartikel_rebuild();
-
- /* ]]> */</script>
- <?php } ?>
+<?php + + /** + * Template für die Einstellungsseite des Produktartikel Moduls + */ + +?> + +<?php echo wpsg_drawForm_Input('wpsg_mod_produktartikel_pathkey', __('URL-Präfix (Produkte)', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_pathkey'), array('maxlength' => 20, 'help' => 'wpsg_mod_produktartikel_pathkey')); ?> +<?php echo wpsg_drawForm_Input('wpsg_mod_produktartikel_pathkey_cat', __('URL-Präfix (Kategorien)', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_pathkey_cat'), array('maxlength' => 20, 'help' => 'wpsg_mod_produktartikel_pathkey_cat')); ?> + +<?php echo wpsg_drawForm_Checkbox('wpsg_mod_produktartikel_showui', __('Beitragstyp im WordPress-Menü sichtbar', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_showui'), array('help' => 'wpsg_mod_produktartikel_showui'))?> + +<?php echo wpsg_drawForm_Checkbox('wpsg_mod_produktartikel_postthumbnail', __('Produktbild als Beitragsbild übergeben', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_postthumbnail'), array('help' => 'wpsg_mod_produktartikel_postthumbnail')); ?> + +<?php echo wpsg_drawForm_Checkbox('wpsg_mod_produktartikel_showHome', __('Direkt auf Startseitenansicht anzeigen', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_showHome'), array('help' => 'wpsg_mod_produktartikel_showHome')); ?> +<?php echo wpsg_drawForm_Checkbox('wpsg_mod_produktartikel_showCategory', __('Direkt in den Kategorieansichten anzeigen', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_showCategory'), array('help' => 'wpsg_mod_produktartikel_showCategory')); ?> +<?php echo wpsg_drawForm_Checkbox('wpsg_mod_produktartikel_showSearch', __('Direkt in den Suchergebnissen anzeigen', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_showSearch'), array('help' => 'wpsg_mod_produktartikel_showSearch')); ?> +<?php echo wpsg_drawForm_Checkbox('wpsg_mod_produktartikel_showFeed', __('Direkt in den Feeds anzeigen', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_showFeed'), array('help' => 'wpsg_mod_produktartikel_showFeed')); ?> +<?php echo wpsg_drawForm_Checkbox('wpsg_mod_produktartikel_onlyMainQuery', __('Nur Hauptabfrage berücksichtigen', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_onlyMainQuery'), array('help' => 'wpsg_mod_produktartikel_onlyMainQuery')); ?> + +<br /> + +<?php echo wpsg_drawForm_Checkbox('wpsg_mod_produktartikel_cat', __('Kategorie in Produktübersicht (Backend) anzeigen', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_cat'), array('help' => 'wpsg_mod_produktartikel_cat')); ?> +<div id="wpsg_mod_produktartikel_cat_1"> + <?php echo wpsg_drawForm_Checkbox('wpsg_mod_produktartikel_cat_first_level', __('Nur erste Ebene', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_cat_first_level'), array('help' => 'wpsg_mod_produktartikel_cat_first_level')); ?> + <?php echo wpsg_drawForm_Input('wpsg_mod_produktartikel_cat_ignore', __('Titelformen (Kommagetrennt) von Kategorien die ignoriert werden sollen', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_cat_ignore'), ['help' => 'wpsg_mod_produktartikel_cat_ignore']); ?> +</div> + +<script> + + let el_wpsg_mod_produktartikel_cat = document.getElementById('wpsg_mod_produktartikel_cat'); + let el_wpsg_mod_produktartikel_cat_1 = document.getElementById('wpsg_mod_produktartikel_cat_1'); + + el_wpsg_mod_produktartikel_cat.addEventListener('change', () => { + + if (el_wpsg_mod_produktartikel_cat.checked) { + + el_wpsg_mod_produktartikel_cat_1.style.display = 'block'; + + } else { + + el_wpsg_mod_produktartikel_cat_1.style.display = 'none'; + + } + + }); + + el_wpsg_mod_produktartikel_cat.dispatchEvent(new Event('change')); + +</script> + +<br /> + +<?php /* echo wpsg_drawForm_Checkbox('wpsg_mod_produktartikel_positionnumber', __('Positionsnummer in Produktverwaltung anzeigen', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_positionnumber'), array('help' => 'wpsg_mod_produktartikel_positionnumber')); */ ?> + +<br /> + +<?php echo wpsg_drawForm_Select('wpsg_mod_produktartikel_comment', __('Kommentarfunktion', 'wpsg'), array( + '0' => __('Produktspezifisch', 'wpsg'), + '1' => __('Global aktiviert', 'wpsg'), + '2' => __('Global deaktiviert', 'wpsg') +), $this->get_option('wpsg_mod_produktartikel_comment')); ?> + +<?php if (!is_array($this->view['arTemplates']) || sizeof($this->view['arTemplates']) <= 0) { ?> +<?php echo wpsg_drawForm_Text(__('Produkttemplate für Ansicht auf Startseite', 'wpsg'), __('Keine Templatedateien gefunden!', 'wpsg'), array('class_content_wrap' => 'wpsg_error')); ?> +<?php } else { ?> +<?php echo wpsg_drawForm_Select('wpsg_mod_produktartikel_hometemplate', __('Produkttemplate für Ansicht auf Startseite', 'wpsg'), wpsg_array_merge(array('-1' => __('Wie Produkttemplate', 'wpsg')), $this->view['arTemplates']), wpsg_getStr($this->get_option('wpsg_mod_produktartikel_hometemplate')), array('help' => 'mod_produktartikel_hometemplate', 'noKeys1' => true)); ?> +<?php } ?> + +<?php if (!is_array($this->view['arTemplates']) || sizeof($this->view['arTemplates']) <= 0) { ?> +<?php echo wpsg_drawForm_Text(__('Produkttemplate für Listenansicht', 'wpsg'), __('Keine Templatedateien gefunden!', 'wpsg'), array('class_content_wrap' => 'wpsg_error')); ?> +<?php } else { ?> +<?php echo wpsg_drawForm_Select('wpsg_mod_produktartikel_listtemplate', __('Produkttemplate für Listenansicht', 'wpsg'), wpsg_array_merge(array('-1' => __('Wie Produkttemplate', 'wpsg')), $this->view['arTemplates']), wpsg_getStr($this->get_option('wpsg_mod_produktartikel_listtemplate')), array('help' => 'mod_produktartikel_listtemplate', 'noKeys1' => true)); ?> +<?php } ?> + +<?php if (!is_array($this->view['arTemplates']) || sizeof($this->view['arTemplates']) <= 0) { ?> +<?php echo wpsg_drawForm_Text(__('Produkttemplate für Suchansicht', 'wpsg'), __('Keine Templatedateien gefunden!', 'wpsg'), array('class_content_wrap' => 'wpsg_error')); ?> +<?php } else { ?> +<?php echo wpsg_drawForm_Select('wpsg_mod_produktartikel_searchtemplate', __('Produkttemplate für Suchansicht', 'wpsg'), wpsg_array_merge(array('-1' => __('Wie Produkttemplate', 'wpsg')), $this->view['arTemplates']), wpsg_getStr($this->get_option('wpsg_mod_produktartikel_searchtemplate')), array('help' => 'mod_produktartikel_searchtemplate', 'noKeys1' => true)); ?> +<?php } ?> + +<br /> + +<?php echo wpsg_drawForm_TextStart(); ?> + + <?php $temp = @$this->view['ToRebuild']['product_ids']; ?> + <?php $proz_done = 1; if (wpsg_isSizedArray($temp)) { + + $proz_done = 1 - (sizeof($this->view['ToRebuild']['product_ids']) / $this->view['ToRebuild']['max']); + + ?> + + <span id="wpsg_mod_produktartikel_rebuild"> + <p><?php echo __('Wird derzeit aufgebaut, bitte warten ...', 'wpsg'); ?></p> + + <div class="progress"> + <div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="<?php echo $proz_done * 100; ?>" aria-valuemax="100" style="width:<?php echo $proz_done * 100; ?>%"> + <span><span class="value"><?php echo round($proz_done * 100); ?></span>% <?php echo __('Komplett', 'wpsg'); ?></span> + </div> + </div> + </span> + + <?php } ?> + <p> + <a href="<?php echo WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_produktartikel&noheader=1&do=index_rebuild'; ?>"><?php echo __('Neu aufbauen', 'wpsg'); ?></a> + </p> + + <?php echo wpsg_drawForm_TextEnd(__('Zuordnung Produkt zu Artikel', 'wpsg'), array('noP' => true)); ?> + + <?php if ($proz_done < 1) { ?> + <script type="text/javascript">/* <![CDATA[ */ + + var proz_done = <?php echo $proz_done; ?>; + + function wpsg_mod_produktartikel_rebuild() + { + + if (proz_done >= 1) return; + + jQuery.ajax( { + url: '<?php echo WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_produktartikel&noheader=1&do=rebuild'; ?>', + error: function(data) { + + jQuery('#wpsg_mod_produktartikel_rebuild').html('<p><?php echo __('Neuaufbau abgeschlossen.', 'wpsg'); ?></p>'); + + }, + success: function(data) { + + if (typeof data.done == "undefined") return; + + proz_done = parseFloat(data.done); + console.log(proz_done); + if (proz_done >= 1) + { + + jQuery('#wpsg_mod_produktartikel_rebuild').html('<p><?php echo __('Neuaufbau abgeschlossen.', 'wpsg'); ?></p>'); + + } + else + { + + jQuery('#wpsg_mod_produktartikel_rebuild').find('.progress-bar').attr("aria-valuemin", proz_done * 100).css('width', (proz_done * 100) + '%').find('span.value').html(Math.round(proz_done * 100)); + + wpsg_mod_produktartikel_rebuild(); + + } + + } + } ); + + } + + wpsg_mod_produktartikel_rebuild(); + + /* ]]> */</script> + <?php } ?> |
