-
-
-
+
Yes, convert line breaks
diff --git a/src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-toggle.html b/src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-toggle.html
index e850bf22b8..ba9257bac7 100644
--- a/src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-toggle.html
+++ b/src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-toggle.html
@@ -1,4 +1,4 @@
-
+
+
diff --git a/src/Umbraco.Web.UI.Client/src/views/content/content.notify.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/content.notify.controller.js
new file mode 100644
index 0000000000..86fd65c74a
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/views/content/content.notify.controller.js
@@ -0,0 +1,49 @@
+(function () {
+ function CreateNotifyController(
+ $scope,
+ contentResource,
+ notificationsService,
+ navigationService,
+ localizationService,
+ angularHelper) {
+ var vm = this;
+ var currentForm;
+ vm.notifyOptions = [];
+ vm.save = save;
+ vm.cancel = cancel;
+ vm.message = {
+ name: $scope.currentNode.name
+ };;
+ function onInit() {
+ vm.loading = true;
+ contentResource.getNotifySettingsById($scope.currentNode.id).then(function (options) {
+ currentForm = angularHelper.getCurrentForm($scope);
+ vm.loading = false;
+ vm.notifyOptions = options;
+ });
+ }
+ function cancel() {
+ navigationService.hideMenu();
+ };
+ function save(notifyOptions) {
+ vm.saveState = "busy";
+ vm.saveError = false;
+ vm.saveSuccces = false;
+ var selectedSting = "";
+ angular.forEach(notifyOptions, function (option) {
+ if (option.checked === true && option.notifyCode) {
+ selectedSting += option.notifyCode;
+ }
+ })
+ contentResource.setNotifySettingsById($scope.currentNode.id, selectedSting).then(function () {
+ vm.saveState = "success";
+ vm.saveSuccces = true;
+ }, function (error) {
+ vm.saveState = "error";
+ vm.saveError = error;
+ });
+ }
+ onInit();
+ }
+ angular.module("umbraco").controller("Umbraco.Editors.Content.CreateNotifyController", CreateNotifyController);
+}());
diff --git a/src/Umbraco.Web.UI.Client/src/views/content/notify.html b/src/Umbraco.Web.UI.Client/src/views/content/notify.html
new file mode 100644
index 0000000000..ec9b3d2b0d
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/views/content/notify.html
@@ -0,0 +1,44 @@
+
diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
index e8a73300e4..2db6fcdd4f 100644
--- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
+++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
@@ -49,6 +49,7 @@
true
true
+
bin\
@@ -760,7 +761,6 @@
-
diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml
index 70f6470a20..e1b2cff4c7 100644
--- a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml
+++ b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml
@@ -2201,4 +2201,8 @@ To manage your website, simply open the Umbraco back office and start adding con
There is no 'restore' relation found for this node. Use the Move menu item to move it manually.
The item you want to restore it under ('%0%') is in the recycle bin. Use the Move menu item to move the item manually.
+
+ Select your notifications for
+ Notification settings saved for
+
diff --git a/src/Umbraco.Web.UI/umbraco/dialogs/notifications.aspx b/src/Umbraco.Web.UI/umbraco/dialogs/notifications.aspx
deleted file mode 100644
index cd97ec267f..0000000000
--- a/src/Umbraco.Web.UI/umbraco/dialogs/notifications.aspx
+++ /dev/null
@@ -1,18 +0,0 @@
-<%@ Page Language="c#" MasterPageFile="../masterpages/umbracoDialog.Master" Codebehind="notifications.aspx.cs" AutoEventWireup="True"
- Inherits="umbraco.dialogs.notifications" %>
-<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Umbraco.Web/Editors/ContentController.cs b/src/Umbraco.Web/Editors/ContentController.cs
index 899c6a0ab3..280a99d418 100644
--- a/src/Umbraco.Web/Editors/ContentController.cs
+++ b/src/Umbraco.Web/Editors/ContentController.cs
@@ -9,7 +9,6 @@ using System.Web.Http;
using System.Web.Http.Controllers;
using System.Web.Http.ModelBinding;
using AutoMapper;
-using umbraco.BusinessLogic.Actions;
using Umbraco.Core;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
@@ -23,10 +22,11 @@ using Umbraco.Web.Mvc;
using Umbraco.Web.WebApi;
using Umbraco.Web.WebApi.Binders;
using Umbraco.Web.WebApi.Filters;
-using umbraco.cms.businesslogic.web;
-using umbraco.presentation.preview;
using Umbraco.Core.Events;
using Constants = Umbraco.Core.Constants;
+using umbraco.cms.businesslogic;
+using System.Collections;
+using umbraco;
namespace Umbraco.Web.Editors
{
@@ -68,7 +68,7 @@ namespace Umbraco.Web.Editors
{
controllerSettings.Services.Replace(typeof(IHttpActionSelector), new ParameterSwapControllerActionSelector(
new ParameterSwapControllerActionSelector.ParameterSwapInfo("GetNiceUrl", "id", typeof(int), typeof(Guid), typeof(Udi)),
- new ParameterSwapControllerActionSelector.ParameterSwapInfo("GetById", "id", typeof(int), typeof(Guid), typeof(Udi))
+ new ParameterSwapControllerActionSelector.ParameterSwapInfo("GetById", "id", typeof(int), typeof(Guid), typeof(Udi))
));
}
}
@@ -1156,5 +1156,37 @@ namespace Umbraco.Web.Editors
return allowed;
}
+ [EnsureUserPermissionForContent("contentId", 'R')]
+ public List GetNotificationOptions(int contentId)
+ {
+ List notifications = new List();
+ if (contentId <= 0) throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound));
+ var content = Services.ContentService.GetById(contentId);
+ if (content == null) throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound));
+ var node = new CMSNode(contentId);
+ ArrayList actionList = global::umbraco.BusinessLogic.Actions.Action.GetAll();
+ foreach (global::umbraco.interfaces.IAction a in actionList)
+ {
+ if (a.ShowInNotifier)
+ {
+ NotifySetting n = new NotifySetting
+ {
+ Name = ui.Text("actions", a.Alias),
+ Checked = (UmbracoUser.GetNotifications(node.Path).IndexOf(a.Letter) > -1),
+ NotifyCode = a.Letter.ToString()
+ };
+ notifications.Add(n);
+ }
+ }
+ return notifications;
+ }
+ public void SetNotificationOptions(int contentId, string notifyOptions = "")
+ {
+ if (contentId <= 0) throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound));
+ var content = Services.ContentService.GetById(contentId);
+ if (content == null) throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound));
+ var node = new CMSNode(contentId);
+ global::umbraco.cms.businesslogic.workflow.Notification.UpdateNotifications(UmbracoUser, node, notifyOptions ?? "");
+ }
}
}
diff --git a/src/Umbraco.Web/Models/ContentEditing/NotifySetting.cs b/src/Umbraco.Web/Models/ContentEditing/NotifySetting.cs
new file mode 100644
index 0000000000..bd81b4a55b
--- /dev/null
+++ b/src/Umbraco.Web/Models/ContentEditing/NotifySetting.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Runtime.Serialization;
+namespace Umbraco.Web.Models.ContentEditing
+{
+ [DataContract(Name = "notifySetting", Namespace = "")]
+ public class NotifySetting : ICloneable
+ {
+ [DataMember(Name = "name")]
+ public string Name { get; set; }
+ [DataMember(Name = "checked")]
+ public bool Checked { get; set; }
+ ///
+ /// The letter from the IAction
+ ///
+ [DataMember(Name = "notifyCode")]
+ public string NotifyCode { get; set; }
+ public object Clone()
+ {
+ return this.MemberwiseClone();
+ }
+ }
+}
diff --git a/src/Umbraco.Web/Trees/ContentTreeController.cs b/src/Umbraco.Web/Trees/ContentTreeController.cs
index 28f9b0420b..6cb13aa847 100644
--- a/src/Umbraco.Web/Trees/ContentTreeController.cs
+++ b/src/Umbraco.Web/Trees/ContentTreeController.cs
@@ -105,7 +105,7 @@ namespace Umbraco.Web.Trees
}
protected override MenuItemCollection PerformGetMenuForNode(string id, FormDataCollection queryStrings)
- {
+ {
if (id == Constants.System.Root.ToInvariantString())
{
var menu = new MenuItemCollection();
@@ -159,7 +159,7 @@ namespace Umbraco.Web.Trees
{
throw new HttpResponseException(HttpStatusCode.NotFound);
}
-
+
//if the user has no path access for this node, all they can do is refresh
if (Security.CurrentUser.HasPathAccess(item, Services.EntityService, RecycleBinId) == false)
{
@@ -235,7 +235,7 @@ namespace Umbraco.Web.Trees
menu.Items.Add(ui.Text("actions", ActionRights.Instance.Alias), true);
menu.Items.Add(ui.Text("actions", ActionProtect.Instance.Alias), true).ConvertLegacyMenuItem(item, "content", "content");
- menu.Items.Add(ui.Text("actions", ActionNotify.Instance.Alias), true).ConvertLegacyMenuItem(item, "content", "content");
+ menu.Items.Add(ui.Text("actions", ActionNotify.Instance.Alias), true);
menu.Items.Add(ui.Text("actions", ActionSendToTranslate.Instance.Alias)).ConvertLegacyMenuItem(item, "content", "content");
menu.Items.Add(ui.Text("actions", ActionRefresh.Instance.Alias), true);
diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj
index 5fd567ee00..e970c09fca 100644
--- a/src/Umbraco.Web/Umbraco.Web.csproj
+++ b/src/Umbraco.Web/Umbraco.Web.csproj
@@ -344,6 +344,7 @@
+
@@ -1550,13 +1551,6 @@
importDocumenttype.aspx
ASPXCodeBehind
-
- notifications.aspx
- ASPXCodeBehind
-
-
- notifications.aspx
-
rollBack.aspx
ASPXCodeBehind
@@ -1885,9 +1879,6 @@
-
- ASPXCodeBehind
-
ASPXCodeBehind
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/notifications.aspx b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/notifications.aspx
deleted file mode 100644
index cd97ec267f..0000000000
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/notifications.aspx
+++ /dev/null
@@ -1,18 +0,0 @@
-<%@ Page Language="c#" MasterPageFile="../masterpages/umbracoDialog.Master" Codebehind="notifications.aspx.cs" AutoEventWireup="True"
- Inherits="umbraco.dialogs.notifications" %>
-<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/notifications.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/notifications.aspx.cs
deleted file mode 100644
index 195ac15ec8..0000000000
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/notifications.aspx.cs
+++ /dev/null
@@ -1,108 +0,0 @@
-using System;
-using System.Collections;
-using System.Globalization;
-using System.Web.UI;
-using System.Web.UI.HtmlControls;
-using System.Web.UI.WebControls;
-using umbraco.BasePages;
-using umbraco.cms.businesslogic;
-using umbraco.cms.businesslogic.workflow;
-
-namespace umbraco.dialogs
-{
- ///
- /// Summary description for cruds.
- ///
- public partial class notifications : UmbracoEnsuredPage
- {
- private ArrayList actions = new ArrayList();
- private CMSNode node;
-
- public notifications()
- {
- CurrentApp = BusinessLogic.DefaultApps.content.ToString();
-
- }
-
- protected void Page_Load(object sender, EventArgs e)
- {
- Button1.Text = ui.Text("update");
- pane_form.Text = ui.Text("notifications", "editNotifications", Server.HtmlEncode(node.Text), base.getUser());
- }
-
- #region Web Form Designer generated code
-
- protected override void OnInit(EventArgs e)
- {
- //
- // CODEGEN: This call is required by the ASP.NET Web Form Designer.
- //
- InitializeComponent();
- base.OnInit(e);
-
- node = new cms.businesslogic.CMSNode(int.Parse(helper.Request("id")));
-
- ArrayList actionList = BusinessLogic.Actions.Action.GetAll();
-
- foreach (interfaces.IAction a in actionList)
- {
- if (a.ShowInNotifier)
- {
-
- CheckBox c = new CheckBox();
- c.ID = a.Letter.ToString(CultureInfo.InvariantCulture);
-
- if (base.getUser().GetNotifications(node.Path).IndexOf(a.Letter) > -1)
- c.Checked = true;
-
- uicontrols.PropertyPanel pp = new umbraco.uicontrols.PropertyPanel();
- pp.CssClass = "inline";
- pp.Text = ui.Text("actions", a.Alias);
- pp.Controls.Add(c);
-
- pane_form.Controls.Add(pp);
-
- actions.Add(c);
-
- }
- }
-
- }
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- }
-
- #endregion
-
- protected void Button1_Click(object sender, EventArgs e)
- {
- string notifications = "";
-
- // First off - load all users
- foreach (CheckBox c in actions)
- {
- // Update the user with the new permission
- if (c.Checked)
- notifications += c.ID;
- }
- Notification.UpdateNotifications(base.getUser(), node, notifications);
- getUser().resetNotificationCache();
- base.getUser().initNotifications();
-
- var feedback = new umbraco.uicontrols.Feedback();
- feedback.Text = ui.Text("notifications") + " " + ui.Text("ok") + "" + ui.Text("closeThisWindow") + "";
- feedback.type = umbraco.uicontrols.Feedback.feedbacktype.success;
-
- pane_form.Controls.Clear();
- pane_form.Controls.Add(feedback);
-
- //pane_form.Visible = false;
- pl_buttons.Visible = false;
- }
- }
-}
\ No newline at end of file
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/notifications.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/notifications.aspx.designer.cs
deleted file mode 100644
index 7ab5c11751..0000000000
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/notifications.aspx.designer.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace umbraco.dialogs {
-
-
- public partial class notifications {
-
- ///
- /// pane_form control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::umbraco.uicontrols.Pane pane_form;
-
- ///
- /// pl_buttons control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.HtmlControls.HtmlGenericControl pl_buttons;
-
- ///
- /// Button1 control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.WebControls.Button Button1;
- }
-}