Merge branch 'master' of ssh://float.ownsoft.de/git/beyondSoft/BeWo into master
This commit is contained in:
@@ -432,54 +432,8 @@ namespace BeWo.Scheduler.View
|
||||
ConstructObject();
|
||||
}
|
||||
|
||||
// ToDo: In den Cache verschieben
|
||||
private static void GetCacheObjects(Action<List<CompactCustomerDC>, List<CompactEmployeeDC>, Dictionary<ValueListEntryDC, List<ResourceDC>>> callback)
|
||||
{
|
||||
//Cache.GetInstance().GetAllActiveEmployeesCompact(allEmployees =>
|
||||
//{
|
||||
// this.Dispatch(() =>
|
||||
// {
|
||||
// Cache.GetInstance().GetAllActiveCustomersCompact(allCustomers =>
|
||||
// {
|
||||
// this.Dispatch(() =>
|
||||
// {
|
||||
// Cache.GetInstance().GetCategories2ResourcesDictionary(resourceDictionary =>
|
||||
// {
|
||||
// this.Dispatch(() =>
|
||||
// {
|
||||
// if(!BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen))
|
||||
// {
|
||||
// allEmployees = new List<CompactEmployeeDC> {BeWoApp.CompactLoggedOnEmployee};
|
||||
// }
|
||||
|
||||
// var darfKlientenAnsichtSehen = BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyTeams) || BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyCustomers) || BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View);
|
||||
// var darfTermineAllerKlientenSehen = BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderKliententermineAlleAnsehen);
|
||||
|
||||
// if(darfKlientenAnsichtSehen)
|
||||
// {
|
||||
// if(!darfTermineAllerKlientenSehen || !BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View))
|
||||
// {
|
||||
// allCustomers = allCustomers.Where(w => w.IsRelatedToEmployee).ToList();
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// allCustomers.Clear();
|
||||
// }
|
||||
|
||||
// if(!BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderRessourcentermineAnsehen))
|
||||
// {
|
||||
// resourceDictionary.Clear();
|
||||
// }
|
||||
|
||||
// callback(allCustomers, allEmployees, resourceDictionary);
|
||||
// });
|
||||
// });
|
||||
// });
|
||||
// });
|
||||
// });
|
||||
//});
|
||||
|
||||
Cache.GetInstance().GetSchedulerObjects(callback);
|
||||
}
|
||||
|
||||
|
||||
@@ -4387,6 +4387,11 @@
|
||||
<Content Include="node_modules\signature_pad\docs\index.html" />
|
||||
<Content Include="node_modules\signature_pad\docs\js\app.js" />
|
||||
<Content Include="node_modules\signature_pad\docs\js\signature_pad.umd.js" />
|
||||
<Content Include="node_modules\signature_pad\src\bezier.js" />
|
||||
<Content Include="node_modules\signature_pad\src\point.js" />
|
||||
<Content Include="node_modules\signature_pad\src\signature_event_target.js" />
|
||||
<Content Include="node_modules\signature_pad\src\signature_pad.js" />
|
||||
<Content Include="node_modules\signature_pad\src\throttle.js" />
|
||||
<Content Include="node_modules\source-map\dist\source-map.debug.js" />
|
||||
<Content Include="node_modules\source-map\dist\source-map.js" />
|
||||
<Content Include="node_modules\source-map\dist\source-map.min.js" />
|
||||
@@ -5036,6 +5041,13 @@
|
||||
<Content Include="node_modules\xpath\package.json" />
|
||||
<Content Include="node_modules\xpath\README.md" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="node_modules\signature_pad\src\bezier.js.map" />
|
||||
<Content Include="node_modules\signature_pad\src\point.js.map" />
|
||||
<Content Include="node_modules\signature_pad\src\signature_event_target.js.map" />
|
||||
<Content Include="node_modules\signature_pad\src\signature_pad.js.map" />
|
||||
<Content Include="node_modules\signature_pad\src\throttle.js.map" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
|
||||
@@ -47,8 +47,6 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
public ActionResult ReportViewer()
|
||||
{
|
||||
TempData["ErrorTest"] = "Das ist nur ein Test.";
|
||||
|
||||
Model.Report = null;
|
||||
|
||||
var month = DateTime.Today.Month;
|
||||
@@ -217,8 +215,6 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public ActionResult LoadMitarbeiterstundenkonto(string parameters)
|
||||
{
|
||||
TempData["PartialViewErrorTest"] = "Das ist nur ein Test.";
|
||||
|
||||
if(Model?.Employee?.EmployeeOid is null)
|
||||
{
|
||||
return Logout();
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
@using BeWoPlanerMobil.Util
|
||||
@model BeWoPlanerMobil.Models.ReportViewerModel
|
||||
|
||||
<!--
|
||||
ToDo: Select für die Berichtsauswahl
|
||||
Berichte
|
||||
Mitarbeiterstundenkonto
|
||||
-->
|
||||
|
||||
<script>
|
||||
$(window).ready(function () {
|
||||
toggleMitarbeiterstundenForm();
|
||||
@@ -23,15 +17,6 @@ Mitarbeiterstundenkonto
|
||||
}
|
||||
}
|
||||
|
||||
// ToDo: Wird das noch gebraucht?
|
||||
function changeReportElements() {
|
||||
try {
|
||||
var selectedCustomReportOid = $("#msk-customReportSelect :selected").val();
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function loadCustomReport() {
|
||||
try {
|
||||
var selectedReportOid = $("#msk-customReportSelect").val();
|
||||
@@ -78,12 +63,7 @@ Mitarbeiterstundenkonto
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-8 col-lg-8 col-xl-9" id="msk-report-container">
|
||||
@if(TempData["PartialViewErrorTest"] != null && Html.IsInDebugMode())
|
||||
{
|
||||
<div class="alert alert-danger" role="alert">
|
||||
@TempData["PartialViewErrorTest"]
|
||||
</div>
|
||||
}
|
||||
|
||||
@if(!(Model.Report is null))
|
||||
{
|
||||
@Html.Partial("DocumentWebViewerPartial", Model)
|
||||
|
||||
@@ -461,14 +461,17 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@*
|
||||
ToDo: Hier weitermachen mit Fehlermeldung/Warnung in TempData
|
||||
*@
|
||||
@if(TempData["ErrorTest"] != null && Html.IsInDebugMode())
|
||||
|
||||
@if(!(TempData["ErrorMessage"] is null))
|
||||
{
|
||||
<div class="alert alert-danger" role="alert">
|
||||
@TempData["ErrorTest"]
|
||||
<div class="container-fluid mt-3">
|
||||
<div class="row d-flex justify-content-center">
|
||||
<div class="col-md-3 col-lg-4">
|
||||
<div class="alert alert-danger" role="alert">
|
||||
@TempData["ErrorMessage"]
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
70
BeWoPlanerMobil/node_modules/signature_pad/src/bezier.js
generated
vendored
Normal file
70
BeWoPlanerMobil/node_modules/signature_pad/src/bezier.js
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Bezier = void 0;
|
||||
var point_1 = require("./point");
|
||||
var Bezier = /** @class */ (function () {
|
||||
function Bezier(startPoint, control2, control1, endPoint, startWidth, endWidth) {
|
||||
this.startPoint = startPoint;
|
||||
this.control2 = control2;
|
||||
this.control1 = control1;
|
||||
this.endPoint = endPoint;
|
||||
this.startWidth = startWidth;
|
||||
this.endWidth = endWidth;
|
||||
}
|
||||
Bezier.fromPoints = function (points, widths) {
|
||||
var c2 = this.calculateControlPoints(points[0], points[1], points[2]).c2;
|
||||
var c3 = this.calculateControlPoints(points[1], points[2], points[3]).c1;
|
||||
return new Bezier(points[1], c2, c3, points[2], widths.start, widths.end);
|
||||
};
|
||||
Bezier.calculateControlPoints = function (s1, s2, s3) {
|
||||
var dx1 = s1.x - s2.x;
|
||||
var dy1 = s1.y - s2.y;
|
||||
var dx2 = s2.x - s3.x;
|
||||
var dy2 = s2.y - s3.y;
|
||||
var m1 = { x: (s1.x + s2.x) / 2.0, y: (s1.y + s2.y) / 2.0 };
|
||||
var m2 = { x: (s2.x + s3.x) / 2.0, y: (s2.y + s3.y) / 2.0 };
|
||||
var l1 = Math.sqrt(dx1 * dx1 + dy1 * dy1);
|
||||
var l2 = Math.sqrt(dx2 * dx2 + dy2 * dy2);
|
||||
var dxm = m1.x - m2.x;
|
||||
var dym = m1.y - m2.y;
|
||||
var k = l2 / (l1 + l2);
|
||||
var cm = { x: m2.x + dxm * k, y: m2.y + dym * k };
|
||||
var tx = s2.x - cm.x;
|
||||
var ty = s2.y - cm.y;
|
||||
return {
|
||||
c1: new point_1.Point(m1.x + tx, m1.y + ty),
|
||||
c2: new point_1.Point(m2.x + tx, m2.y + ty),
|
||||
};
|
||||
};
|
||||
// Returns approximated length. Code taken from https://www.lemoda.net/maths/bezier-length/index.html.
|
||||
Bezier.prototype.length = function () {
|
||||
var steps = 10;
|
||||
var length = 0;
|
||||
var px;
|
||||
var py;
|
||||
for (var i = 0; i <= steps; i += 1) {
|
||||
var t = i / steps;
|
||||
var cx = this.point(t, this.startPoint.x, this.control1.x, this.control2.x, this.endPoint.x);
|
||||
var cy = this.point(t, this.startPoint.y, this.control1.y, this.control2.y, this.endPoint.y);
|
||||
if (i > 0) {
|
||||
var xdiff = cx - px;
|
||||
var ydiff = cy - py;
|
||||
length += Math.sqrt(xdiff * xdiff + ydiff * ydiff);
|
||||
}
|
||||
px = cx;
|
||||
py = cy;
|
||||
}
|
||||
return length;
|
||||
};
|
||||
// Calculate parametric value of x or y given t and the four point coordinates of a cubic bezier curve.
|
||||
Bezier.prototype.point = function (t, start, c1, c2, end) {
|
||||
// prettier-ignore
|
||||
return (start * (1.0 - t) * (1.0 - t) * (1.0 - t))
|
||||
+ (3.0 * c1 * (1.0 - t) * (1.0 - t) * t)
|
||||
+ (3.0 * c2 * (1.0 - t) * t * t)
|
||||
+ (end * t * t * t);
|
||||
};
|
||||
return Bezier;
|
||||
}());
|
||||
exports.Bezier = Bezier;
|
||||
//# sourceMappingURL=bezier.js.map
|
||||
1
BeWoPlanerMobil/node_modules/signature_pad/src/bezier.js.map
generated
vendored
Normal file
1
BeWoPlanerMobil/node_modules/signature_pad/src/bezier.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"bezier.js","sourceRoot":"","sources":["bezier.ts"],"names":[],"mappings":"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"}
|
||||
31
BeWoPlanerMobil/node_modules/signature_pad/src/point.js
generated
vendored
Normal file
31
BeWoPlanerMobil/node_modules/signature_pad/src/point.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Point = void 0;
|
||||
var Point = /** @class */ (function () {
|
||||
function Point(x, y, pressure, time) {
|
||||
if (isNaN(x) || isNaN(y)) {
|
||||
throw new Error("Point is invalid: (" + x + ", " + y + ")");
|
||||
}
|
||||
this.x = +x;
|
||||
this.y = +y;
|
||||
this.pressure = pressure || 0;
|
||||
this.time = time || Date.now();
|
||||
}
|
||||
Point.prototype.distanceTo = function (start) {
|
||||
return Math.sqrt(Math.pow(this.x - start.x, 2) + Math.pow(this.y - start.y, 2));
|
||||
};
|
||||
Point.prototype.equals = function (other) {
|
||||
return (this.x === other.x &&
|
||||
this.y === other.y &&
|
||||
this.pressure === other.pressure &&
|
||||
this.time === other.time);
|
||||
};
|
||||
Point.prototype.velocityFrom = function (start) {
|
||||
return this.time !== start.time
|
||||
? this.distanceTo(start) / (this.time - start.time)
|
||||
: 0;
|
||||
};
|
||||
return Point;
|
||||
}());
|
||||
exports.Point = Point;
|
||||
//# sourceMappingURL=point.js.map
|
||||
1
BeWoPlanerMobil/node_modules/signature_pad/src/point.js.map
generated
vendored
Normal file
1
BeWoPlanerMobil/node_modules/signature_pad/src/point.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"point.js","sourceRoot":"","sources":["point.ts"],"names":[],"mappings":";;;AAQA;IAME,eAAY,CAAS,EAAE,CAAS,EAAE,QAAiB,EAAE,IAAa;QAChE,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE;YACxB,MAAM,IAAI,KAAK,CAAC,wBAAsB,CAAC,UAAK,CAAC,MAAG,CAAC,CAAC;SACnD;QACD,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACZ,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACZ,IAAI,CAAC,QAAQ,GAAG,QAAQ,IAAI,CAAC,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;IACjC,CAAC;IAEM,0BAAU,GAAjB,UAAkB,KAAiB;QACjC,OAAO,IAAI,CAAC,IAAI,CACd,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAC9D,CAAC;IACJ,CAAC;IAEM,sBAAM,GAAb,UAAc,KAAiB;QAC7B,OAAO,CACL,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC;YAClB,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC;YAClB,IAAI,CAAC,QAAQ,KAAK,KAAK,CAAC,QAAQ;YAChC,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,CACzB,CAAC;IACJ,CAAC;IAEM,4BAAY,GAAnB,UAAoB,KAAiB;QACnC,OAAO,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI;YAC7B,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;YACnD,CAAC,CAAC,CAAC,CAAC;IACR,CAAC;IACH,YAAC;AAAD,CAAC,AApCD,IAoCC;AApCY,sBAAK"}
|
||||
28
BeWoPlanerMobil/node_modules/signature_pad/src/signature_event_target.js
generated
vendored
Normal file
28
BeWoPlanerMobil/node_modules/signature_pad/src/signature_event_target.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.SignatureEventTarget = void 0;
|
||||
var SignatureEventTarget = /** @class */ (function () {
|
||||
/* tslint:enable: variable-name */
|
||||
function SignatureEventTarget() {
|
||||
try {
|
||||
this._et = new EventTarget();
|
||||
}
|
||||
catch (error) {
|
||||
// Using document as EventTarget to support iOS 13 and older.
|
||||
// Because EventTarget constructor just exists at iOS 14 and later.
|
||||
this._et = document;
|
||||
}
|
||||
}
|
||||
SignatureEventTarget.prototype.addEventListener = function (type, listener, options) {
|
||||
this._et.addEventListener(type, listener, options);
|
||||
};
|
||||
SignatureEventTarget.prototype.dispatchEvent = function (event) {
|
||||
return this._et.dispatchEvent(event);
|
||||
};
|
||||
SignatureEventTarget.prototype.removeEventListener = function (type, callback, options) {
|
||||
this._et.removeEventListener(type, callback, options);
|
||||
};
|
||||
return SignatureEventTarget;
|
||||
}());
|
||||
exports.SignatureEventTarget = SignatureEventTarget;
|
||||
//# sourceMappingURL=signature_event_target.js.map
|
||||
1
BeWoPlanerMobil/node_modules/signature_pad/src/signature_event_target.js.map
generated
vendored
Normal file
1
BeWoPlanerMobil/node_modules/signature_pad/src/signature_event_target.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"signature_event_target.js","sourceRoot":"","sources":["signature_event_target.ts"],"names":[],"mappings":";;;AAAA;IAGE,kCAAkC;IAElC;QACE,IAAI;YACF,IAAI,CAAC,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC;SAC9B;QAAC,OAAO,KAAK,EAAE;YACd,6DAA6D;YAC7D,mEAAmE;YACnE,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAC;SACrB;IACH,CAAC;IAED,+CAAgB,GAAhB,UACE,IAAY,EACZ,QAAmD,EACnD,OAA2C;QAE3C,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;IAED,4CAAa,GAAb,UAAc,KAAY;QACxB,OAAO,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IAED,kDAAmB,GAAnB,UACE,IAAY,EACZ,QAAmD,EACnD,OAAwC;QAExC,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;IACH,2BAAC;AAAD,CAAC,AAlCD,IAkCC;AAlCY,oDAAoB"}
|
||||
489
BeWoPlanerMobil/node_modules/signature_pad/src/signature_pad.js
generated
vendored
Normal file
489
BeWoPlanerMobil/node_modules/signature_pad/src/signature_pad.js
generated
vendored
Normal file
@@ -0,0 +1,489 @@
|
||||
"use strict";
|
||||
/**
|
||||
* The main idea and some parts of the code (e.g. drawing variable width Bézier curve) are taken from:
|
||||
* http://corner.squareup.com/2012/07/smoother-signatures.html
|
||||
*
|
||||
* Implementation of interpolation using cubic Bézier curves is taken from:
|
||||
* https://web.archive.org/web/20160323213433/http://www.benknowscode.com/2012/09/path-interpolation-using-cubic-bezier_9742.html
|
||||
*
|
||||
* Algorithm for approximated length of a Bézier curve is taken from:
|
||||
* http://www.lemoda.net/maths/bezier-length/index.html
|
||||
*/
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var bezier_1 = require("./bezier");
|
||||
var point_1 = require("./point");
|
||||
var signature_event_target_1 = require("./signature_event_target");
|
||||
var throttle_1 = require("./throttle");
|
||||
var SignaturePad = /** @class */ (function (_super) {
|
||||
__extends(SignaturePad, _super);
|
||||
/* tslint:enable: variable-name */
|
||||
function SignaturePad(canvas, options) {
|
||||
if (options === void 0) { options = {}; }
|
||||
var _this = _super.call(this) || this;
|
||||
_this.canvas = canvas;
|
||||
_this._drawningStroke = false;
|
||||
_this._isEmpty = true;
|
||||
_this._lastPoints = []; // Stores up to 4 most recent points; used to generate a new curve
|
||||
_this._data = []; // Stores all points in groups (one group per line or dot)
|
||||
_this._lastVelocity = 0;
|
||||
_this._lastWidth = 0;
|
||||
// Event handlers
|
||||
_this._handleMouseDown = function (event) {
|
||||
if (event.buttons === 1) {
|
||||
_this._drawningStroke = true;
|
||||
_this._strokeBegin(event);
|
||||
}
|
||||
};
|
||||
_this._handleMouseMove = function (event) {
|
||||
if (_this._drawningStroke) {
|
||||
_this._strokeMoveUpdate(event);
|
||||
}
|
||||
};
|
||||
_this._handleMouseUp = function (event) {
|
||||
if (event.buttons === 1 && _this._drawningStroke) {
|
||||
_this._drawningStroke = false;
|
||||
_this._strokeEnd(event);
|
||||
}
|
||||
};
|
||||
_this._handleTouchStart = function (event) {
|
||||
// Prevent scrolling.
|
||||
if (event.cancelable) {
|
||||
event.preventDefault();
|
||||
}
|
||||
if (event.targetTouches.length === 1) {
|
||||
var touch = event.changedTouches[0];
|
||||
_this._strokeBegin(touch);
|
||||
}
|
||||
};
|
||||
_this._handleTouchMove = function (event) {
|
||||
// Prevent scrolling.
|
||||
if (event.cancelable) {
|
||||
event.preventDefault();
|
||||
}
|
||||
var touch = event.targetTouches[0];
|
||||
_this._strokeMoveUpdate(touch);
|
||||
};
|
||||
_this._handleTouchEnd = function (event) {
|
||||
var wasCanvasTouched = event.target === _this.canvas;
|
||||
if (wasCanvasTouched) {
|
||||
if (event.cancelable) {
|
||||
event.preventDefault();
|
||||
}
|
||||
var touch = event.changedTouches[0];
|
||||
_this._strokeEnd(touch);
|
||||
}
|
||||
};
|
||||
_this._handlePointerStart = function (event) {
|
||||
_this._drawningStroke = true;
|
||||
event.preventDefault();
|
||||
_this._strokeBegin(event);
|
||||
};
|
||||
_this._handlePointerMove = function (event) {
|
||||
if (_this._drawningStroke) {
|
||||
event.preventDefault();
|
||||
_this._strokeMoveUpdate(event);
|
||||
}
|
||||
};
|
||||
_this._handlePointerEnd = function (event) {
|
||||
if (_this._drawningStroke) {
|
||||
event.preventDefault();
|
||||
_this._drawningStroke = false;
|
||||
_this._strokeEnd(event);
|
||||
}
|
||||
};
|
||||
_this.velocityFilterWeight = options.velocityFilterWeight || 0.7;
|
||||
_this.minWidth = options.minWidth || 0.5;
|
||||
_this.maxWidth = options.maxWidth || 2.5;
|
||||
_this.throttle = ('throttle' in options ? options.throttle : 16); // in milisecondss
|
||||
_this.minDistance = ('minDistance' in options ? options.minDistance : 5); // in pixels
|
||||
_this.dotSize = options.dotSize || 0;
|
||||
_this.penColor = options.penColor || 'black';
|
||||
_this.backgroundColor = options.backgroundColor || 'rgba(0,0,0,0)';
|
||||
_this._strokeMoveUpdate = _this.throttle
|
||||
? throttle_1.throttle(SignaturePad.prototype._strokeUpdate, _this.throttle)
|
||||
: SignaturePad.prototype._strokeUpdate;
|
||||
_this._ctx = canvas.getContext('2d');
|
||||
_this.clear();
|
||||
// Enable mouse and touch event handlers
|
||||
_this.on();
|
||||
return _this;
|
||||
}
|
||||
SignaturePad.prototype.clear = function () {
|
||||
var _a = this, ctx = _a._ctx, canvas = _a.canvas;
|
||||
// Clear canvas using background color
|
||||
ctx.fillStyle = this.backgroundColor;
|
||||
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
||||
this._data = [];
|
||||
this._reset(this._getPointGroupOptions());
|
||||
this._isEmpty = true;
|
||||
};
|
||||
SignaturePad.prototype.fromDataURL = function (dataUrl, options) {
|
||||
var _this = this;
|
||||
if (options === void 0) { options = {}; }
|
||||
return new Promise(function (resolve, reject) {
|
||||
var image = new Image();
|
||||
var ratio = options.ratio || window.devicePixelRatio || 1;
|
||||
var width = options.width || _this.canvas.width / ratio;
|
||||
var height = options.height || _this.canvas.height / ratio;
|
||||
var xOffset = options.xOffset || 0;
|
||||
var yOffset = options.yOffset || 0;
|
||||
_this._reset(_this._getPointGroupOptions());
|
||||
image.onload = function () {
|
||||
_this._ctx.drawImage(image, xOffset, yOffset, width, height);
|
||||
resolve();
|
||||
};
|
||||
image.onerror = function (error) {
|
||||
reject(error);
|
||||
};
|
||||
image.crossOrigin = 'anonymous';
|
||||
image.src = dataUrl;
|
||||
_this._isEmpty = false;
|
||||
});
|
||||
};
|
||||
SignaturePad.prototype.toDataURL = function (type, encoderOptions) {
|
||||
if (type === void 0) { type = 'image/png'; }
|
||||
switch (type) {
|
||||
case 'image/svg+xml':
|
||||
if (typeof encoderOptions !== 'object') {
|
||||
encoderOptions = undefined;
|
||||
}
|
||||
return "data:image/svg+xml;base64," + btoa(this.toSVG(encoderOptions));
|
||||
default:
|
||||
if (typeof encoderOptions !== 'number') {
|
||||
encoderOptions = undefined;
|
||||
}
|
||||
return this.canvas.toDataURL(type, encoderOptions);
|
||||
}
|
||||
};
|
||||
SignaturePad.prototype.on = function () {
|
||||
// Disable panning/zooming when touching canvas element
|
||||
this.canvas.style.touchAction = 'none';
|
||||
this.canvas.style.msTouchAction = 'none';
|
||||
this.canvas.style.userSelect = 'none';
|
||||
var isIOS = /Macintosh/.test(navigator.userAgent) && 'ontouchstart' in document;
|
||||
// The "Scribble" feature of iOS intercepts point events. So that we can lose some of them when tapping rapidly.
|
||||
// Use touch events for iOS platforms to prevent it. See https://developer.apple.com/forums/thread/664108 for more information.
|
||||
if (window.PointerEvent && !isIOS) {
|
||||
this._handlePointerEvents();
|
||||
}
|
||||
else {
|
||||
this._handleMouseEvents();
|
||||
if ('ontouchstart' in window) {
|
||||
this._handleTouchEvents();
|
||||
}
|
||||
}
|
||||
};
|
||||
SignaturePad.prototype.off = function () {
|
||||
// Enable panning/zooming when touching canvas element
|
||||
this.canvas.style.touchAction = 'auto';
|
||||
this.canvas.style.msTouchAction = 'auto';
|
||||
this.canvas.style.userSelect = 'auto';
|
||||
this.canvas.removeEventListener('pointerdown', this._handlePointerStart);
|
||||
this.canvas.removeEventListener('pointermove', this._handlePointerMove);
|
||||
this.canvas.ownerDocument.removeEventListener('pointerup', this._handlePointerEnd);
|
||||
this.canvas.removeEventListener('mousedown', this._handleMouseDown);
|
||||
this.canvas.removeEventListener('mousemove', this._handleMouseMove);
|
||||
this.canvas.ownerDocument.removeEventListener('mouseup', this._handleMouseUp);
|
||||
this.canvas.removeEventListener('touchstart', this._handleTouchStart);
|
||||
this.canvas.removeEventListener('touchmove', this._handleTouchMove);
|
||||
this.canvas.removeEventListener('touchend', this._handleTouchEnd);
|
||||
};
|
||||
SignaturePad.prototype.isEmpty = function () {
|
||||
return this._isEmpty;
|
||||
};
|
||||
SignaturePad.prototype.fromData = function (pointGroups, _a) {
|
||||
var _b = _a === void 0 ? {} : _a, _c = _b.clear, clear = _c === void 0 ? true : _c;
|
||||
if (clear) {
|
||||
this.clear();
|
||||
}
|
||||
this._fromData(pointGroups, this._drawCurve.bind(this), this._drawDot.bind(this));
|
||||
this._data = this._data.concat(pointGroups);
|
||||
};
|
||||
SignaturePad.prototype.toData = function () {
|
||||
return this._data;
|
||||
};
|
||||
SignaturePad.prototype._getPointGroupOptions = function (group) {
|
||||
return {
|
||||
penColor: group && 'penColor' in group ? group.penColor : this.penColor,
|
||||
dotSize: group && 'dotSize' in group ? group.dotSize : this.dotSize,
|
||||
minWidth: group && 'minWidth' in group ? group.minWidth : this.minWidth,
|
||||
maxWidth: group && 'maxWidth' in group ? group.maxWidth : this.maxWidth,
|
||||
velocityFilterWeight: group && 'velocityFilterWeight' in group
|
||||
? group.velocityFilterWeight
|
||||
: this.velocityFilterWeight,
|
||||
};
|
||||
};
|
||||
// Private methods
|
||||
SignaturePad.prototype._strokeBegin = function (event) {
|
||||
this.dispatchEvent(new CustomEvent('beginStroke', { detail: event }));
|
||||
var pointGroupOptions = this._getPointGroupOptions();
|
||||
var newPointGroup = __assign(__assign({}, pointGroupOptions), { points: [] });
|
||||
this._data.push(newPointGroup);
|
||||
this._reset(pointGroupOptions);
|
||||
this._strokeUpdate(event);
|
||||
};
|
||||
SignaturePad.prototype._strokeUpdate = function (event) {
|
||||
if (this._data.length === 0) {
|
||||
// This can happen if clear() was called while a signature is still in progress,
|
||||
// or if there is a race condition between start/update events.
|
||||
this._strokeBegin(event);
|
||||
return;
|
||||
}
|
||||
this.dispatchEvent(new CustomEvent('beforeUpdateStroke', { detail: event }));
|
||||
var x = event.clientX;
|
||||
var y = event.clientY;
|
||||
var pressure = event.pressure !== undefined
|
||||
? event.pressure
|
||||
: event.force !== undefined
|
||||
? event.force
|
||||
: 0;
|
||||
var point = this._createPoint(x, y, pressure);
|
||||
var lastPointGroup = this._data[this._data.length - 1];
|
||||
var lastPoints = lastPointGroup.points;
|
||||
var lastPoint = lastPoints.length > 0 && lastPoints[lastPoints.length - 1];
|
||||
var isLastPointTooClose = lastPoint
|
||||
? point.distanceTo(lastPoint) <= this.minDistance
|
||||
: false;
|
||||
var pointGroupOptions = this._getPointGroupOptions(lastPointGroup);
|
||||
// Skip this point if it's too close to the previous one
|
||||
if (!lastPoint || !(lastPoint && isLastPointTooClose)) {
|
||||
var curve = this._addPoint(point, pointGroupOptions);
|
||||
if (!lastPoint) {
|
||||
this._drawDot(point, pointGroupOptions);
|
||||
}
|
||||
else if (curve) {
|
||||
this._drawCurve(curve, pointGroupOptions);
|
||||
}
|
||||
lastPoints.push({
|
||||
time: point.time,
|
||||
x: point.x,
|
||||
y: point.y,
|
||||
pressure: point.pressure,
|
||||
});
|
||||
}
|
||||
this.dispatchEvent(new CustomEvent('afterUpdateStroke', { detail: event }));
|
||||
};
|
||||
SignaturePad.prototype._strokeEnd = function (event) {
|
||||
this._strokeUpdate(event);
|
||||
this.dispatchEvent(new CustomEvent('endStroke', { detail: event }));
|
||||
};
|
||||
SignaturePad.prototype._handlePointerEvents = function () {
|
||||
this._drawningStroke = false;
|
||||
this.canvas.addEventListener('pointerdown', this._handlePointerStart);
|
||||
this.canvas.addEventListener('pointermove', this._handlePointerMove);
|
||||
this.canvas.ownerDocument.addEventListener('pointerup', this._handlePointerEnd);
|
||||
};
|
||||
SignaturePad.prototype._handleMouseEvents = function () {
|
||||
this._drawningStroke = false;
|
||||
this.canvas.addEventListener('mousedown', this._handleMouseDown);
|
||||
this.canvas.addEventListener('mousemove', this._handleMouseMove);
|
||||
this.canvas.ownerDocument.addEventListener('mouseup', this._handleMouseUp);
|
||||
};
|
||||
SignaturePad.prototype._handleTouchEvents = function () {
|
||||
this.canvas.addEventListener('touchstart', this._handleTouchStart);
|
||||
this.canvas.addEventListener('touchmove', this._handleTouchMove);
|
||||
this.canvas.addEventListener('touchend', this._handleTouchEnd);
|
||||
};
|
||||
// Called when a new line is started
|
||||
SignaturePad.prototype._reset = function (options) {
|
||||
this._lastPoints = [];
|
||||
this._lastVelocity = 0;
|
||||
this._lastWidth = (options.minWidth + options.maxWidth) / 2;
|
||||
this._ctx.fillStyle = options.penColor;
|
||||
};
|
||||
SignaturePad.prototype._createPoint = function (x, y, pressure) {
|
||||
var rect = this.canvas.getBoundingClientRect();
|
||||
return new point_1.Point(x - rect.left, y - rect.top, pressure, new Date().getTime());
|
||||
};
|
||||
// Add point to _lastPoints array and generate a new curve if there are enough points (i.e. 3)
|
||||
SignaturePad.prototype._addPoint = function (point, options) {
|
||||
var _lastPoints = this._lastPoints;
|
||||
_lastPoints.push(point);
|
||||
if (_lastPoints.length > 2) {
|
||||
// To reduce the initial lag make it work with 3 points
|
||||
// by copying the first point to the beginning.
|
||||
if (_lastPoints.length === 3) {
|
||||
_lastPoints.unshift(_lastPoints[0]);
|
||||
}
|
||||
// _points array will always have 4 points here.
|
||||
var widths = this._calculateCurveWidths(_lastPoints[1], _lastPoints[2], options);
|
||||
var curve = bezier_1.Bezier.fromPoints(_lastPoints, widths);
|
||||
// Remove the first element from the list, so that there are no more than 4 points at any time.
|
||||
_lastPoints.shift();
|
||||
return curve;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
SignaturePad.prototype._calculateCurveWidths = function (startPoint, endPoint, options) {
|
||||
var velocity = options.velocityFilterWeight * endPoint.velocityFrom(startPoint) +
|
||||
(1 - options.velocityFilterWeight) * this._lastVelocity;
|
||||
var newWidth = this._strokeWidth(velocity, options);
|
||||
var widths = {
|
||||
end: newWidth,
|
||||
start: this._lastWidth,
|
||||
};
|
||||
this._lastVelocity = velocity;
|
||||
this._lastWidth = newWidth;
|
||||
return widths;
|
||||
};
|
||||
SignaturePad.prototype._strokeWidth = function (velocity, options) {
|
||||
return Math.max(options.maxWidth / (velocity + 1), options.minWidth);
|
||||
};
|
||||
SignaturePad.prototype._drawCurveSegment = function (x, y, width) {
|
||||
var ctx = this._ctx;
|
||||
ctx.moveTo(x, y);
|
||||
ctx.arc(x, y, width, 0, 2 * Math.PI, false);
|
||||
this._isEmpty = false;
|
||||
};
|
||||
SignaturePad.prototype._drawCurve = function (curve, options) {
|
||||
var ctx = this._ctx;
|
||||
var widthDelta = curve.endWidth - curve.startWidth;
|
||||
// '2' is just an arbitrary number here. If only length is used, then
|
||||
// there are gaps between curve segments :/
|
||||
var drawSteps = Math.ceil(curve.length()) * 2;
|
||||
ctx.beginPath();
|
||||
ctx.fillStyle = options.penColor;
|
||||
for (var i = 0; i < drawSteps; i += 1) {
|
||||
// Calculate the Bezier (x, y) coordinate for this step.
|
||||
var t = i / drawSteps;
|
||||
var tt = t * t;
|
||||
var ttt = tt * t;
|
||||
var u = 1 - t;
|
||||
var uu = u * u;
|
||||
var uuu = uu * u;
|
||||
var x = uuu * curve.startPoint.x;
|
||||
x += 3 * uu * t * curve.control1.x;
|
||||
x += 3 * u * tt * curve.control2.x;
|
||||
x += ttt * curve.endPoint.x;
|
||||
var y = uuu * curve.startPoint.y;
|
||||
y += 3 * uu * t * curve.control1.y;
|
||||
y += 3 * u * tt * curve.control2.y;
|
||||
y += ttt * curve.endPoint.y;
|
||||
var width = Math.min(curve.startWidth + ttt * widthDelta, options.maxWidth);
|
||||
this._drawCurveSegment(x, y, width);
|
||||
}
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
};
|
||||
SignaturePad.prototype._drawDot = function (point, options) {
|
||||
var ctx = this._ctx;
|
||||
var width = options.dotSize > 0
|
||||
? options.dotSize
|
||||
: (options.minWidth + options.maxWidth) / 2;
|
||||
ctx.beginPath();
|
||||
this._drawCurveSegment(point.x, point.y, width);
|
||||
ctx.closePath();
|
||||
ctx.fillStyle = options.penColor;
|
||||
ctx.fill();
|
||||
};
|
||||
SignaturePad.prototype._fromData = function (pointGroups, drawCurve, drawDot) {
|
||||
for (var _i = 0, pointGroups_1 = pointGroups; _i < pointGroups_1.length; _i++) {
|
||||
var group = pointGroups_1[_i];
|
||||
var points = group.points;
|
||||
var pointGroupOptions = this._getPointGroupOptions(group);
|
||||
if (points.length > 1) {
|
||||
for (var j = 0; j < points.length; j += 1) {
|
||||
var basicPoint = points[j];
|
||||
var point = new point_1.Point(basicPoint.x, basicPoint.y, basicPoint.pressure, basicPoint.time);
|
||||
if (j === 0) {
|
||||
this._reset(pointGroupOptions);
|
||||
}
|
||||
var curve = this._addPoint(point, pointGroupOptions);
|
||||
if (curve) {
|
||||
drawCurve(curve, pointGroupOptions);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
this._reset(pointGroupOptions);
|
||||
drawDot(points[0], pointGroupOptions);
|
||||
}
|
||||
}
|
||||
};
|
||||
SignaturePad.prototype.toSVG = function (_a) {
|
||||
var _b = _a === void 0 ? {} : _a, _c = _b.includeBackgroundColor, includeBackgroundColor = _c === void 0 ? false : _c;
|
||||
var pointGroups = this._data;
|
||||
var ratio = Math.max(window.devicePixelRatio || 1, 1);
|
||||
var minX = 0;
|
||||
var minY = 0;
|
||||
var maxX = this.canvas.width / ratio;
|
||||
var maxY = this.canvas.height / ratio;
|
||||
var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
||||
svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
|
||||
svg.setAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
|
||||
svg.setAttribute('viewBox', minX + " " + minY + " " + maxX + " " + maxY);
|
||||
svg.setAttribute('width', maxX.toString());
|
||||
svg.setAttribute('height', maxY.toString());
|
||||
if (includeBackgroundColor && this.backgroundColor) {
|
||||
var rect = document.createElement('rect');
|
||||
rect.setAttribute('width', '100%');
|
||||
rect.setAttribute('height', '100%');
|
||||
rect.setAttribute('fill', this.backgroundColor);
|
||||
svg.appendChild(rect);
|
||||
}
|
||||
this._fromData(pointGroups, function (curve, _a) {
|
||||
var penColor = _a.penColor;
|
||||
var path = document.createElement('path');
|
||||
// Need to check curve for NaN values, these pop up when drawing
|
||||
// lines on the canvas that are not continuous. E.g. Sharp corners
|
||||
// or stopping mid-stroke and than continuing without lifting mouse.
|
||||
/* eslint-disable no-restricted-globals */
|
||||
if (!isNaN(curve.control1.x) &&
|
||||
!isNaN(curve.control1.y) &&
|
||||
!isNaN(curve.control2.x) &&
|
||||
!isNaN(curve.control2.y)) {
|
||||
var attr = "M " + curve.startPoint.x.toFixed(3) + "," + curve.startPoint.y.toFixed(3) + " " +
|
||||
("C " + curve.control1.x.toFixed(3) + "," + curve.control1.y.toFixed(3) + " ") +
|
||||
(curve.control2.x.toFixed(3) + "," + curve.control2.y.toFixed(3) + " ") +
|
||||
(curve.endPoint.x.toFixed(3) + "," + curve.endPoint.y.toFixed(3));
|
||||
path.setAttribute('d', attr);
|
||||
path.setAttribute('stroke-width', (curve.endWidth * 2.25).toFixed(3));
|
||||
path.setAttribute('stroke', penColor);
|
||||
path.setAttribute('fill', 'none');
|
||||
path.setAttribute('stroke-linecap', 'round');
|
||||
svg.appendChild(path);
|
||||
}
|
||||
/* eslint-enable no-restricted-globals */
|
||||
}, function (point, _a) {
|
||||
var penColor = _a.penColor, dotSize = _a.dotSize, minWidth = _a.minWidth, maxWidth = _a.maxWidth;
|
||||
var circle = document.createElement('circle');
|
||||
var size = dotSize > 0 ? dotSize : (minWidth + maxWidth) / 2;
|
||||
circle.setAttribute('r', size.toString());
|
||||
circle.setAttribute('cx', point.x.toString());
|
||||
circle.setAttribute('cy', point.y.toString());
|
||||
circle.setAttribute('fill', penColor);
|
||||
svg.appendChild(circle);
|
||||
});
|
||||
return svg.outerHTML;
|
||||
};
|
||||
return SignaturePad;
|
||||
}(signature_event_target_1.SignatureEventTarget));
|
||||
exports.default = SignaturePad;
|
||||
//# sourceMappingURL=signature_pad.js.map
|
||||
1
BeWoPlanerMobil/node_modules/signature_pad/src/signature_pad.js.map
generated
vendored
Normal file
1
BeWoPlanerMobil/node_modules/signature_pad/src/signature_pad.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
50
BeWoPlanerMobil/node_modules/signature_pad/src/throttle.js
generated
vendored
Normal file
50
BeWoPlanerMobil/node_modules/signature_pad/src/throttle.js
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-this-alias */
|
||||
// Slightly simplified version of http://stackoverflow.com/a/27078401/815507
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.throttle = void 0;
|
||||
function throttle(fn, wait) {
|
||||
if (wait === void 0) { wait = 250; }
|
||||
var previous = 0;
|
||||
var timeout = null;
|
||||
var result;
|
||||
var storedContext;
|
||||
var storedArgs;
|
||||
var later = function () {
|
||||
previous = Date.now();
|
||||
timeout = null;
|
||||
result = fn.apply(storedContext, storedArgs);
|
||||
if (!timeout) {
|
||||
storedContext = null;
|
||||
storedArgs = [];
|
||||
}
|
||||
};
|
||||
return function wrapper() {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
var now = Date.now();
|
||||
var remaining = wait - (now - previous);
|
||||
storedContext = this;
|
||||
storedArgs = args;
|
||||
if (remaining <= 0 || remaining > wait) {
|
||||
if (timeout) {
|
||||
clearTimeout(timeout);
|
||||
timeout = null;
|
||||
}
|
||||
previous = now;
|
||||
result = fn.apply(storedContext, storedArgs);
|
||||
if (!timeout) {
|
||||
storedContext = null;
|
||||
storedArgs = [];
|
||||
}
|
||||
}
|
||||
else if (!timeout) {
|
||||
timeout = window.setTimeout(later, remaining);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
}
|
||||
exports.throttle = throttle;
|
||||
//# sourceMappingURL=throttle.js.map
|
||||
1
BeWoPlanerMobil/node_modules/signature_pad/src/throttle.js.map
generated
vendored
Normal file
1
BeWoPlanerMobil/node_modules/signature_pad/src/throttle.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"throttle.js","sourceRoot":"","sources":["throttle.ts"],"names":[],"mappings":";AAAA,yFAAyF;AACzF,4EAA4E;;;AAE5E,SAAgB,QAAQ,CACtB,EAA2B,EAC3B,IAAU;IAAV,qBAAA,EAAA,UAAU;IAEV,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,IAAI,OAAO,GAAkB,IAAI,CAAC;IAClC,IAAI,MAAW,CAAC;IAChB,IAAI,aAAkB,CAAC;IACvB,IAAI,UAAiB,CAAC;IAEtB,IAAM,KAAK,GAAG;QACZ,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACtB,OAAO,GAAG,IAAI,CAAC;QACf,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;QAE7C,IAAI,CAAC,OAAO,EAAE;YACZ,aAAa,GAAG,IAAI,CAAC;YACrB,UAAU,GAAG,EAAE,CAAC;SACjB;IACH,CAAC,CAAC;IAEF,OAAO,SAAS,OAAO;QAAY,cAAc;aAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;YAAd,yBAAc;;QAC/C,IAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACvB,IAAM,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,GAAG,QAAQ,CAAC,CAAC;QAE1C,aAAa,GAAG,IAAI,CAAC;QACrB,UAAU,GAAG,IAAI,CAAC;QAElB,IAAI,SAAS,IAAI,CAAC,IAAI,SAAS,GAAG,IAAI,EAAE;YACtC,IAAI,OAAO,EAAE;gBACX,YAAY,CAAC,OAAO,CAAC,CAAC;gBACtB,OAAO,GAAG,IAAI,CAAC;aAChB;YAED,QAAQ,GAAG,GAAG,CAAC;YACf,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;YAE7C,IAAI,CAAC,OAAO,EAAE;gBACZ,aAAa,GAAG,IAAI,CAAC;gBACrB,UAAU,GAAG,EAAE,CAAC;aACjB;SACF;aAAM,IAAI,CAAC,OAAO,EAAE;YACnB,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;SAC/C;QAED,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AA/CD,4BA+CC"}
|
||||
@@ -723,7 +723,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
var result = customers.Select(customer => MapperFactory.CompactCustomerDC_Customer.MapToNewDC(customer)).ToList();
|
||||
|
||||
ApplicationUser user;
|
||||
if (LoggedInUserOperationContextExt.Current != null && LoggedInUserOperationContextExt.Current.User != null)
|
||||
if(LoggedInUserOperationContextExt.Current != null && LoggedInUserOperationContextExt.Current.User != null)
|
||||
{
|
||||
user = LoggedInUserOperationContextExt.Current.User;
|
||||
}
|
||||
@@ -733,20 +733,25 @@ namespace BeWo.Service.ServiceImplementations
|
||||
}
|
||||
|
||||
var relatedCustomerOids = new List<long>();
|
||||
foreach (var customer in customers)
|
||||
foreach(var customer in customers)
|
||||
{
|
||||
foreach (var rel in customer.Employee2CustomerList)
|
||||
{
|
||||
if (rel.Employee.Equals(user.Employee) && rel.CustomerOid.HasValue)
|
||||
if(customer.Team2CustomerList.Any(t2c => t2c.Team.Leader.Equals(user.Employee) || t2c.Team.MemberList.Contains(user.Employee)) && customer.Oid.HasValue)
|
||||
{
|
||||
relatedCustomerOids.AddIfNotIn(customer.Oid.Value);
|
||||
}
|
||||
|
||||
foreach(var rel in customer.Employee2CustomerList)
|
||||
{
|
||||
if(rel.Employee.Equals(user.Employee) && rel.CustomerOid.HasValue)
|
||||
{
|
||||
relatedCustomerOids.AddIfNotIn(rel.CustomerOid.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var customer in result)
|
||||
foreach(var customer in result)
|
||||
{
|
||||
if (relatedCustomerOids.Contains(customer.CustomerOid))
|
||||
if(relatedCustomerOids.Contains(customer.CustomerOid))
|
||||
{
|
||||
customer.IsRelatedToEmployee = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user