Verteilerlisten, Mailsystem

This commit is contained in:
aschwarz
2023-04-28 09:41:23 +02:00
parent 3d58070a69
commit c69b2b8b5e
16 changed files with 817 additions and 65 deletions

View File

@ -1,7 +1,7 @@
$(document).ready(function (e){
$("#frmEnquiry").on('submit',(function(e){
e.preventDefault();
$('#loader-icon').show();
//$('#loader-icon').show();
var valid;
valid = validateContact();
if(valid) {
@ -12,10 +12,21 @@
contentType: false,
cache: false,
processData:false,
success: function(data){
//alert(data);
$("#mail-status").html(data);
$('#loader-icon').hide();
success: function(result){
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
//https://developer.snapappointments.com/bootstrap-select/methods/#selectpickertoggle
$('.selectpicker').selectpicker('deselectAll');
document.getElementById("subject").value ="";
tinyMCE.get(0).setContent("");
}
$('#msg').show().delay(5000).fadeOut(500);
$('#msg').html(a[0]);
}
//alert(data);
//$("#mail-status").html(data);
//$('#loader-icon').hide();
},
error: function(){}
@ -29,7 +40,11 @@
$(".info").html('');
// $("#userName").removeClass("invalid");
// $("#userEmail").removeClass("invalid");
$("#empfaenger").removeClass("invalid");
// $('.selectpicker').removeClass('invalid').selectpicker('setStyle');
//https://github.com/snapappointments/bootstrap-select/issues/1891
$('.selectpicker').removeClass('invalid').selectpicker('setStyle').parent().removeClass('invalid ');
$("#subject").removeClass("invalid");
$("#content").removeClass("invalid");
// Bei TinyMCE geht das anders
@ -38,8 +53,7 @@
t.getBody().style.backgroundColor = color;
if($("#empfaenger").val()=='') {
$("#empfaenger").addClass("invalid");
$("#empfaenger").attr("title","Required");
$('.selectpicker').addClass('invalid').selectpicker('setStyle');
valid = false;
}
/*
@ -55,7 +69,6 @@
}
*/
if(!$("#subject").val()) {
$("#subject").addClass("invalid");
$("#subject").attr("title","Required");
valid = false;

View File

@ -14,10 +14,10 @@ function rollesave(){
if(a[1]=="success"){
document.getElementById("rollenname").value ="";
$(document).ajaxStop(function(){
window.location = "?";
setTimeout(() => { window.location = "?"; }, 2000);
});
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').show().delay(2000).fadeOut(500);
$('#msg').html(a[0]);
}
},
@ -192,10 +192,10 @@ function delRole(rid) {
var a = result.split('|***|');
if(a[1]=="success"){
$(document).ajaxStop(function(){
window.location = "?";
setTimeout(() => { window.location = "?"; }, 2000);
});
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').show().delay(2000).fadeOut(500);
$('#msg').html(a[0]);
}
},

View File

@ -0,0 +1,130 @@
function verteilersave(){
var verteilername = document.getElementById("verteilername").value;
$.ajax({
type: 'POST',
url: '../controller/admin_verteilerlisten.php',
data: {
'function': 'verteilersave',
'verteilername': verteilername
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
document.getElementById("verteilername").value ="";
$(document).ajaxStop(function(){
setTimeout(() => { window.location = "?"; }, 2000);
});
}
$('#msg').show().delay(2000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function erfuser(mveid, mvid) {
$.ajax({
type: 'POST',
url: '../controller/admin_verteilerlisten.php',
data: {
'function': 'erfuser',
'mveid': mveid,
'mvid': mvid
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
$(document).ajaxStop(function(){
// Refresh Modal
var value = a[2];
// load the url and show modal on success
$("#ZuordnungModal .modal-body").load('verteileruserzuordnung.php?edit='+value, function() {
$("#ZuordnungModal").modal("show");
});
});
}
$('#msg').show().delay(1000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function deluser(mveid, mvid) {
$.ajax({
type: 'POST',
url: '../controller/admin_verteilerlisten.php',
data: {
'function': 'deluser',
'mveid': mveid,
'mvid': mvid
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
$(document).ajaxStop(function(){
// Refresh Modal
var value = a[2];
// load the url and show modal on success
$("#ZuordnungModal .modal-body").load('verteileruserzuordnung.php?edit='+value, function() {
$("#ZuordnungModal").modal("show");
});
});
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function delVerteiler(mvid) {
r = confirm('Verteiler wirklich löschen?');
if (r) {
$.ajax({
type: 'POST',
url: '../controller/admin_verteilerlisten.php',
data: {
'function': 'delVerteiler',
'mvid': mvid
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
$(document).ajaxStop(function(){
setTimeout(() => { window.location = "?"; }, 2000);
});
}
$('#msg').show().delay(2000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
}

6
js/select/bootstrap-select.min.css vendored Normal file

File diff suppressed because one or more lines are too long

8
js/select/bootstrap-select.min.js vendored Normal file

File diff suppressed because one or more lines are too long

7
js/select/defaults-de_DE.min.js vendored Normal file
View File

@ -0,0 +1,7 @@
/*!
* Bootstrap-select v1.14.0-beta3 (https://developer.snapappointments.com/bootstrap-select)
*
* Copyright 2012-2022 SnapAppointments, LLC
* Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE)
*/
!function(e,t){void 0===e&&void 0!==window&&(e=window),"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(e.jQuery)}(this,function(e){e.fn.selectpicker.defaults={noneSelectedText:"Bitte w\xe4hlen...",noneResultsText:"Keine Ergebnisse f\xfcr {0}",countSelectedText:function(e,t){return 1==e?"{0} Element ausgew\xe4hlt":"{0} Elemente ausgew\xe4hlt"},maxOptionsText:function(e,t){return[1==e?"Limit erreicht ({n} Element max.)":"Limit erreicht ({n} Elemente max.)",1==t?"Gruppen-Limit erreicht ({n} Element max.)":"Gruppen-Limit erreicht ({n} Elemente max.)"]},selectAllText:"Alles ausw\xe4hlen",deselectAllText:"Nichts ausw\xe4hlen",multipleSeparator:", "}});