diff --git a/Fuchs/Controllers/IntranetController.Invoices.cs b/Fuchs/Controllers/IntranetController.Invoices.cs index a5fc16f..26efcca 100644 --- a/Fuchs/Controllers/IntranetController.Invoices.cs +++ b/Fuchs/Controllers/IntranetController.Invoices.cs @@ -17,34 +17,51 @@ public partial class IntranetController { private async Task Do_Process_Invoices(string fn, string id, string code) { + _logger.LogDebug("Do_Process_Invoices called: fn={Fn} id={Id} code={Code} user={User}", fn, id, code, UserAccountID); + switch (id.ToLower()) { case "auth": + _logger.LogDebug("Invoice auth check for user {User}", UserAccountID); return await JSONAsync(new { manage = 1 }); case "setpyd": - if (!HasForm("id")) return BadRequest400(); - return await setSQLValue_async( - "EXECUTE [dbo].[fds__setInvoicePayed] @Id, @authuser;", - _intranet.Intranet__SQLConnectionString, - StdParamlist(SQL_VarChar("@Id", Form("id"))), - Security: DbSec, options: SqlOpt(fn, id, code)) - ? Ok() : StatusCode(500); + if (!HasForm("id")) { _logger.LogWarning("setpyd: missing form field 'id', user={User}", UserAccountID); return BadRequest400(); } + { + var invoiceId = Form("id"); + _logger.LogInformation("setpyd: marking invoice {InvoiceId} as paid, user={User}", invoiceId, UserAccountID); + var ok = await setSQLValue_async( + "EXECUTE [dbo].[fds__setInvoicePayed] @Id, @authuser;", + _intranet.Intranet__SQLConnectionString, + StdParamlist(SQL_VarChar("@Id", invoiceId)), + Security: DbSec, options: SqlOpt(fn, id, code)); + if (!ok) _logger.LogError("setpyd: SQL failed for invoice {InvoiceId}, user={User}", invoiceId, UserAccountID); + return ok ? Ok() : StatusCode(500); + } case "setupd": - if (!HasForm("id")) return BadRequest400(); - return await setSQLValue_async( - "EXECUTE [dbo].[fds__setInvoiceUNPayed] @Id, @authuser;", - _intranet.Intranet__SQLConnectionString, - StdParamlist(SQL_VarChar("@Id", Form("id"))), - Security: DbSec, options: SqlOpt(fn, id, code)) - ? Ok() : StatusCode(500); + if (!HasForm("id")) { _logger.LogWarning("setupd: missing form field 'id', user={User}", UserAccountID); return BadRequest400(); } + { + var invoiceId = Form("id"); + _logger.LogInformation("setupd: marking invoice {InvoiceId} as unpaid, user={User}", invoiceId, UserAccountID); + var ok = await setSQLValue_async( + "EXECUTE [dbo].[fds__setInvoiceUNPayed] @Id, @authuser;", + _intranet.Intranet__SQLConnectionString, + StdParamlist(SQL_VarChar("@Id", invoiceId)), + Security: DbSec, options: SqlOpt(fn, id, code)); + if (!ok) _logger.LogError("setupd: SQL failed for invoice {InvoiceId}, user={User}", invoiceId, UserAccountID); + return ok ? Ok() : StatusCode(500); + } case "setvat": if (!float.TryParse(Form("val").Replace("%", "").Replace(",", ".").Trim(), NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out float vatVal)) - return BadRequest400(); { + _logger.LogWarning("setvat: invalid VAT value '{Val}', user={User}", Form("val"), UserAccountID); + return BadRequest400(); + } + { + _logger.LogInformation("setvat: setting VAT {Vat} on report {ReportId}, user={User}", vatVal, Form("id"), UserAccountID); var pl = StdParamlist( SQL_BigInt("@id", Form("id")), SQL_VarChar("@entitytype", "report"), @@ -53,42 +70,90 @@ public partial class IntranetController string sqlEx = ""; int? sqlCode = null; setSQLValue("EXECUTE [dbo].[fds__setReportVAT] @id, @entitytype, @vat, @authuser;", _intranet.Intranet_SqlCon(), ref sqlEx, ref sqlCode, pl, Security: DbSec); + if (!string.IsNullOrEmpty(sqlEx)) + _logger.LogError("setvat: SQL error for report {ReportId}: {SqlError}, user={User}", Form("id"), sqlEx, UserAccountID); return string.IsNullOrEmpty(sqlEx) ? Ok() : StatusCode(500, new { error = sqlEx }); } case "sis": - if (!HasForm("id")) return BadRequest400(); + if (!HasForm("id")) { _logger.LogWarning("sis: missing form field 'id', user={User}", UserAccountID); return BadRequest400(); } { - var pl = StdParamlist(SQL_VarChar("@Id", Form("id")), SQL_Bit("@auto", false)); + var invoiceId = Form("id"); + _logger.LogInformation("sis: marking invoice {InvoiceId} as sent, user={User}", invoiceId, UserAccountID); + var pl = StdParamlist(SQL_VarChar("@Id", invoiceId), SQL_Bit("@auto", false)); var dt2 = await getSQLDataSet_async( "EXECUTE [dbo].[fds__setInvoiceSent] @Id, @auto, @authuser;", _intranet.Intranet__SQLConnectionString, pl, Security: DbSec, options: SqlOpt(fn, id, code)); + if (!string.IsNullOrEmpty(dt2.Exception)) + _logger.LogError("sis: SQL error for invoice {InvoiceId}: {SqlError}, user={User}", invoiceId, dt2.Exception, UserAccountID); return string.IsNullOrEmpty(dt2.Exception) ? Ok() : StatusCode(500); } - case "pget": return await HandleInvoicePget(fn, id, code); - case "get": return await HandleInvoiceGet(fn, id, code); - case "icget": return await HandleInvoiceIcGet(fn, id, code); + case "pget": + _logger.LogDebug("pget: invoice PDF get, user={User}", UserAccountID); + return await HandleInvoicePget(fn, id, code); + + case "get": + _logger.LogDebug("get: invoice get, user={User}", UserAccountID); + return await HandleInvoiceGet(fn, id, code); + + case "icget": + _logger.LogDebug("icget: invoice IC get, user={User}", UserAccountID); + return await HandleInvoiceIcGet(fn, id, code); + case "storno": - case "credit": return await HandleInvoiceStornoCredit(fn, id, code); - case "invl": return await HandleInvoiceList(fn, id, code); - case "rqi": return await HandleInvoiceRequestItems(fn, id, code); - case "pyi": return await HandleInvoicePayments(fn, id, code); - case "datev": return await HandleDatev(fn, id, code); - case "rdoc": return await HandleReportDoc(fn, id, code, Form("id")); - case "rdocn": return await HandleReportDocByName(fn, id, code); - case "datevzip": return await HandleDatevZip(fn, id, code); - case "getrem": return await HandleGetReminder(fn, id, code); + case "credit": + _logger.LogInformation("{Action}: invoice storno/credit, user={User}", id, UserAccountID); + return await HandleInvoiceStornoCredit(fn, id, code); + + case "invl": + _logger.LogDebug("invl: invoice list, user={User}", UserAccountID); + return await HandleInvoiceList(fn, id, code); + + case "rqi": + _logger.LogDebug("rqi: invoice request items, user={User}", UserAccountID); + return await HandleInvoiceRequestItems(fn, id, code); + + case "pyi": + _logger.LogDebug("pyi: invoice payments, user={User}", UserAccountID); + return await HandleInvoicePayments(fn, id, code); + + case "datev": + _logger.LogDebug("datev: DATEV export, user={User}", UserAccountID); + return await HandleDatev(fn, id, code); + + case "rdoc": + _logger.LogDebug("rdoc: report document get id={DocId}, user={User}", Form("id"), UserAccountID); + return await HandleReportDoc(fn, id, code, Form("id")); + + case "rdocn": + _logger.LogDebug("rdocn: report document get by name, user={User}", UserAccountID); + return await HandleReportDocByName(fn, id, code); + + case "datevzip": + _logger.LogDebug("datevzip: DATEV ZIP export, user={User}", UserAccountID); + return await HandleDatevZip(fn, id, code); + + case "getrem": + _logger.LogDebug("getrem: get reminder for invoice, user={User}", UserAccountID); + return await HandleGetReminder(fn, id, code); case "mfrrel": - if (!HasForm("id") || !long.TryParse(Form("id"), out long relId)) return BadRequest400(); + if (!HasForm("id") || !long.TryParse(Form("id"), out long relId)) + { + _logger.LogWarning("mfrrel: missing or invalid form field 'id', user={User}", UserAccountID); + return BadRequest400(); + } + _logger.LogInformation("mfrrel: resetting MFR relation for invoice {InvoiceId}, user={User}", relId, UserAccountID); using (var mfr = new fds.FdsMfrClient()) await mfr.Update__entitytable(EntityTypes.Invoice, fds.FdsMfr.UpdateNeed.Reset, new[] { relId }); return Ok(); - default: return Ok(); + default: + _logger.LogWarning("Do_Process_Invoices: unhandled action id={Id}, user={User}", id, UserAccountID); + return Ok(); } } } diff --git a/Fuchs/Controllers/IntranetController.Invoices2.cs b/Fuchs/Controllers/IntranetController.Invoices2.cs index 634798f..76505e8 100644 --- a/Fuchs/Controllers/IntranetController.Invoices2.cs +++ b/Fuchs/Controllers/IntranetController.Invoices2.cs @@ -18,11 +18,16 @@ public partial class IntranetController { private async Task HandleInvoicePget(string fn, string id, string code) { - if (!HasForm("id")) return BadRequest400(); - if (!long.TryParse(Form("id"), out long tgtid)) return BadRequest400(); + if (!HasForm("id")) { _logger.LogWarning("HandleInvoicePget: missing 'id' form field user={User}", UserAccountID); return BadRequest400(); } + if (!long.TryParse(Form("id"), out long tgtid)) { _logger.LogWarning("HandleInvoicePget: invalid 'id' value='{Value}' user={User}", Form("id"), UserAccountID); return BadRequest400(); } + _logger.LogDebug("HandleInvoicePget tgtid={TgtId} user={User}", tgtid, UserAccountID); + using (var mfr = new fds.FdsMfrClient()) + { + _logger.LogDebug("HandleInvoicePget resetting invoice entity tgtid={TgtId}", tgtid); await mfr.Update__entitytable(EntityTypes.Invoice, fds.FdsMfr.UpdateNeed.Reset, new[] { tgtid }); + } var dt = await getSQLDatatable_async( "SELECT * FROM [dbo].[fds__getInvoiceTreeIds](@srqid);", @@ -30,6 +35,7 @@ public partial class IntranetController StdParamlist(SQL_BigInt("@srqid", tgtid)), Security: DbSec, options: SqlOpt(fn, id, code)); + _logger.LogDebug("HandleInvoicePget tree query returned {Count} rows for tgtid={TgtId}", dt.Count, tgtid); if (dt.Count > 0) { var invIds = new List(); @@ -43,11 +49,14 @@ public partial class IntranetController case "servicerequest": if (iid > 0 && !srqIds.Contains(iid)) srqIds.Add(iid); break; } } + _logger.LogDebug("HandleInvoicePget resetting {InvCount} invoices and {SrqCount} service requests", invIds.Count, srqIds.Count); using var mfr2 = new fds.FdsMfrClient(); foreach (var iid in invIds) await mfr2.Update__entitytable(EntityTypes.Invoice, fds.FdsMfr.UpdateNeed.Reset, new[] { iid }); foreach (var iid in srqIds) await mfr2.Update__entitytable(EntityTypes.ServiceRequest, fds.FdsMfr.UpdateNeed.Reset, new[] { iid }); + _logger.LogInformation("HandleInvoicePget reset complete for tgtid={TgtId} invoices={InvCount} serviceRequests={SrqCount} user={User}", + tgtid, invIds.Count, srqIds.Count, UserAccountID); } return Ok(); } @@ -56,35 +65,48 @@ public partial class IntranetController { try { - if (!HasForm("id")) return BadRequest400(); + if (!HasForm("id")) { _logger.LogWarning("HandleInvoiceGet: missing 'id' form field user={User}", UserAccountID); return BadRequest400(); } + string invoiceId = Form("id"); + _logger.LogDebug("HandleInvoiceGet invoiceId={InvoiceId} user={User}", invoiceId, UserAccountID); var sqldset = await getSQLDataSet_async( "EXECUTE [dbo].[fds__getInvoice] @Id, @authuser;", _intranet.Intranet__SQLConnectionString, - StdParamlist(SQL_VarChar("@Id", Form("id"))), + StdParamlist(SQL_VarChar("@Id", invoiceId)), tablenames: new[] { "admin", "inv", "req", "itm" }, Security: DbSec, options: SqlOpt(fn, id, code)); var ldic = BuildInvoiceRequestList(sqldset); var adminDic = sqldset.Table("admin").FirstRow.toObjectDictionary(); var invDic = sqldset.Table("inv").FirstRow.toObjectDictionary(); - if (invDic.nz("InvoiceOptions", "").Split(',').Contains("§13b")) + bool has13b = invDic.nz("InvoiceOptions", "").Split(',').Contains("§13b"); + if (has13b) adminDic["p13b"] = true; + _logger.LogDebug("HandleInvoiceGet invoiceId={InvoiceId} requestCount={ReqCount} has13b={Has13b} user={User}", + invoiceId, ldic.Count, has13b, UserAccountID); return await JSONAsync(new { admin = adminDic, inv = invDic, req = ldic }); } - catch { return StatusCode(500); } + catch (Exception ex) + { + _logger.LogError(ex, "HandleInvoiceGet failed for id={InvoiceId} user={User}", Form("id"), UserAccountID); + return StatusCode(500); + } } private async Task HandleInvoiceIcGet(string fn, string id, string code) { - if (!HasForm("id")) return BadRequest400(); + if (!HasForm("id")) { _logger.LogWarning("HandleInvoiceIcGet: missing 'id' form field user={User}", UserAccountID); return BadRequest400(); } + string invoiceId = Form("id"); + _logger.LogDebug("HandleInvoiceIcGet (storno/recreate prep) invoiceId={InvoiceId} user={User}", invoiceId, UserAccountID); var sqldset = await getSQLDataSet_async( "EXECUTE [dbo].[fds__prepStorno_recreate] @InvId, @authuser;", _intranet.Intranet__SQLConnectionString, - StdParamlist(SQL_VarChar("@InvId", Form("id"))), + StdParamlist(SQL_VarChar("@InvId", invoiceId)), tablenames: new[] { "admin", "requests", "items", "steps", "companies", "locations" }, Security: DbSec, options: SqlOpt(fn, id, code)); var ldic = BuildRequestItemList(sqldset); + _logger.LogDebug("HandleInvoiceIcGet invoiceId={InvoiceId} requestCount={ReqCount} user={User}", + invoiceId, ldic.Count, UserAccountID); return await JSONAsync(new { admin = sqldset.Table("admin").FirstRow.toObjectDictionary(), @@ -96,34 +118,47 @@ public partial class IntranetController private async Task HandleInvoiceStornoCredit(string fn, string id, string code) { - if (!HasForm("id", "mode")) return BadRequest400(); - string sqlcmd = Form("mode") switch + if (!HasForm("id", "mode")) { _logger.LogWarning("HandleInvoiceStornoCredit: missing required form fields user={User}", UserAccountID); return BadRequest400(); } + string invoiceId = Form("id"); + string mode = Form("mode"); + _logger.LogDebug("HandleInvoiceStornoCredit invoiceId={InvoiceId} mode={Mode} user={User}", invoiceId, mode, UserAccountID); + string sqlcmd = mode switch { "credit" => "EXECUTE [dbo].[fds__createCredit_simple] @Id, @authuser;", "simple" => "EXECUTE [dbo].[fds__createStorno_simple] @Id, @authuser;", "copy" => "EXECUTE [dbo].[fds__createStorno_copy] @Id, @authuser;", _ => "" }; - if (string.IsNullOrEmpty(sqlcmd)) return StatusCode(500, new { error = "function not allowed" }); + if (string.IsNullOrEmpty(sqlcmd)) + { + _logger.LogWarning("HandleInvoiceStornoCredit: unknown mode={Mode} invoiceId={InvoiceId} user={User}", mode, invoiceId, UserAccountID); + return StatusCode(500, new { error = "function not allowed" }); + } + _logger.LogInformation("HandleInvoiceStornoCredit executing mode={Mode} invoiceId={InvoiceId} user={User}", mode, invoiceId, UserAccountID); var sqldset = await getSQLDataSet_async(sqlcmd, _intranet.Intranet__SQLConnectionString, - StdParamlist(SQL_VarChar("@Id", Form("id"))), + StdParamlist(SQL_VarChar("@Id", invoiceId)), tablenames: new[] { "admin", "inv", "req", "itm" }, Security: DbSec, options: SqlOpt(fn, id, code)); + var reqList = BuildInvoiceRequestList(sqldset); + _logger.LogDebug("HandleInvoiceStornoCredit complete mode={Mode} invoiceId={InvoiceId} requestCount={ReqCount} user={User}", + mode, invoiceId, reqList.Count, UserAccountID); return await JSONAsync(new { admin = sqldset.Table("admin").FirstRow.toObjectDictionary(), inv = sqldset.Table("inv").FirstRow.toObjectDictionary(), - req = BuildInvoiceRequestList(sqldset) + req = reqList }); } private async Task HandleInvoiceList(string fn, string id, string code) { - if (!HasForm("mode")) return BadRequest400(); + if (!HasForm("mode")) { _logger.LogWarning("HandleInvoiceList: missing 'mode' form field user={User}", UserAccountID); return BadRequest400(); } string mode = Form("mode").ToLower(); + _logger.LogDebug("HandleInvoiceList mode={Mode} tgt={Tgt} user={User}", mode, Form("tgt"), UserAccountID); if (mode == "s" && Form("tgt").Contains(':')) { + _logger.LogDebug("HandleInvoiceList using search path mode={Mode} search={Search} user={User}", mode, Form("tgt"), UserAccountID); var pl = StdParamlist( SQL_Date("@tgtdate", DBNull.Value), SQL_VarChar("@mode", Form("mode").ne("m")), @@ -134,6 +169,8 @@ public partial class IntranetController _intranet.Intranet__SQLConnectionString, pl, tablenames: new[] { "admin", "invoices" }, Security: DbSec, options: SqlOpt(fn, id, code)); + _logger.LogDebug("HandleInvoiceList search returned {Count} invoices user={User}", + dset.Tables("invoices").Rows.Count, UserAccountID); return await JSONAsync(new { admin = dset.Table("admin").FirstRow.toObjectDictionary(), @@ -142,17 +179,25 @@ public partial class IntranetController } if (!DateTime.TryParseExact(Form("tgt"), "yy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.AllowWhiteSpaces, out var tgtdate)) - return BadRequest400(); { + _logger.LogWarning("HandleInvoiceList: invalid date format tgt='{Tgt}' user={User}", Form("tgt"), UserAccountID); + return BadRequest400(); + } + { + string includes = Form("includes").ne(Form("all") == "true" ? "all" : ""); + _logger.LogDebug("HandleInvoiceList date-based tgtdate={TgtDate} mode={Mode} includes={Includes} user={User}", + tgtdate.ToString("yy-MM-dd"), mode, includes, UserAccountID); var pl = StdParamlist( SQL_Date("@tgtdate", tgtdate), SQL_VarChar("@mode", Form("mode").ne("m")), - SQL_VarChar("@includes", Form("includes").ne(Form("all") == "true" ? "all" : ""))); + SQL_VarChar("@includes", includes)); var dset = await getSQLDataSet_async( "EXECUTE [dbo].[fds__getInvoices_list_vario] @tgtdate, @mode, @includes, @authuser;", _intranet.Intranet__SQLConnectionString, pl, tablenames: new[] { "admin", "invoices" }, Security: DbSec, options: SqlOpt(fn, id, code)); + _logger.LogDebug("HandleInvoiceList date-based returned {Count} invoices user={User}", + dset.Tables("invoices").Rows.Count, UserAccountID); return await JSONAsync(new { admin = dset.Table("admin").FirstRow.toObjectDictionary(), @@ -163,11 +208,13 @@ public partial class IntranetController private async Task HandleInvoiceRequestItems(string fn, string id, string code) { - if (!HasForm("id")) return BadRequest400(); + if (!HasForm("id")) { _logger.LogWarning("HandleInvoiceRequestItems: missing 'id' form field user={User}", UserAccountID); return BadRequest400(); } + string invoiceId = Form("id"); + _logger.LogDebug("HandleInvoiceRequestItems invoiceId={InvoiceId} user={User}", invoiceId, UserAccountID); var sqldt = await getSQLDataSet_async( "EXECUTE [dbo].[fds__getInvRequestItems] @invoiceid, @authuser;", _intranet.Intranet__SQLConnectionString, - StdParamlist(SQL_VarChar("@invoiceid", Form("id"))), + StdParamlist(SQL_VarChar("@invoiceid", invoiceId)), tablenames: new[] { "requests", "items" }, Security: DbSec, options: SqlOpt(fn, id, code)); var ldic = new List>(); @@ -180,18 +227,25 @@ public partial class IntranetController .Select(r => r.toObjectDictionary()).ToList(); ldic.Add(sdic!); } + _logger.LogDebug("HandleInvoiceRequestItems invoiceId={InvoiceId} requestCount={ReqCount} user={User}", + invoiceId, ldic.Count, UserAccountID); return await JSONAsync(new { requests = ldic }); } private async Task HandleInvoicePayments(string fn, string id, string code) { - if (!HasForm("id")) return BadRequest400(); + if (!HasForm("id")) { _logger.LogWarning("HandleInvoicePayments: missing 'id' form field user={User}", UserAccountID); return BadRequest400(); } + string invoiceId = Form("id"); + _logger.LogDebug("HandleInvoicePayments invoiceId={InvoiceId} user={User}", invoiceId, UserAccountID); var sqldt = await getSQLDataSet_async( "EXECUTE [dbo].[fds__getInvPayments] @invoiceid, @authuser;", _intranet.Intranet__SQLConnectionString, - StdParamlist(SQL_VarChar("@invoiceid", Form("id"))), + StdParamlist(SQL_VarChar("@invoiceid", invoiceId)), tablenames: new[] { "items" }, Security: DbSec, options: SqlOpt(fn, id, code)); + int paymentCount = sqldt.Tables("items").Rows.Count; + _logger.LogDebug("HandleInvoicePayments invoiceId={InvoiceId} paymentCount={PaymentCount} user={User}", + invoiceId, paymentCount, UserAccountID); return await JSONAsync(new { payments = sqldt.Tables("items").toArrayofObjectDictionaries() }); } @@ -199,13 +253,20 @@ public partial class IntranetController { if (!DateTime.TryParseExact(Form("tgt"), "yy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.AllowWhiteSpaces, out var tgtdate)) + { + _logger.LogWarning("HandleDatev: invalid date format tgt='{Tgt}' user={User}", Form("tgt"), UserAccountID); return BadRequest400(); + } + string mode = Form("mode").ne("m"); + _logger.LogDebug("HandleDatev tgtdate={TgtDate} mode={Mode} user={User}", tgtdate.ToString("yy-MM-dd"), mode, UserAccountID); var dset = await getSQLDataSet_async( "EXECUTE [dbo].[fds__getDatevExports] @tgtdate, @mode, @authuser;", _intranet.Intranet__SQLConnectionString, - StdParamlist(SQL_Date("@tgtdate", tgtdate), SQL_VarChar("@mode", Form("mode").ne("m"))), + StdParamlist(SQL_Date("@tgtdate", tgtdate), SQL_VarChar("@mode", mode)), tablenames: new[] { "files", "invoices", "debits" }, Security: DbSec, options: SqlOpt(fn, id, code)); + _logger.LogDebug("HandleDatev tgtdate={TgtDate} files={FileCount} invoices={InvCount} user={User}", + tgtdate.ToString("yy-MM-dd"), dset.Tables("files").Rows.Count, dset.Tables("invoices").Rows.Count, UserAccountID); return await JSONAsync(new { files = dset.Tables("files").toArrayofObjectDictionaries(), @@ -215,9 +276,16 @@ public partial class IntranetController private async Task HandleReportDoc(string fn, string id, string code, string reportid) { + _logger.LogDebug("HandleReportDoc reportid={ReportId} typ={Typ} user={User}", reportid, Form("typ"), UserAccountID); byte[]? content = null; var file = _mfr.GetReportDoc(ref content, reportid); - if (file == null) return StatusCode(404, new { error = "Dokument wurde nicht gefunden" }); + if (file == null) + { + _logger.LogWarning("HandleReportDoc: document not found reportid={ReportId} user={User}", reportid, UserAccountID); + return StatusCode(404, new { error = "Dokument wurde nicht gefunden" }); + } + _logger.LogDebug("HandleReportDoc found reportid={ReportId} fileName={FileName} mimeType={MimeType} size={Size} user={User}", + reportid, file.Name, file.MimeType(), content?.Length ?? 0, UserAccountID); return Form("typ") != "img" ? await FileContentResultAsync(content!, file.MimeType(), file.Name) : await JSONAsync(new { id = reportid, img = await BuildPdfImageArray(content!) }); @@ -225,46 +293,76 @@ public partial class IntranetController private async Task HandleReportDocByName(string fn, string id, string code) { - if (!HasForm("name")) return BadRequest400(); + if (!HasForm("name")) { _logger.LogWarning("HandleReportDocByName: missing 'name' form field user={User}", UserAccountID); return BadRequest400(); } string nme = Form("name").LeftToFirst("(").Trim(); - if (string.IsNullOrEmpty(nme)) return StatusCode(404); + _logger.LogDebug("HandleReportDocByName name='{Name}' user={User}", nme, UserAccountID); + if (string.IsNullOrEmpty(nme)) + { + _logger.LogWarning("HandleReportDocByName: empty name after trim user={User}", UserAccountID); + return StatusCode(404); + } var so = await getSQLValue_async( "SELECT [dbo].[fds__fn_InvoiceIdByName](@nme);", _intranet.Intranet__SQLConnectionString, StdParamlist(SQL_VarChar("@nme", nme)), Security: DbSec, options: SqlOpt(fn, id, code)); string reportid = so.Result?.ToString() ?? ""; - return string.IsNullOrEmpty(reportid) - ? StatusCode(404) - : await HandleReportDoc(fn, id, code, reportid); + if (string.IsNullOrEmpty(reportid)) + { + _logger.LogWarning("HandleReportDocByName: no invoice found for name='{Name}' user={User}", nme, UserAccountID); + return StatusCode(404); + } + _logger.LogDebug("HandleReportDocByName resolved name='{Name}' to reportid={ReportId} user={User}", nme, reportid, UserAccountID); + return await HandleReportDoc(fn, id, code, reportid); } private async Task HandleDatevZip(string fn, string id, string code) { if (!DateTime.TryParseExact(Form("tgt"), "yy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.AllowWhiteSpaces, out var tgtdate)) + { + _logger.LogWarning("HandleDatevZip: invalid date format tgt='{Tgt}' user={User}", Form("tgt"), UserAccountID); return BadRequest400(); + } + string mode = Form("mode").ne("m"); + bool includeFiles = Form("files", "1") != "0"; + _logger.LogDebug("HandleDatevZip tgtdate={TgtDate} mode={Mode} includeFiles={IncludeFiles} user={User}", + tgtdate.ToString("yy-MM-dd"), mode, includeFiles, UserAccountID); Stream? ms = new MemoryStream(); var file = _mfr.GetDatevZip(ref ms, tgtdate, - mode: Form("mode").ne("m"), + mode: mode, authUser: UserAccountID, - includeFiles: Form("files", "1") != "0"); - if (file == null) return BadRequest400(); + includeFiles: includeFiles); + if (file == null) + { + _logger.LogWarning("HandleDatevZip: zip generation returned null for tgtdate={TgtDate} mode={Mode} user={User}", + tgtdate.ToString("yy-MM-dd"), mode, UserAccountID); + return BadRequest400(); + } + _logger.LogInformation("HandleDatevZip sending file='{FileName}' tgtdate={TgtDate} user={User}", + file.Name, tgtdate.ToString("yy-MM-dd"), UserAccountID); ms!.Position = 0; return await FileStreamResultAsync(ms, file.MimeType(), file.Name); } private async Task HandleGetReminder(string fn, string id, string code) { - if (!HasForm("id")) return BadRequest400(); + if (!HasForm("id")) { _logger.LogWarning("HandleGetReminder: missing 'id' form field user={User}", UserAccountID); return BadRequest400(); } + string invoiceId = Form("id"); + string includeDrafts = Form("drafts"); + _logger.LogDebug("HandleGetReminder invoiceId={InvoiceId} includeDrafts={IncludeDrafts} user={User}", + invoiceId, includeDrafts, UserAccountID); var pl = StdParamlist( - SQL_VarChar("@InvId", Form("id")), - SQL_Bit("@include_drafts", Form("drafts"))); + SQL_VarChar("@InvId", invoiceId), + SQL_Bit("@include_drafts", includeDrafts)); var sqldt = await getSQLDataSet_async( "EXECUTE [dbo].[fds__getInvoiceReminder] @InvId, @include_drafts, @authuser;", _intranet.Intranet__SQLConnectionString, pl, tablenames: new[] { "reminder" }, Security: DbSec, options: SqlOpt(fn, id, code)); + int reminderCount = sqldt.Table("reminder").DataTable.Rows.Count; + _logger.LogDebug("HandleGetReminder invoiceId={InvoiceId} reminderCount={ReminderCount} user={User}", + invoiceId, reminderCount, UserAccountID); return await JSONAsync(sqldt.Table("reminder").DataTable.toArrayofObjectDictionaries()); } diff --git a/Fuchs/Controllers/IntranetController.cs b/Fuchs/Controllers/IntranetController.cs index b752e28..5635ca0 100644 --- a/Fuchs/Controllers/IntranetController.cs +++ b/Fuchs/Controllers/IntranetController.cs @@ -76,23 +76,27 @@ public partial class IntranetController : Microsoft.AspNetCore.Mvc.Controller // ── Index (GET /) ───────────────────────────────────────────────────────── [AllowAnonymous] - public IActionResult Index(string? fn, string? id, string? code) => + public IActionResult Index([FromRoute] string? fn, [FromRoute] string? id, [FromRoute] string? code) => View("intranet"); // ── Do (POST+GET /do/{fn}/{id}/{code}) ───────────────────────────────── [AllowAnonymous] - public async Task Do(string? fn, string? id, string? code) + public async Task Do([FromRoute] string? fn, [FromRoute] string? id, [FromRoute] string? code) { fn = (fn ?? "").ToLower(); id ??= ""; code ??= ""; bool isGet = HttpContext.Request.Method.Equals("GET", StringComparison.OrdinalIgnoreCase); + _logger.LogDebug("Do dispatching {Fn}/{Id}/{Code} [{Method}] user={User}", + fn, id, code, HttpContext.Request.Method, UserAccountID); + if (!UserIdent.IsAuthenticated && !(new string[] { "login","logout" }).Contains(fn.ToLower()) && !_allowedNonAuth.Contains(fn.ToLower())) { if (!_allowedGet.Contains(fn.ToLower()) && !_allowedGet.Contains($"{fn.ToLower()}|{id.ToLower()}")) { - _logger.LogInformation($"rejected function on do {fn}"); + _logger.LogWarning("Rejected unauthenticated request for fn={Fn} id={Id} ip={IP}", + fn, id, HttpContext.Connection.RemoteIpAddress); return Unauthorized401(); } } @@ -121,12 +125,16 @@ public partial class IntranetController : Microsoft.AspNetCore.Mvc.Controller "logout" => await HandleLogout(), _ => null }; + if (result == null) + _logger.LogWarning("No handler matched fn={Fn}", fn); + else + _logger.LogDebug("Do completed fn={Fn}/{Id} result={ResultType}", fn, id, result.GetType().Name); return result ?? Ok(); } catch (Exception ex) { - _intranet.debug_log("IntranetController.Do", ex, UserAccountID, - data: new { fn, id, code }); + _logger.LogError(ex, "Unhandled exception in Do fn={Fn} id={Id} code={Code} user={User}", + fn, id, code, UserAccountID); return ServerError(); } } @@ -134,8 +142,14 @@ public partial class IntranetController : Microsoft.AspNetCore.Mvc.Controller // ── Auth helper ─────────────────────────────────────────────────────────── private async Task HandleAuth(string fn, string id, string code) { - if (!Request.Form.ContainsKey("module")) return BadRequest400(); + if (!Request.Form.ContainsKey("module")) + { + _logger.LogWarning("HandleAuth called without 'module' form field by user={User}", UserAccountID); + return BadRequest400(); + } string module = Request.Form["module"].ToString(); + _logger.LogDebug("HandleAuth module={Module} array={Array} user={User}", + module, Request.Form["array"].ToString(), UserAccountID); if (Request.Form["array"] == "1") { var dt = await getSQLDatatable_async( @@ -143,6 +157,8 @@ public partial class IntranetController : Microsoft.AspNetCore.Mvc.Controller _intranet.Intranet__SQLConnectionString, StdParamlist(SQL_VarChar("@module", module)), Security: DbSec, options: SqlOpt(fn, id, code)); + _logger.LogDebug("HandleAuth returned {Count} module auth entries for user={User}", + dt.DataTable.Rows.Count, UserAccountID); return await JSONAsync(dt.DataTable.ToDictionary(KeyColumn: "module", ValueColumn: "auth")); } else @@ -152,6 +168,8 @@ public partial class IntranetController : Microsoft.AspNetCore.Mvc.Controller _intranet.Intranet__SQLConnectionString, -1, StdParamlist(SQL_VarChar("@module", module)), Security: DbSec, options: SqlOpt(fn, id, code)); + _logger.LogDebug("HandleAuth module={Module} auth={Auth} user={User}", + module, val.Result, UserAccountID); return await JSONAsync(new { auth = val.Result }); } } @@ -162,13 +180,13 @@ public partial class IntranetController : Microsoft.AspNetCore.Mvc.Controller { string email = Request.Form["userinfo"].ToString(); string password = Request.Form["userpass"].ToString(); + _logger.LogDebug("HandleLogin attempt for email={Email} ip={IP}", + email, HttpContext.Connection.RemoteIpAddress); var row = await _intranet.AuthenticateAsync(email, password); if (row == null) { - _logger.LogWarning("Login failed for '{Email}' from {IP}", + _logger.LogWarning("Login failed for email={Email} ip={IP}", email, HttpContext.Connection.RemoteIpAddress); - _intranet.debug_log("HandleLogin: failed", - data: new { email, ip = HttpContext.Connection.RemoteIpAddress?.ToString() }); return Unauthorized401(); } @@ -179,6 +197,8 @@ public partial class IntranetController : Microsoft.AspNetCore.Mvc.Controller var identity = FuchsUserIdentity.BuildIdentity(userId, userEmail, auth, Fuchs_intranet.AuthScheme); var principal = new System.Security.Claims.ClaimsPrincipal(identity); await HttpContext.SignInAsync(Fuchs_intranet.AuthScheme, principal); + _logger.LogInformation("Login succeeded for userId={UserId} email={Email} authorization={Auth} ip={IP}", + userId, userEmail, auth, HttpContext.Connection.RemoteIpAddress); return await JSONAsync(new { login = userEmail, @@ -192,7 +212,10 @@ public partial class IntranetController : Microsoft.AspNetCore.Mvc.Controller private async Task HandleLogout() { + _logger.LogInformation("Logout user={User} ip={IP}", + UserAccountID, HttpContext.Connection.RemoteIpAddress); await HttpContext.SignOutAsync(Fuchs_intranet.AuthScheme); + _logger.LogDebug("Logout sign-out complete for user={User}", UserAccountID); return Ok(); } @@ -201,16 +224,27 @@ public partial class IntranetController : Microsoft.AspNetCore.Mvc.Controller { string? lastname = Request.Form["lastname"]; string? email = Request.Form["email"]; - if (string.IsNullOrEmpty(lastname) || string.IsNullOrEmpty(email)) return BadRequest400(); + _logger.LogDebug("HandleSendPasswordCode called for email={Email}", email); + if (string.IsNullOrEmpty(lastname) || string.IsNullOrEmpty(email)) + { + _logger.LogWarning("HandleSendPasswordCode missing lastname or email"); + return BadRequest400(); + } var row = await _intranet.GetUserAccountByEmailAsync(email); if (row != null && row.nz("email").Length > 5 && row.nz("name").ToLower().Trim() == lastname.ToLower().Trim() && row.nz("mobile").Length > 5 && !Request.Host.Host.ToLower().Contains("localhost")) { + _logger.LogInformation("Sending password code SMS to mobile for email={Email}", email); string totp = OCORE.security.TFA.generateTotp_12h(_intranet.Intranet__TOTPsharedsecret_base); await _comService.SendSmsAsync(row.nz("mobile"), "Zur Bestätigung des Passwortversands auf sanitarfuchs.de, verwenden Sie bitte folgenden Code:" + totp); + _logger.LogDebug("Password code SMS sent for email={Email}", email); + } + else + { + _logger.LogDebug("HandleSendPasswordCode: no SMS sent for email={Email} (user not found, name mismatch, no mobile, or localhost)", email); } return Ok(); // always OK to prevent enumeration } @@ -220,34 +254,57 @@ public partial class IntranetController : Microsoft.AspNetCore.Mvc.Controller string? lastname = Request.Form["lastname"]; string? email = Request.Form["email"]; string? totpCode = Request.Form["code"]; + _logger.LogDebug("HandleSendPassword called for email={Email}", email); if (string.IsNullOrEmpty(lastname) || string.IsNullOrEmpty(email) || string.IsNullOrEmpty(totpCode)) - return BadRequest400(); - - if (OCORE.security.TFA.validateTotp_12h(_intranet.Intranet__TOTPsharedsecret_base, totpCode).isVerifiedInTime) { + _logger.LogWarning("HandleSendPassword missing required fields (lastname, email or code)"); + return BadRequest400(); + } + + var totpResult = OCORE.security.TFA.validateTotp_12h(_intranet.Intranet__TOTPsharedsecret_base, totpCode); + if (totpResult.isVerifiedInTime) + { + _logger.LogDebug("HandleSendPassword TOTP verified for email={Email}", email); var row = await _intranet.GetUserAccountByEmailAsync(email, includePassword: true); if (row != null && row.nz("email").Length > 5) { + _logger.LogInformation("Sending password email to email={Email}", email); await _comService.SendEmailAsync("pw_" + row.nz("email"), "sanitaerfuchs.de Intranet Passwort", $"

Guten Tag {row.nz("firstname")} {row.nz("name")},
Ihr Passwort: {HttpUtility.HtmlEncode(row.nz("password"))}

", row.nz("email"), $"{row.nz("firstname")} {row.nz("name")}", null); + _logger.LogDebug("Password email sent for email={Email}", email); } + else + { + _logger.LogWarning("HandleSendPassword: user not found for email={Email}", email); + } + } + else + { + _logger.LogWarning("HandleSendPassword: TOTP verification failed for email={Email}", email); } return Ok(); } private async Task HandleAccount(string fn, string id, string code) { + _logger.LogDebug("HandleAccount action={Action} user={User}", id, UserAccountID); switch (id.ToLower()) { case "sms": var row = await _intranet.GetUserAccountByEmailAsync(UserIdent.Email, includePassword: true); if (row != null && row.nz("mobile").Length > 5 && !Request.Host.Host.Contains("localhost")) { + _logger.LogInformation("Sending change-password confirmation SMS to user={User}", UserAccountID); string totp2 = OCORE.security.TFA.generateTotp_3h(_intranet.Intranet__TOTPsharedsecret_base + "3MDR"); await _comService.SendSmsAsync(row.nz("mobile"), "Zur Bestätigung der Passwortänderung auf sanitarfuchs.de: " + totp2); + _logger.LogDebug("Change-password SMS sent for user={User}", UserAccountID); + } + else + { + _logger.LogDebug("HandleAccount sms: no SMS sent for user={User} (no mobile or localhost)", UserAccountID); } return Ok(); @@ -256,9 +313,16 @@ public partial class IntranetController : Microsoft.AspNetCore.Mvc.Controller string? npwc = Request.Form["npwc"]; string? totpCode = Request.Form["code"]; if (string.IsNullOrEmpty(npw) || string.IsNullOrEmpty(npwc) || string.IsNullOrEmpty(totpCode)) + { + _logger.LogWarning("HandleAccount changepassword: missing required fields for user={User}", UserAccountID); return BadRequest400(); + } if (!OCORE.security.TFA.validateTotp_3h(_intranet.Intranet__TOTPsharedsecret_base + "3MDR", totpCode).isVerifiedInTime) + { + _logger.LogWarning("HandleAccount changepassword: TOTP verification failed for user={User}", UserAccountID); return StatusCode(409, new { error = "sms" }); + } + _logger.LogInformation("Changing password for user={User}", UserAccountID); await setSQLValue_async( "EXECUTE [dbo].[fis_admin_setNewPassword] @useraccount_id, @oldpassword, @newpassword, @enc_key;", _intranet.Intranet__SQLConnectionString, @@ -269,39 +333,55 @@ public partial class IntranetController : Microsoft.AspNetCore.Mvc.Controller SQL_VarChar("@newpassword", npw) }, Security: DbSec, options: SqlOpt(fn, id, code)); + _logger.LogDebug("Password changed successfully for user={User}", UserAccountID); return Ok(); } + _logger.LogWarning("HandleAccount unknown action={Action} user={User}", id, UserAccountID); return Ok(); } private async Task HandleMfr(string fn, string id, string code) { + _logger.LogDebug("HandleMfr id={Id} code={Code} user={User} auth={Auth}", + id, code, UserAccountID, UserIdent.Authorization); if (!string.IsNullOrEmpty(UserAccountID) && UserIdent.Authorization > 3) { string path = id + (!string.IsNullOrEmpty(code) ? "/" + code : HttpUtility.UrlDecode(Request.QueryString.Value ?? "")); + _logger.LogDebug("HandleMfr reading OData path={Path} user={User}", path, UserAccountID); using var mfrRead = new fds.FdsMfrClient(); var result = await mfrRead.ReadOData(path, throwErrorIfNotOk: false); + _logger.LogDebug("HandleMfr OData read complete for path={Path} user={User}", path, UserAccountID); return Content(JsonConvert.SerializeObject(result), "application/json"); } + _logger.LogWarning("HandleMfr access denied for user={User} authorization={Auth}", + UserAccountID, UserIdent.Authorization); return Ok(); } private async Task HandleMfrUpdate(string fn, string id, string code) { - var et = EntityHelper.EntityValue(Request.Form["type"].ToString()); + string typeParam = Request.Form["type"].ToString(); + string needParam = Request.Form["need"].ToString(); + var et = EntityHelper.EntityValue(typeParam); + _logger.LogDebug("HandleMfrUpdate type={Type} need={Need} user={User}", typeParam, needParam, UserAccountID); if (et != EntityTypes.none && string.IsNullOrEmpty(Request.Form["need"])) { + _logger.LogInformation("MfrUpdate entity={EntityType} need=Short user={User}", et, UserAccountID); using var mfrSingle = new fds.FdsMfrClient(); await mfrSingle.Update__entitytable(et, fds.FdsMfr.UpdateNeed.Short); + _logger.LogDebug("MfrUpdate Short completed for entity={EntityType}", et); return Ok(); } if (et != EntityTypes.none && !string.IsNullOrEmpty(Request.Form["need"])) { - var need = fds.FdsMfr.UpdateNeedValue(Request.Form["need"].ToString()); + var need = fds.FdsMfr.UpdateNeedValue(needParam); + _logger.LogInformation("MfrUpdate entity={EntityType} need={Need} user={User}", et, need, UserAccountID); using var mfr = new fds.FdsMfrClient(); await mfr.Update__entitytable(et, updateNeed: need, debugDetails: false); + _logger.LogDebug("MfrUpdate completed for entity={EntityType} need={Need}", et, need); return Ok(); } + _logger.LogWarning("HandleMfrUpdate bad request: unknown type={Type} user={User}", typeParam, UserAccountID); return BadRequest400(); } } diff --git a/Fuchs/js/intranet/oci_mainbase.js b/Fuchs/js/intranet/oci_mainbase.js index 167dfa3..e816289 100644 --- a/Fuchs/js/intranet/oci_mainbase.js +++ b/Fuchs/js/intranet/oci_mainbase.js @@ -224,7 +224,7 @@ function getMonday(d) { $.fn.rwText = function (text, addtitle, options) { var tgt = $(this).empty(); options = $.extend({ wrap: true }, options); - var sa = Array.isArray(text) === true ? text : (text || '').split('\n'); + var sa = Array.isArray(text) === true ? text : (text == null ? '' : String(text)).split('\n'); $.each(sa, function (ti, tx) { if ((tx || '') !== '') { if (ti > 0) { diff --git a/Fuchs/wwwroot/fts/glyphicons-halflings-regular.eot b/Fuchs/wwwroot/fts/glyphicons-halflings-regular.eot index b5aab37..b93a495 100644 Binary files a/Fuchs/wwwroot/fts/glyphicons-halflings-regular.eot and b/Fuchs/wwwroot/fts/glyphicons-halflings-regular.eot differ diff --git a/Fuchs/wwwroot/fts/glyphicons-halflings-regular.ttf b/Fuchs/wwwroot/fts/glyphicons-halflings-regular.ttf index 8dab117..1413fc6 100644 Binary files a/Fuchs/wwwroot/fts/glyphicons-halflings-regular.ttf and b/Fuchs/wwwroot/fts/glyphicons-halflings-regular.ttf differ diff --git a/Fuchs/wwwroot/fts/glyphicons-halflings-regular.woff b/Fuchs/wwwroot/fts/glyphicons-halflings-regular.woff index a078bce..9e61285 100644 Binary files a/Fuchs/wwwroot/fts/glyphicons-halflings-regular.woff and b/Fuchs/wwwroot/fts/glyphicons-halflings-regular.woff differ diff --git a/Fuchs/wwwroot/fts/glyphicons-halflings-regular.woff2 b/Fuchs/wwwroot/fts/glyphicons-halflings-regular.woff2 index a631cf8..64539b5 100644 Binary files a/Fuchs/wwwroot/fts/glyphicons-halflings-regular.woff2 and b/Fuchs/wwwroot/fts/glyphicons-halflings-regular.woff2 differ diff --git a/Fuchs/wwwroot/web/fis.js b/Fuchs/wwwroot/web/fis.js index 0c49e05..7fe410b 100644 --- a/Fuchs/wwwroot/web/fis.js +++ b/Fuchs/wwwroot/web/fis.js @@ -1317,7 +1317,7 @@ function getMonday(d) { $.fn.rwText = function (text, addtitle, options) { var tgt = $(this).empty(); options = $.extend({ wrap: true }, options); - var sa = Array.isArray(text) === true ? text : (text || '').split('\n'); + var sa = Array.isArray(text) === true ? text : (text == null ? '' : String(text)).split('\n'); $.each(sa, function (ti, tx) { if ((tx || '') !== '') { if (ti > 0) { diff --git a/Fuchs/wwwroot/web/fis.min.js b/Fuchs/wwwroot/web/fis.min.js index 35df193..3387aa7 100644 --- a/Fuchs/wwwroot/web/fis.min.js +++ b/Fuchs/wwwroot/web/fis.min.js @@ -1,4 +1,4 @@ var $t={lng:"de-DE",dn:["So","Mo","Di","Mi","Do","Fr","Sa"],mn:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],ma:["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],datepattern:"(0[1-9]|1[0-9]|2[0-9]|3[01]).(0[1-9]|1[012]).[0-9]{4}",datetimepattern:"(0[1-9]|1[0-9]|2[0-9]|3[01]).(0[1-9]|1[012]).[0-9]{4}\\s([0-5][0-9]):([0-5][0-9])",dateplaceholder:"dd.MM.yyyy",datetimeplaceholder:"dd.MM.yyyy HH:mm",dateformat:"dd.MM.yyyy",datetimeformat:"dd.MM.yyyy HH:mm",f1:"Der Server hat einen Fehler gemeldet: \n",f2:"Bitte versuchen Sie es erneut.",m0:"Diese Internet-Seite benötigt einen html5-kompatiblen Browser.",m0b:"Unterstützt werden bspw: Internet Explorer ab Version 10, Firefox ab Version 31, Chrome ab Version 31, Safari ab Version 7, Opera ab Version 27",m1:"Dieser Datensatz ist momentan von jemand anderem zur Bearbeitung gesperrt.",m2:"Diese Funktion ist zur Zeit nicht verfügbar",t1:"Eingabe erforderlich.",t2:"Eingabe ist nicht erforderlich.",true:"Ja",false:"Nein",alert:"Hinweis",confirm:"Bestätigen",open:"Öffnen","not implemented":"Diese Funktion in zur Zeit noch nicht verfügbar.",l0:"Anmeldung",l1:"Email / Anmeldename",l2:"Email-Adresse / Anmeldename",l3:"Passwort",l4:"Benutzer",l5:"Wird vom System ermittelt...",l6:"Anmelden",l7:"Passwort vergessen?",l7a:'Die "Passwort vergessen"-Funktion läuft in zwei Schritten ab:\n \nIm ersten Schritt wird eine SMS mit einem Code an die hinterlegte Mobilfunk-Nummer versandt.\nIm zweiten Schritt geben Sie bitte diesen Code in das Formular ein und übermitteln es erneut.\n \nIn beiden Schritten wird aus Sicherheitsgründen kein Fehler angezeigt und auch dann ein erfolgreicher Versand bestätigt, wenn die Kombination aus Email-Adresse und Nachname nicht gefunden wurde und/oder der code falsch ist.',l8:"Keinen Account?",l9:"Anmeldenamen der Email-Adresse wurde nicht erkannt.",l10:"Nachname",l11:"Email-Adresse",l12:"Passwort zusenden",l13:"Das Passwort wurde erfolgreich verschickt",l14:"Das Passwort konnte nicht verschickt werden",l15:"Sie sind nicht berechtigt, diese Funktion auszuführen.",l16:"Sie müssen zunächst einen Account angeben.",l17:"Die Kombination aus Anmeldenamen und Passwort konnte nicht bestätigt werden.",l18:"Es gibt ein Problem mit dem Formular.\nEs kann momentan nicht verarbeitet und versendet werden.",name:"Name",submit:"Senden",cancel:"Abbrechen",noop:"Diese Funktion is noch nicht verfügar."};$.extend($t,{t1:"Eingabe erforderlich",t2:"Bitte überprüfen Sie Ihre Eingaben im Formular.",b0:"Erstellt",b1:"Zuletzt geändert",b2:"von",t12:"Der Server hat einen Fehler zurückgegeben. Bitte versuchen Sie es erneut.",t17:"Eine Email mit einem Aktivierungs-Link wurde an deine Adresse versandt.",t18:"Ein Account mit deinem Namen existiert bereits. Dennoch erstellen?",t19:"Einträge sind entweder unngültig oder zu kurz.",t20:"Der Server hat einen Fehler gemeldet. Bitte versuch es erneut.",t21:"Der Zugang wurde nicht gefunden.",t30a:"Als erledigt markieren.",t30b:"Als unerledigt markieren.",t55:"Ein Email mit einem Aktivierungs-Link wurde an Ihre Adresse versandt.",t56:"Ein Zugang für diesen Namen besteht bereits. Trotzdem erstellen?",t57:"Ein bestehender Zugang wurde für diese Serie registriert.",t60:"Bitte geben Sie Email-Adresse an, die Sie hier hinterlegt haben.",t61:"Ihr Passwort wurde erfolgreich versandt.",t62:"Die angegebene Email-Adresse stimmt nicht mit der hier hinterlegten überein.",ov:"Persönliche Übersicht"});var $v={}; /*! loadCSS. [c]2020 Filament Group, Inc. MIT License */ /*! onloadCSS. (onload callback for loadCSS) [c]2017 Filament Group, Inc. MIT License */ -function onloadCSS(t,e){e=e||{};let n=function(e){return new Promise(((n,r)=>{t.addEventListener?e.addEventListener("load",newcb):t.attachEvent&&e.attachEvent("onload",newcb),"isApplicationInstalled"in navigator&&"onloadcssdefined"in t&&e.onloadcssdefined(newcb)}))};if(Array.isArray(t)){let r=t.length;Promise.all(t.map(n)).then((function(t){var n=t.reduce(((t,e)=>t+(!0===e?1:0)));!async function(t){!0===t&&"function"==typeof e.success?e.success():!0===t&&"object"==typeof e.success&&e.success instanceof Promise&&await e.success(),e.complete()}(r===n)}))}else n(t)}!function(t){"use strict";var e=function(e,n,r,i){var o,a=t.document,s=a.createElement("link");if(n)o=n;else{var l=(a.body||a.getElementsByTagName("head")[0]).childNodes;o=l[l.length-1]}var c=a.styleSheets;if(i)for(var d in i)i.hasOwnProperty(d)&&s.setAttribute(d,i[d]);s.rel="stylesheet",s.href=e,s.media="only x",function t(e){if(a.body)return e();setTimeout((function(){t(e)}))}((function(){o.parentNode.insertBefore(s,n?o:o.nextSibling)}));var u=function(t){for(var e=s.href,n=c.length;n--;)if(c[n].href===e)return t();setTimeout((function(){u(t)}))};function f(){s.addEventListener&&s.removeEventListener("load",f),s.media=r||"all"}return s.addEventListener&&s.addEventListener("load",f),s.onloadcssdefined=u,u(f),s};"undefined"!=typeof exports?exports.loadCSS=e:t.loadCSS=e}("undefined"!=typeof global?global:this);const isIE=/MSIE\/|Trident/gi.test(window.navigator.userAgent)||void 0!==window.document.documentMode,isfileapi=!!(window.File&&window.FileReader&&window.FileList&&window.Blob);var $ocms={auth:{},no:function(t){t.stopPropagation()},vmin:function(t){var e=$(window).width*(t||1),n=$(window).height*(t||1);return e($ocms.baseurl+"/"+(t||"")).replace(/\/\//,"/"),cexi:null};function deepCopy(t){var e,n,r;if("object"!=typeof t||null===t)return t;for(r in e=Array.isArray(t)?[]:{},t)n=t[r],e[r]=deepCopy(n);return e}function fields_definition(t,e,n){this.label_sng=!0===Array.isArray(t)?"":t||"",this.label_pl=!0===Array.isArray(t)?"":e||"",this.fields=!0===Array.isArray(t)?t:n||[],this.itm=function(t){for(var e=0;e0)for(var n=0;nt||"")).filter(((t,e)=>""!==t)).join(e)}function parseDt(t,e,n){t=(t||"").substr(0,e.length);var r=e,i=t.length>0&&e.split(";").some((function(e){for(var n,i=/[^yMdhms0-9]/gi,o=!0;null!==(n=i.exec(e));)o=o&&e.substr(n.index,1)===t.substr(n.index,1);var a=t.length===e.length&&o;return!0===a&&(r=e),a}));if(!0===i){for(var o,a=[0,0,0,0,0,0,0],s=/(mm{1,2}|dd{1,2}|MM{1,2}|(yy){2,4}|ss{1,2}|hh{1,2})(?!\w)/g;null!==(o=s.exec(r));)a["yMdhms".indexOf(o[0].substr(0,1))]=parseInt(("yy"===o[0]?"20":"")+t.substr(o.index,o[0].length))-("M"===o[0].substr(0,1)?1:0);var l=new(Function.prototype.bind.apply(Date,[null].concat(a)));return"string"==typeof n?fdt(l,n):l}return!1}function bool(t,e){return"boolean"==typeof t?t:"boolean"==typeof e&&e}function booln(t,e){return"boolean"==typeof t?t:"number"==typeof t?1===t:"boolean"==typeof e&&e}Date.prototype.isValid=function(){return!isNaN(this)},Date.prototype.format=function(t){return fdt(this,t)},Date.prototype.addDays=function(t){return this.setDate(this.getDate()+t),this},Date.prototype.isBetween=function(t,e){return this>t&&this section");$(window).scroll((function(e){let n=$(window).scrollTop(),r=$("body");r.toggleClass("unfocus",n>vh()-1.2*t),r.toggleClass("btb",n>.5*vh()-t)}))},$ocms.cf_reset=function(){return $("#contentframe").empty()},function(t){t.fn.scrollTo=function(e){if(t(this).length>0){var n=t(this).offset().top||0;n>0&&t("html, body").animate({scrollTop:n-hh()},2e3)}},t.fn.ldng=function(e){var n=!0;return"boolean"==typeof e?n=e:"number"==typeof e&&(n=e>0),t(this).toggleClass("loading",n)},"function"!=typeof t.noop&&(t.noop=function(){}),t.fn.hasAttr=function(e){var n=t(this).attr(e);return void 0!==n&&!1!==n},t.fn.parseCssPx=function(e){try{return parseFloat(t(this).css(e).replace("px","")||0)}catch(t){return 0}},t.max=function(t,e){return isNaN(t)&&isNaN(e)?null:isNaN(t)&&!isNaN(e)?e:!isNaN(e)&&isNaN(e)||t>=e?t:e},t.min=function(t,e){return isNaN(t)&&isNaN(e)?null:isNaN(t)&&!isNaN(e)?e:!isNaN(e)&&isNaN(e)||t<=e?t:e},t.lim=function(t,e){return isNaN(t)?null:isNaN(e)?t:e<=t?e:t},t.fn.enterKey=function(e){return this.each((function(){t(this).keypress((function(t){"13"===(t.keyCode?t.keyCode:t.which).toString()&&e.call(this,t)}))}))}}(jQuery),$ocms.defaultTimeout=3e4,$ocms.AjaxEX=function(t){var e=this;e.responseText=e.responseText||"";var n=e.getResponseHeader("x-ocms-code")||"";e.internalCode=""!==n&&!1===isNaN(n)?parseInt(n):-1,e.isInternal=e.internalCode>-1,e.internalText=decodeURIComponent((e.getResponseHeader("x-ocms-desc")||"").replace(/\+/g,"%20")||"");var r=e.internalText||t,i=e.internalCode||e.status;e.logtext=r+" ("+i+")"},$ocms.postXTS=function(t){$ocms.postXT.call(this,$.extend(t,{sync:!0}))},$ocms.postXT=function(t){if((t=t||{}).trycount=t.trycount||0,""!==(t.url||"")){t.url=-1!==t.url.indexOf("&yy=")?t.url:t.url.indexOf("?")>-1?t.url+"&yy="+(new Date).getTime():t.url+"?yy="+(new Date).getTime();var e=t.context||this;switch(t.context=e,t.retryLimit=t.retryLimit||0,t.timeout=t.timeout||$ocms.defaultTimeout,t.timeout<100&&(t.timeout=1e3*t.timeout),t.data=t.data||{},t.contentType=t.contentType||"multipart/form-data; charset=UTF-8",t.islogin="boolean"==typeof t.islogin&&t.islogin,t.contentType){case"":case"json":t.contentType="application/json; charset=utf-8";break;case"form":t.contentType="application/x-www-form-urlencoded; charset=UTF-8";break;case"multi":t.contentType="multipart/form-data";break;case"text":t.contentType="text/plain; charset=UTF-8"}if(t.form instanceof jQuery?(t.data=t.form.serializeObject(),t.contentType="form-data"):t.lzw instanceof jQuery&&(t.data.lzw=$.ccLZW(t.lzw.serializeAnything(!0)).join(",")),"multipart/form-data"!==t.contentType.substr(0,19)&&"form-data"!==t.contentType.substr(0,9)||t.data instanceof FormData!=!1)t.data instanceof FormData&&(t.contentType=!1,t.processData=!1);else{t.contentType=!1;var n=new FormData;$.each(t.files||[],(function(t,e){n.append("upload_file",e)})),$.each(t.data||{},(function(t,e){n.append(t,e)})),t.data=n,t.processData=!1}var r={type:t.method||"post",url:t.url,data:t.data,processData:"boolean"!=typeof t.processData||t.processData,contentType:t.contentType,cache:t.cache||!1,timeout:t.timeout,beforeSend:function(n){$(t.loading).ldng(),$("body").addClass("ldng"),"function"==typeof t.beforesend&&t.beforesend.apply(e,[n])},success:function(n,r,i){"false"===n||"not authorized"===n?("function"==typeof t.error&&t.error.apply(e,[i,r,n]),"function"==typeof $.status&&$.status(r+" - "+n)):"function"==typeof t.success&&t.success.apply(e,[n,r,i])},error:function(n,r,i){if($ocms.AjaxEX.call(n,r),-1===t.url.indexOf("doc.ashx")||-1!==t.url.indexOf("ftest")){if(401===n.status&&111===n.internalCode&&!1===t.islogin&&"function"==typeof $ocms.login.dlg)$ocms.login.dlg({ajo:t});else if("timeout"===r||302===n.status)return t.tryCount++,t.tryCount<=t.retryLimit?void $ocms.postXT(t):void 0;"function"==typeof t.error?t.error.apply(e,[n,r,i]):"function"==typeof $ocms.failure?$ocms.failure.apply(e,[n]):"function"==typeof $.status&&$.status("Server error: "+r+" - "+i)}},dataType:t.datatype||"json",complete:function(n,r){"function"==typeof t.complete&&t.complete.apply(e,[n,r]),$(t.loading).ldng(0),$("body").removeClass("ldng");let i=$("body > .timer");if(i.length>0){let t=new Date(n.getResponseHeader("ocms_cec")||""),e=new Date(n.getResponseHeader("ocms_cex")||"");if(t.isValid()&&e.isValid()){let n=new Date,r=Math.abs(e-t);n.setMilliseconds(n.getMilliseconds()+r),i.data({cex:n,ctt:r}),$ocms.cex_timer()}}},context:e,async:!0};"boolean"==typeof t.sync&&(r.async=!1===t.sync),!0==("boolean"==typeof t.contentType&&!1===t.contentType)&&(r.contentType=!1),$.ajax(r)}},$ocms.cex_timer=function(){$ocms.cexi||($ocms.cexi=setInterval($ocms.cex_timer,15e3));let t=$("body > .timer"),e=t.data("cex"),n=t.data("ctt"),r=new Date;if(e instanceof Date&&e.isValid()&&"number"==typeof n&&n>0&&e>r){let i=Math.abs(r-e)/n*100;t.css("width",i.toString()+"%"),i<98&&(!$ocms.cex_lp||Math.abs(r-$ocms.cex_lp)>6e5)&&$ocms.postXT({url:$ocms.url("ping"),success:()=>{$ocms.cex_lp=r},timeout:5e3,error:()=>{}})}},$ocms.vbl_send=function(t){var e=t.data||{};if(""!==(e.url||"")){var n=$("#contentframe form:first"),r={url:e.url,data:new FormData,success:function(t){"function"==typeof e.success?e.success(t):"string"==typeof e.success&&alert(e.success)},error:function(t,n,r){"function"==typeof e.error?e.error(r):"string"==typeof e.error&&alert(e.error)},complete:function(){n.ldng(0)}},i=!0;n.find("input").each((function(){var t=$(this),e=t.nza("name"),n=t.val(),o=$(this).prop("required")||!1;if(""!==e){var a=""!==n||!1===o;i=i&&a,!0===a?(r.data.append(e,n),t[0].setCustomValidity("")):""!==$(this).nza("ocms-nvnote")&&t[0].setCustomValidity($(this).nza("ocms-nvnote"))}})),!0===i&&(n.ldng(1),$ocms.postXT.call(this,r))}},function(t){t.fn.nza=function(e,n){var r=t(this).attr(e);return void 0!==r&&!1!==r?r:n||""},t.fn.serializeObject=function(e,n){var r=/\r?\n/g,i=/^(?:submit|button|image|reset|file)$/i,o=/^(?:input|select|textarea|keygen)/i,a=/^(?:checkbox|radio)$/i,s=bool((n=n||{}).typedvalues,!1),l={},c=t(this),d=c.find(':input:not([nosend],[type="file"])').addBack(":input"),u=!0;return t.each(d.not(".tinymce").get(),(function(n,c){var d=t(this),f=this,p=(this.type||"").toLowerCase(),m=d.prop("required")||!1;if(!0===(f.name&&!d.is(":disabled")&&o.test(f.nodeName)&&!i.test(p))){var h=d.val(),g=f.name,y=d.nza("data-format").split(":"),$=d.nza("pattern")||".*";if(!0===a.test(p)&&(h=f.checked?""!==h?h:"true":""),"date"===y[0].substr(0,4)&&y.length>1)"boolean"==typeof(h=parseDt(h,y.slice(1).join(":")))&&(h=null),null===h&&"date"===d.prop("type").substr(0,4)&&!1===isNaN(new Date(d.val()))&&(h=new Date(d.val())),h instanceof Date==!0&&"function"==typeof h.getMonth?!1===s&&(h=fdt(h,"date"===y[0]?"dts":"iso")):h=null;else if("number"===p&&!0===s){let t;t="integer"===y[0]?parseInt(h):parseFloat(h),h=isNaN(t)?h:t}if(!0!==m||""!==(h||"")&&null!==h.match($)?!0===bool(e,!1)&&f.setCustomValidity(""):(!0===bool(e,!1)&&f.setCustomValidity(d.nza("ocms-nvnote",$ocms.t.inv||"Invalid field")),h=null),null!=h&&"string"==typeof h){let t=l[g];null!=t?Array.isArray(t)?t.push(h.replace(r,"\r\n")):l[g]=[t,h.replace(r,"\r\n")]:l[g]=h.replace(r,"\r\n")}else if(null!=h){let t=l[g];null!=t?Array.isArray(t)?t.push(h):l[g]=[t,h]:l[g]=h}else u=!1}})),d.filter(".tinymce").each((function(e,n){var r=t(this),i=((this.type||"").toLowerCase(),r.prop("required")||!1);try{var o=tinymce.get(t(n).attr("id"));if(o){var a=t(n).attr("name"),s=o.getContent();!1===i||""!==(s||"")?l[a]=s:u=!1}}catch(e){t.noop()}})),c.toggleClass("invalid",!u),u?l:null},t.fn.sendForm=function(e,n,r){var i=t(this);r=r||{};var o={url:e,success:function(t){if(r.response=t,"function"==typeof n)n(t);i.closest("div.modal").remove()},error:function(t,e,n){"function"==typeof r.error?r.error.call(this,t):$ocms.failure.call(this,t)},complete:function(){i.ldng(0),"function"==typeof r.complete&&r.complete.call(this,jqXHR)}},a=i.find('input[type="file"]');o.data=new FormData,a.length>0&&t.each(a[0].files,(function(t,e){o.data.append(t,e),o.data.append("file_lastmodified",$ocms.isodt(e.lastModifiedDate))}));var s=i.serializeObject();t.each(s||{},(function(t,e){o.data.append(t,e)})),i.ldng(),$ocms.postXT.call(this,o)},t.fn.checkValidity=function(){var e=t(this),n=!0;return e.each((function(t,e){n=n&&e.checkValidity()})),n},t.fn.wrap=function(e,n){var r=t(this),i=$$.dc(e).attr(n||{}).insertAfter(r);return r.append(i),i}}(jQuery),$ocms.logout=function(){$ocms.postXT({url:$ocms.url("logout"),complete:function(){window.location.reload()}})},$ocms.login={send:function(t){t.preventDefault();var e=$(this);if(!0===e.find("#dbtn-confirm").hasClass("disabled"))return!1;var n=e.serializeObject();return n.loginaccount=ne(n.loginaccount,$ocms.auth.account||$ocms.auth.requestedaccount||""),n.loginaccount=ne(n.loginaccount,$ocms.auth.account||$ocms.auth.requestedaccount||""),""===ne(n.loginaccount)&&!0===bool($ocms.auth.accountrequired,!0)?(alert($t.l16),!1):($ocms.postXT({url:$ocms.url("login"),data:n,success:function(){window.location.reload()}}),!1)},uichange:function(){let t=$(this),e=t.closest("form"),n=bool($ocms.auth.accountrequired,!0),r=ne(e.find('[name="loginaccount"]').val(),$ocms.auth.account||$ocms.auth.requestedaccount||"");if(""!==r||!1===n){var i=e.find('[name="userlogin"]').empty().val(""),o=e.find('[name="username"]').empty().val(""),a=$("#dlg_userlogin_sel").empty().val(""),s=t.val()||"";if(!1===t.checkValidity()&&""===s)return;var l=t.closest("table").ldng();$ocms.postXT.call(this,{url:$ocms.url("auth"),data:{userinfo:s,account:r||""},success:function(t,e,n){if(1===t.length){var r=t[0];i.val(r.login).change().attr("required","").removeAttr("nosend"),o.val(r.name).change().attr("required","").show(),a.removeAttr("required").attr("nosend","").hide()}else t.length>0?(o.hide().removeAttr("required"),i.removeAttr("required").attr("nosend",""),0===a.length&&(a=$("").attr({name:"userlogin",size:t.length,id:"dlg_userlogin_sel",class:"form-control",required:""}).css({width:"100%","max-width":"100%",padding:"2px"}).insertAfter(o)),$.each(t,(function(t,e){var n=$("").attr({value:e.login,style:"padding-top: 2px; padding-bottom: 5px;","border-bottom":"1px solid #EEE;"}).text(e.name).appendTo(a);t%2==0&&n.css({"background-color":"#F9F9F9"})})),a.attr("required","").removeAttr("nosend")):(a.hide().attr("nosend",""),o.attr("required","").show(),i.attr("required","").removeAttr("nosend"),alert($t.l9))},error:function(t){$ocms.failure.call(this,t)},complete:function(){l.ldng(0)}})}else alert($t.l18)},sendpassword:function(t){var e=$(''),n=e.find(".form-body"),r=null;e.find("form").submit((function(t){t.preventDefault();var i=$(this).serializeObject(!0),o=null===r,a=o?"spwc":"spw";return $ocms.postXT.call(this,{url:$ocms.url(a),data:i,complete:function(){o?(n.append('
Ihnen wurde ein Code per SMS zugesandt.
Bitte tragen Sie den hier ein:
'),r=$('
').appendTo(n)):(alert($t.l13),e.remove())},error:()=>{}}),!1})),e.find(".modal-close").click((function(){e.remove()}));var i=[];$.each($t.l7a.split("\n"),((t,e)=>{Array.prototype.push.apply(i,[$("
"),$("").text(e)])})),e.find(".modal-note").append($('').text($t.alert)).append(i),e.appendTo("body"),setTimeout((function(){$(".modal").find('input[name="lastname"]').focus()}),600)}};var $$={s:function(t){return $("").text(t)},br:function(){return $("
")},sc:function(t,e){return $("").addClass(t).text(e)},td:function(t,e){var n=$("");return t instanceof jQuery==!0?n.appendTo(t):"object"==typeof t?n.attr(t):"string"==typeof t&&n.text(t),"object"==typeof e?n.attr(e):"string"==typeof e&&n.text(e),n},th:function(t,e){var n=$("");return t instanceof jQuery==!0?n.appendTo(t):"object"==typeof t?n.attr(t):"string"==typeof t&&n.text(t),"object"==typeof e?n.attr(e):"string"==typeof e&&n.text(e),n},tdc:function(t,e,n){return $$.td(e,n).addClass(t)},td2:function(t){var e=$('');return"string"===$.type(t)?e.text(t):t instanceof jQuery?e.append(t):"function"==typeof t?t.call(e):e.html(" "),e},td3:function(t){var e=$('');return"string"===$.type(t)?e.text(t):t instanceof jQuery?e.append(t):"function"==typeof t?t.call(e):e.html(" "),e},tdtr:function(t,e){var n=$$.tr().appendTo(e);return t instanceof jQuery==!0||"string"==typeof t?t.appendTo($$.td().appendTo(n)):!0===Array.isArray(t)&&$.each(t,(function(t,e){$(e).appendTo($$.td().appendTo(n))})),n},tr:function(t,e){var n=$("");return t instanceof jQuery==!0?n.appendTo(t):"object"==typeof t&&n.attr(t),"object"==typeof e&&n.attr(e),n},trc:function(t,e){var n=$("").addClass(t);return e instanceof jQuery==!0?n.appendTo(e):"object"==typeof e&&n.attr(e),n},d:function(t){return $("
").attr(t||{})},dc:function(t,e,n,r){var i=$("
").addClass(t);return e instanceof jQuery==!0?i.appendTo(e):"object"==typeof e?i.attr(e):"function"==typeof e?i.click(e):"string"==typeof e&&i.text(e),"string"==typeof n?i.text(n):"object"==typeof n?i.attr(n):"function"==typeof n&&i.click(n),"string"==typeof r?i.text(r):"object"==typeof r?i.attr(r):"function"==typeof r&&i.click(r),i},df:function(t){return $("
 
").attr(t||{})},opt:function(t,e,n){var r=$("");return"string"==typeof t?r.attr("value",t):"object"==typeof t&&r.attr(t),"string"==typeof e?r.text(e):"object"==typeof e&&r.attr(e),"object"==typeof n&&r.attr(n),r},eOpt:function(t){var e=$('');return t&&e.attr("selected","selected"),e},tbl:function(t){return $("
").attr(t||{})},tblc:function(t){return $("
").addClass(t)},thead:function(t){let e=$("");return t instanceof jQuery&&e.prependTo(t),e},tbody:function(t){let e=$("");return t instanceof jQuery&&e.appendTo(t),e},tblset:function(t,e){let n=$$.tbl(t||{});return e instanceof jQuery&&e.append(n),{tbl:n,hd:$$.thead().appendTo(n),bdy:$$.tbody().appendTo(n)}},i:function(t){return $("").attr(t||{})},img:function(t,e){return $("").attr("src",t).attr(e||{})},sel:function(t){return $("").attr(t||{})},btn:function(t){return $("").attr(t||{})},a:function(t){return $("").attr(t||{})},li:function(t){return $("
  • ").attr(t||{})},ul:function(t){return $("
      ").attr(t||{})},nav:function(t){return $("").attr(t||{})},lbl:function(t,e){var n=$("");return"string"==typeof t&&n.text(t),"object"==typeof t?n.attr(t):"object"==typeof e&&n.attr(e),n},txt:function(t){return $("").attr(t||{})},0:function(t,e){return $("<"+t+">").attr(e||{})},bbtn:function(t,e){return $$.btn({type:"button",class:"btn"}).addClass(e).text(t)},svg:t=>$(document.createElementNS("http://www.w3.org/2000/svg",t))};function getMonday(t){var e=(t=new Date(t)).getDay(),n=t.getDate()-e+(0==e?-6:1);return new Date(t.setDate(n))}function $lf(t){var e=void 0===t?null:"number"==typeof t&&1!==t||"boolean"==typeof cl&&!1===t;return $("#listframe").tC("hd",e).is(".hd")}function $nuf(t){if(t&&t.stopPropagation(),!$(this).is(".disabled")){var e=function(t){t.removeClass("vis").find("li.dropdown").removeClass("open").removeClass("vis").attr("aria-expanded","false")},n=$(this).parent("li.dropdown");if(n.length>0){n.tC("open"),navs=!0===n.is(".open")?"true":"false",n.attr("aria-expanded",navs);var r=n.closest("nav");r.find("li.dropdown").not(n.parentsUntil("nav")).not(n).removeClass("open").attr("aria-expanded","false"),!1===n.is(".open")&&n.find("li.dropdown").removeClass("open").attr("aria-expanded","false"),e($("nav").not(r))}else e($("nav"))}}function $tbr(){return $lf(0),$("#topbar").ocmsmenu([])}function $lfr(){return $("#sidebar").empty(),$("#listframe").removeClass("fix").addClass("hd").empty()}function $cfr(){return $tbr(),$("#contentframe").empty()}function jObj(t,e){let n={};if("{"===(t||"").substr(0,1))try{n=JSON.parse(t)}catch(t){n={}}return n[e]||""}function string(t,e){var n,r=t||"";return $.each(e||[],(function(t,e){n=new RegExp("\\{"+t.toString()+"\\}","ig"),r=r.replace(n,e)})),r}function init_tooltip(t){var e=!0===("boolean"==typeof t&&t)&&"mouse";$("[title]").qtip({position:{target:e,adjust:{x:2,y:2},viewport:!0},events:{hidden:$ocms.tooltip_hidden},effect:!1}),$("div.tooltiptext").each((function(){$(this).filter(":not(:empty)").parent().qtip({suppress:!1,content:{text:$(this).clone()},position:{target:e,adjust:{x:2,y:2},viewport:!0},events:{hidden:$ocms.tooltip_hidden}})}))}String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")},String.prototype.left=function(t){if("string"===$.type(t)){var e=this.indexOf(t);return e>0?this.slice(0,e):""}return this.substring(0,t)},String.prototype.right=function(t){if("string"===$.type(t)){var e=this.indexOf(t);return e>0?this.substring(this.length-e):""}return this.substring(this.length-t)},Array.prototype.move=function(t,e){if(e>=this.length)for(var n=e-this.length;1+n--;)this.push(void 0);return this.splice(e,0,this.splice(t,1)[0]),this},function(t){t.fn.appendToIf=function(e,n){var r=t(this),i="function"==typeof n?n(r):n;return!0===("boolean"!=typeof i||i)&&r.appendTo(e),r},t.fn.appendIf=function(e,n){var r=t(this),i="function"==typeof n?n(r):n;return!0===("boolean"!=typeof i||i)&&r.append(e),r},t.fn.rwText=function(e,n,r){var i=t(this).empty();r=t.extend({wrap:!0},r);var o=!0===Array.isArray(e)?e:(e||"").split("\n");return t.each(o,(function(t,e){""!==(e||"")&&(t>0&&i.append($$.br()),i.append(!0===r.wrap?$$.s(e):e))})),n&&i.attr("title",n),i},t.fn.loadSel=function(e,n,r){if("SELECT"===t(this).prop("tagName").toUpperCase()){var i=t(this);$ocms.postXT.call(this,{url:e,data:n||{},success:function(e){t.each(e,(function(){i.append($$.opt(e.value,e.text))}))},complete:function(){i.ldng(0),"function"==typeof r&&r.call(i)}})}},t.fn.emptyWithEditors=function(e){var n=t(this);return n.find(":input.tinymce").each((function(e,n){try{var r=tinymce.get(t(n).attr("id"));r&&r.remove()}catch(e){t.noop()}})),n.empty()},t.fn.cssValue=function(t){if(this.length>0){var e=this.css(t)||"";if(""===e)return 0;var n=/(^[\d\.]*)(\D{1,3}$)/gi.exec(e);return null!==n?"rem"===n[2]?$ocms.rpx(parseFloat(n[1])):parseFloat(n[1]):!1===isNaN(e)?parseFloat(e):0}return 0},t.fn.veryInnerHeight=function(){let e=e=>t(this).cssValue(e);return t(this).innerHeight()-e("padding-top")-e("padding-bottom")},t.fn.veryInnerWidth=function(){let e=e=>t(this).cssValue(e);return t(this).innerWidth()-e("padding-left")-e("padding-right")},t.fn.marginWidth=function(){let e=e=>t(this).cssValue(e);return e("margin-left")+e("margin-right")},t.fn.marginHeight=function(){let e=e=>t(this).cssValue(e);return e("margin-top")+e("margin-bottom")},t.inArrayRegEx=function(e,n,r){var i="regexp"===t.type(e)?e:new RegExp(e);if(!n)return-1;for(var o=r=r||0;o7){r=e.split(","),i=(n||(t<0?"rgb(0,0,0)":"rgb(255,255,255)")).split(",");var l=s(r[0].slice(4)),c=s(r[1]),d=s(r[2]);return"rgb("+(a((s(i[0].slice(4))-l)*o)+l)+","+(a((s(i[1])-c)*o)+c)+","+(a((s(i[2])-d)*o)+d)+")"}var u=(r=s(e.slice(1),16))>>16,f=r>>8&255,p=255&r;return"#"+(16777216+65536*(a((((i=s((n||(t<0?"#000000":"#FFFFFF")).slice(1),16))>>16)-u)*o)+u)+256*(a(((i>>8&255)-f)*o)+f)+(a(((255&i)-p)*o)+p)).toString(16).slice(1)},t.fn.IN=function(e){return t(this).fadeIn(400,e),t(this)},t.fn.OUT=function(e){return t(this).fadeOut(400,e),t(this)},t.fn.tooltip=function(e,n){var r=!0===("boolean"==typeof e&&e)&&"mouse",i="boolean"==typeof n&&n,o=t(this);return o.each((function(){var e=i?t(this).find(".tooltiptext"):t(this).children(".tooltiptext");t(e).length>0?e.each((function(){var e=t(this);t(this).filter(":not(:empty)").parent().qtip({suppress:!1,content:{text:e.clone()},position:{target:r,adjust:{x:2,y:2},viewport:!0},events:{hidden:$ocms.tooltip_hidden},show:{effect:!1},hide:{effect:!1}}),e.remove()})):t(this).qtip({position:{target:r,adjust:{x:2,y:2},viewport:!0},events:{hidden:$ocms.tooltip_hidden},effect:!1})})),o},t.fn.rC=function(e){return t(this).removeClass(e)},t.fn.aC=function(e){return t(this).addClass(e)},t.fn.tC=function(e,n){return t(this).toggleClass(e,n)}}(jQuery),function(t){t.fn.ocmsmenu=function(e,n){var r=t(this);return $ocms.menu.call(r,e,n),r},t.fn.activatemenu=function(){var e=t(this).filter("nav");return e.find("a").not(".on").addClass("on").click($nuf),e.find(".nav-btn").not(".on").addClass("on").click((function(e){e.stopPropagation();var n=t(this);t(n.attr("data-target")).tC(n.attr("data-toggle"))})),e}}(jQuery);class ObjectArray extends Array{isEmpty(){return 0===this[0].length}static get[Symbol.species](){return Array}filter(t){return"function"==typeof t?new ObjectArray(this[0].filter(t)):this}remove(t){if("function"!=typeof t)return this;{let e=this[0].findIndex(t);for(;e>-1;)this[0].splice(e),e=this[0].findIndex(t)}}sortBy(t){return"function"==typeof t&&this[0].sort(t),this}sortString(t){return this[0].sort(((e,n)=>{let r=(e[t]||"").toString().toUpperCase(),i=(n[t]||"").toString().toUpperCase();return console.debug(r.localeCompare(i)),r.localeCompare(i)})),this}sortNum(t){return this[0].sort(((e,n)=>{let r=e[t],i=n[t];return!0===isNaN(i)&&!1===isNaN(r)||ri?1:0})),this}sum(t){return this[0].reduce(((e,n)=>e+(!0===isNaN(n[t])?0:n[t])),0)}groupBy(t){return this[0].reduce((function(e,n){let r=n[t];return e[r]||(e[r]=[]),e[r].push(n),e}),{})}each(t){if("function"==typeof t){let e=!1;this[0].forEach(((n,r,i)=>{if(!1===e){let o=t(n,r,i);"boolean"==typeof o&&!1===o&&(e=!0)}}))}}get toArray(){return this[0]}}class NumArray extends Array{sum(){return this.reduce(((t,e)=>t+e))}first(){return this[0]}last(){return this[this.length-1]}average(){return this.sum()/this.length}range(){let t=this.map((t=>t)).sort();return{min:t[0],max:t[this.length-1]}}static get[Symbol.species](){return Array}}$ocms.ocmsmenu=[{lbl:"",id:"m_home",ico:"glyphicon glyphicon-home",fnc:"init:home"},{fnc:"separator"}],function(t){t.multline=function(t){let e=t.split("\n"),n=$$.d();return $.each(e,((t,e)=>{n.append($$.s(e))})),n.html()},t.tooltip_hidden=function(t,e){$(this).remove(),e.rendered=!1},t.isDateString=function(t){return"string"==typeof t&&!1===isNaN(new Date(t))},t.failure=function(e){11110===(e.internalCode||-1)?t.login.dlg():alert($t.f1+"\n"+(e.internalText||""))},t.getScript=function(e,n){var r=[],i=[],o=function(t){return"string"==typeof t&&""!==(t||"")},a=function(t,e){!0===bool(e.condition,!0)&&(""!==(e.script||"")&&i.push({url:e.script,module:e.module||""}),!0===o(e.css||"")?r.push(e.css):!0===Array.isArray(e.css)&&Array.prototype.push.apply(r,e.css.filter(o)))};!0===o(e||"")?i.push(e):!0===Array.isArray(e)?$.each(e,a):"object"==typeof e&&""!==(e.script||"")&&a(0,e);let s=[];$.each(r,(function(t,e){""!==(e||"")&&s.push(loadCSS(e))}));let l=i.map((function(e,n){let r=e.url,o=e.module||"";if(""===o){return new Promise((function(t,e){try{!async function(){$.ajax({url:r,dataType:"script",success:function(){t(i)},error:function(){e(i)},timeout:3e4})}()}catch(t){console.debug(t.message+"%o",t)}}))}return t.loadmodule(o,r,e.alias)}));Promise.all(l).then(n)},t.loadmodule=function(e,n,r){return new Promise((function(i,o){!async function(){try{let a=(n.startsWith("/")||n.startsWith(".")?"":"/")+n;import(a).then((n=>{t[e]=n[r||"default"],i(e)})).catch((t=>{console.debug(t.message+"%o",t),o(e)}))}catch(t){console.debug(t.message+"%o",t)}}()}))},t.ocms_auth=function(e,n,r,i){!1===$.isPlainObject(t.auth.modules)&&(t.auth.modules={});var o=0;t.auth.modules[e+(r||"")]?((o=t.auth.modules[e+(r||"")])<2&&(r||"")===auth.guid&&(o=2),o>=(n||0)&&i(false)):t.postXT({url:t.url("auth"),data:{module:e,person_guid:r||""},success:function(a){o=a[e],t.auth.modules[e+(r||"")]=o,o<2&&(r||"")===t.auth.person_guid&&(o=2),o>=(n||0)&&i(false)},error:function(e){t.failure.call(this,e)}})},t.auth.locale="de",t.ocms_prepauth=function(e,n,r){t.postXT({url:t.url("auth"),data:{fn:"csv",modules:e,person_guid:n||""},success:function(e){t.ocms_regauth(e)},error:function(e){t.failure.call(this,e)},complete:function(){r()}})},t.ocms_regauth=function(t){$.each(t||{},(function(t,e){auth.modules[t]=parseInt(e)}))},t.init=function(e){var n="string"==typeof e?e:(e.data||{}).fn||"";""!==n&&("home"===n?($cfr(),$lfr(),$("#topbar").ocmsmenu([],!0),$("#activemodule").text($t.ov),t.ov.call($("#contentframe"))):($cfr(),$lfr(),$("#topbar").ocmsmenu([]),t.postXT({url:t.url(n+"/auth"),success:function(e){void 0===t[n]&&(t[n]={}),t[n].auth=e,e.manage>0&&t.getScript({module:n,script:["web/imdl",n,t.auth.locale||"de","js"].join("."),css:["web/imdl",n,"css"].join("."),condition:"function"!=typeof t[n].init2},(function(){t[n].init2()}))},error:function(){$("#contentframe").empty()}})))},t.menuarray=function(t){this.array=[],this.sep=function(){this.length>0&&"separator"!==this.array[array.length-1].fnc&&this.push({fnc:"separator"})},this.push=function(t){return void 0===t?null:(!0===Array.isArray(t)?Array.prototype.push.apply(this.array,t):"object"==typeof t&&this.array.push(t),t)},this.unshift=function(t){return void 0===t?null:(!0===Array.isArray(t)?Array.prototype.unshift.apply(this.array,t):"object"==typeof t&&this.array.unshift(t),t)},this.push(t)},t.menu=function(e,n){e=e||[];var r=$(this).removeClass("vis");if(!0===bool(n,!0)&&!1===r.is("#mainmenu")&&r.empty(),!1===bool(n,!1)&&r.is("#sidebar,#topbar")&&(e.unshift({id:"sbctrl",glyph:"glyphicon-th-list",aclass:"fbtn",fnc:function(){$lf()}}),$lf(0)),0===(e||[]).length)r.empty().addClass("hd");else{r.removeClass("hd");var i=!0===r.is("nav")?r:r.children("nav");1!==i.length&&(i=$("").tC("nv",r.is("#sidebar")).tC("ctxt",r.is("#topbar")).appendTo(r));var o,a=$$.ul().appendTo(i),s=function(t,e){var n=$(this).addClass("dropdown submenu");t.append($$.sc("caret dd")).addClass("dds dropdown-toggle").attr({"aria-expanded":"false"}),""!==(e.ico||"")&&t.prepend($$.sc("ico "+e.ico));var r=$$.ul({class:"dropdown-menu",role:"menu"}).appendTo(n);$.each(e.itm||[],(function(t,e){o.call(r,e)}))},l=function(t){$(this).tC("disabled","boolean"==typeof t.disabled?t.disabled:"string"==typeof t.disabled&&"subs"===t.disabled&&0===(t.itm||[]).length)};o=function(e){var n,r=$$.li({id:e.id}).attr(e.attr||{}).addClass(e.lclass).appendTo($(this)),i="string"==typeof e.fnc&&""!==e.fnc?e.fnc.split(":")[0]:"";""!==i&&"init"!==i?r.attr("role",i).appendIf($$.s(e.lbl),""!==ne(e.lbl)):(n=$$.a({class:"on",role:"button"}).addClass(e.aclass).appendTo(r).append($$.s(e.lbl)),l.call(n,e),(e.itm||[]).length>0&&s.call(r,n,e),n.click($nuf),"function"==typeof e.fnc?n.click(e.data||{},e.fnc):"init"===i&&n.click($.extend({},e.data||{},{fn:e.fnc.split(":")[1]}),t.init))},$.each(e,(function(e,n){var r,i=$$.li({id:n.id}).attr(n.attr||{}).addClass(n.lclass),s="string"==typeof n.fnc&&""!==n.fnc?n.fnc.split(":")[0]:"";if(""!==s&&"init"!==s)i.attr("role",s).appendIf($$.s(n.lbl),""!==ne(n.lbl));else{if(r=$$.a({class:"on",role:"button"}).addClass(n.aclass).appendTo(i),l.call(r,n),""!==(n.lbl||"")&&r.append($$.s(n.lbl)),""!==(n.ico||"")&&r.prepend($$.sc("ico "+n.ico)),""!==(n.glyph||"")&&r.prepend($$.sc("glyphicon "+n.glyph)),(n.itm||[]).length>0){i.addClass("dropdown"),r.append($$.sc("caret dd")).addClass("dds dropdown-toggle").attr({"aria-expanded":"false"});var c=$$.ul({class:"dropdown-menu",role:"menu"}).appendTo(i);$.each(n.itm||[],(function(t,e){o.call(c,e)}))}(n.sel||[]).length>0||(r.click($nuf),"function"==typeof n.fnc?r.click(n.data||{},n.fnc):"init"===s&&r.click($.extend({},n.data||{},{fn:n.fnc.split(":")[1]}),t.init))}i.appendTo(a)})),i.activatemenu()}},t.easytbl=(t,e)=>{e=e||{};let n=$$.tbl().addClass(e.class).css("border-collapse","collapse"),r=($$.tbody(n),!0===bool(e.frame,!1)?{padding:"5px",border:"1px solid #727272"}:{});if(!0===Array.isArray(e.header)){let t=$$.thead(n);$.each(e.header,((n,i)=>$$.th(t).css(e.cellcss||r).rwText(i)))}else if(!0===bool(e.header,!1)&&(t||[]).length>0){let i=$$.thead(n);$.each(Object.keys(t[0]),((t,n)=>$$.th(i).css(e.cellcss||r).rwText(n)))}return $.each(t||[],((t,i)=>{let o=$$.tr();$.each(i,((t,n)=>{n=n||"";let i=$$.td(o).css(e.cellcss||r);n instanceof jQuery?i.append(n):"string"==typeof n&&("<"===n.substring(0,1)?i.append(n):i.text(n))})),n.append(o)})),n},t.dlgtbl=(e,n,r)=>{r=r||{};let i=t.easytbl(e,r);t.dlg(i,$.extend({title:n},r))},t.dlg=function(t,n){n=n||{};let r=$("body > .modal").length>0,i=t=>typeof n[t],o=t=>"function"===i(t);if(!0===bool(n.exclusive,!0)&&!0===r)return void alert($t.dbldlg||"Es ist bereits ein Dialog geöffnet");let a=$$.dc("modal",$("body")),s=$$.dc("modal-dialog",a);!1===isNaN(n.zindex)?a.css("zIndex",n.zindex):!0===r&&a.css("zIndex",parseInt($("body > .modal:last").cssValue("zIndex"))+200),!1===isNaN(n.zindex_min)&&a.cssValue("zIndex")').appendTo(u)),""!==ne(n.title)&&(l=$$.dc("modal-header",u),$("

      ").text(n.title).appendTo(l));let p=$$.dc("modal-body",u),m=$$.dc("modal-footer",u);t instanceof jQuery==!0&&p.append(t);let h=function(t){t&&"function"==typeof t.stopPropagation&&t.stopPropagation(),s.removeClass("in"),!0===o("closing")&&n.closing.call(u),p.hide().emptyWithEditors(),a.remove(),!0===o("close")&&n.close.call(u)};if(u.find(":input[required]").length>0&&($$.dc("note_required",m).append($$.sc("ind_required","*")).append($$.s($t.t1||"Eingabe erforderlich")),$$.dc("note_invalid",m).append($$.s($t.t2||"Bitte überprüfen Sie Ihre Eingaben im Formular."))),!0===o("cancel")){$$.bbtn(n.cancelbutton||"Abbrechen","cancel").attr({type:"button",role:"cancel"}).appendTo(m).click((function(t){n.cancel.call(u,t);t.stopPropagation(),h()}))}if(!0===o("confirm")){let t=$$.bbtn(n.button||"OK","confirm").attr({type:!0===bool(n.form,!1)?"submit":"button",role:"confirm"}).appendTo(m);!0===f?(u.submit((function(t){try{n.confirm.call(u,t)}finally{t.preventDefault()}return!1})),u.on("modal_submit",(function(){n.confirm.call(u,e)}))):(t.click((function(t){n.confirm.call(u,t);t.stopPropagation()})),u.on("modal_submit",(function(){t.click()})))}else!0===f&&u.submit((function(t){return t.preventDefault(),!1}));return u.on("modal_close",(function(){h()})),c.click(h),!0===o("opening")&&n.opening.call(u),s.addClass("in"),ne(n.mode).indexOf("maxbody")>-1&&p.css("min-height",(d.height()-l.outerHeight()-m.outerHeight()).toString()+"px"),!0===o("open")&&n.open.call(u),{hd:l,bdy:p,ft:m,ct:d,dlg:s,c:u}},t.mform=function(e){let n=$$.dc("form-body"),r=Array.isArray(e)?e:e instanceof fields_definition?e.fields:[];return $.each(r||[],(function(e,r){let i=r.type||"";if("ignore"===i)return!0;let o=$$.dc("form-group",n),a=r.id||"dlg_"+(r.name||"")+("html"===r.type?"_"+(65536*(1+Math.random())||0).toString(16).substr(9):""),s=$$.lbl(r.label||r.name,{for:a}).appendTo($$.dc("form-itm",o)),l=$$.dc("form-itm",o),c=$$.i({id:a,name:r.name,placeholder:r.placeholder,type:r.type});switch(i){case"email":r.pattern=ne(r.pattern,"[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,}$");break;case"url":r.pattern=ne(r.pattern,"https?://.+");break;case"number":r.pattern=ne(r.pattern,"[-+]?[0-9]*[.,]?[0-9]*"),c.attr("step",r.precision||"any"),c.attr("data-format","float");break;case"integer":case"int":r.pattern=ne(r.pattern,"[-+]?[0-9]*"),c.attr("type","number"),c.attr("data-format","integer");break;case"date":if(""!==ne(r.pattern,$t.datepattern)&&(r.pattern=ne(r.pattern,"("+$t.datepattern+")|([0-9]{4}.(0[1-9]|1[012]).(0[1-9]|1[0-9]|2[0-9]|3[01]))")),""!==ne(r.placeholder,$t.dateplaceholder)&&c.attr("placeholder",ne(r.placeholder,$t.dateplaceholder)),"string"==typeof r.value){var d=r.value.substr(0,10);r.value="date"!==c.prop("type")?fdt(d+"T00:00:00",ne(r.dateformat,$t.dateformat)):d}c.attr("data-format","date:"+ne(r.dateformat,$t.dateformat)+";yyyy-MM-dd");break;case"datetime":c.attr("type","datetime-local"),""!==ne(r.pattern,$t.datetimepattern)&&(r.pattern=ne(r.pattern,"("+$t.datetimepattern+")|([0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])\\s([0-5][0-9]):([0-5][0-9]))")),""!==ne(r.placeholder,$t.datetimeplaceholder)&&c.attr("placeholder",ne(r.placeholder,$t.datetimeplaceholder)),"string"==typeof r.value&&"T"===r.value.substr(10,1)&&(r.value="datetime"!==c.prop("type").substr(0,8)?fdt(r.value,ne(r.datetimeformat,$t.datetimeformat)):r.value),c.attr("data-format","datetime:"+ne(r.datetimeformat,$t.datetimeformat)+";yyyy-MM-dd HH:mm:ss");break;case"hidden":o.addClass("hd");break;case"html":case"text":c=$$.txt({id:a,name:r.name,placeholder:r.placeholder,type:r.type}),c.tC("tinymce","html"===r.type);break;case"bool":case"boolean":r.url=[{value:"true",label:($t||{}).true||"Yes"},{value:"false",label:($t||{}).false||"No"}],"boolean"==typeof r.value&&(r.value=r.value?"true":"false");case"select":c=$$.sel({id:a,name:r.name,type:r.type}),!1===bool(r.required,!1)&&$$.eOpt().appendTo(c);try{var u=function(t){!0===Array.isArray(t)&&$.each(t,(function(t,e){"string"==typeof e?$$.opt(e,e).appendTo(c):!0===Array.isArray(e)?$$.opt(e[0],e[1]).appendTo(c):"object"==typeof e&&$$.opt(e.value,e.label||e.text).appendTo(c)}))};!0===Array.isArray(r.url)?u(r.url):"function"==typeof r.url?r.url.call(c):"string"==typeof r.url&&t.postXT({url:r.url,success:u})}catch(t){$.noop()}break;default:""!==ne(r["max-length"])&&c.attr("max-length",r["max-length"])}""!==ne(r.pattern)&&c.attr("pattern",r.pattern),c.val(r.value).change(),c.change((function(){$(this)[0].setCustomValidity("")})),c.addClass("form-control").prop("required",bool(r.required,!1)).prop("readonly",bool(r.readonly,!1)).appendTo(l),!0===bool(r.required,!1)&&s.append($$.sc("ind_required","*")),"object"==typeof r.attr&&c.attr(r.attr),"object"==typeof r.prop&&c.prop(r.prop),"string"==typeof r.class&&c.addClass(r.class),"function"==typeof r.change&&(c.change(r.change),!0===bool(r.applychange,!1)&&void 0!==r.value&&c.change()),""!==(r.note||"")&&$$.dc("form-note",l).rwText(r.note),"function"==typeof r.complete&&r.complete.call(c)})),n},t.initMCE=function(t,e){t=$(t),e=e||{};try{let n={target:t[0],inline:!1,width:e.width||"100%",statusbar:!1,document_base_url:window.location.origin+"/",content_style:"ph:before {content: '«'; color: #BBB; font-style:italic; } ph:after {content: '»'; color: #BBB; font-style:italic; } ph { color: #AAA; font-style:italic; }",relative_urls:!1,remove_script_host:!1};!0===bool(e.hidemenu,!1)&&(n.menubar=!1,n.menu={}),!0===bool(e.hidetoolbar,!1)&&(n.toolbar=!1),$.extend(n,e||{}),tinymce.init(n)}catch(t){alert(t.message)}},t.dlgform=function(e,n){n=n||{};let r,i=$$.dc("frm").append(t.mform(e||[]).addClass("stacked"));n.addcontent instanceof jQuery&&i.append(n.addcontent),"function"==typeof n.submit?r=n.submit:"function"==typeof n.success&&(r=function(e){var r=$(this).ldng(1),i=$.extend({loginaccount:t.auth.account||""},r.serializeObject(bool(n.checkvalidity,!0),{typedvalues:bool(n.typedvalues,!1)}));""!==(n.url||"")?t.postXT({url:n.url,data:i,success:function(t){n.success.call(this,t),r.trigger("modal_close")},error:function(){alert($t.l17)},complete:function(){r.ldng(0)},timeout:6e4}):(n.success.call(this,i),r.trigger("modal_close"))});let o={form:!0,title:n.title||"",button:n.button||$t.submit,confirm:r,size:n.size||[500,600],open:function(){let e=$(this).find(".tinymce");e.length>0&&t.initMCE(e,n.tinymce||{})}};return t.dlg.call(this,i,o)},t.login.dlg=function(e){e=e||{};let n=[{name:"userinfo",label:$t.l1,type:"string",value:t.auth.login,change:t.login.uichange,required:!0},{name:"userlogin",type:"hidden",required:!0,value:t.auth.login},{name:"username",type:"string",label:$t.l4,required:!0,readonly:!0,placeholder:$t.l5,value:t.auth.fullname_rev},{name:"userpass",type:"password",label:$t.l3,required:!0,placeholder:$t.l3}];""===(t.auth.account||"")&&n.unshift({id:"dlg_loginaccount",name:"loginaccount",type:"string",required:!0,value:t.auth.account});let r=$$.dc("frm").append(t.mform(n).addClass("stacked")),i=t.dlg.call(this,r,{form:!0,title:$t.l0,button:$t.submit,confirm:function(n){var r=$(this).ldng(1),i=$.extend({loginaccount:t.auth.account||""},r.serializeObject());t.postXT({url:"/vt/login",data:i,success:function(n){""!==((n||{}).login||"")&&(r.trigger("modal_close"),t.auth=n,"object"==typeof e.ajo&&(e.ajo.islogin,$.ajax(e.ajo)))},error:function(){alert($t.l17)},complete:function(){r.ldng(0)},timeout:6e4})},size:[500,600]}),o=$$.dc("modal-content").css("height","auto").attr("novalidate","true").append($$.dc("modal-header").appendIf($("

      ").text(t.auth.accountname),""!==(t.auth.accountname||"")).append($("

      Vereinsmanager

      ")));i.dlg.prepend(o)},t.addNoEntryInfo=function(t){$(this).append($$.dc("noentryinfo").text(t||$t.t11))}}($ocms),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(t){var e=this;do{if(Element.prototype.matches.call(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}),function(t,e){var n,r;"object"==typeof window&&(window[t]=(n=function(t){var e=window,n=document.body,r=document.documentElement,i=Math.max(0,e.pageXOffset||r.scrollLeft||n.scrollLeft||0)-(r.clientLeft||0),o=Math.max(0,e.pageYOffset||r.scrollTop||n.scrollTop||0)-(r.clientTop||0);return{x:t?Math.max(0,t.pageX||t.clientX||0)-i:0,y:t?Math.max(0,t.pageY||t.clientY||0)-o:0}},(r=function(t,e){t&&t instanceof Element&&(this._container=t,this._options=e||{},this._clickItem=null,this._dragItem=null,this._showDragItem="boolean"!=typeof this._options.dragItem||!1!==this._options.dragItem,this._hovItem=null,this._sortLists=[],this._click={},this._dragging=!1,this._dragHandleClass=this._options.dragHandleClass||"",this._parentident=this._options.parentident||"",this._swapdone="function"==typeof this._options.swapdone?this._options._swapdone:null,this._container.setAttribute("data-is-sortable",1),this._container.classList.add("sortable"),this._container.style.position="static",window.addEventListener("mousedown",this._onPress.bind(this),!0),window.addEventListener("touchstart",this._onPress.bind(this),!0),window.addEventListener("mouseup",this._onRelease.bind(this),!0),window.addEventListener("touchend",this._onRelease.bind(this),!0),window.addEventListener("mousemove",this._onMove.bind(this),!0),window.addEventListener("touchmove",this._onMove.bind(this),!0))}).prototype={constructor:r,toArray:function(t){t=t||"id";for(var e=[],n="",r=0;rr.left&&er.top&&n-1)&&e.className.indexOf("nosort")<0)&&(t.preventDefault(),this._dragging=!0,this._click=n(t),this._makeDragItem(e),this._onMove(t),!0)}t&&!1===e.call(this,t.target)&&""!==this._parentident&&t.target.closest(this._parentident)&&e.call(this,t.target.closest(this._parentident))},_onRelease:function(t){this._dragging=!1,this._trashDragItem()},_onMove:function(t){if(this._dragItem&&this._dragging){t.preventDefault();var e=n(t),r=this._container;!0===this._showDragItem&&this._moveItem(this._dragItem,e.x-this._click.x,e.y-this._click.y);for(var i=0;i0?s.mousedown(l).addClass("dctrl"):a.mousedown(l).addClass("dctrl"),t(this)}}(jQuery),$(document).ready((function(){$("html").click((function(t){$nuf()})),$("#listframe").click((function(t){t.stopPropagation(),$nuf()})),$("#mainmenu").ocmsmenu($ocms.ocmsmenu),$("#mainmenu").activatemenu()})),$.extend($t,{m_inv:"Rechnungen",m_req:"Aufträge",m_rep:"Berichte",m_todo:"ToDos",m_bcd:"BankBuchungen",rsp:"Passwort ändern",pnm:"Die Passwörter stimmen nicht überein",cps:"Das neue Passwort wurde gespeichert.",pwr:"Bitte wählen Sie ein starkes Passwort (min 8 Zeichen, davon jeweils min 2 Zahlen, kleine und große Buchstaben, Sonderzeichen sind optional).",smsc:"Sie beötigen für diese Funktion einen SMS-Code.\nSoll dieser nun versandt werden?",wdc:"Doppelt klicken, um die Box zu aktualisieren.",wdg:{}}),$t.rspf={sms:"Der SMS-Code konnte nicht bestätigt werden",valid:"Das alte Passwort ist nicht korrekt",requirements:"Das Passwort entspricht nicht den Anforderungen.\n"+$t.pwr},$fd={rsp:new fields_definition("","",[{name:"opw",label:"aktuelles Passwort",type:"password",required:!0,attr:{"auto-complete":"current-password"}},{name:"npw",label:"neues Passwort",type:"password",required:!0,pattern:"(.{6,})",attr:{"auto-complete":"new-password"}},{name:"npwc",label:"neues Passwort (Bestätigung)",type:"password",required:!0,attr:{"auto-complete":"new-password"},note:$t.pwr},{name:"code",label:"SMS-Code",type:"string",required:!0,attr:{"auto-complete":"one-time-code"}}])},$ocms.init=function(t){var e="string"==typeof t?t:(t.data||{}).fn||"";""!==e&&("home"===e?($cfr(),$lfr(),$("#topbar").ocmsmenu([],!0),$("#activemodule").text($t.ov),$fis.ov()):($cfr(),$lfr(),$("#topbar").ocmsmenu([]),$ocms.postXT({url:$ocms.url(e+"/auth"),success:function(t){void 0===$ocms[e]&&($ocms[e]={}),$ocms[e].auth=t,t.manage>0&&$ocms.getScript({module:e,script:["/web/fis",e,$ocms.auth.locale||"de","js"].join("."),css:["/web/fis",e,"css"].join("."),condition:"function"!=typeof $ocms[e].init2},(function(){$ocms[e].init2()}))},error:function(){$("#contentframe").empty()}})))};var $fis={auth:{},db:function(){$("#mainmenu_activemodule").text($t.ov);let t=$(this).empty(),e=$$.d({id:"dashboard_frame"}).appendTo(t);$ocms.postXT({url:$ocms.url("wdg/my"),success:function(t){$.each(t,(function(t,n){var r=$$.dc("wdg_frame",e,{"data-wdg":n}).ldng(1);$ocms.wdg.call(r,{wdg:n})}))},loading:e})},ValidateEmail:function(t){return!!/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(t)},cf:t=>{let e=$("#contentframe");return!0===bool(t,!1)&&e.empty().rC("hd"),e},lf:t=>{let e=$("#listframe");return!0===bool(t,!1)&&e.empty().aC("hd").rC("fix"),e},frm_edit:function(t){let e=$fis.cf(!1),n=e.children(".cfrm"),r=e.children(".edit_frm");return n.length<1?n=$$.dc("cfrm hd").prependTo(e):!0===bool(t,!1)&&n.empty(),r.length<1&&(r=$$.dc("edit_frm").insertAfter(n)),r.empty()},frm_list:function(t,e){let n=$fis.cf(!1),r=n.children(".cfrm"),i=n.children(".list_frm");return r.length<1?r=$$.dc("cfrm hd").prependTo(n):!0===bool(t,!1)&&r.empty(),!0===bool(e,!1)&&n.children(".edit_frm").remove(),i.length<1&&(i=$$.dc("list_frm").appendTo(n)),i.empty()},lfm:()=>{let t=$fis.lf(!1),e=t.children(".lfrm");return e.length<1&&(e=$$.dc("lfrm").prependTo(t)),e},getAuth:(t,e)=>new Promise(((n,r)=>{$fis.auth[t]&&!1===bool(e,!1)?n($fis.auth[t]||-1):$ocms.postXT({url:$ocms.url("auth"),data:{module:t},success:e=>{$fis.auth[t]=e.auth||-1,n($fis.auth[t]||-1)},error:()=>{r()}})})),prepAuth:t=>new Promise(((e,n)=>{$ocms.postXT({url:$ocms.url("auth"),data:{module:t,array:1},success:t=>{$.extend($fis.auth,t||{})},complete:()=>{e()}})})),isAuth:(t,e)=>($fis.auth[t]||-1)>=(e||1),resetPass:function(t,e){confirm($t.smsc)&&($ocms.postXT({url:$ocms.url("account/sms"),data:{fn:"pwc"}}),$ocms.dlgform($fd.rsp.clone(),{title:$t.rsp||"",submit:function(t){var e=$(this).ldng(1),n=$.extend({loginaccount:$ocms.auth.account||""},e.serializeObject(!0,{typedvalues:!0}));(n.npw||"")!==(n.npwc||"")?e.find('input[name="npw"]:first')[0].setCustomValidity($t.pnm):$ocms.postXT({url:$ocms.url("account/changepassword"),data:n,success:function(t){alert($t.cps),e.trigger("modal_close")},error:function(t){alert($t.rspf[t.getResponseHeader("x-ocms-std")])},complete:function(){e.ldng(0)},timeout:6e4})}}))},wdg:function(t){let e=$(this).empty();$ocms.postXT({url:$ocms.url("wdg/one"),data:{short_name:t.wdg},success:function(n,r,i){let o=t.wdg,a=n[o];if(!a)return void e.ldng(0);let s=$.inArrayRegEx("dblwidth",a.rendering_options)>-1,l=$.inArrayRegEx("tiny",a.rendering_options)>-1;e.toggleClass("dbl",s&&!l).toggleClass("tny",l);$$.dc("wdg_hd",e,{title:ne(a.description,$t.wdc)}).toggleClass("dbl",s).text(ne(a.name,t.wdg)).dblclick((function(t){t.stopPropagation(),$fis.wdg.call(e,{wdg:o})}));let c=$$.dc("wdg_cnt",e).toggleClass("dbl",s).hide(),d=$.inArrayRegEx("bgcolor",a.rendering_options);switch(d>-1&&c.css("backgroundColor",a.rendering_options[d].toString().right(":")),a.type){case"table":var u=$$.tblset({},c),f=$$.tr().appendTo(u.hd),p=$t.wdg[o.indexOf("wdg_ev_")>=0?"wdg_ev_":o]||{};$.each(a.columns,(function(t,e){var n=p[e]?p[e].label:e;$$.th().text(n).appendTo(f)})),$.each(a.data,(function(t,e){var n=$$.tr().appendTo(u.bdy);$.each(a.columns,(function(t,r){var i=$$.td().appendTo(n);e[r]instanceof Date||!0===$ocms.isDateString(e[r])?i.text(fdt(e[r],$t.dateformat)):i.rwText(e[r])}))})),$.inArray("firstrow_bold",a.rendering_options)>-1&&f.nextAll("tr:first").css("font-weight","bold");break;case"ind":$$.dc("ind",c).addClass("sts_"+(a.data.status||"")).append([$$.dc("ind").text(a.data.value),$$.lbl(a.data.label)]);break;case"image_url":c.css("background","url('"+a.url+"') no-repeat center center transparent");break;case"image_base64":c.css("background","url('data:image/png;base64,"+a.image+"') no-repeat center center transparent");break;case"html":if(c.html(a.html),$.inArray("reload_10min",a.rendering_options)>-1){var m=c.find("iframe");setTimeout((function(){m.attr("src",(function(t,e){return e}))}),6e5)}}$.inArray("reload_30min",a.rendering_options)>-1&&"html"!==a.type&&setTimeout((function(){$fis.wdg.call(e,{wdg:o})}),18e5),c.slideDown(150)},error:function(t){e.slideUp(150),$fis.failure.call(this,t)},complete:function(){e.ldng(0)}})},ov:function(){$fis.lf(!0);let t=$("#contentframe").empty(),e=$$.d({id:"dashboard_frame"}).appendTo(t);$ocms.postXT({url:$ocms.url("wdg/my"),success:function(t){$.each(t,(function(t,n){var r=$$.dc("wdg_frame",e,{"data-wdg":n}).ldng(1);$fis.wdg.call(r,{wdg:n})}))},loading:e})}};Array.prototype.push.apply($ocms.ocmsmenu,[{lbl:$t.m_inv,id:"m_inv",fnc:"init:inv",ico:"glyphicon glyphicon-list-alt"},{lbl:$t.m_req,id:"m_req",fnc:"init:req",ico:"glyphicon glyphicon-eur"},{lbl:$t.m_bcd,id:"m_bcd",fnc:"init:bam",ico:"glyphicon glyphicon-indent-right"},{fnc:"separator"},{lbl:$t.m_rep,id:"m_rep",fnc:"init:rep",ico:"glyphicon glyphicon-dashboard"},{fnc:"separator"},{lbl:$t.m_todo,id:"m_todo",fnc:()=>{$("#contentframe").empty().load($ocms.url("todos")),$("#listframe").rC("fix").aC("hd")},ico:"glyphicon glyphicon-sunglasses"}]),$(document).ready((function(){$fis.ov()})); \ No newline at end of file +function onloadCSS(t,e){e=e||{};let n=function(e){return new Promise(((n,r)=>{t.addEventListener?e.addEventListener("load",newcb):t.attachEvent&&e.attachEvent("onload",newcb),"isApplicationInstalled"in navigator&&"onloadcssdefined"in t&&e.onloadcssdefined(newcb)}))};if(Array.isArray(t)){let r=t.length;Promise.all(t.map(n)).then((function(t){var n=t.reduce(((t,e)=>t+(!0===e?1:0)));!async function(t){!0===t&&"function"==typeof e.success?e.success():!0===t&&"object"==typeof e.success&&e.success instanceof Promise&&await e.success(),e.complete()}(r===n)}))}else n(t)}!function(t){"use strict";var e=function(e,n,r,i){var o,a=t.document,s=a.createElement("link");if(n)o=n;else{var l=(a.body||a.getElementsByTagName("head")[0]).childNodes;o=l[l.length-1]}var c=a.styleSheets;if(i)for(var d in i)i.hasOwnProperty(d)&&s.setAttribute(d,i[d]);s.rel="stylesheet",s.href=e,s.media="only x",function t(e){if(a.body)return e();setTimeout((function(){t(e)}))}((function(){o.parentNode.insertBefore(s,n?o:o.nextSibling)}));var u=function(t){for(var e=s.href,n=c.length;n--;)if(c[n].href===e)return t();setTimeout((function(){u(t)}))};function f(){s.addEventListener&&s.removeEventListener("load",f),s.media=r||"all"}return s.addEventListener&&s.addEventListener("load",f),s.onloadcssdefined=u,u(f),s};"undefined"!=typeof exports?exports.loadCSS=e:t.loadCSS=e}("undefined"!=typeof global?global:this);const isIE=/MSIE\/|Trident/gi.test(window.navigator.userAgent)||void 0!==window.document.documentMode,isfileapi=!!(window.File&&window.FileReader&&window.FileList&&window.Blob);var $ocms={auth:{},no:function(t){t.stopPropagation()},vmin:function(t){var e=$(window).width*(t||1),n=$(window).height*(t||1);return e($ocms.baseurl+"/"+(t||"")).replace(/\/\//,"/"),cexi:null};function deepCopy(t){var e,n,r;if("object"!=typeof t||null===t)return t;for(r in e=Array.isArray(t)?[]:{},t)n=t[r],e[r]=deepCopy(n);return e}function fields_definition(t,e,n){this.label_sng=!0===Array.isArray(t)?"":t||"",this.label_pl=!0===Array.isArray(t)?"":e||"",this.fields=!0===Array.isArray(t)?t:n||[],this.itm=function(t){for(var e=0;e0)for(var n=0;nt||"")).filter(((t,e)=>""!==t)).join(e)}function parseDt(t,e,n){t=(t||"").substr(0,e.length);var r=e,i=t.length>0&&e.split(";").some((function(e){for(var n,i=/[^yMdhms0-9]/gi,o=!0;null!==(n=i.exec(e));)o=o&&e.substr(n.index,1)===t.substr(n.index,1);var a=t.length===e.length&&o;return!0===a&&(r=e),a}));if(!0===i){for(var o,a=[0,0,0,0,0,0,0],s=/(mm{1,2}|dd{1,2}|MM{1,2}|(yy){2,4}|ss{1,2}|hh{1,2})(?!\w)/g;null!==(o=s.exec(r));)a["yMdhms".indexOf(o[0].substr(0,1))]=parseInt(("yy"===o[0]?"20":"")+t.substr(o.index,o[0].length))-("M"===o[0].substr(0,1)?1:0);var l=new(Function.prototype.bind.apply(Date,[null].concat(a)));return"string"==typeof n?fdt(l,n):l}return!1}function bool(t,e){return"boolean"==typeof t?t:"boolean"==typeof e&&e}function booln(t,e){return"boolean"==typeof t?t:"number"==typeof t?1===t:"boolean"==typeof e&&e}Date.prototype.isValid=function(){return!isNaN(this)},Date.prototype.format=function(t){return fdt(this,t)},Date.prototype.addDays=function(t){return this.setDate(this.getDate()+t),this},Date.prototype.isBetween=function(t,e){return this>t&&this section");$(window).scroll((function(e){let n=$(window).scrollTop(),r=$("body");r.toggleClass("unfocus",n>vh()-1.2*t),r.toggleClass("btb",n>.5*vh()-t)}))},$ocms.cf_reset=function(){return $("#contentframe").empty()},function(t){t.fn.scrollTo=function(e){if(t(this).length>0){var n=t(this).offset().top||0;n>0&&t("html, body").animate({scrollTop:n-hh()},2e3)}},t.fn.ldng=function(e){var n=!0;return"boolean"==typeof e?n=e:"number"==typeof e&&(n=e>0),t(this).toggleClass("loading",n)},"function"!=typeof t.noop&&(t.noop=function(){}),t.fn.hasAttr=function(e){var n=t(this).attr(e);return void 0!==n&&!1!==n},t.fn.parseCssPx=function(e){try{return parseFloat(t(this).css(e).replace("px","")||0)}catch(t){return 0}},t.max=function(t,e){return isNaN(t)&&isNaN(e)?null:isNaN(t)&&!isNaN(e)?e:!isNaN(e)&&isNaN(e)||t>=e?t:e},t.min=function(t,e){return isNaN(t)&&isNaN(e)?null:isNaN(t)&&!isNaN(e)?e:!isNaN(e)&&isNaN(e)||t<=e?t:e},t.lim=function(t,e){return isNaN(t)?null:isNaN(e)?t:e<=t?e:t},t.fn.enterKey=function(e){return this.each((function(){t(this).keypress((function(t){"13"===(t.keyCode?t.keyCode:t.which).toString()&&e.call(this,t)}))}))}}(jQuery),$ocms.defaultTimeout=3e4,$ocms.AjaxEX=function(t){var e=this;e.responseText=e.responseText||"";var n=e.getResponseHeader("x-ocms-code")||"";e.internalCode=""!==n&&!1===isNaN(n)?parseInt(n):-1,e.isInternal=e.internalCode>-1,e.internalText=decodeURIComponent((e.getResponseHeader("x-ocms-desc")||"").replace(/\+/g,"%20")||"");var r=e.internalText||t,i=e.internalCode||e.status;e.logtext=r+" ("+i+")"},$ocms.postXTS=function(t){$ocms.postXT.call(this,$.extend(t,{sync:!0}))},$ocms.postXT=function(t){if((t=t||{}).trycount=t.trycount||0,""!==(t.url||"")){t.url=-1!==t.url.indexOf("&yy=")?t.url:t.url.indexOf("?")>-1?t.url+"&yy="+(new Date).getTime():t.url+"?yy="+(new Date).getTime();var e=t.context||this;switch(t.context=e,t.retryLimit=t.retryLimit||0,t.timeout=t.timeout||$ocms.defaultTimeout,t.timeout<100&&(t.timeout=1e3*t.timeout),t.data=t.data||{},t.contentType=t.contentType||"multipart/form-data; charset=UTF-8",t.islogin="boolean"==typeof t.islogin&&t.islogin,t.contentType){case"":case"json":t.contentType="application/json; charset=utf-8";break;case"form":t.contentType="application/x-www-form-urlencoded; charset=UTF-8";break;case"multi":t.contentType="multipart/form-data";break;case"text":t.contentType="text/plain; charset=UTF-8"}if(t.form instanceof jQuery?(t.data=t.form.serializeObject(),t.contentType="form-data"):t.lzw instanceof jQuery&&(t.data.lzw=$.ccLZW(t.lzw.serializeAnything(!0)).join(",")),"multipart/form-data"!==t.contentType.substr(0,19)&&"form-data"!==t.contentType.substr(0,9)||t.data instanceof FormData!=!1)t.data instanceof FormData&&(t.contentType=!1,t.processData=!1);else{t.contentType=!1;var n=new FormData;$.each(t.files||[],(function(t,e){n.append("upload_file",e)})),$.each(t.data||{},(function(t,e){n.append(t,e)})),t.data=n,t.processData=!1}var r={type:t.method||"post",url:t.url,data:t.data,processData:"boolean"!=typeof t.processData||t.processData,contentType:t.contentType,cache:t.cache||!1,timeout:t.timeout,beforeSend:function(n){$(t.loading).ldng(),$("body").addClass("ldng"),"function"==typeof t.beforesend&&t.beforesend.apply(e,[n])},success:function(n,r,i){"false"===n||"not authorized"===n?("function"==typeof t.error&&t.error.apply(e,[i,r,n]),"function"==typeof $.status&&$.status(r+" - "+n)):"function"==typeof t.success&&t.success.apply(e,[n,r,i])},error:function(n,r,i){if($ocms.AjaxEX.call(n,r),-1===t.url.indexOf("doc.ashx")||-1!==t.url.indexOf("ftest")){if(401===n.status&&111===n.internalCode&&!1===t.islogin&&"function"==typeof $ocms.login.dlg)$ocms.login.dlg({ajo:t});else if("timeout"===r||302===n.status)return t.tryCount++,t.tryCount<=t.retryLimit?void $ocms.postXT(t):void 0;"function"==typeof t.error?t.error.apply(e,[n,r,i]):"function"==typeof $ocms.failure?$ocms.failure.apply(e,[n]):"function"==typeof $.status&&$.status("Server error: "+r+" - "+i)}},dataType:t.datatype||"json",complete:function(n,r){"function"==typeof t.complete&&t.complete.apply(e,[n,r]),$(t.loading).ldng(0),$("body").removeClass("ldng");let i=$("body > .timer");if(i.length>0){let t=new Date(n.getResponseHeader("ocms_cec")||""),e=new Date(n.getResponseHeader("ocms_cex")||"");if(t.isValid()&&e.isValid()){let n=new Date,r=Math.abs(e-t);n.setMilliseconds(n.getMilliseconds()+r),i.data({cex:n,ctt:r}),$ocms.cex_timer()}}},context:e,async:!0};"boolean"==typeof t.sync&&(r.async=!1===t.sync),!0==("boolean"==typeof t.contentType&&!1===t.contentType)&&(r.contentType=!1),$.ajax(r)}},$ocms.cex_timer=function(){$ocms.cexi||($ocms.cexi=setInterval($ocms.cex_timer,15e3));let t=$("body > .timer"),e=t.data("cex"),n=t.data("ctt"),r=new Date;if(e instanceof Date&&e.isValid()&&"number"==typeof n&&n>0&&e>r){let i=Math.abs(r-e)/n*100;t.css("width",i.toString()+"%"),i<98&&(!$ocms.cex_lp||Math.abs(r-$ocms.cex_lp)>6e5)&&$ocms.postXT({url:$ocms.url("ping"),success:()=>{$ocms.cex_lp=r},timeout:5e3,error:()=>{}})}},$ocms.vbl_send=function(t){var e=t.data||{};if(""!==(e.url||"")){var n=$("#contentframe form:first"),r={url:e.url,data:new FormData,success:function(t){"function"==typeof e.success?e.success(t):"string"==typeof e.success&&alert(e.success)},error:function(t,n,r){"function"==typeof e.error?e.error(r):"string"==typeof e.error&&alert(e.error)},complete:function(){n.ldng(0)}},i=!0;n.find("input").each((function(){var t=$(this),e=t.nza("name"),n=t.val(),o=$(this).prop("required")||!1;if(""!==e){var a=""!==n||!1===o;i=i&&a,!0===a?(r.data.append(e,n),t[0].setCustomValidity("")):""!==$(this).nza("ocms-nvnote")&&t[0].setCustomValidity($(this).nza("ocms-nvnote"))}})),!0===i&&(n.ldng(1),$ocms.postXT.call(this,r))}},function(t){t.fn.nza=function(e,n){var r=t(this).attr(e);return void 0!==r&&!1!==r?r:n||""},t.fn.serializeObject=function(e,n){var r=/\r?\n/g,i=/^(?:submit|button|image|reset|file)$/i,o=/^(?:input|select|textarea|keygen)/i,a=/^(?:checkbox|radio)$/i,s=bool((n=n||{}).typedvalues,!1),l={},c=t(this),d=c.find(':input:not([nosend],[type="file"])').addBack(":input"),u=!0;return t.each(d.not(".tinymce").get(),(function(n,c){var d=t(this),f=this,p=(this.type||"").toLowerCase(),m=d.prop("required")||!1;if(!0===(f.name&&!d.is(":disabled")&&o.test(f.nodeName)&&!i.test(p))){var h=d.val(),g=f.name,y=d.nza("data-format").split(":"),$=d.nza("pattern")||".*";if(!0===a.test(p)&&(h=f.checked?""!==h?h:"true":""),"date"===y[0].substr(0,4)&&y.length>1)"boolean"==typeof(h=parseDt(h,y.slice(1).join(":")))&&(h=null),null===h&&"date"===d.prop("type").substr(0,4)&&!1===isNaN(new Date(d.val()))&&(h=new Date(d.val())),h instanceof Date==!0&&"function"==typeof h.getMonth?!1===s&&(h=fdt(h,"date"===y[0]?"dts":"iso")):h=null;else if("number"===p&&!0===s){let t;t="integer"===y[0]?parseInt(h):parseFloat(h),h=isNaN(t)?h:t}if(!0!==m||""!==(h||"")&&null!==h.match($)?!0===bool(e,!1)&&f.setCustomValidity(""):(!0===bool(e,!1)&&f.setCustomValidity(d.nza("ocms-nvnote",$ocms.t.inv||"Invalid field")),h=null),null!=h&&"string"==typeof h){let t=l[g];null!=t?Array.isArray(t)?t.push(h.replace(r,"\r\n")):l[g]=[t,h.replace(r,"\r\n")]:l[g]=h.replace(r,"\r\n")}else if(null!=h){let t=l[g];null!=t?Array.isArray(t)?t.push(h):l[g]=[t,h]:l[g]=h}else u=!1}})),d.filter(".tinymce").each((function(e,n){var r=t(this),i=((this.type||"").toLowerCase(),r.prop("required")||!1);try{var o=tinymce.get(t(n).attr("id"));if(o){var a=t(n).attr("name"),s=o.getContent();!1===i||""!==(s||"")?l[a]=s:u=!1}}catch(e){t.noop()}})),c.toggleClass("invalid",!u),u?l:null},t.fn.sendForm=function(e,n,r){var i=t(this);r=r||{};var o={url:e,success:function(t){if(r.response=t,"function"==typeof n)n(t);i.closest("div.modal").remove()},error:function(t,e,n){"function"==typeof r.error?r.error.call(this,t):$ocms.failure.call(this,t)},complete:function(){i.ldng(0),"function"==typeof r.complete&&r.complete.call(this,jqXHR)}},a=i.find('input[type="file"]');o.data=new FormData,a.length>0&&t.each(a[0].files,(function(t,e){o.data.append(t,e),o.data.append("file_lastmodified",$ocms.isodt(e.lastModifiedDate))}));var s=i.serializeObject();t.each(s||{},(function(t,e){o.data.append(t,e)})),i.ldng(),$ocms.postXT.call(this,o)},t.fn.checkValidity=function(){var e=t(this),n=!0;return e.each((function(t,e){n=n&&e.checkValidity()})),n},t.fn.wrap=function(e,n){var r=t(this),i=$$.dc(e).attr(n||{}).insertAfter(r);return r.append(i),i}}(jQuery),$ocms.logout=function(){$ocms.postXT({url:$ocms.url("logout"),complete:function(){window.location.reload()}})},$ocms.login={send:function(t){t.preventDefault();var e=$(this);if(!0===e.find("#dbtn-confirm").hasClass("disabled"))return!1;var n=e.serializeObject();return n.loginaccount=ne(n.loginaccount,$ocms.auth.account||$ocms.auth.requestedaccount||""),n.loginaccount=ne(n.loginaccount,$ocms.auth.account||$ocms.auth.requestedaccount||""),""===ne(n.loginaccount)&&!0===bool($ocms.auth.accountrequired,!0)?(alert($t.l16),!1):($ocms.postXT({url:$ocms.url("login"),data:n,success:function(){window.location.reload()}}),!1)},uichange:function(){let t=$(this),e=t.closest("form"),n=bool($ocms.auth.accountrequired,!0),r=ne(e.find('[name="loginaccount"]').val(),$ocms.auth.account||$ocms.auth.requestedaccount||"");if(""!==r||!1===n){var i=e.find('[name="userlogin"]').empty().val(""),o=e.find('[name="username"]').empty().val(""),a=$("#dlg_userlogin_sel").empty().val(""),s=t.val()||"";if(!1===t.checkValidity()&&""===s)return;var l=t.closest("table").ldng();$ocms.postXT.call(this,{url:$ocms.url("auth"),data:{userinfo:s,account:r||""},success:function(t,e,n){if(1===t.length){var r=t[0];i.val(r.login).change().attr("required","").removeAttr("nosend"),o.val(r.name).change().attr("required","").show(),a.removeAttr("required").attr("nosend","").hide()}else t.length>0?(o.hide().removeAttr("required"),i.removeAttr("required").attr("nosend",""),0===a.length&&(a=$("").attr({name:"userlogin",size:t.length,id:"dlg_userlogin_sel",class:"form-control",required:""}).css({width:"100%","max-width":"100%",padding:"2px"}).insertAfter(o)),$.each(t,(function(t,e){var n=$("").attr({value:e.login,style:"padding-top: 2px; padding-bottom: 5px;","border-bottom":"1px solid #EEE;"}).text(e.name).appendTo(a);t%2==0&&n.css({"background-color":"#F9F9F9"})})),a.attr("required","").removeAttr("nosend")):(a.hide().attr("nosend",""),o.attr("required","").show(),i.attr("required","").removeAttr("nosend"),alert($t.l9))},error:function(t){$ocms.failure.call(this,t)},complete:function(){l.ldng(0)}})}else alert($t.l18)},sendpassword:function(t){var e=$(''),n=e.find(".form-body"),r=null;e.find("form").submit((function(t){t.preventDefault();var i=$(this).serializeObject(!0),o=null===r,a=o?"spwc":"spw";return $ocms.postXT.call(this,{url:$ocms.url(a),data:i,complete:function(){o?(n.append('
      Ihnen wurde ein Code per SMS zugesandt.
      Bitte tragen Sie den hier ein:
      '),r=$('
      ').appendTo(n)):(alert($t.l13),e.remove())},error:()=>{}}),!1})),e.find(".modal-close").click((function(){e.remove()}));var i=[];$.each($t.l7a.split("\n"),((t,e)=>{Array.prototype.push.apply(i,[$("
      "),$("").text(e)])})),e.find(".modal-note").append($('').text($t.alert)).append(i),e.appendTo("body"),setTimeout((function(){$(".modal").find('input[name="lastname"]').focus()}),600)}};var $$={s:function(t){return $("").text(t)},br:function(){return $("
      ")},sc:function(t,e){return $("").addClass(t).text(e)},td:function(t,e){var n=$("");return t instanceof jQuery==!0?n.appendTo(t):"object"==typeof t?n.attr(t):"string"==typeof t&&n.text(t),"object"==typeof e?n.attr(e):"string"==typeof e&&n.text(e),n},th:function(t,e){var n=$("");return t instanceof jQuery==!0?n.appendTo(t):"object"==typeof t?n.attr(t):"string"==typeof t&&n.text(t),"object"==typeof e?n.attr(e):"string"==typeof e&&n.text(e),n},tdc:function(t,e,n){return $$.td(e,n).addClass(t)},td2:function(t){var e=$('');return"string"===$.type(t)?e.text(t):t instanceof jQuery?e.append(t):"function"==typeof t?t.call(e):e.html(" "),e},td3:function(t){var e=$('');return"string"===$.type(t)?e.text(t):t instanceof jQuery?e.append(t):"function"==typeof t?t.call(e):e.html(" "),e},tdtr:function(t,e){var n=$$.tr().appendTo(e);return t instanceof jQuery==!0||"string"==typeof t?t.appendTo($$.td().appendTo(n)):!0===Array.isArray(t)&&$.each(t,(function(t,e){$(e).appendTo($$.td().appendTo(n))})),n},tr:function(t,e){var n=$("");return t instanceof jQuery==!0?n.appendTo(t):"object"==typeof t&&n.attr(t),"object"==typeof e&&n.attr(e),n},trc:function(t,e){var n=$("").addClass(t);return e instanceof jQuery==!0?n.appendTo(e):"object"==typeof e&&n.attr(e),n},d:function(t){return $("
      ").attr(t||{})},dc:function(t,e,n,r){var i=$("
      ").addClass(t);return e instanceof jQuery==!0?i.appendTo(e):"object"==typeof e?i.attr(e):"function"==typeof e?i.click(e):"string"==typeof e&&i.text(e),"string"==typeof n?i.text(n):"object"==typeof n?i.attr(n):"function"==typeof n&&i.click(n),"string"==typeof r?i.text(r):"object"==typeof r?i.attr(r):"function"==typeof r&&i.click(r),i},df:function(t){return $("
       
      ").attr(t||{})},opt:function(t,e,n){var r=$("");return"string"==typeof t?r.attr("value",t):"object"==typeof t&&r.attr(t),"string"==typeof e?r.text(e):"object"==typeof e&&r.attr(e),"object"==typeof n&&r.attr(n),r},eOpt:function(t){var e=$('');return t&&e.attr("selected","selected"),e},tbl:function(t){return $("
      ").attr(t||{})},tblc:function(t){return $("
      ").addClass(t)},thead:function(t){let e=$("");return t instanceof jQuery&&e.prependTo(t),e},tbody:function(t){let e=$("");return t instanceof jQuery&&e.appendTo(t),e},tblset:function(t,e){let n=$$.tbl(t||{});return e instanceof jQuery&&e.append(n),{tbl:n,hd:$$.thead().appendTo(n),bdy:$$.tbody().appendTo(n)}},i:function(t){return $("").attr(t||{})},img:function(t,e){return $("").attr("src",t).attr(e||{})},sel:function(t){return $("").attr(t||{})},btn:function(t){return $("").attr(t||{})},a:function(t){return $("").attr(t||{})},li:function(t){return $("
    • ").attr(t||{})},ul:function(t){return $("
        ").attr(t||{})},nav:function(t){return $("").attr(t||{})},lbl:function(t,e){var n=$("");return"string"==typeof t&&n.text(t),"object"==typeof t?n.attr(t):"object"==typeof e&&n.attr(e),n},txt:function(t){return $("").attr(t||{})},0:function(t,e){return $("<"+t+">").attr(e||{})},bbtn:function(t,e){return $$.btn({type:"button",class:"btn"}).addClass(e).text(t)},svg:t=>$(document.createElementNS("http://www.w3.org/2000/svg",t))};function getMonday(t){var e=(t=new Date(t)).getDay(),n=t.getDate()-e+(0==e?-6:1);return new Date(t.setDate(n))}function $lf(t){var e=void 0===t?null:"number"==typeof t&&1!==t||"boolean"==typeof cl&&!1===t;return $("#listframe").tC("hd",e).is(".hd")}function $nuf(t){if(t&&t.stopPropagation(),!$(this).is(".disabled")){var e=function(t){t.removeClass("vis").find("li.dropdown").removeClass("open").removeClass("vis").attr("aria-expanded","false")},n=$(this).parent("li.dropdown");if(n.length>0){n.tC("open"),navs=!0===n.is(".open")?"true":"false",n.attr("aria-expanded",navs);var r=n.closest("nav");r.find("li.dropdown").not(n.parentsUntil("nav")).not(n).removeClass("open").attr("aria-expanded","false"),!1===n.is(".open")&&n.find("li.dropdown").removeClass("open").attr("aria-expanded","false"),e($("nav").not(r))}else e($("nav"))}}function $tbr(){return $lf(0),$("#topbar").ocmsmenu([])}function $lfr(){return $("#sidebar").empty(),$("#listframe").removeClass("fix").addClass("hd").empty()}function $cfr(){return $tbr(),$("#contentframe").empty()}function jObj(t,e){let n={};if("{"===(t||"").substr(0,1))try{n=JSON.parse(t)}catch(t){n={}}return n[e]||""}function string(t,e){var n,r=t||"";return $.each(e||[],(function(t,e){n=new RegExp("\\{"+t.toString()+"\\}","ig"),r=r.replace(n,e)})),r}function init_tooltip(t){var e=!0===("boolean"==typeof t&&t)&&"mouse";$("[title]").qtip({position:{target:e,adjust:{x:2,y:2},viewport:!0},events:{hidden:$ocms.tooltip_hidden},effect:!1}),$("div.tooltiptext").each((function(){$(this).filter(":not(:empty)").parent().qtip({suppress:!1,content:{text:$(this).clone()},position:{target:e,adjust:{x:2,y:2},viewport:!0},events:{hidden:$ocms.tooltip_hidden}})}))}String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")},String.prototype.left=function(t){if("string"===$.type(t)){var e=this.indexOf(t);return e>0?this.slice(0,e):""}return this.substring(0,t)},String.prototype.right=function(t){if("string"===$.type(t)){var e=this.indexOf(t);return e>0?this.substring(this.length-e):""}return this.substring(this.length-t)},Array.prototype.move=function(t,e){if(e>=this.length)for(var n=e-this.length;1+n--;)this.push(void 0);return this.splice(e,0,this.splice(t,1)[0]),this},function(t){t.fn.appendToIf=function(e,n){var r=t(this),i="function"==typeof n?n(r):n;return!0===("boolean"!=typeof i||i)&&r.appendTo(e),r},t.fn.appendIf=function(e,n){var r=t(this),i="function"==typeof n?n(r):n;return!0===("boolean"!=typeof i||i)&&r.append(e),r},t.fn.rwText=function(e,n,r){var i=t(this).empty();r=t.extend({wrap:!0},r);var o=!0===Array.isArray(e)?e:(null==e?"":String(e)).split("\n");return t.each(o,(function(t,e){""!==(e||"")&&(t>0&&i.append($$.br()),i.append(!0===r.wrap?$$.s(e):e))})),n&&i.attr("title",n),i},t.fn.loadSel=function(e,n,r){if("SELECT"===t(this).prop("tagName").toUpperCase()){var i=t(this);$ocms.postXT.call(this,{url:e,data:n||{},success:function(e){t.each(e,(function(){i.append($$.opt(e.value,e.text))}))},complete:function(){i.ldng(0),"function"==typeof r&&r.call(i)}})}},t.fn.emptyWithEditors=function(e){var n=t(this);return n.find(":input.tinymce").each((function(e,n){try{var r=tinymce.get(t(n).attr("id"));r&&r.remove()}catch(e){t.noop()}})),n.empty()},t.fn.cssValue=function(t){if(this.length>0){var e=this.css(t)||"";if(""===e)return 0;var n=/(^[\d\.]*)(\D{1,3}$)/gi.exec(e);return null!==n?"rem"===n[2]?$ocms.rpx(parseFloat(n[1])):parseFloat(n[1]):!1===isNaN(e)?parseFloat(e):0}return 0},t.fn.veryInnerHeight=function(){let e=e=>t(this).cssValue(e);return t(this).innerHeight()-e("padding-top")-e("padding-bottom")},t.fn.veryInnerWidth=function(){let e=e=>t(this).cssValue(e);return t(this).innerWidth()-e("padding-left")-e("padding-right")},t.fn.marginWidth=function(){let e=e=>t(this).cssValue(e);return e("margin-left")+e("margin-right")},t.fn.marginHeight=function(){let e=e=>t(this).cssValue(e);return e("margin-top")+e("margin-bottom")},t.inArrayRegEx=function(e,n,r){var i="regexp"===t.type(e)?e:new RegExp(e);if(!n)return-1;for(var o=r=r||0;o7){r=e.split(","),i=(n||(t<0?"rgb(0,0,0)":"rgb(255,255,255)")).split(",");var l=s(r[0].slice(4)),c=s(r[1]),d=s(r[2]);return"rgb("+(a((s(i[0].slice(4))-l)*o)+l)+","+(a((s(i[1])-c)*o)+c)+","+(a((s(i[2])-d)*o)+d)+")"}var u=(r=s(e.slice(1),16))>>16,f=r>>8&255,p=255&r;return"#"+(16777216+65536*(a((((i=s((n||(t<0?"#000000":"#FFFFFF")).slice(1),16))>>16)-u)*o)+u)+256*(a(((i>>8&255)-f)*o)+f)+(a(((255&i)-p)*o)+p)).toString(16).slice(1)},t.fn.IN=function(e){return t(this).fadeIn(400,e),t(this)},t.fn.OUT=function(e){return t(this).fadeOut(400,e),t(this)},t.fn.tooltip=function(e,n){var r=!0===("boolean"==typeof e&&e)&&"mouse",i="boolean"==typeof n&&n,o=t(this);return o.each((function(){var e=i?t(this).find(".tooltiptext"):t(this).children(".tooltiptext");t(e).length>0?e.each((function(){var e=t(this);t(this).filter(":not(:empty)").parent().qtip({suppress:!1,content:{text:e.clone()},position:{target:r,adjust:{x:2,y:2},viewport:!0},events:{hidden:$ocms.tooltip_hidden},show:{effect:!1},hide:{effect:!1}}),e.remove()})):t(this).qtip({position:{target:r,adjust:{x:2,y:2},viewport:!0},events:{hidden:$ocms.tooltip_hidden},effect:!1})})),o},t.fn.rC=function(e){return t(this).removeClass(e)},t.fn.aC=function(e){return t(this).addClass(e)},t.fn.tC=function(e,n){return t(this).toggleClass(e,n)}}(jQuery),function(t){t.fn.ocmsmenu=function(e,n){var r=t(this);return $ocms.menu.call(r,e,n),r},t.fn.activatemenu=function(){var e=t(this).filter("nav");return e.find("a").not(".on").addClass("on").click($nuf),e.find(".nav-btn").not(".on").addClass("on").click((function(e){e.stopPropagation();var n=t(this);t(n.attr("data-target")).tC(n.attr("data-toggle"))})),e}}(jQuery);class ObjectArray extends Array{isEmpty(){return 0===this[0].length}static get[Symbol.species](){return Array}filter(t){return"function"==typeof t?new ObjectArray(this[0].filter(t)):this}remove(t){if("function"!=typeof t)return this;{let e=this[0].findIndex(t);for(;e>-1;)this[0].splice(e),e=this[0].findIndex(t)}}sortBy(t){return"function"==typeof t&&this[0].sort(t),this}sortString(t){return this[0].sort(((e,n)=>{let r=(e[t]||"").toString().toUpperCase(),i=(n[t]||"").toString().toUpperCase();return console.debug(r.localeCompare(i)),r.localeCompare(i)})),this}sortNum(t){return this[0].sort(((e,n)=>{let r=e[t],i=n[t];return!0===isNaN(i)&&!1===isNaN(r)||ri?1:0})),this}sum(t){return this[0].reduce(((e,n)=>e+(!0===isNaN(n[t])?0:n[t])),0)}groupBy(t){return this[0].reduce((function(e,n){let r=n[t];return e[r]||(e[r]=[]),e[r].push(n),e}),{})}each(t){if("function"==typeof t){let e=!1;this[0].forEach(((n,r,i)=>{if(!1===e){let o=t(n,r,i);"boolean"==typeof o&&!1===o&&(e=!0)}}))}}get toArray(){return this[0]}}class NumArray extends Array{sum(){return this.reduce(((t,e)=>t+e))}first(){return this[0]}last(){return this[this.length-1]}average(){return this.sum()/this.length}range(){let t=this.map((t=>t)).sort();return{min:t[0],max:t[this.length-1]}}static get[Symbol.species](){return Array}}$ocms.ocmsmenu=[{lbl:"",id:"m_home",ico:"glyphicon glyphicon-home",fnc:"init:home"},{fnc:"separator"}],function(t){t.multline=function(t){let e=t.split("\n"),n=$$.d();return $.each(e,((t,e)=>{n.append($$.s(e))})),n.html()},t.tooltip_hidden=function(t,e){$(this).remove(),e.rendered=!1},t.isDateString=function(t){return"string"==typeof t&&!1===isNaN(new Date(t))},t.failure=function(e){11110===(e.internalCode||-1)?t.login.dlg():alert($t.f1+"\n"+(e.internalText||""))},t.getScript=function(e,n){var r=[],i=[],o=function(t){return"string"==typeof t&&""!==(t||"")},a=function(t,e){!0===bool(e.condition,!0)&&(""!==(e.script||"")&&i.push({url:e.script,module:e.module||""}),!0===o(e.css||"")?r.push(e.css):!0===Array.isArray(e.css)&&Array.prototype.push.apply(r,e.css.filter(o)))};!0===o(e||"")?i.push(e):!0===Array.isArray(e)?$.each(e,a):"object"==typeof e&&""!==(e.script||"")&&a(0,e);let s=[];$.each(r,(function(t,e){""!==(e||"")&&s.push(loadCSS(e))}));let l=i.map((function(e,n){let r=e.url,o=e.module||"";if(""===o){return new Promise((function(t,e){try{!async function(){$.ajax({url:r,dataType:"script",success:function(){t(i)},error:function(){e(i)},timeout:3e4})}()}catch(t){console.debug(t.message+"%o",t)}}))}return t.loadmodule(o,r,e.alias)}));Promise.all(l).then(n)},t.loadmodule=function(e,n,r){return new Promise((function(i,o){!async function(){try{let a=(n.startsWith("/")||n.startsWith(".")?"":"/")+n;import(a).then((n=>{t[e]=n[r||"default"],i(e)})).catch((t=>{console.debug(t.message+"%o",t),o(e)}))}catch(t){console.debug(t.message+"%o",t)}}()}))},t.ocms_auth=function(e,n,r,i){!1===$.isPlainObject(t.auth.modules)&&(t.auth.modules={});var o=0;t.auth.modules[e+(r||"")]?((o=t.auth.modules[e+(r||"")])<2&&(r||"")===auth.guid&&(o=2),o>=(n||0)&&i(false)):t.postXT({url:t.url("auth"),data:{module:e,person_guid:r||""},success:function(a){o=a[e],t.auth.modules[e+(r||"")]=o,o<2&&(r||"")===t.auth.person_guid&&(o=2),o>=(n||0)&&i(false)},error:function(e){t.failure.call(this,e)}})},t.auth.locale="de",t.ocms_prepauth=function(e,n,r){t.postXT({url:t.url("auth"),data:{fn:"csv",modules:e,person_guid:n||""},success:function(e){t.ocms_regauth(e)},error:function(e){t.failure.call(this,e)},complete:function(){r()}})},t.ocms_regauth=function(t){$.each(t||{},(function(t,e){auth.modules[t]=parseInt(e)}))},t.init=function(e){var n="string"==typeof e?e:(e.data||{}).fn||"";""!==n&&("home"===n?($cfr(),$lfr(),$("#topbar").ocmsmenu([],!0),$("#activemodule").text($t.ov),t.ov.call($("#contentframe"))):($cfr(),$lfr(),$("#topbar").ocmsmenu([]),t.postXT({url:t.url(n+"/auth"),success:function(e){void 0===t[n]&&(t[n]={}),t[n].auth=e,e.manage>0&&t.getScript({module:n,script:["web/imdl",n,t.auth.locale||"de","js"].join("."),css:["web/imdl",n,"css"].join("."),condition:"function"!=typeof t[n].init2},(function(){t[n].init2()}))},error:function(){$("#contentframe").empty()}})))},t.menuarray=function(t){this.array=[],this.sep=function(){this.length>0&&"separator"!==this.array[array.length-1].fnc&&this.push({fnc:"separator"})},this.push=function(t){return void 0===t?null:(!0===Array.isArray(t)?Array.prototype.push.apply(this.array,t):"object"==typeof t&&this.array.push(t),t)},this.unshift=function(t){return void 0===t?null:(!0===Array.isArray(t)?Array.prototype.unshift.apply(this.array,t):"object"==typeof t&&this.array.unshift(t),t)},this.push(t)},t.menu=function(e,n){e=e||[];var r=$(this).removeClass("vis");if(!0===bool(n,!0)&&!1===r.is("#mainmenu")&&r.empty(),!1===bool(n,!1)&&r.is("#sidebar,#topbar")&&(e.unshift({id:"sbctrl",glyph:"glyphicon-th-list",aclass:"fbtn",fnc:function(){$lf()}}),$lf(0)),0===(e||[]).length)r.empty().addClass("hd");else{r.removeClass("hd");var i=!0===r.is("nav")?r:r.children("nav");1!==i.length&&(i=$("").tC("nv",r.is("#sidebar")).tC("ctxt",r.is("#topbar")).appendTo(r));var o,a=$$.ul().appendTo(i),s=function(t,e){var n=$(this).addClass("dropdown submenu");t.append($$.sc("caret dd")).addClass("dds dropdown-toggle").attr({"aria-expanded":"false"}),""!==(e.ico||"")&&t.prepend($$.sc("ico "+e.ico));var r=$$.ul({class:"dropdown-menu",role:"menu"}).appendTo(n);$.each(e.itm||[],(function(t,e){o.call(r,e)}))},l=function(t){$(this).tC("disabled","boolean"==typeof t.disabled?t.disabled:"string"==typeof t.disabled&&"subs"===t.disabled&&0===(t.itm||[]).length)};o=function(e){var n,r=$$.li({id:e.id}).attr(e.attr||{}).addClass(e.lclass).appendTo($(this)),i="string"==typeof e.fnc&&""!==e.fnc?e.fnc.split(":")[0]:"";""!==i&&"init"!==i?r.attr("role",i).appendIf($$.s(e.lbl),""!==ne(e.lbl)):(n=$$.a({class:"on",role:"button"}).addClass(e.aclass).appendTo(r).append($$.s(e.lbl)),l.call(n,e),(e.itm||[]).length>0&&s.call(r,n,e),n.click($nuf),"function"==typeof e.fnc?n.click(e.data||{},e.fnc):"init"===i&&n.click($.extend({},e.data||{},{fn:e.fnc.split(":")[1]}),t.init))},$.each(e,(function(e,n){var r,i=$$.li({id:n.id}).attr(n.attr||{}).addClass(n.lclass),s="string"==typeof n.fnc&&""!==n.fnc?n.fnc.split(":")[0]:"";if(""!==s&&"init"!==s)i.attr("role",s).appendIf($$.s(n.lbl),""!==ne(n.lbl));else{if(r=$$.a({class:"on",role:"button"}).addClass(n.aclass).appendTo(i),l.call(r,n),""!==(n.lbl||"")&&r.append($$.s(n.lbl)),""!==(n.ico||"")&&r.prepend($$.sc("ico "+n.ico)),""!==(n.glyph||"")&&r.prepend($$.sc("glyphicon "+n.glyph)),(n.itm||[]).length>0){i.addClass("dropdown"),r.append($$.sc("caret dd")).addClass("dds dropdown-toggle").attr({"aria-expanded":"false"});var c=$$.ul({class:"dropdown-menu",role:"menu"}).appendTo(i);$.each(n.itm||[],(function(t,e){o.call(c,e)}))}(n.sel||[]).length>0||(r.click($nuf),"function"==typeof n.fnc?r.click(n.data||{},n.fnc):"init"===s&&r.click($.extend({},n.data||{},{fn:n.fnc.split(":")[1]}),t.init))}i.appendTo(a)})),i.activatemenu()}},t.easytbl=(t,e)=>{e=e||{};let n=$$.tbl().addClass(e.class).css("border-collapse","collapse"),r=($$.tbody(n),!0===bool(e.frame,!1)?{padding:"5px",border:"1px solid #727272"}:{});if(!0===Array.isArray(e.header)){let t=$$.thead(n);$.each(e.header,((n,i)=>$$.th(t).css(e.cellcss||r).rwText(i)))}else if(!0===bool(e.header,!1)&&(t||[]).length>0){let i=$$.thead(n);$.each(Object.keys(t[0]),((t,n)=>$$.th(i).css(e.cellcss||r).rwText(n)))}return $.each(t||[],((t,i)=>{let o=$$.tr();$.each(i,((t,n)=>{n=n||"";let i=$$.td(o).css(e.cellcss||r);n instanceof jQuery?i.append(n):"string"==typeof n&&("<"===n.substring(0,1)?i.append(n):i.text(n))})),n.append(o)})),n},t.dlgtbl=(e,n,r)=>{r=r||{};let i=t.easytbl(e,r);t.dlg(i,$.extend({title:n},r))},t.dlg=function(t,n){n=n||{};let r=$("body > .modal").length>0,i=t=>typeof n[t],o=t=>"function"===i(t);if(!0===bool(n.exclusive,!0)&&!0===r)return void alert($t.dbldlg||"Es ist bereits ein Dialog geöffnet");let a=$$.dc("modal",$("body")),s=$$.dc("modal-dialog",a);!1===isNaN(n.zindex)?a.css("zIndex",n.zindex):!0===r&&a.css("zIndex",parseInt($("body > .modal:last").cssValue("zIndex"))+200),!1===isNaN(n.zindex_min)&&a.cssValue("zIndex")').appendTo(u)),""!==ne(n.title)&&(l=$$.dc("modal-header",u),$("

        ").text(n.title).appendTo(l));let p=$$.dc("modal-body",u),m=$$.dc("modal-footer",u);t instanceof jQuery==!0&&p.append(t);let h=function(t){t&&"function"==typeof t.stopPropagation&&t.stopPropagation(),s.removeClass("in"),!0===o("closing")&&n.closing.call(u),p.hide().emptyWithEditors(),a.remove(),!0===o("close")&&n.close.call(u)};if(u.find(":input[required]").length>0&&($$.dc("note_required",m).append($$.sc("ind_required","*")).append($$.s($t.t1||"Eingabe erforderlich")),$$.dc("note_invalid",m).append($$.s($t.t2||"Bitte überprüfen Sie Ihre Eingaben im Formular."))),!0===o("cancel")){$$.bbtn(n.cancelbutton||"Abbrechen","cancel").attr({type:"button",role:"cancel"}).appendTo(m).click((function(t){n.cancel.call(u,t);t.stopPropagation(),h()}))}if(!0===o("confirm")){let t=$$.bbtn(n.button||"OK","confirm").attr({type:!0===bool(n.form,!1)?"submit":"button",role:"confirm"}).appendTo(m);!0===f?(u.submit((function(t){try{n.confirm.call(u,t)}finally{t.preventDefault()}return!1})),u.on("modal_submit",(function(){n.confirm.call(u,e)}))):(t.click((function(t){n.confirm.call(u,t);t.stopPropagation()})),u.on("modal_submit",(function(){t.click()})))}else!0===f&&u.submit((function(t){return t.preventDefault(),!1}));return u.on("modal_close",(function(){h()})),c.click(h),!0===o("opening")&&n.opening.call(u),s.addClass("in"),ne(n.mode).indexOf("maxbody")>-1&&p.css("min-height",(d.height()-l.outerHeight()-m.outerHeight()).toString()+"px"),!0===o("open")&&n.open.call(u),{hd:l,bdy:p,ft:m,ct:d,dlg:s,c:u}},t.mform=function(e){let n=$$.dc("form-body"),r=Array.isArray(e)?e:e instanceof fields_definition?e.fields:[];return $.each(r||[],(function(e,r){let i=r.type||"";if("ignore"===i)return!0;let o=$$.dc("form-group",n),a=r.id||"dlg_"+(r.name||"")+("html"===r.type?"_"+(65536*(1+Math.random())||0).toString(16).substr(9):""),s=$$.lbl(r.label||r.name,{for:a}).appendTo($$.dc("form-itm",o)),l=$$.dc("form-itm",o),c=$$.i({id:a,name:r.name,placeholder:r.placeholder,type:r.type});switch(i){case"email":r.pattern=ne(r.pattern,"[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,}$");break;case"url":r.pattern=ne(r.pattern,"https?://.+");break;case"number":r.pattern=ne(r.pattern,"[-+]?[0-9]*[.,]?[0-9]*"),c.attr("step",r.precision||"any"),c.attr("data-format","float");break;case"integer":case"int":r.pattern=ne(r.pattern,"[-+]?[0-9]*"),c.attr("type","number"),c.attr("data-format","integer");break;case"date":if(""!==ne(r.pattern,$t.datepattern)&&(r.pattern=ne(r.pattern,"("+$t.datepattern+")|([0-9]{4}.(0[1-9]|1[012]).(0[1-9]|1[0-9]|2[0-9]|3[01]))")),""!==ne(r.placeholder,$t.dateplaceholder)&&c.attr("placeholder",ne(r.placeholder,$t.dateplaceholder)),"string"==typeof r.value){var d=r.value.substr(0,10);r.value="date"!==c.prop("type")?fdt(d+"T00:00:00",ne(r.dateformat,$t.dateformat)):d}c.attr("data-format","date:"+ne(r.dateformat,$t.dateformat)+";yyyy-MM-dd");break;case"datetime":c.attr("type","datetime-local"),""!==ne(r.pattern,$t.datetimepattern)&&(r.pattern=ne(r.pattern,"("+$t.datetimepattern+")|([0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])\\s([0-5][0-9]):([0-5][0-9]))")),""!==ne(r.placeholder,$t.datetimeplaceholder)&&c.attr("placeholder",ne(r.placeholder,$t.datetimeplaceholder)),"string"==typeof r.value&&"T"===r.value.substr(10,1)&&(r.value="datetime"!==c.prop("type").substr(0,8)?fdt(r.value,ne(r.datetimeformat,$t.datetimeformat)):r.value),c.attr("data-format","datetime:"+ne(r.datetimeformat,$t.datetimeformat)+";yyyy-MM-dd HH:mm:ss");break;case"hidden":o.addClass("hd");break;case"html":case"text":c=$$.txt({id:a,name:r.name,placeholder:r.placeholder,type:r.type}),c.tC("tinymce","html"===r.type);break;case"bool":case"boolean":r.url=[{value:"true",label:($t||{}).true||"Yes"},{value:"false",label:($t||{}).false||"No"}],"boolean"==typeof r.value&&(r.value=r.value?"true":"false");case"select":c=$$.sel({id:a,name:r.name,type:r.type}),!1===bool(r.required,!1)&&$$.eOpt().appendTo(c);try{var u=function(t){!0===Array.isArray(t)&&$.each(t,(function(t,e){"string"==typeof e?$$.opt(e,e).appendTo(c):!0===Array.isArray(e)?$$.opt(e[0],e[1]).appendTo(c):"object"==typeof e&&$$.opt(e.value,e.label||e.text).appendTo(c)}))};!0===Array.isArray(r.url)?u(r.url):"function"==typeof r.url?r.url.call(c):"string"==typeof r.url&&t.postXT({url:r.url,success:u})}catch(t){$.noop()}break;default:""!==ne(r["max-length"])&&c.attr("max-length",r["max-length"])}""!==ne(r.pattern)&&c.attr("pattern",r.pattern),c.val(r.value).change(),c.change((function(){$(this)[0].setCustomValidity("")})),c.addClass("form-control").prop("required",bool(r.required,!1)).prop("readonly",bool(r.readonly,!1)).appendTo(l),!0===bool(r.required,!1)&&s.append($$.sc("ind_required","*")),"object"==typeof r.attr&&c.attr(r.attr),"object"==typeof r.prop&&c.prop(r.prop),"string"==typeof r.class&&c.addClass(r.class),"function"==typeof r.change&&(c.change(r.change),!0===bool(r.applychange,!1)&&void 0!==r.value&&c.change()),""!==(r.note||"")&&$$.dc("form-note",l).rwText(r.note),"function"==typeof r.complete&&r.complete.call(c)})),n},t.initMCE=function(t,e){t=$(t),e=e||{};try{let n={target:t[0],inline:!1,width:e.width||"100%",statusbar:!1,document_base_url:window.location.origin+"/",content_style:"ph:before {content: '«'; color: #BBB; font-style:italic; } ph:after {content: '»'; color: #BBB; font-style:italic; } ph { color: #AAA; font-style:italic; }",relative_urls:!1,remove_script_host:!1};!0===bool(e.hidemenu,!1)&&(n.menubar=!1,n.menu={}),!0===bool(e.hidetoolbar,!1)&&(n.toolbar=!1),$.extend(n,e||{}),tinymce.init(n)}catch(t){alert(t.message)}},t.dlgform=function(e,n){n=n||{};let r,i=$$.dc("frm").append(t.mform(e||[]).addClass("stacked"));n.addcontent instanceof jQuery&&i.append(n.addcontent),"function"==typeof n.submit?r=n.submit:"function"==typeof n.success&&(r=function(e){var r=$(this).ldng(1),i=$.extend({loginaccount:t.auth.account||""},r.serializeObject(bool(n.checkvalidity,!0),{typedvalues:bool(n.typedvalues,!1)}));""!==(n.url||"")?t.postXT({url:n.url,data:i,success:function(t){n.success.call(this,t),r.trigger("modal_close")},error:function(){alert($t.l17)},complete:function(){r.ldng(0)},timeout:6e4}):(n.success.call(this,i),r.trigger("modal_close"))});let o={form:!0,title:n.title||"",button:n.button||$t.submit,confirm:r,size:n.size||[500,600],open:function(){let e=$(this).find(".tinymce");e.length>0&&t.initMCE(e,n.tinymce||{})}};return t.dlg.call(this,i,o)},t.login.dlg=function(e){e=e||{};let n=[{name:"userinfo",label:$t.l1,type:"string",value:t.auth.login,change:t.login.uichange,required:!0},{name:"userlogin",type:"hidden",required:!0,value:t.auth.login},{name:"username",type:"string",label:$t.l4,required:!0,readonly:!0,placeholder:$t.l5,value:t.auth.fullname_rev},{name:"userpass",type:"password",label:$t.l3,required:!0,placeholder:$t.l3}];""===(t.auth.account||"")&&n.unshift({id:"dlg_loginaccount",name:"loginaccount",type:"string",required:!0,value:t.auth.account});let r=$$.dc("frm").append(t.mform(n).addClass("stacked")),i=t.dlg.call(this,r,{form:!0,title:$t.l0,button:$t.submit,confirm:function(n){var r=$(this).ldng(1),i=$.extend({loginaccount:t.auth.account||""},r.serializeObject());t.postXT({url:"/vt/login",data:i,success:function(n){""!==((n||{}).login||"")&&(r.trigger("modal_close"),t.auth=n,"object"==typeof e.ajo&&(e.ajo.islogin,$.ajax(e.ajo)))},error:function(){alert($t.l17)},complete:function(){r.ldng(0)},timeout:6e4})},size:[500,600]}),o=$$.dc("modal-content").css("height","auto").attr("novalidate","true").append($$.dc("modal-header").appendIf($("

        ").text(t.auth.accountname),""!==(t.auth.accountname||"")).append($("

        Vereinsmanager

        ")));i.dlg.prepend(o)},t.addNoEntryInfo=function(t){$(this).append($$.dc("noentryinfo").text(t||$t.t11))}}($ocms),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(t){var e=this;do{if(Element.prototype.matches.call(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}),function(t,e){var n,r;"object"==typeof window&&(window[t]=(n=function(t){var e=window,n=document.body,r=document.documentElement,i=Math.max(0,e.pageXOffset||r.scrollLeft||n.scrollLeft||0)-(r.clientLeft||0),o=Math.max(0,e.pageYOffset||r.scrollTop||n.scrollTop||0)-(r.clientTop||0);return{x:t?Math.max(0,t.pageX||t.clientX||0)-i:0,y:t?Math.max(0,t.pageY||t.clientY||0)-o:0}},(r=function(t,e){t&&t instanceof Element&&(this._container=t,this._options=e||{},this._clickItem=null,this._dragItem=null,this._showDragItem="boolean"!=typeof this._options.dragItem||!1!==this._options.dragItem,this._hovItem=null,this._sortLists=[],this._click={},this._dragging=!1,this._dragHandleClass=this._options.dragHandleClass||"",this._parentident=this._options.parentident||"",this._swapdone="function"==typeof this._options.swapdone?this._options._swapdone:null,this._container.setAttribute("data-is-sortable",1),this._container.classList.add("sortable"),this._container.style.position="static",window.addEventListener("mousedown",this._onPress.bind(this),!0),window.addEventListener("touchstart",this._onPress.bind(this),!0),window.addEventListener("mouseup",this._onRelease.bind(this),!0),window.addEventListener("touchend",this._onRelease.bind(this),!0),window.addEventListener("mousemove",this._onMove.bind(this),!0),window.addEventListener("touchmove",this._onMove.bind(this),!0))}).prototype={constructor:r,toArray:function(t){t=t||"id";for(var e=[],n="",r=0;rr.left&&er.top&&n-1)&&e.className.indexOf("nosort")<0)&&(t.preventDefault(),this._dragging=!0,this._click=n(t),this._makeDragItem(e),this._onMove(t),!0)}t&&!1===e.call(this,t.target)&&""!==this._parentident&&t.target.closest(this._parentident)&&e.call(this,t.target.closest(this._parentident))},_onRelease:function(t){this._dragging=!1,this._trashDragItem()},_onMove:function(t){if(this._dragItem&&this._dragging){t.preventDefault();var e=n(t),r=this._container;!0===this._showDragItem&&this._moveItem(this._dragItem,e.x-this._click.x,e.y-this._click.y);for(var i=0;i0?s.mousedown(l).addClass("dctrl"):a.mousedown(l).addClass("dctrl"),t(this)}}(jQuery),$(document).ready((function(){$("html").click((function(t){$nuf()})),$("#listframe").click((function(t){t.stopPropagation(),$nuf()})),$("#mainmenu").ocmsmenu($ocms.ocmsmenu),$("#mainmenu").activatemenu()})),$.extend($t,{m_inv:"Rechnungen",m_req:"Aufträge",m_rep:"Berichte",m_todo:"ToDos",m_bcd:"BankBuchungen",rsp:"Passwort ändern",pnm:"Die Passwörter stimmen nicht überein",cps:"Das neue Passwort wurde gespeichert.",pwr:"Bitte wählen Sie ein starkes Passwort (min 8 Zeichen, davon jeweils min 2 Zahlen, kleine und große Buchstaben, Sonderzeichen sind optional).",smsc:"Sie beötigen für diese Funktion einen SMS-Code.\nSoll dieser nun versandt werden?",wdc:"Doppelt klicken, um die Box zu aktualisieren.",wdg:{}}),$t.rspf={sms:"Der SMS-Code konnte nicht bestätigt werden",valid:"Das alte Passwort ist nicht korrekt",requirements:"Das Passwort entspricht nicht den Anforderungen.\n"+$t.pwr},$fd={rsp:new fields_definition("","",[{name:"opw",label:"aktuelles Passwort",type:"password",required:!0,attr:{"auto-complete":"current-password"}},{name:"npw",label:"neues Passwort",type:"password",required:!0,pattern:"(.{6,})",attr:{"auto-complete":"new-password"}},{name:"npwc",label:"neues Passwort (Bestätigung)",type:"password",required:!0,attr:{"auto-complete":"new-password"},note:$t.pwr},{name:"code",label:"SMS-Code",type:"string",required:!0,attr:{"auto-complete":"one-time-code"}}])},$ocms.init=function(t){var e="string"==typeof t?t:(t.data||{}).fn||"";""!==e&&("home"===e?($cfr(),$lfr(),$("#topbar").ocmsmenu([],!0),$("#activemodule").text($t.ov),$fis.ov()):($cfr(),$lfr(),$("#topbar").ocmsmenu([]),$ocms.postXT({url:$ocms.url(e+"/auth"),success:function(t){void 0===$ocms[e]&&($ocms[e]={}),$ocms[e].auth=t,t.manage>0&&$ocms.getScript({module:e,script:["/web/fis",e,$ocms.auth.locale||"de","js"].join("."),css:["/web/fis",e,"css"].join("."),condition:"function"!=typeof $ocms[e].init2},(function(){$ocms[e].init2()}))},error:function(){$("#contentframe").empty()}})))};var $fis={auth:{},db:function(){$("#mainmenu_activemodule").text($t.ov);let t=$(this).empty(),e=$$.d({id:"dashboard_frame"}).appendTo(t);$ocms.postXT({url:$ocms.url("wdg/my"),success:function(t){$.each(t,(function(t,n){var r=$$.dc("wdg_frame",e,{"data-wdg":n}).ldng(1);$ocms.wdg.call(r,{wdg:n})}))},loading:e})},ValidateEmail:function(t){return!!/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(t)},cf:t=>{let e=$("#contentframe");return!0===bool(t,!1)&&e.empty().rC("hd"),e},lf:t=>{let e=$("#listframe");return!0===bool(t,!1)&&e.empty().aC("hd").rC("fix"),e},frm_edit:function(t){let e=$fis.cf(!1),n=e.children(".cfrm"),r=e.children(".edit_frm");return n.length<1?n=$$.dc("cfrm hd").prependTo(e):!0===bool(t,!1)&&n.empty(),r.length<1&&(r=$$.dc("edit_frm").insertAfter(n)),r.empty()},frm_list:function(t,e){let n=$fis.cf(!1),r=n.children(".cfrm"),i=n.children(".list_frm");return r.length<1?r=$$.dc("cfrm hd").prependTo(n):!0===bool(t,!1)&&r.empty(),!0===bool(e,!1)&&n.children(".edit_frm").remove(),i.length<1&&(i=$$.dc("list_frm").appendTo(n)),i.empty()},lfm:()=>{let t=$fis.lf(!1),e=t.children(".lfrm");return e.length<1&&(e=$$.dc("lfrm").prependTo(t)),e},getAuth:(t,e)=>new Promise(((n,r)=>{$fis.auth[t]&&!1===bool(e,!1)?n($fis.auth[t]||-1):$ocms.postXT({url:$ocms.url("auth"),data:{module:t},success:e=>{$fis.auth[t]=e.auth||-1,n($fis.auth[t]||-1)},error:()=>{r()}})})),prepAuth:t=>new Promise(((e,n)=>{$ocms.postXT({url:$ocms.url("auth"),data:{module:t,array:1},success:t=>{$.extend($fis.auth,t||{})},complete:()=>{e()}})})),isAuth:(t,e)=>($fis.auth[t]||-1)>=(e||1),resetPass:function(t,e){confirm($t.smsc)&&($ocms.postXT({url:$ocms.url("account/sms"),data:{fn:"pwc"}}),$ocms.dlgform($fd.rsp.clone(),{title:$t.rsp||"",submit:function(t){var e=$(this).ldng(1),n=$.extend({loginaccount:$ocms.auth.account||""},e.serializeObject(!0,{typedvalues:!0}));(n.npw||"")!==(n.npwc||"")?e.find('input[name="npw"]:first')[0].setCustomValidity($t.pnm):$ocms.postXT({url:$ocms.url("account/changepassword"),data:n,success:function(t){alert($t.cps),e.trigger("modal_close")},error:function(t){alert($t.rspf[t.getResponseHeader("x-ocms-std")])},complete:function(){e.ldng(0)},timeout:6e4})}}))},wdg:function(t){let e=$(this).empty();$ocms.postXT({url:$ocms.url("wdg/one"),data:{short_name:t.wdg},success:function(n,r,i){let o=t.wdg,a=n[o];if(!a)return void e.ldng(0);let s=$.inArrayRegEx("dblwidth",a.rendering_options)>-1,l=$.inArrayRegEx("tiny",a.rendering_options)>-1;e.toggleClass("dbl",s&&!l).toggleClass("tny",l);$$.dc("wdg_hd",e,{title:ne(a.description,$t.wdc)}).toggleClass("dbl",s).text(ne(a.name,t.wdg)).dblclick((function(t){t.stopPropagation(),$fis.wdg.call(e,{wdg:o})}));let c=$$.dc("wdg_cnt",e).toggleClass("dbl",s).hide(),d=$.inArrayRegEx("bgcolor",a.rendering_options);switch(d>-1&&c.css("backgroundColor",a.rendering_options[d].toString().right(":")),a.type){case"table":var u=$$.tblset({},c),f=$$.tr().appendTo(u.hd),p=$t.wdg[o.indexOf("wdg_ev_")>=0?"wdg_ev_":o]||{};$.each(a.columns,(function(t,e){var n=p[e]?p[e].label:e;$$.th().text(n).appendTo(f)})),$.each(a.data,(function(t,e){var n=$$.tr().appendTo(u.bdy);$.each(a.columns,(function(t,r){var i=$$.td().appendTo(n);e[r]instanceof Date||!0===$ocms.isDateString(e[r])?i.text(fdt(e[r],$t.dateformat)):i.rwText(e[r])}))})),$.inArray("firstrow_bold",a.rendering_options)>-1&&f.nextAll("tr:first").css("font-weight","bold");break;case"ind":$$.dc("ind",c).addClass("sts_"+(a.data.status||"")).append([$$.dc("ind").text(a.data.value),$$.lbl(a.data.label)]);break;case"image_url":c.css("background","url('"+a.url+"') no-repeat center center transparent");break;case"image_base64":c.css("background","url('data:image/png;base64,"+a.image+"') no-repeat center center transparent");break;case"html":if(c.html(a.html),$.inArray("reload_10min",a.rendering_options)>-1){var m=c.find("iframe");setTimeout((function(){m.attr("src",(function(t,e){return e}))}),6e5)}}$.inArray("reload_30min",a.rendering_options)>-1&&"html"!==a.type&&setTimeout((function(){$fis.wdg.call(e,{wdg:o})}),18e5),c.slideDown(150)},error:function(t){e.slideUp(150),$fis.failure.call(this,t)},complete:function(){e.ldng(0)}})},ov:function(){$fis.lf(!0);let t=$("#contentframe").empty(),e=$$.d({id:"dashboard_frame"}).appendTo(t);$ocms.postXT({url:$ocms.url("wdg/my"),success:function(t){$.each(t,(function(t,n){var r=$$.dc("wdg_frame",e,{"data-wdg":n}).ldng(1);$fis.wdg.call(r,{wdg:n})}))},loading:e})}};Array.prototype.push.apply($ocms.ocmsmenu,[{lbl:$t.m_inv,id:"m_inv",fnc:"init:inv",ico:"glyphicon glyphicon-list-alt"},{lbl:$t.m_req,id:"m_req",fnc:"init:req",ico:"glyphicon glyphicon-eur"},{lbl:$t.m_bcd,id:"m_bcd",fnc:"init:bam",ico:"glyphicon glyphicon-indent-right"},{fnc:"separator"},{lbl:$t.m_rep,id:"m_rep",fnc:"init:rep",ico:"glyphicon glyphicon-dashboard"},{fnc:"separator"},{lbl:$t.m_todo,id:"m_todo",fnc:()=>{$("#contentframe").empty().load($ocms.url("todos")),$("#listframe").rC("fix").aC("hd")},ico:"glyphicon glyphicon-sunglasses"}]),$(document).ready((function(){$fis.ov()})); \ No newline at end of file diff --git a/Fuchs/wwwroot/web/tools.js b/Fuchs/wwwroot/web/tools.js index f36c9c0..ceb47a5 100644 --- a/Fuchs/wwwroot/web/tools.js +++ b/Fuchs/wwwroot/web/tools.js @@ -1,5 +1,4 @@ +/*! js-cookie v3.0.1 | MIT */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self,function(){var n=e.Cookies,o=e.Cookies=t();o.noConflict=function(){return e.Cookies=n,o}}())}(this,(function(){"use strict";function e(e){for(var t=1;t+~]|"+ge+")"+ge+"*"),x=new RegExp(ge+"|>"),j=new RegExp(g),A=new RegExp("^"+t+"$"),D={ID:new RegExp("^#("+t+")"),CLASS:new RegExp("^\\.("+t+")"),TAG:new RegExp("^("+t+"|[*])"),ATTR:new RegExp("^"+p),PSEUDO:new RegExp("^"+g),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ge+"*(even|odd|(([+-]|)(\\d*)n|)"+ge+"*(?:([+-]|)"+ge+"*(\\d+)|))"+ge+"*\\)|)","i"),bool:new RegExp("^(?:"+f+")$","i"),needsContext:new RegExp("^"+ge+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ge+"*((?:-\\d)?\\d*)"+ge+"*\\)|)(?=[^-]|$)","i")},N=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,L=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,H=/[+~]/,O=new RegExp("\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\([^\\r\\n\\f])","g"),P=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},M=function(){V()},R=J(function(e){return!0===e.disabled&&fe(e,"fieldset")},{dir:"parentNode",next:"legend"});try{k.apply(oe=ae.call(ye.childNodes),ye.childNodes),oe[ye.childNodes.length].nodeType}catch(e){k={apply:function(e,t){me.apply(e,ae.call(t))},call:function(e){me.apply(e,ae.call(arguments,1))}}}function I(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(V(e),e=e||T,C)){if(11!==p&&(u=L.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return k.call(n,a),n}else if(f&&(a=f.getElementById(i))&&I.contains(e,a)&&a.id===i)return k.call(n,a),n}else{if(u[2])return k.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&e.getElementsByClassName)return k.apply(n,e.getElementsByClassName(i)),n}if(!(h[t+" "]||d&&d.test(t))){if(c=t,f=e,1===p&&(x.test(t)||m.test(t))){(f=H.test(t)&&U(e.parentNode)||e)==e&&le.scope||((s=e.getAttribute("id"))?s=ce.escapeSelector(s):e.setAttribute("id",s=S)),o=(l=Y(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+Q(l[o]);c=l.join(",")}try{return k.apply(n,f.querySelectorAll(c)),n}catch(e){h(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return re(t.replace(ve,"$1"),e,n,r)}function W(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function F(e){return e[S]=!0,e}function $(e){var t=T.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function B(t){return function(e){return fe(e,"input")&&e.type===t}}function _(t){return function(e){return(fe(e,"input")||fe(e,"button"))&&e.type===t}}function z(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&R(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function X(a){return F(function(o){return o=+o,F(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function U(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function V(e){var t,n=e?e.ownerDocument||e:ye;return n!=T&&9===n.nodeType&&n.documentElement&&(r=(T=n).documentElement,C=!ce.isXMLDoc(T),i=r.matches||r.webkitMatchesSelector||r.msMatchesSelector,r.msMatchesSelector&&ye!=T&&(t=T.defaultView)&&t.top!==t&&t.addEventListener("unload",M),le.getById=$(function(e){return r.appendChild(e).id=ce.expando,!T.getElementsByName||!T.getElementsByName(ce.expando).length}),le.disconnectedMatch=$(function(e){return i.call(e,"*")}),le.scope=$(function(){return T.querySelectorAll(":scope")}),le.cssHas=$(function(){try{return T.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),le.getById?(b.filter.ID=function(e){var t=e.replace(O,P);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(O,P);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},b.find.CLASS=function(e,t){if("undefined"!=typeof t.getElementsByClassName&&C)return t.getElementsByClassName(e)},d=[],$(function(e){var t;r.appendChild(e).innerHTML="",e.querySelectorAll("[selected]").length||d.push("\\["+ge+"*(?:value|"+f+")"),e.querySelectorAll("[id~="+S+"-]").length||d.push("~="),e.querySelectorAll("a#"+S+"+*").length||d.push(".#.+[+~]"),e.querySelectorAll(":checked").length||d.push(":checked"),(t=T.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),r.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(t=T.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||d.push("\\["+ge+"*name"+ge+"*="+ge+"*(?:''|\"\")")}),le.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),l=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!le.sortDetached&&t.compareDocumentPosition(e)===n?e===T||e.ownerDocument==ye&&I.contains(ye,e)?-1:t===T||t.ownerDocument==ye&&I.contains(ye,t)?1:o?se.call(o,e)-se.call(o,t):0:4&n?-1:1)}),T}for(e in I.matches=function(e,t){return I(e,null,null,t)},I.matchesSelector=function(e,t){if(V(e),C&&!h[t+" "]&&(!d||!d.test(t)))try{var n=i.call(e,t);if(n||le.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){h(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(O,P),e[3]=(e[3]||e[4]||e[5]||"").replace(O,P),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||I.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&I.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return D.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&j.test(n)&&(t=Y(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(O,P).toLowerCase();return"*"===e?function(){return!0}:function(e){return fe(e,t)}},CLASS:function(e){var t=s[e+" "];return t||(t=new RegExp("(^|"+ge+")"+e+"("+ge+"|$)"))&&s(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=I.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function T(e,n,r){return v(n)?ce.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?ce.grep(e,function(e){return e===n!==r}):"string"!=typeof n?ce.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(ce.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||k,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:S.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ce?t[0]:t,ce.merge(this,ce.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:C,!0)),w.test(r[1])&&ce.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=C.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(ce):ce.makeArray(e,this)}).prototype=ce.fn,k=ce(C);var E=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){while((e=e[t])&&1!==e.nodeType);return e}ce.fn.extend({has:function(e){var t=ce(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;xe=C.createDocumentFragment().appendChild(C.createElement("div")),(be=C.createElement("input")).setAttribute("type","radio"),be.setAttribute("checked","checked"),be.setAttribute("name","t"),xe.appendChild(be),le.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML="",le.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue,xe.innerHTML="",le.option=!!xe.lastChild;var ke={thead:[1,"","
        "],col:[2,"","
        "],tr:[2,"","
        "],td:[3,"","
        "],_default:[0,"",""]};function Se(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&fe(e,t)?ce.merge([e],n):n}function Ee(e,t){for(var n=0,r=e.length;n",""]);var je=/<|&#?\w+;/;function Ae(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function Re(e,t){return fe(e,"table")&&fe(11!==t.nodeType?t:t.firstChild,"tr")&&ce(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function We(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(_.hasData(e)&&(s=_.get(e).events))for(i in _.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),C.head.appendChild(r[0])},abort:function(){i&&i()}}});var Jt,Kt=[],Zt=/(=)\?(?=&|$)|\?\?/;ce.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Kt.pop()||ce.expando+"_"+jt.guid++;return this[e]=!0,e}}),ce.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Zt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Zt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Zt,"$1"+r):!1!==e.jsonp&&(e.url+=(At.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||ce.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=ie[r],ie[r]=function(){o=arguments},n.always(function(){void 0===i?ce(ie).removeProp(r):ie[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Kt.push(r)),o&&v(i)&&i(o[0]),o=i=void 0}),"script"}),le.createHTMLDocument=((Jt=C.implementation.createHTMLDocument("").body).innerHTML="
        ",2===Jt.childNodes.length),ce.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(le.createHTMLDocument?((r=(t=C.implementation.createHTMLDocument("")).createElement("base")).href=C.location.href,t.head.appendChild(r)):t=C),o=!n&&[],(i=w.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,o),o&&o.length&&ce(o).remove(),ce.merge([],i.childNodes)));var r,i,o},ce.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(ce.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},ce.expr.pseudos.animated=function(t){return ce.grep(ce.timers,function(e){return t===e.elem}).length},ce.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=ce.css(e,"position"),c=ce(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=ce.css(e,"top"),u=ce.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),v(t)&&(t=t.call(e,n,ce.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},ce.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ce.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===ce.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===ce.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=ce(e).offset()).top+=ce.css(e,"borderTopWidth",!0),i.left+=ce.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-ce.css(r,"marginTop",!0),left:t.left-i.left-ce.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===ce.css(e,"position"))e=e.offsetParent;return e||J})}}),ce.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;ce.fn[t]=function(e){return M(this,function(e,t,n){var r;if(y(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),ce.each(["top","left"],function(e,n){ce.cssHooks[n]=Ye(le.pixelPosition,function(e,t){if(t)return t=Ge(e,n),_e.test(t)?ce(e).position()[n]+"px":t})}),ce.each({Height:"height",Width:"width"},function(a,s){ce.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){ce.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return M(this,function(e,t,n){var r;return y(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?ce.css(e,t,i):ce.style(e,t,n,i)},s,n?e:void 0,n)}})}),ce.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ce.fn[t]=function(e){return this.on(t,e)}}),ce.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),ce.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){ce.fn[n]=function(e,t){return 0