From 78475b0686d3c06fa1cc57c5cb36e800dd8cb8a8 Mon Sep 17 00:00:00 2001 From: Rasmus John Pedersen Date: Fri, 9 Oct 2015 20:25:51 +0200 Subject: [PATCH] Added recursive option to copy dialog --- .../src/views/content/content.copy.controller.js | 3 ++- src/Umbraco.Web.UI.Client/src/views/content/copy.html | 6 ++++++ src/Umbraco.Web/Editors/ContentController.cs | 2 +- src/Umbraco.Web/Models/ContentEditing/MoveOrCopy.cs | 7 +++++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/content/content.copy.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/content.copy.controller.js index fc3015ed09..5ff55ba397 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/content.copy.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/content/content.copy.controller.js @@ -7,6 +7,7 @@ angular.module("umbraco").controller("Umbraco.Editors.Content.CopyController", searchText = value + "..."; }); + $scope.recursive = true; $scope.relateToOriginal = false; $scope.dialogTreeEventHandler = $({}); $scope.busy = false; @@ -95,7 +96,7 @@ angular.module("umbraco").controller("Umbraco.Editors.Content.CopyController", $scope.busy = true; $scope.error = false; - contentResource.copy({ parentId: $scope.target.id, id: node.id, relateToOriginal: $scope.relateToOriginal }) + contentResource.copy({ parentId: $scope.target.id, id: node.id, relateToOriginal: $scope.relateToOriginal, recursive: $scope.recursive }) .then(function (path) { $scope.error = false; $scope.success = true; diff --git a/src/Umbraco.Web.UI.Client/src/views/content/copy.html b/src/Umbraco.Web.UI.Client/src/views/content/copy.html index fddc07db22..f9a3c300d0 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/copy.html +++ b/src/Umbraco.Web.UI.Client/src/views/content/copy.html @@ -56,6 +56,12 @@ + + + + + + diff --git a/src/Umbraco.Web/Editors/ContentController.cs b/src/Umbraco.Web/Editors/ContentController.cs index f8a75a23d1..1b6fbfa3cb 100644 --- a/src/Umbraco.Web/Editors/ContentController.cs +++ b/src/Umbraco.Web/Editors/ContentController.cs @@ -491,7 +491,7 @@ namespace Umbraco.Web.Editors { var toCopy = ValidateMoveOrCopy(copy); - var c = Services.ContentService.Copy(toCopy, copy.ParentId, copy.RelateToOriginal); + var c = Services.ContentService.Copy(toCopy, copy.ParentId, copy.RelateToOriginal, copy.Recursive); var response = Request.CreateResponse(HttpStatusCode.OK); response.Content = new StringContent(c.Path, Encoding.UTF8, "application/json"); diff --git a/src/Umbraco.Web/Models/ContentEditing/MoveOrCopy.cs b/src/Umbraco.Web/Models/ContentEditing/MoveOrCopy.cs index a2cc45c446..a387876a45 100644 --- a/src/Umbraco.Web/Models/ContentEditing/MoveOrCopy.cs +++ b/src/Umbraco.Web/Models/ContentEditing/MoveOrCopy.cs @@ -33,6 +33,13 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "relateToOriginal", IsRequired = true)] [Required] public bool RelateToOriginal { get; set; } + + /// + /// Boolean indicating whether copying the object should be recursive + /// + [DataMember(Name = "recursive", IsRequired = true)] + [Required] + public bool Recursive { get; set; } } }