|
@@ -1,4 +1,5 @@
|
|
|
@using GreenTree.Nachtragsmanagement.Web.Extensions
|
|
@using GreenTree.Nachtragsmanagement.Web.Extensions
|
|
|
|
|
+@using GreenTree.Nachtragsmanagement.Core.Plugins
|
|
|
|
|
|
|
|
@{
|
|
@{
|
|
|
var userContext = GreenTree.Nachtragsmanagement.Core.CommonHelper.UserContext();
|
|
var userContext = GreenTree.Nachtragsmanagement.Core.CommonHelper.UserContext();
|
|
@@ -8,10 +9,82 @@
|
|
|
|
|
|
|
|
<div class="mailNotificationEditContainer">
|
|
<div class="mailNotificationEditContainer">
|
|
|
|
|
|
|
|
|
|
+ <script src="~/Scripts/jquery-cron-min.js"></script>
|
|
|
<script>
|
|
<script>
|
|
|
var textSeparator = ", ";
|
|
var textSeparator = ", ";
|
|
|
- var deleteId = null;
|
|
|
|
|
- var pluginSystemName = "";
|
|
|
|
|
|
|
+ var pluginSystemName = "@Model.NotificationPluginSystemName";
|
|
|
|
|
+ var cronEditor = null;
|
|
|
|
|
+ var notificationPluginDictionary = {};
|
|
|
|
|
+ var notificationJobDictionary = {};
|
|
|
|
|
+
|
|
|
|
|
+ @foreach (var notificationPlugin in (IEnumerable<INotificationPlugin>)ViewData["AllNotificationPlugins"])
|
|
|
|
|
+ {
|
|
|
|
|
+ ViewContext.Writer.WriteLine("notificationPluginDictionary[\"" + notificationPlugin.SystemName + "\"] = \"" + notificationPlugin.Description + "\";");
|
|
|
|
|
+
|
|
|
|
|
+ foreach (var notificationJob in notificationPlugin.AvailableNotificationJobs)
|
|
|
|
|
+ {
|
|
|
|
|
+ ViewContext.Writer.WriteLine("notificationJobDictionary[\"" + notificationJob.SystemName + "\"] = \"" + notificationJob.Description + "\";");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ cronEditor = $("#cronExpressionEditor").cron({
|
|
|
|
|
+ onChange: function () {
|
|
|
|
|
+ $("#CronExpression").val($(this).cron("value"));
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ function changeElementText(selector, textArray) {
|
|
|
|
|
+ for (var i = 0; i < textArray.length; i++) {
|
|
|
|
|
+ $(selector).contents().filter(function () {
|
|
|
|
|
+ return this.nodeType == 3;
|
|
|
|
|
+ })[i].nodeValue = textArray[i];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $(document).ready(function () {
|
|
|
|
|
+ @if (String.IsNullOrEmpty(Model.CronExpression))
|
|
|
|
|
+ {
|
|
|
|
|
+ ViewContext.Writer.WriteLine("cronEditor.cron('value', '0 6 * * 1');");
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ ViewContext.Writer.WriteLine("cronEditor.cron('value', '" + Model.CronExpression + "');");
|
|
|
|
|
+ }
|
|
|
|
|
+ changeElementText(".cron-period", ["Jede(r/s) "]);
|
|
|
|
|
+ changeElementText(".cron-block-mins", ["auf der ", " Minute nach der Stunde"]);
|
|
|
|
|
+ changeElementText(".cron-block-time", ["um "]);
|
|
|
|
|
+ changeElementText(".cron-block-dow", ["am "]);
|
|
|
|
|
+ changeElementText(".cron-block-dom", ["am "]);
|
|
|
|
|
+ changeElementText(".cron-block-month", [" des "]);
|
|
|
|
|
+ $('select[name="cron-period"] > option[value="minute"]').text("Minute");
|
|
|
|
|
+ $('select[name="cron-period"] > option[value="hour"]').text("Stunde");
|
|
|
|
|
+ $('select[name="cron-period"] > option[value="day"]').text("Tag");
|
|
|
|
|
+ $('select[name="cron-period"] > option[value="week"]').text("Woche");
|
|
|
|
|
+ $('select[name="cron-period"] > option[value="month"]').text("Monat");
|
|
|
|
|
+ $('select[name="cron-period"] > option[value="year"]').text("Jahr");
|
|
|
|
|
+ $('select[name="cron-dow"] > option[value="0"]').text("Sonntag");
|
|
|
|
|
+ $('select[name="cron-dow"] > option[value="1"]').text("Montag");
|
|
|
|
|
+ $('select[name="cron-dow"] > option[value="2"]').text("Dienstag");
|
|
|
|
|
+ $('select[name="cron-dow"] > option[value="3"]').text("Mittwoch");
|
|
|
|
|
+ $('select[name="cron-dow"] > option[value="4"]').text("Donnerstag");
|
|
|
|
|
+ $('select[name="cron-dow"] > option[value="5"]').text("Freitag");
|
|
|
|
|
+ $('select[name="cron-dow"] > option[value="6"]').text("Samstag");
|
|
|
|
|
+ $('select[name="cron-month"] > option[value="1"]').text("Januar");
|
|
|
|
|
+ $('select[name="cron-month"] > option[value="2"]').text("Februar");
|
|
|
|
|
+ $('select[name="cron-month"] > option[value="3"]').text("März");
|
|
|
|
|
+ $('select[name="cron-month"] > option[value="4"]').text("April");
|
|
|
|
|
+ $('select[name="cron-month"] > option[value="5"]').text("Mai");
|
|
|
|
|
+ $('select[name="cron-month"] > option[value="6"]').text("Juni");
|
|
|
|
|
+ $('select[name="cron-month"] > option[value="7"]').text("Juli");
|
|
|
|
|
+ $('select[name="cron-month"] > option[value="8"]').text("August");
|
|
|
|
|
+ $('select[name="cron-month"] > option[value="9"]').text("September");
|
|
|
|
|
+ $('select[name="cron-month"] > option[value="10"]').text("Oktober");
|
|
|
|
|
+ $('select[name="cron-month"] > option[value="11"]').text("November");
|
|
|
|
|
+ $('select[name="cron-month"] > option[value="12"]').text("Dezember");
|
|
|
|
|
+ for (var i = 1; i <= 31; i++) {
|
|
|
|
|
+ $('select[name="cron-dom"] > option[value="' + i + '"]').text(i + ".");
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
function saveMailNotification() {
|
|
function saveMailNotification() {
|
|
|
var form = $("#mailNotificationEditForm");
|
|
var form = $("#mailNotificationEditForm");
|
|
@@ -24,7 +97,7 @@
|
|
|
setTimeout(function () {
|
|
setTimeout(function () {
|
|
|
$(".mailNotificationEditContainer").remove();
|
|
$(".mailNotificationEditContainer").remove();
|
|
|
if (response == "success") {
|
|
if (response == "success") {
|
|
|
- devGridViewMailNotification.PerformCallback();
|
|
|
|
|
|
|
+ devGridViewMailNotifications.PerformCallback();
|
|
|
} else {
|
|
} else {
|
|
|
$("body").append(response);
|
|
$("body").append(response);
|
|
|
}
|
|
}
|
|
@@ -70,8 +143,47 @@
|
|
|
}
|
|
}
|
|
|
return actualValues;
|
|
return actualValues;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ function onNotificationPluginSelectedIndexChanged() {
|
|
|
|
|
+ pluginSystemName = NotificationPluginSystemName.GetValue();
|
|
|
|
|
+ NotificationJobSystemName.PerformCallback();
|
|
|
|
|
+ $("#notificationPluginDescription").text(notificationPluginDictionary[pluginSystemName]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ function onNotificationJobSelectedIndexChanged() {
|
|
|
|
|
+ var jobSystemName = NotificationJobSystemName.GetValue();
|
|
|
|
|
+ $("#notificationJobDescription").text(notificationJobDictionary[jobSystemName]);
|
|
|
|
|
+ }
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
|
|
+ <style>
|
|
|
|
|
+ .notificationDescription {
|
|
|
|
|
+ margin-top: 8px;
|
|
|
|
|
+ color: #009688;
|
|
|
|
|
+ font-style: italic;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ #cronExpressionEditor {
|
|
|
|
|
+ margin-top: 3px;
|
|
|
|
|
+ padding-top: 10px;
|
|
|
|
|
+ border-top: 1px solid #009688;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ #cronExpressionEditor select {
|
|
|
|
|
+ padding: 6px 4px;
|
|
|
|
|
+ border: 1px solid #DCDCDC;
|
|
|
|
|
+ border-radius: 2px;
|
|
|
|
|
+ -webkit-border-radius: 2px;
|
|
|
|
|
+ -moz-border-radius: 2px;
|
|
|
|
|
+ -o-border-radius: 2px;
|
|
|
|
|
+ -khtml-border-radius: 2px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ #cronExpressionEditor select:focus {
|
|
|
|
|
+ border: 1px solid #009688;
|
|
|
|
|
+ }
|
|
|
|
|
+ </style>
|
|
|
|
|
+
|
|
|
@Html.DevExpress().PopupControl(s =>
|
|
@Html.DevExpress().PopupControl(s =>
|
|
|
{
|
|
{
|
|
|
s.Name = "devPopupControlEditMailNotification";
|
|
s.Name = "devPopupControlEditMailNotification";
|
|
@@ -79,17 +191,17 @@
|
|
|
if (Model.Id == -1)
|
|
if (Model.Id == -1)
|
|
|
s.HeaderText = "Neue Benachrichtigung erstellen";
|
|
s.HeaderText = "Neue Benachrichtigung erstellen";
|
|
|
else
|
|
else
|
|
|
- s.HeaderText = "\"" + Model.NotificationPluginSystemNameDescription + " - " + Model.NotificationJobSystemNameDescription + "\" bearbeiten";
|
|
|
|
|
|
|
+ s.HeaderText = "\"" + Model.NotificationPluginSystemNameDescription + "\" bearbeiten";
|
|
|
|
|
|
|
|
s.Modal = true;
|
|
s.Modal = true;
|
|
|
- s.Width = new Unit(600, UnitType.Pixel);
|
|
|
|
|
|
|
+ s.Width = new Unit(700, UnitType.Pixel);
|
|
|
s.CloseAction = CloseAction.CloseButton;
|
|
s.CloseAction = CloseAction.CloseButton;
|
|
|
s.PopupHorizontalAlign = PopupHorizontalAlign.WindowCenter;
|
|
s.PopupHorizontalAlign = PopupHorizontalAlign.WindowCenter;
|
|
|
s.PopupVerticalAlign = PopupVerticalAlign.TopSides;
|
|
s.PopupVerticalAlign = PopupVerticalAlign.TopSides;
|
|
|
s.PopupVerticalOffset = 10;
|
|
s.PopupVerticalOffset = 10;
|
|
|
s.AllowDragging = true;
|
|
s.AllowDragging = true;
|
|
|
s.AllowResize = false;
|
|
s.AllowResize = false;
|
|
|
- s.ShowMaximizeButton = true;
|
|
|
|
|
|
|
+ s.ShowMaximizeButton = false;
|
|
|
s.ShowFooter = false;
|
|
s.ShowFooter = false;
|
|
|
s.ShowOnPageLoad = true;
|
|
s.ShowOnPageLoad = true;
|
|
|
s.SetContent(() =>
|
|
s.SetContent(() =>
|
|
@@ -99,6 +211,7 @@
|
|
|
ViewContext.Writer.Write("<div class='editFormWrapper'>");
|
|
ViewContext.Writer.Write("<div class='editFormWrapper'>");
|
|
|
|
|
|
|
|
ViewContext.Writer.Write("<input type=\"hidden\" value=\"" + Model.Id + "\" id=\"Id\" name=\"Id\" />");
|
|
ViewContext.Writer.Write("<input type=\"hidden\" value=\"" + Model.Id + "\" id=\"Id\" name=\"Id\" />");
|
|
|
|
|
+ ViewContext.Writer.Write("<input type=\"hidden\" value=\"" + Model.CronExpression + "\" id=\"CronExpression\" name=\"CronExpression\" />");
|
|
|
|
|
|
|
|
ViewContext.Writer.Write("<div class='inlineModelPropertyContainer'>");
|
|
ViewContext.Writer.Write("<div class='inlineModelPropertyContainer'>");
|
|
|
{
|
|
{
|
|
@@ -108,15 +221,33 @@
|
|
|
ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.NotificationPluginSystemName).ToHtmlString());
|
|
ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.NotificationPluginSystemName).ToHtmlString());
|
|
|
Html.DevExpress().ComboBoxFor(m => m.NotificationPluginSystemName, t =>
|
|
Html.DevExpress().ComboBoxFor(m => m.NotificationPluginSystemName, t =>
|
|
|
{
|
|
{
|
|
|
- t.Width = new Unit(95, UnitType.Percentage);
|
|
|
|
|
|
|
+ t.Width = new Unit(100, UnitType.Percentage);
|
|
|
t.Properties.ValueField = "SystemName";
|
|
t.Properties.ValueField = "SystemName";
|
|
|
t.Properties.ValueType = typeof(string);
|
|
t.Properties.ValueType = typeof(string);
|
|
|
t.Properties.TextField = "Name";
|
|
t.Properties.TextField = "Name";
|
|
|
- t.Properties.ClientSideEvents.SelectedIndexChanged = "function (s, e) { pluginSystemName = s.GetValue(); }";
|
|
|
|
|
|
|
+ t.Properties.ClientSideEvents.SelectedIndexChanged = "function (s, e) { onNotificationPluginSelectedIndexChanged(); }";
|
|
|
}).BindList(ViewData["AllNotificationPlugins"]).Bind(Model.NotificationPluginSystemName).Render();
|
|
}).BindList(ViewData["AllNotificationPlugins"]).Bind(Model.NotificationPluginSystemName).Render();
|
|
|
}
|
|
}
|
|
|
ViewContext.Writer.Write("</div>");
|
|
ViewContext.Writer.Write("</div>");
|
|
|
|
|
+ }
|
|
|
|
|
+ ViewContext.Writer.Write("</div>");
|
|
|
|
|
+
|
|
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelPropertyContainer'>");
|
|
|
|
|
+ {
|
|
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 100%'>");
|
|
|
|
|
+ {
|
|
|
|
|
+ if (Model == null || (Model != null && Model.NotificationPlugin == null))
|
|
|
|
|
+ ViewContext.Writer.Write("<div id=\"notificationPluginDescription\" class=\"notificationDescription\"></div>");
|
|
|
|
|
+ else
|
|
|
|
|
+ ViewContext.Writer.Write(
|
|
|
|
|
+ "<div id=\"notificationPluginDescription\" class=\"notificationDescription\">" + Model.NotificationPlugin.Description + "</div>");
|
|
|
|
|
+ }
|
|
|
|
|
+ ViewContext.Writer.Write("</div>");
|
|
|
|
|
+ }
|
|
|
|
|
+ ViewContext.Writer.Write("</div>");
|
|
|
|
|
|
|
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelPropertyContainer'>");
|
|
|
|
|
+ {
|
|
|
ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 50%'>");
|
|
ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 50%'>");
|
|
|
{
|
|
{
|
|
|
ViewContext.Writer.Write(Html.CustomLabelFor(m => m.NotificationJobSystemName, "Benachrichtigungs-Job:"));
|
|
ViewContext.Writer.Write(Html.CustomLabelFor(m => m.NotificationJobSystemName, "Benachrichtigungs-Job:"));
|
|
@@ -130,6 +261,26 @@
|
|
|
ViewContext.Writer.Write("<div class='inlineModelPropertyContainer'>");
|
|
ViewContext.Writer.Write("<div class='inlineModelPropertyContainer'>");
|
|
|
{
|
|
{
|
|
|
ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 100%'>");
|
|
ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 100%'>");
|
|
|
|
|
+ {
|
|
|
|
|
+ if (Model == null || (Model != null && Model.NotificationPlugin == null))
|
|
|
|
|
+ ViewContext.Writer.Write("<div id=\"notificationJobDescription\" class=\"notificationDescription\"></div>");
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ var notificationJob = Model.NotificationPlugin.AvailableNotificationJobs
|
|
|
|
|
+ .FirstOrDefault(j => j.SystemName == Model.NotificationJobSystemName);
|
|
|
|
|
+
|
|
|
|
|
+ if (notificationJob != null)
|
|
|
|
|
+ ViewContext.Writer.Write(
|
|
|
|
|
+ "<div id=\"notificationJobDescription\" class=\"notificationDescription\">" + notificationJob.Description + "</div>");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ ViewContext.Writer.Write("</div>");
|
|
|
|
|
+ }
|
|
|
|
|
+ ViewContext.Writer.Write("</div>");
|
|
|
|
|
+
|
|
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelPropertyContainer'>");
|
|
|
|
|
+ {
|
|
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 65%'>");
|
|
|
{
|
|
{
|
|
|
ViewContext.Writer.Write(Html.CustomLabelFor(m => m.UserValues, "Benutzer:"));
|
|
ViewContext.Writer.Write(Html.CustomLabelFor(m => m.UserValues, "Benutzer:"));
|
|
|
ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.UserValues).ToHtmlString());
|
|
ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.UserValues).ToHtmlString());
|
|
@@ -174,6 +325,25 @@
|
|
|
}
|
|
}
|
|
|
ViewContext.Writer.Write("</div>");
|
|
ViewContext.Writer.Write("</div>");
|
|
|
|
|
|
|
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelPropertyContainer'>");
|
|
|
|
|
+ {
|
|
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 100%'>");
|
|
|
|
|
+ {
|
|
|
|
|
+ ViewContext.Writer.Write(Html.CustomLabelFor(m => m.CronExpression, "Interval:"));
|
|
|
|
|
+ ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.CronExpression).ToHtmlString());
|
|
|
|
|
+ ViewContext.Writer.Write("<div id=\"cronExpressionEditor\"></div>");
|
|
|
|
|
+ //Html.DevExpress().AppointmentRecurrenceForm(t =>
|
|
|
|
|
+ //{
|
|
|
|
|
+ // t.Name = "devRecurrenceFormCronExpresseion";
|
|
|
|
|
+ // t.Width = new Unit(100, UnitType.Percentage);
|
|
|
|
|
+ // t.IsRecurring = true;
|
|
|
|
|
+
|
|
|
|
|
+ //}).Render();
|
|
|
|
|
+ }
|
|
|
|
|
+ ViewContext.Writer.Write("</div>");
|
|
|
|
|
+ }
|
|
|
|
|
+ ViewContext.Writer.Write("</div>");
|
|
|
|
|
+
|
|
|
ViewContext.Writer.Write("</div>");
|
|
ViewContext.Writer.Write("</div>");
|
|
|
|
|
|
|
|
Html.RenderPartial(
|
|
Html.RenderPartial(
|