mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-19 01:57:55 +08:00
Create a report during an upgrade
--HG-- branch : dev
This commit is contained in:
@@ -6,6 +6,7 @@ using Orchard.Localization;
|
|||||||
using Orchard.Modules.ViewModels;
|
using Orchard.Modules.ViewModels;
|
||||||
using Orchard.Mvc.Results;
|
using Orchard.Mvc.Results;
|
||||||
using Orchard.Packaging;
|
using Orchard.Packaging;
|
||||||
|
using Orchard.Reports.Services;
|
||||||
using Orchard.UI.Notify;
|
using Orchard.UI.Notify;
|
||||||
|
|
||||||
namespace Orchard.Modules.Controllers {
|
namespace Orchard.Modules.Controllers {
|
||||||
@@ -13,16 +14,19 @@ namespace Orchard.Modules.Controllers {
|
|||||||
private readonly IModuleService _moduleService;
|
private readonly IModuleService _moduleService;
|
||||||
private readonly IDataMigrationManager _dataMigrationManager;
|
private readonly IDataMigrationManager _dataMigrationManager;
|
||||||
private readonly IPackageManager _packageManager;
|
private readonly IPackageManager _packageManager;
|
||||||
|
private readonly IReportsCoordinator _reportsCoordinator;
|
||||||
|
|
||||||
public AdminController(IOrchardServices services,
|
public AdminController(IOrchardServices services,
|
||||||
IModuleService moduleService,
|
IModuleService moduleService,
|
||||||
IDataMigrationManager dataMigrationManager,
|
IDataMigrationManager dataMigrationManager,
|
||||||
IPackageManager packageManager) {
|
IPackageManager packageManager,
|
||||||
|
IReportsCoordinator reportsCoordinator) {
|
||||||
|
|
||||||
Services = services;
|
Services = services;
|
||||||
_moduleService = moduleService;
|
_moduleService = moduleService;
|
||||||
_dataMigrationManager = dataMigrationManager;
|
_dataMigrationManager = dataMigrationManager;
|
||||||
_packageManager = packageManager;
|
_packageManager = packageManager;
|
||||||
|
_reportsCoordinator = reportsCoordinator;
|
||||||
|
|
||||||
T = NullLocalizer.Instance;
|
T = NullLocalizer.Instance;
|
||||||
}
|
}
|
||||||
@@ -113,7 +117,7 @@ namespace Orchard.Modules.Controllers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public ActionResult Update(string id, bool? force) {
|
public ActionResult Update(string id) {
|
||||||
if (!Services.Authorizer.Authorize(Permissions.ManageFeatures, T("Not allowed to manage features")))
|
if (!Services.Authorizer.Authorize(Permissions.ManageFeatures, T("Not allowed to manage features")))
|
||||||
return new HttpUnauthorizedResult();
|
return new HttpUnauthorizedResult();
|
||||||
|
|
||||||
@@ -121,6 +125,7 @@ namespace Orchard.Modules.Controllers {
|
|||||||
return new NotFoundResult();
|
return new NotFoundResult();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
_reportsCoordinator.Register("Data Migration", "Upgrade " + id, "Orchard installation");
|
||||||
_dataMigrationManager.Update(id);
|
_dataMigrationManager.Update(id);
|
||||||
Services.Notifier.Information(T("The feature {0} was updated succesfuly", id));
|
Services.Notifier.Information(T("The feature {0} was updated succesfuly", id));
|
||||||
}
|
}
|
||||||
|
@@ -69,7 +69,6 @@
|
|||||||
if(Model.FeaturesThatNeedUpdate.Contains(feature.Descriptor.Name)){
|
if(Model.FeaturesThatNeedUpdate.Contains(feature.Descriptor.Name)){
|
||||||
using (Html.BeginFormAntiForgeryPost(string.Format("{0}", Url.Action("Update", new { area = "Orchard.Modules" })), FormMethod.Post, new {@class = "inline link"})) { %>
|
using (Html.BeginFormAntiForgeryPost(string.Format("{0}", Url.Action("Update", new { area = "Orchard.Modules" })), FormMethod.Post, new {@class = "inline link"})) { %>
|
||||||
<%: Html.Hidden("id", feature.Descriptor.Name, new { id = "" })%>
|
<%: Html.Hidden("id", feature.Descriptor.Name, new { id = "" })%>
|
||||||
<%: Html.Hidden("force", true)%>
|
|
||||||
<button type="submit" class="update"><%: T("Update") %></button><%
|
<button type="submit" class="update"><%: T("Update") %></button><%
|
||||||
}
|
}
|
||||||
}%>
|
}%>
|
||||||
|
Reference in New Issue
Block a user