several minor fixes
This commit is contained in:
parent
fd167f9a2d
commit
155c9c3b2e
@ -406,23 +406,26 @@ function init_saimod_mail_email() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('#btn-email-image-new').click(function(){
|
$('#btn-email-image-new').click(function(){
|
||||||
var $new = $('.email-image-new').clone().removeClass('email-image-new');
|
var $new = $('.email-image-new').clone().removeClass('email-image-new');
|
||||||
$('#tbody_mail_email_images').append($new);
|
$('#tbody_mail_email_images').append($new);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#btn-email-placeholder-new').click(function(){
|
$('#btn-email-placeholder-new').click(function(){
|
||||||
var $new = $('.email-placeholder-new').clone().removeClass('email-placeholder-new');
|
var $new = $('.email-placeholder-new').clone().removeClass('email-placeholder-new');
|
||||||
$('#tbody_mail_email_placeholders').append($new);
|
$('#tbody_mail_email_placeholders').append($new);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.btn-email-placeholder-switch-value-new').click(function(){
|
$('.btn-email-placeholder-switch-value-new').click(function(){
|
||||||
var $new = $(this).parent().parent().parent().find('.email-placeholder-switch-value-new').clone().removeClass('email-placeholder-switch-value-new');
|
|
||||||
$(this).parent().parent().parent().append($new);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.email-placeholder-type').trigger('change');
|
$('.email-placeholder-type').trigger('change');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function placeholder_switch_new(e){
|
||||||
|
var $new = $(e).parent().parent().parent().find('.email-placeholder-switch-value-new').clone().removeClass('email-placeholder-switch-value-new');
|
||||||
|
$(e).parent().parent().parent().append($new);
|
||||||
|
}
|
||||||
|
|
||||||
function placeholder_type(e){
|
function placeholder_type(e){
|
||||||
switch(e.val()){
|
switch(e.val()){
|
||||||
case '2':
|
case '2':
|
||||||
|
|||||||
@ -339,7 +339,8 @@ class saimod_mail extends \SYSTEM\SAI\sai_module{
|
|||||||
$vars['placeholders'] .= \SYSTEM\PAGE\replace::replaceFile((new \PSAI('saimod_mail/tpl/saimod_mail_email_placeholder.tpl'))->SERVERPATH(),$row);
|
$vars['placeholders'] .= \SYSTEM\PAGE\replace::replaceFile((new \PSAI('saimod_mail/tpl/saimod_mail_email_placeholder.tpl'))->SERVERPATH(),$row);
|
||||||
}
|
}
|
||||||
//placeholder new
|
//placeholder new
|
||||||
$new_placeholder = ['selected_1' => 'selected', 'selected_2' => '', 'selected_3' => '',
|
$new_placeholder = ['id' => '',
|
||||||
|
'selected_1' => 'selected', 'selected_2' => '', 'selected_3' => '',
|
||||||
'name' => '',
|
'name' => '',
|
||||||
'text_value' => '', 'name_default' => '',
|
'text_value' => '', 'name_default' => '',
|
||||||
'switch_table' => '', 'switch_field' => '', 'switch_default' => '',
|
'switch_table' => '', 'switch_field' => '', 'switch_default' => '',
|
||||||
@ -406,22 +407,26 @@ class saimod_mail extends \SYSTEM\SAI\sai_module{
|
|||||||
|
|
||||||
public static function sai_mod__SAI_saimod_mail_action_update_email($data){
|
public static function sai_mod__SAI_saimod_mail_action_update_email($data){
|
||||||
\SQL\EMAIL_UPDATE::QI(array($data['name'],$data['account'],$data['sender'],$data['subject'],$data['text_template'],$data['html_template'],$data['id']));
|
\SQL\EMAIL_UPDATE::QI(array($data['name'],$data['account'],$data['sender'],$data['subject'],$data['text_template'],$data['html_template'],$data['id']));
|
||||||
foreach($data['images'] as $image){
|
if(array_key_exists('images', $data)){
|
||||||
if($image['deleted'] && $image['id']){
|
foreach($data['images'] as $image){
|
||||||
\SQL\EMAIL_IMAGE_DELETE::QI(array($data['id'],$image['id']));
|
if($image['deleted'] && $image['id']){
|
||||||
} else if($image['id']){
|
\SQL\EMAIL_IMAGE_DELETE::QI(array($data['id'],$image['id']));
|
||||||
\SQL\EMAIL_IMAGE_UPDATE::QI(array($image['name'],$image['file'],$image['mime'],$data['id'],$image['id']));
|
} else if($image['id']){
|
||||||
} else if(!$image['deleted']){
|
\SQL\EMAIL_IMAGE_UPDATE::QI(array($image['name'],$image['file'],$image['mime'],$data['id'],$image['id']));
|
||||||
\SQL\EMAIL_IMAGE_INSERT::QI(array($image['id'],$data['id'],$image['name'],$image['file'],$image['mime']));
|
} else if(!$image['deleted']){
|
||||||
|
\SQL\EMAIL_IMAGE_INSERT::QI(array($image['id'],$data['id'],$image['name'],$image['file'],$image['mime']));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach($data['placeholders'] as $placeholder){
|
if(array_key_exists('placeholders', $data)){
|
||||||
if($placeholder['deleted'] && $placeholder['id']){
|
foreach($data['placeholders'] as $placeholder){
|
||||||
\SQL\EMAIL_PLACEHOLDER_DELETE::QI(array($data['id'],$placeholder['id']));
|
if($placeholder['deleted'] && $placeholder['id']){
|
||||||
} else if($placeholder['id']){
|
\SQL\EMAIL_PLACEHOLDER_DELETE::QI(array($data['id'],$placeholder['id']));
|
||||||
\SQL\EMAIL_PLACEHOLDER_UPDATE::QI(array($placeholder['name'],$placeholder['type'],json_encode($placeholder['data']),$data['id'],$placeholder['id']));
|
} else if($placeholder['id']){
|
||||||
} else if(!$placeholder['deleted']){
|
\SQL\EMAIL_PLACEHOLDER_UPDATE::QI(array($placeholder['name'],$placeholder['type'],json_encode($placeholder['data']),$data['id'],$placeholder['id']));
|
||||||
\SQL\EMAIL_PLACEHOLDER_INSERT::QI(array($placeholder['id'],$data['id'],$placeholder['name'],$placeholder['type'],json_encode($placeholder['data'])));
|
} else if(!$placeholder['deleted']){
|
||||||
|
\SQL\EMAIL_PLACEHOLDER_INSERT::QI(array($placeholder['id'],$data['id'],$placeholder['name'],$placeholder['type'],json_encode($placeholder['data'])));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return \JsonResult::ok();
|
return \JsonResult::ok();
|
||||||
|
|||||||
@ -2,9 +2,9 @@ INSERT IGNORE INTO email_list (`id`,`name`,`system_lock`) VALUES (1,'Test Liste'
|
|||||||
INSERT IGNORE INTO email_list (`id`,`name`,`system_lock`) VALUES (2,'Newsletter',1);
|
INSERT IGNORE INTO email_list (`id`,`name`,`system_lock`) VALUES (2,'Newsletter',1);
|
||||||
INSERT IGNORE INTO email_list (`id`,`name`,`system_lock`) VALUES (3,'Prototype',1);
|
INSERT IGNORE INTO email_list (`id`,`name`,`system_lock`) VALUES (3,'Prototype',1);
|
||||||
|
|
||||||
INSERT IGNORE INTO email (`id`,`name`,`sender`,`subject`,`template_text`,`template_html`,`system_lock`) VALUES (1,'Mail Test','Testing | DEMOCRACY <contact@democracy-deutschland.de>','${emoji_mobile} DEMOCRACY Mail Test',1,2,0);
|
INSERT IGNORE INTO email (`id`,`name`,`sender`,`subject`,`template_text`,`template_html`,`system_lock`) VALUES (1,'Mail Test','Testing | DEMOCRACY <contact@democracy-deutschland.de>','${emoji_mobile} DEMOCRACY Mail Test',1,2,NULL);
|
||||||
INSERT IGNORE INTO email_template (`id`,`type`,`name`,`value`,`system_lock`) VALUES (1,0,'Mail Test Text','Use this Mail for testing',0);
|
INSERT IGNORE INTO email_template (`id`,`type`,`name`,`value`,`system_lock`) VALUES (1,0,'Mail Test Text','Use this Mail for testing',NULL);
|
||||||
INSERT IGNORE INTO email_template (`id`,`type`,`name`,`value`,`system_lock`) VALUES (2,1,'Mail Test HTML','Use this Mail for testing',0);
|
INSERT IGNORE INTO email_template (`id`,`type`,`name`,`value`,`system_lock`) VALUES (2,1,'Mail Test HTML','Use this Mail for testing',NULL);
|
||||||
|
|
||||||
INSERT IGNORE INTO email (`id`,`name`,`sender`,`subject`,`template_text`,`template_html`,`system_lock`) VALUES (10,'Website Contact','${data_vorname} ${data_nachname} <${data_email}>','${emoji_mobile} DEMOCRACY Website: ${data_type} from ${data_email}',10,11,1);
|
INSERT IGNORE INTO email (`id`,`name`,`sender`,`subject`,`template_text`,`template_html`,`system_lock`) VALUES (10,'Website Contact','${data_vorname} ${data_nachname} <${data_email}>','${emoji_mobile} DEMOCRACY Website: ${data_type} from ${data_email}',10,11,1);
|
||||||
INSERT IGNORE INTO email_template (`id`,`type`,`name`,`value`,`system_lock`) VALUES (10,0,'Website Contact Text','Eine Nachricht ist über die Website eingegangen:\n\n${data_json}\n\nAchtung: Diese EMail ist die einzige Kopie dieser Daten',1);
|
INSERT IGNORE INTO email_template (`id`,`type`,`name`,`value`,`system_lock`) VALUES (10,0,'Website Contact Text','Eine Nachricht ist über die Website eingegangen:\n\n${data_json}\n\nAchtung: Diese EMail ist die einzige Kopie dieser Daten',1);
|
||||||
|
|||||||
@ -40,7 +40,7 @@
|
|||||||
<th>Values</th>
|
<th>Values</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th>
|
<th>
|
||||||
<button class="btn btn-sm btn-success btn-email-placeholder-switch-value-new"><i class="fa fa-plus"></i></button>
|
<button class="btn btn-sm btn-success btn-email-placeholder-switch-value-new" onclick="placeholder_switch_new($(this))"><i class="fa fa-plus"></i></button>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
${switch_values}
|
${switch_values}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user