diff --git a/BeWo/ViewModel/TextModuleVM.cs b/BeWo/ViewModel/TextModuleVM.cs index 7f99327f2..874a33672 100644 --- a/BeWo/ViewModel/TextModuleVM.cs +++ b/BeWo/ViewModel/TextModuleVM.cs @@ -28,9 +28,10 @@ namespace BeWo.ViewModel private bool _IsExpanded; private TextModuleVM _Parent; - - public TextModuleVM(TextModuleDC pDataContract) : base(pDataContract, pDataContract.TextModuleOid == null) {} + private ActivationTypeId _ActivationType; + + public TextModuleVM(TextModuleDC pDataContract) : base(pDataContract, pDataContract.TextModuleOid == null) {} public bool IsExpanded @@ -78,6 +79,22 @@ namespace BeWo.ViewModel } } + public ActivationTypeId ActivationType + { + get => _ActivationType; + + set + { + if(AreDifferent(_ActivationType, value)) + { + _ActivationType = value; + StoreDirtyInformation(AreDifferent(DataContract.ActivationType, value), nameof(ActivationType)); + + FirePropertyChanged(nameof(ActivationType)); + } + } + } + public int Position { get => _Position; @@ -207,6 +224,7 @@ namespace BeWo.ViewModel pDataContract.Name = _Name; pDataContract.IsParent = _IsParent; pDataContract.IsExpanded = _IsExpanded; + pDataContract.ActivationType = _ActivationType; pDataContract.IsOnlyForEmployee = _IsOnlyForEmployee; diff --git a/BeWoPlanerMobil/BeWoPlanerMobil.csproj.user b/BeWoPlanerMobil/BeWoPlanerMobil.csproj.user index e244fab95..017954e4c 100644 --- a/BeWoPlanerMobil/BeWoPlanerMobil.csproj.user +++ b/BeWoPlanerMobil/BeWoPlanerMobil.csproj.user @@ -8,7 +8,7 @@ - Debug|Any CPU + Release|Any CPU ShowAllFiles 600 MvcControllerEmptyScaffolder diff --git a/BeWoPlanerMobil/Controllers/MainController.cs b/BeWoPlanerMobil/Controllers/MainController.cs index 52c9e1816..5629190a1 100644 --- a/BeWoPlanerMobil/Controllers/MainController.cs +++ b/BeWoPlanerMobil/Controllers/MainController.cs @@ -91,6 +91,7 @@ namespace BeWoPlanerMobil.Controllers Model.ShowExpiredSupportConcepts = GetUserSettingValue("ShowExpiredSupportConcepts") == "1"; Model.ShowOnlyOwnSupportConcepts = GetUserSettingValue("ShowOnlyMySupportConcepts") == "1"; + var mandator = GetMandator(); @@ -912,6 +913,11 @@ namespace BeWoPlanerMobil.Controllers var oidList = OperationsService.InsertNewServiceRecords(new List { Model.NewServiceRecord }); Model.ServiceRecordOid = oidList[0]; + + if(Model.NewServiceRecord.CostBearer != null) + { + TempData[FormCollectionConstants.ShowSignatureSuggestionPopup] = true; + } } else { @@ -2143,7 +2149,7 @@ namespace BeWoPlanerMobil.Controllers Model.ServiceCategories = CreateServiceCategoryModels(OperationsService.GetAllServiceDescriptions()); - Model.SelectedEmployees.Add(MobileSessionFacade.LoggedInCompactEmployee); + Model.SelectedEmployees.AddIfNotIn(MobileSessionFacade.LoggedInCompactEmployee); Model.IsInEditingMode = false; Model.SelectedServiceRecord = null; diff --git a/BeWoPlanerMobil/Models/MainModel.cs b/BeWoPlanerMobil/Models/MainModel.cs index 8f3c7658a..b10188620 100644 --- a/BeWoPlanerMobil/Models/MainModel.cs +++ b/BeWoPlanerMobil/Models/MainModel.cs @@ -120,7 +120,7 @@ namespace BeWoPlanerMobil.Models public List SupportConcepts { get; set; } public List ServiceCategories { get; set; } - public List Textbausteine { get; set; } + public List Textbausteine { get; set; } = new List(); private List _ServiceRecords; diff --git a/BeWoPlanerMobil/Scripts/mobileUtils.js b/BeWoPlanerMobil/Scripts/mobileUtils.js index b7ac9531d..a759cd660 100644 --- a/BeWoPlanerMobil/Scripts/mobileUtils.js +++ b/BeWoPlanerMobil/Scripts/mobileUtils.js @@ -40,7 +40,8 @@ function showMessagePopupWithCallback(title, message, callback, executeCallbackB }); if (executeCallbackByBothButtons === true) { - $("#message-popup-close-btn").on("click", function() { + $("#message-popup-close-btn, #message-popup-esc-btn").on("click", + function() { callback(); }); } diff --git a/BeWoPlanerMobil/Scripts/view-scripts/main.js b/BeWoPlanerMobil/Scripts/view-scripts/main.js index 62386de66..3f02b70d2 100644 --- a/BeWoPlanerMobil/Scripts/view-scripts/main.js +++ b/BeWoPlanerMobil/Scripts/view-scripts/main.js @@ -62,6 +62,15 @@ function loadServiceDescriptions() { return; } + var test = $.parseJSON(result); + if(test.length === 0) { + $("#textmodule-container").hide(); + + return; + } + + $("#textmodule-container").show(); + $("#tree").treeview({ data: result, onNodeSelected: function (event, data) { diff --git a/BeWoPlanerMobil/Util/FormCollectionConstants.cs b/BeWoPlanerMobil/Util/FormCollectionConstants.cs index 6b7b4a5d8..95e76fe38 100644 --- a/BeWoPlanerMobil/Util/FormCollectionConstants.cs +++ b/BeWoPlanerMobil/Util/FormCollectionConstants.cs @@ -44,6 +44,8 @@ public static string SelectedMonthKey => "SelectedMonth"; public static string SelectedYearKey => "SelectedYear"; public static string SelectedTeamOidKey => "SelectedTeamOid"; + public static string ShowSignatureSuggestionPopup => "ShowSignatureSuggestionPopup"; + public static string ServiceRecordOidForSignature => "ServiceRecordOidForSignature"; } public class ModelSessionConstants diff --git a/BeWoPlanerMobil/Views/Customer/Customer.cshtml b/BeWoPlanerMobil/Views/Customer/Customer.cshtml index 583fc1777..958d39245 100644 --- a/BeWoPlanerMobil/Views/Customer/Customer.cshtml +++ b/BeWoPlanerMobil/Views/Customer/Customer.cshtml @@ -185,6 +185,23 @@ + + + @if(Model.SelectedJsonCustomer.Kommentar != null) + { +
+
+
+
Kommentar
+
+
+
+ @Model.SelectedJsonCustomer.Kommentar +
+
+
+
+ } @if(Model.SelectedJsonCustomer.ReferenceNumbers.Any()) diff --git a/BeWoPlanerMobil/Views/Main/Main.cshtml b/BeWoPlanerMobil/Views/Main/Main.cshtml index e47421ebb..e8a999aea 100644 --- a/BeWoPlanerMobil/Views/Main/Main.cshtml +++ b/BeWoPlanerMobil/Views/Main/Main.cshtml @@ -105,6 +105,22 @@ $("#create-button").prop("disabled", @Model.SelectedEmployees.Count === 0 ? true : false); } + + @{ + var shouldShowSignaturePopup = TempData[FormCollectionConstants.ShowSignatureSuggestionPopup]?.GetType() == typeof(bool) && (bool) TempData[FormCollectionConstants.ShowSignatureSuggestionPopup]; + + if(Model.ServiceRecordOid > 0) + { + if(shouldShowSignaturePopup && Model.ShowSignature) + { + + showMessagePopupWithCallback("Erfolgreich gespeichert", "Möchten Sie den Eintrag unterschreiben lassen?", function() { + initializeSignature(@Model.ServiceRecordOid); + }, false); + + } + } + } }); function setInputFilter() { @@ -490,18 +506,21 @@ } -
-
-
- - + @if(Model.ShowDistanceField) + { +
+
+
+ + +
-
+ } @if(AbstractModel.HasRightToSeeTextModules) { -
+
@@ -794,7 +813,6 @@ var header = $"Dokumentation { i + 1 }"; - // TODO: 3 Notices bei 2 aktiven Dokufeldern führt zu Exception. Was ist mit der dritten Notice? Nicht anzeigen? if(Model.NumberOfDokuTypes >= 2) { if(Model.NumberOfDokuTypes <= i) @@ -1012,19 +1030,22 @@
-
-
-
- - + @if(Model.ShowDistanceField) + { +
+
+
+ + +
-
+ } @if(AbstractModel.HasRightToSeeTextModules) { -
+
@@ -1110,7 +1131,7 @@
- +
@@ -1141,7 +1162,7 @@
- +
@@ -1152,7 +1173,7 @@
- +
@@ -1162,7 +1183,7 @@
- +
@@ -1172,7 +1193,7 @@
- +
@@ -1201,7 +1222,7 @@ }
- +
@@ -1227,7 +1248,7 @@
- +
@@ -1254,27 +1275,30 @@ }
- -
-
-
- - -
-
-
- - - @if(AbstractModel.HasRightToSeeTextModules) + + @if(Model.ShowDistanceField) {
+
+
+ + +
+
+
+ } + + + @if(AbstractModel.HasRightToSeeTextModules) + { +
} - +
@if(Model.NumberOfDokuTypes == 0) diff --git a/BeWoPlanerMobil/Views/Shared/_Layout.cshtml b/BeWoPlanerMobil/Views/Shared/_Layout.cshtml index ad29be358..fd5ac3e23 100644 --- a/BeWoPlanerMobil/Views/Shared/_Layout.cshtml +++ b/BeWoPlanerMobil/Views/Shared/_Layout.cshtml @@ -19,23 +19,24 @@ - + - - - - + + + + - - - - - - + + + + + + - + +