From ffe2c578ed26485e4869762e88c97e90b181bab3 Mon Sep 17 00:00:00 2001 From: Daniel Schmitzer Date: Wed, 19 Sep 2018 05:52:43 +0000 Subject: - Email Anhang universell in E-Mail Konfiguration git-svn-id: https://[internal]/wordpress/plugins/wpsg4@7156 0d5edaf7-2b12-4e95-93f4-047927463d4b --- views/admin/emailconf.phtml | 84 +++++++++++++++++++++++++++++++++- views/admin/form/emailconf.phtml | 98 +++++++++++++++++++++++++++++++++++----- views/css/admin.css | 5 ++ 3 files changed, 174 insertions(+), 13 deletions(-) diff --git a/views/admin/emailconf.phtml b/views/admin/emailconf.phtml index 2f86c8c..97e0c3d 100644 --- a/views/admin/emailconf.phtml +++ b/views/admin/emailconf.phtml @@ -16,6 +16,12 @@ + +
@@ -154,9 +160,85 @@ jQuery.cookie('wpsg_mail', wpsg_mail_open.join(',')); } // function wpsg_mail_save_cookie() - + + function wpsg_removeAttachemnt(a) { + + var id = parseInt(a.getAttribute('data-id')); + var key = a.getAttribute('data-key'); + + uploadData[key].forEach(function(item, index, object) { + + if (parseInt(item.id) === id) { + + object.splice(index, 1); + + } + + } ); + + return false; + + } + + var wpframe; + jQuery(document).ready(function() { + + jQuery(".btnAddAttachment").click(function(event) { + + var source = event.target || event.srcElement; + var key = jQuery(source).attr("data-key"); + + event.preventDefault(); + + if (wpframe) { wpframe.open(); return; } + + wpframe = wp.media.frames.file_frame = wp.media({ + title: "", + button: { text: "" }, + multiple: true + }); + + wpframe.on('select', function() { + + var attachments = wpframe.state().get('selection').map( function(attachment) { + + attachment.toJSON(); + + var bDrin = false; + + for (var i in uploadData[key]) { + + if (uploadData[key][i].id === attachment.id) { + + bDrin = true; + + break; + + } + + } + + if (!bDrin) { + + uploadData[key].push( { + id: attachment.id, + filename: attachment.attributes.filename, + url: attachment.attributes.url + } ); + + } + + return attachment; + + } ); + + } ); + + wpframe.open(); + } ); + jQuery('.wpsg_email_box .panel-heading').bind('click', function() { jQuery(this).next().toggle(); diff --git a/views/admin/form/emailconf.phtml b/views/admin/form/emailconf.phtml index e89055d..98fd45c 100644 --- a/views/admin/form/emailconf.phtml +++ b/views/admin/form/emailconf.phtml @@ -11,19 +11,39 @@ view['field_key'].'_cc', __('CC', 'wpsg'), $this->get_option('wpsg_'.$this->view['field_key'].'_cc')); ?> view['field_key'].'_bcc', __('BCC', 'wpsg'), $this->get_option('wpsg_'.$this->view['field_key'].'_bcc')); ?> - view['field_attachment'] === true) { ?> - - view['field_key'].'_attachfile', __('Mailanhang', 'wpsg'), '', '43', '100000'); ?> -
-
- : get_option('wpsg_'.$this->view['field_key'].'_attachfile')))?$this->get_option('wpsg_'.$this->view['field_key'].'_attachfile'):__('keiner', 'wpsg')); ?> - get_option('wpsg_kundenmail_attachfile')))?'':''); ?> -
-
- - +
+ + + +
+ +
+
+ + + +
+ +
+ +
+ +
+ +
+ +
-

+


+ + \ No newline at end of file diff --git a/views/css/admin.css b/views/css/admin.css index 5377fad..8de5fbb 100644 --- a/views/css/admin.css +++ b/views/css/admin.css @@ -3,6 +3,9 @@ /* Allgemein */ .wpsg_clear { clear:both; } +.wpsg_flex { display:flex; width:100%; } +.wpsg_flex_justify_content_space_between { justify-content:space-between; } +.wpsg_flex_align_items_center { align-items:center; } /* Bootstrap Teil */ #wpsg-bs { margin-top:20px; min-width:1000px; } @@ -178,6 +181,8 @@ table.wpsgitrecht_table { width:100%; } .email-logo-alignment, .email-logo-alignment input[type="radio"] { font-family: FontAwesome; margin: 0; outline: 0; } .email-logo { padding-bottom: 10px; } .email-logo-watermark { position:absolute; top:10%; left:0; right:0; display:flex; justify-content:center; align-items:center; } +.wpsg_mailattachment { padding:8px 0px; } +.wpsg_mailattachment a { display:block; min-height:24px; line-height:24px; } /* Produktverwaltung */ .wpsg_pic_col { width:50px; } -- cgit v1.2.3