From 43efe21f03d30b2a5b1eed412a89ee0e21e9bb68 Mon Sep 17 00:00:00 2001 From: Daniel Schmitzer Date: Wed, 10 Feb 2021 08:44:56 +0000 Subject: - Feature: Globale Bilder in globalen Variationen git-svn-id: https://[internal]/wordpress/plugins/wpsg4@7841 0d5edaf7-2b12-4e95-93f4-047927463d4b --- views/css/admin.css | 5 + .../mod_downloadplus/settings_edit_templates.phtml | 20 ++- views/mods/mod_productgroups/list.phtml | 36 ++-- views/mods/mod_productindex/layouts/list.phtml | 2 +- views/mods/mod_productvariants/admin_edit.phtml | 184 ++++++++++++++++++--- views/mods/mod_productvariants/admin_html.phtml | 9 +- views/mods/mod_productvariants/admin_show.phtml | 8 +- views/produkttemplates/standard.phtml | 2 +- 8 files changed, 218 insertions(+), 48 deletions(-) diff --git a/views/css/admin.css b/views/css/admin.css index fab0761..cfd6d28 100644 --- a/views/css/admin.css +++ b/views/css/admin.css @@ -66,6 +66,7 @@ #wpsg-bs .wpsg-wp-header-end { margin-top:-10px !important; } #wpsg-bs .wpsg_msg_wrap { margin-right:20px; } #wpsg-bs .d-flex { display:flex; } +#wpsg-bs .justify-content-between { justify-content:space-between; } #wpsg-bs .w-100 { width:100%; } #wpsg-bs .justify-content_center { justify-content:center; } #wpsg-bs .align-items_center { align-items:center; } @@ -385,6 +386,10 @@ .wpsg_mod_productvariants_table_variants .col_type { width:100px; } .wpsg_mod_productvariants_table_variants .col_id { width:50px; } .wpsg_mod_productvariants_table_variation .col_action { text-align:right; width:75px; } +.wpsg_mod_productvariants_table_variation .wpsg_mod_productvariants_remove_global_vari_image { position:relative; text-decoration:none; display:inline-block; } +.wpsg_mod_productvariants_table_variation .wpsg_mod_productvariants_remove_global_vari_image > span { color:#FFFFFF; background-color:rgba(0, 0, 0, 0.5); position:absolute; left:0; top:0; width:100%; height:100%; display:none; justify-content:center; align-items:center; } +.wpsg_mod_productvariants_table_variation .wpsg_mod_productvariants_remove_global_vari_image:hover > span { display:flex; } +.wpsg_mod_productvariants_table_variation .wpsg_mod_productvariants_remove_global_vari_image img { max-width:25px; max-height:25px; } .wpsg_mod_productvariants_table_variation tbody:nth-child(even) td { background-color:#F9F9F9; } .wpsg_mod_productvariants_table_variation .col_id { width:50px; } .wpsg_mod_productvariants_table_variation .col_active { width:25px; } diff --git a/views/mods/mod_downloadplus/settings_edit_templates.phtml b/views/mods/mod_downloadplus/settings_edit_templates.phtml index 498aed4..a3e97ee 100644 --- a/views/mods/mod_downloadplus/settings_edit_templates.phtml +++ b/views/mods/mod_downloadplus/settings_edit_templates.phtml @@ -46,7 +46,10 @@
- +
@@ -179,6 +182,8 @@ #wpsg_dp_templates_app .file_wrap { display:flex; justify-content:space-between; align-items:center; } #wpsg_dp_templates_app .file_wrap .file { display:flex; gap:1rem; justify-content:flex-end; align-items:center; } #wpsg_dp_templates_app .file_wrap .file .wpsg-glyphicon { margin-right:8px; } + #wpsg_dp_templates_app .label-copy { display:flex; justify-content:space-between; } + #wpsg_dp_templates_app .label-copy .glyphicon { font-size:14px; } @@ -220,6 +225,19 @@ }, + copyTemplate: function() { + + if (!confirm('')) return false; + + let new_template = JSON.parse(JSON.stringify(this.template)); + + new_template.name += ' (Kopie)'; + + this.arTemplates.push(new_template); + this.template = new_template; + + }, + removeTemplate: function() { if (!confirm('')) return; diff --git a/views/mods/mod_productgroups/list.phtml b/views/mods/mod_productgroups/list.phtml index 3491629..07df917 100644 --- a/views/mods/mod_productgroups/list.phtml +++ b/views/mods/mod_productgroups/list.phtml @@ -21,16 +21,32 @@
- - = 0 && is_int($image)) { ?> -
- - - - - -
- + + callMod('wpsg_mod_stock', 'getBestand', [$g['produkte'][$i]['id']]); + + ?> + + + + Ausverkauft ... + + + + + = 0 && is_int($image)) { ?> +
+ + + + + +
+ + + +
diff --git a/views/mods/mod_productindex/layouts/list.phtml b/views/mods/mod_productindex/layouts/list.phtml index fa1eb24..4200544 100644 --- a/views/mods/mod_productindex/layouts/list.phtml +++ b/views/mods/mod_productindex/layouts/list.phtml @@ -101,7 +101,7 @@
- hasMod('wpsg_mod_fuellmenge') && $this->get_option('wpsg_mod_fuellmenge_showProductindex_fmenge') == '1') { ?> + hasMod('wpsg_mod_fuellmenge') && $this->get_option('wpsg_mod_fuellmenge_showProductindex_fmenge') == '1') { ?> '0') { ?>
diff --git a/views/mods/mod_productvariants/admin_edit.phtml b/views/mods/mod_productvariants/admin_edit.phtml index 5b4722e..02d00bb 100644 --- a/views/mods/mod_productvariants/admin_edit.phtml +++ b/views/mods/mod_productvariants/admin_edit.phtml @@ -5,10 +5,22 @@ */ ?> - + + + view['arVariation'])) { ?> @@ -49,7 +61,11 @@ - view['arVariation'] as $vari) { $i ++; ?> + view['arVariation'] as $vari) { $i ++; + + $vari_id = intval($vari['id']); + + ?> @@ -180,31 +196,122 @@ - - view['product_id'])) { ?> + imagehandler->getAttachmentIDs($this->view['product_id'], $vari['id'], true); + + if (wpsg_isSizedInt($this->view['product_id'])) { + + $arAttachmentIDs = $this->imagehandler->getAttachmentIDs($this->view['product_id'], $vari['id'], true); + + } else { + + $vari_images = $this->get_option('wpsg_mod_productvariants_global_images'); + if (!is_array($vari_images)) $vari_images = []; + + $arAttachmentIDs = ((isset($vari_images[$vari_id]))?$vari_images[$vari_id]:[]); + + } ?>
  - - - - pic" id="" onclick="return wpsg_vp_vari_setPic(this, view['variant']['id']; ?>, , '', view['product_id']; ?>);"> - - - - - - + +
+ + + + view['product_id'])) { ?> +
+ + + +
+ + +
- + + jQuery('.wpsg_mod_productvariants_remove_global_vari_image').on('click', function() { + + let el = jQuery(this); + + event.preventDefault(); + + if (!confirm('')) return; + + el.remove(); + + jQuery.ajax({ + url: '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) { } + }); + + }); + + view['product_id'])) { ?>

@@ -345,7 +476,7 @@ - + + + - \ No newline at end of file diff --git a/views/mods/mod_productvariants/admin_html.phtml b/views/mods/mod_productvariants/admin_html.phtml index 7fc6fe6..dd225e0 100644 --- a/views/mods/mod_productvariants/admin_html.phtml +++ b/views/mods/mod_productvariants/admin_html.phtml @@ -40,7 +40,7 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/views/mods/mod_productvariants/admin_show.phtml b/views/mods/mod_productvariants/admin_show.phtml index 0460d75..c3d7c9a 100644 --- a/views/mods/mod_productvariants/admin_show.phtml +++ b/views/mods/mod_productvariants/admin_show.phtml @@ -47,7 +47,7 @@
- + @@ -85,7 +85,7 @@

- + diff --git a/views/produkttemplates/standard.phtml b/views/produkttemplates/standard.phtml index bdcf3ba..718f8f9 100644 --- a/views/produkttemplates/standard.phtml +++ b/views/produkttemplates/standard.phtml @@ -43,7 +43,7 @@ /* Array mit allen AttachmentIDs der Produktbilder */ $arAttachmentIDsAll = $this->imagehandler->getAttachmentIDs($this->view['data']['product_id']); - + ?> -- cgit v1.2.3