From d38ac62efcf91fe895fbcac04da557353cb313f2 Mon Sep 17 00:00:00 2001 From: Jean-Luc Beer Date: Thu, 9 Oct 2025 15:35:58 +0000 Subject: Gutscheine duplizieren git-svn-id: https://[internal]/wordpress/plugins/wpsg4@8506 0d5edaf7-2b12-4e95-93f4-047927463d4b --- views/mods/mod_gutschein/index.phtml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/views/mods/mod_gutschein/index.phtml b/views/mods/mod_gutschein/index.phtml index 26931c4..3a8d173 100644 --- a/views/mods/mod_gutschein/index.phtml +++ b/views/mods/mod_gutschein/index.phtml @@ -104,6 +104,8 @@ | + | + " href="#" class="wpsg_voucher_duplicate" onclick="return false;" data-voucher_id="getId(); ?>"> @@ -332,4 +334,24 @@ } ); + + jQuery('.wpsg_voucher_duplicate').on('click', function() { + if (!confirm('')) return false; + var id = jQuery(this).data('voucher_id'); + wpsg_loading('body'); + jQuery.ajax({ + url: 'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_gutschein&subaction=duplicate&noheader=1&voucher_id=' + id, + success: function(data) { + wpsg_loading_done('body'); + if (data !== '1') { alert(data); } + else { location.reload(); } + }, + error: function() { + wpsg_loading_done('body'); + alert(''); + } + }); + return false; + }).attr('onclick', null); + /* ]]> */ \ No newline at end of file -- cgit v1.2.3