bug fix #185: fix document package generation
This commit is contained in:
@@ -1961,9 +1961,9 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
|
||||
#region Handlers
|
||||
[HttpPost, ValidateAntiForgeryToken]
|
||||
public virtual ActionResult GenerateDocumentHandlerUi(string templateId, string targetId, string handlerId)
|
||||
public virtual ActionResult GenerateDocumentHandlerUi(string id, string targetId, string handlerId)
|
||||
{
|
||||
Disco.Services.DocumentTemplateExtensions.GetTemplateAndTarget(Database, Authorization, templateId, targetId, out var template, out var target, out var targetUser);
|
||||
Disco.Services.DocumentTemplateExtensions.GetTemplateAndTarget(Database, Authorization, id, targetId, out var template, out var target, out var targetUser);
|
||||
|
||||
var handlerManifest = Plugins.GetPluginFeature(handlerId, typeof(DocumentHandlerProviderFeature));
|
||||
|
||||
@@ -1984,9 +1984,9 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
}
|
||||
|
||||
[HttpPost, ValidateAntiForgeryToken]
|
||||
public virtual ActionResult DocumentHandlers(string templateId, string targetId)
|
||||
public virtual ActionResult DocumentHandlers(string id, string targetId)
|
||||
{
|
||||
Disco.Services.DocumentTemplateExtensions.GetTemplateAndTarget(Database, Authorization, templateId, targetId, out var template, out var target, out _);
|
||||
Disco.Services.DocumentTemplateExtensions.GetTemplateAndTarget(Database, Authorization, id, targetId, out var template, out var target, out _);
|
||||
|
||||
var handlers = Plugins.GetPluginFeatures(typeof(DocumentHandlerProviderFeature))
|
||||
.SelectMany(f =>
|
||||
|
||||
@@ -4,8 +4,11 @@ using Disco.Models.Services.Documents;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Documents;
|
||||
using Disco.Services.Plugins;
|
||||
using Disco.Services.Plugins.Features.DocumentHandlerProvider;
|
||||
using Disco.Services.Users;
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web.Areas.API.Models.DocumentTemplate;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@@ -470,5 +473,65 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Handlers
|
||||
[HttpPost, ValidateAntiForgeryToken]
|
||||
public virtual ActionResult GenerateDocumentHandlerUi(string id, string targetId, string handlerId)
|
||||
{
|
||||
DocumentTemplatePackageExtensions.GetPackageAndTarget(Database, Authorization, id, targetId, out var package, out var target, out var targetUser);
|
||||
|
||||
var handlerManifest = Plugins.GetPluginFeature(handlerId, typeof(DocumentHandlerProviderFeature));
|
||||
|
||||
using (var handler = handlerManifest.CreateInstance<DocumentHandlerProviderFeature>())
|
||||
{
|
||||
if (!handler.CanHandle(package, target))
|
||||
throw new NotSupportedException("Handler does not support this Document Template and Target");
|
||||
|
||||
var handlerPartialView = handler.GenerationOptionsUi;
|
||||
|
||||
if (handlerPartialView == null)
|
||||
throw new NotSupportedException("Handler does not have a Generation Options UI");
|
||||
|
||||
var model = handler.GetGenerationOptionsUiModel(package, target, targetUser, CurrentUser);
|
||||
|
||||
return this.PrecompiledPartialView(handlerPartialView, model);
|
||||
}
|
||||
}
|
||||
|
||||
[HttpPost, ValidateAntiForgeryToken]
|
||||
public virtual ActionResult DocumentHandlers(string id, string targetId)
|
||||
{
|
||||
DocumentTemplatePackageExtensions.GetPackageAndTarget(Database, Authorization, id, targetId, out var package, out var target, out _);
|
||||
|
||||
var handlers = Plugins.GetPluginFeatures(typeof(DocumentHandlerProviderFeature))
|
||||
.SelectMany(f =>
|
||||
{
|
||||
using (var handler = f.CreateInstance<DocumentHandlerProviderFeature>())
|
||||
{
|
||||
if (handler.CanHandle(package, target))
|
||||
return OneOf.Create(new DocumentHandlerModel()
|
||||
{
|
||||
Id = f.Id,
|
||||
Title = handler.HandlerTitle,
|
||||
Description = handler.HandlerDescription,
|
||||
UiUrl = handler.GenerationOptionsUi == null ? null : Url.Action(MVC.API.DocumentTemplatePackage.GenerateDocumentHandlerUi(package.Id, target.AttachmentReferenceId, f.Id)),
|
||||
Icon = handler.GenerationOptionsIcon,
|
||||
});
|
||||
}
|
||||
return Enumerable.Empty<DocumentHandlerModel>();
|
||||
}).ToList();
|
||||
|
||||
var model = new DocumentHandlersModel()
|
||||
{
|
||||
TemplateId = package.Id,
|
||||
TemplateName = package.Description,
|
||||
TargetId = target.AttachmentReferenceId,
|
||||
TargetName = target.ToString(),
|
||||
Handlers = handlers,
|
||||
};
|
||||
|
||||
return Json(model);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -9,13 +9,14 @@
|
||||
const generatePackageUrl = $container.attr('data-generatepackageurl');
|
||||
const handlersPresent = $container.attr('data-handlerspresent') === 'true';
|
||||
const handlersUrl = $container.attr('data-handlersurl');
|
||||
const handlersPackageUrl = $container.attr('data-handlerspackageurl');
|
||||
let $handlersDialog = null;
|
||||
let lastTemplateId = null;
|
||||
|
||||
const downloadPdf = function (templateId) {
|
||||
let action = generatePdfUrl;
|
||||
if (templateId.lastIndexOf('Package:', 0) === 0) {
|
||||
templateId + templateId.substring(8);
|
||||
templateId = templateId.substring(8);
|
||||
action = generatePackageUrl;
|
||||
}
|
||||
|
||||
@@ -35,6 +36,12 @@
|
||||
}
|
||||
|
||||
const updateHandlers = function (templateId) {
|
||||
let action = handlersUrl;
|
||||
if (templateId.lastIndexOf('Package:', 0) === 0) {
|
||||
templateId = templateId.substring(8);
|
||||
action = handlersPackageUrl;
|
||||
}
|
||||
|
||||
const $handlerPicker = $handlersDialog.find('.handlerPicker');
|
||||
const $loadingUi = $handlersDialog.find('#Document_Generation_Dialog_Handlers_Loading');
|
||||
|
||||
@@ -43,9 +50,9 @@
|
||||
|
||||
var formData = new FormData();
|
||||
formData.append('__RequestVerificationToken', document.body.dataset.antiforgery);
|
||||
formData.append('templateId', decodeURI(templateId));
|
||||
formData.append('id', decodeURI(templateId));
|
||||
formData.append('targetId', decodeURI(targetId));
|
||||
fetch(handlersUrl, {
|
||||
fetch(action, {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
}).then(r => r.json())
|
||||
|
||||
@@ -1 +1 @@
|
||||
(function(n,t,i){i(function(){let u=null;const r=i("#Document_Generation_Container"),f=r.find("#Document_Generate"),e=r.attr("data-targetid"),y=r.attr("data-targettype"),h=r.attr("data-generatepdfurl"),c=r.attr("data-generatepackageurl"),l=r.attr("data-handlerspresent")==="true",a=r.attr("data-handlersurl");let n=null,o=null;const s=function(n){let f=h;n.lastIndexOf("Package:",0)===0&&(n+n.substring(8),f=c);u||(u=i("<iframe>").attr("title","Document Generation Host").addClass("hidden").appendTo("body").contents(),u[0].body.innerHTML='<form method="post"><input type="hidden" name="__RequestVerificationToken" value="'+t.body.dataset.antiforgery+'"><input type="hidden" name="id"><input type="hidden" name="targetId"><\/form>');const r=u[0].forms[0];r.action=f;r.id.value=n;r.targetId.value=e;r.submit()},v=function(r){const f=n.find(".handlerPicker"),o=n.find("#Document_Generation_Dialog_Handlers_Loading");f.find("div.handler").remove();o.show();var u=new FormData;u.append("__RequestVerificationToken",t.body.dataset.antiforgery);u.append("templateId",decodeURI(r));u.append("targetId",decodeURI(e));fetch(a,{method:"POST",body:u}).then(n=>n.json()).then(n=>{o.hide(),i.each(n.Handlers,(n,t)=>{i('<div class="handler">').text(t.Title).attr({"data-id":t.Id,"data-uiurl":t.UiUrl}).prepend(i('<i class="fa fa-fw fa-lg">').addClass("fa-"+t.Icon)).appendTo(f)})})};f.change(function(){var u=f.val();if(u){if(o=u,l){if(!n){n=r.find("#Document_Generation_Dialog");n.dialog({width:750,height:500,resizable:!1,modal:!0,autoOpen:!1,buttons:{Cancel:function(){i(this).dialog("close")}}});n.find("#Document_Generation_Dialog_Download").click(t=>(t.preventDefault(),s(o),n.dialog("close"),!1));const f=n.find(".handlerPicker"),e=n.find("#Document_Generation_Dialog_Download_Container"),u=n.find("#Document_Generation_Dialog_HandlerUI");f.on("click","div[data-id]",n=>{f.find("div").removeClass("selected");const r=i(n.currentTarget);r.addClass("selected");const o=r.attr("data-id");if(o==="download")e.show(),u.hide(),u.empty();else{e.hide();u.empty();u.show();const i=r.attr("data-uiurl"),n=new FormData;n.append("__RequestVerificationToken",t.body.dataset.antiforgery);fetch(i,{method:"POST",body:n}).then(n=>n.text()).then(n=>{u.html(n)})}})}const e=n.find(".handlerPicker"),c=n.find("#Document_Generation_Dialog_Download_Container"),h=n.find("#Document_Generation_Dialog_HandlerUI");e.find("div").removeClass("selected");e.find("div[data-id=download]").addClass("selected");c.show();h.hide();h.empty();n.dialog("option","title","Generate Document: "+f[0].selectedOptions[0].label);n.dialog("open");v(u)}else s(u);f.val("").blur()}})})})(window,document,$);
|
||||
(function(n,t,i){i(function(){let u=null;const r=i("#Document_Generation_Container"),f=r.find("#Document_Generate"),e=r.attr("data-targetid"),p=r.attr("data-targettype"),h=r.attr("data-generatepdfurl"),c=r.attr("data-generatepackageurl"),l=r.attr("data-handlerspresent")==="true",a=r.attr("data-handlersurl"),v=r.attr("data-handlerspackageurl");let n=null,o=null;const s=function(n){let f=h;n.lastIndexOf("Package:",0)===0&&(n=n.substring(8),f=c);u||(u=i("<iframe>").attr("title","Document Generation Host").addClass("hidden").appendTo("body").contents(),u[0].body.innerHTML='<form method="post"><input type="hidden" name="__RequestVerificationToken" value="'+t.body.dataset.antiforgery+'"><input type="hidden" name="id"><input type="hidden" name="targetId"><\/form>');const r=u[0].forms[0];r.action=f;r.id.value=n;r.targetId.value=e;r.submit()},y=function(r){let f=a;r.lastIndexOf("Package:",0)===0&&(r=r.substring(8),f=v);const o=n.find(".handlerPicker"),s=n.find("#Document_Generation_Dialog_Handlers_Loading");o.find("div.handler").remove();s.show();var u=new FormData;u.append("__RequestVerificationToken",t.body.dataset.antiforgery);u.append("id",decodeURI(r));u.append("targetId",decodeURI(e));fetch(f,{method:"POST",body:u}).then(n=>n.json()).then(n=>{s.hide(),i.each(n.Handlers,(n,t)=>{i('<div class="handler">').text(t.Title).attr({"data-id":t.Id,"data-uiurl":t.UiUrl}).prepend(i('<i class="fa fa-fw fa-lg">').addClass("fa-"+t.Icon)).appendTo(o)})})};f.change(function(){var u=f.val();if(u){if(o=u,l){if(!n){n=r.find("#Document_Generation_Dialog");n.dialog({width:750,height:500,resizable:!1,modal:!0,autoOpen:!1,buttons:{Cancel:function(){i(this).dialog("close")}}});n.find("#Document_Generation_Dialog_Download").click(t=>(t.preventDefault(),s(o),n.dialog("close"),!1));const f=n.find(".handlerPicker"),e=n.find("#Document_Generation_Dialog_Download_Container"),u=n.find("#Document_Generation_Dialog_HandlerUI");f.on("click","div[data-id]",n=>{f.find("div").removeClass("selected");const r=i(n.currentTarget);r.addClass("selected");const o=r.attr("data-id");if(o==="download")e.show(),u.hide(),u.empty();else{e.hide();u.empty();u.show();const i=r.attr("data-uiurl"),n=new FormData;n.append("__RequestVerificationToken",t.body.dataset.antiforgery);fetch(i,{method:"POST",body:n}).then(n=>n.text()).then(n=>{u.html(n)})}})}const e=n.find(".handlerPicker"),c=n.find("#Document_Generation_Dialog_Download_Container"),h=n.find("#Document_Generation_Dialog_HandlerUI");e.find("div").removeClass("selected");e.find("div[data-id=download]").addClass("selected");c.show();h.hide();h.empty();n.dialog("option","title","Generate Document: "+f[0].selectedOptions[0].label);n.dialog("open");y(u)}else s(u);f.val("").blur()}})})})(window,document,$);
|
||||
+10
-3
@@ -9,13 +9,14 @@
|
||||
const generatePackageUrl = $container.attr('data-generatepackageurl');
|
||||
const handlersPresent = $container.attr('data-handlerspresent') === 'true';
|
||||
const handlersUrl = $container.attr('data-handlersurl');
|
||||
const handlersPackageUrl = $container.attr('data-handlerspackageurl');
|
||||
let $handlersDialog = null;
|
||||
let lastTemplateId = null;
|
||||
|
||||
const downloadPdf = function (templateId) {
|
||||
let action = generatePdfUrl;
|
||||
if (templateId.lastIndexOf('Package:', 0) === 0) {
|
||||
templateId + templateId.substring(8);
|
||||
templateId = templateId.substring(8);
|
||||
action = generatePackageUrl;
|
||||
}
|
||||
|
||||
@@ -35,6 +36,12 @@
|
||||
}
|
||||
|
||||
const updateHandlers = function (templateId) {
|
||||
let action = handlersUrl;
|
||||
if (templateId.lastIndexOf('Package:', 0) === 0) {
|
||||
templateId = templateId.substring(8);
|
||||
action = handlersPackageUrl;
|
||||
}
|
||||
|
||||
const $handlerPicker = $handlersDialog.find('.handlerPicker');
|
||||
const $loadingUi = $handlersDialog.find('#Document_Generation_Dialog_Handlers_Loading');
|
||||
|
||||
@@ -43,9 +50,9 @@
|
||||
|
||||
var formData = new FormData();
|
||||
formData.append('__RequestVerificationToken', document.body.dataset.antiforgery);
|
||||
formData.append('templateId', decodeURI(templateId));
|
||||
formData.append('id', decodeURI(templateId));
|
||||
formData.append('targetId', decodeURI(targetId));
|
||||
fetch(handlersUrl, {
|
||||
fetch(action, {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
}).then(r => r.json())
|
||||
|
||||
@@ -794,7 +794,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_GenerateDocumentHandlerUi
|
||||
{
|
||||
public readonly string templateId = "templateId";
|
||||
public readonly string id = "id";
|
||||
public readonly string targetId = "targetId";
|
||||
public readonly string handlerId = "handlerId";
|
||||
}
|
||||
@@ -804,7 +804,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_DocumentHandlers
|
||||
{
|
||||
public readonly string templateId = "templateId";
|
||||
public readonly string id = "id";
|
||||
public readonly string targetId = "targetId";
|
||||
}
|
||||
static readonly ActionParamsClass_Export s_params_Export = new ActionParamsClass_Export();
|
||||
@@ -1385,29 +1385,29 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void GenerateDocumentHandlerUiOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string templateId, string targetId, string handlerId);
|
||||
partial void GenerateDocumentHandlerUiOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string targetId, string handlerId);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult GenerateDocumentHandlerUi(string templateId, string targetId, string handlerId)
|
||||
public override System.Web.Mvc.ActionResult GenerateDocumentHandlerUi(string id, string targetId, string handlerId)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.GenerateDocumentHandlerUi);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "templateId", templateId);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "targetId", targetId);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "handlerId", handlerId);
|
||||
GenerateDocumentHandlerUiOverride(callInfo, templateId, targetId, handlerId);
|
||||
GenerateDocumentHandlerUiOverride(callInfo, id, targetId, handlerId);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void DocumentHandlersOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string templateId, string targetId);
|
||||
partial void DocumentHandlersOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string targetId);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult DocumentHandlers(string templateId, string targetId)
|
||||
public override System.Web.Mvc.ActionResult DocumentHandlers(string id, string targetId)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.DocumentHandlers);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "templateId", templateId);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "targetId", targetId);
|
||||
DocumentHandlersOverride(callInfo, templateId, targetId);
|
||||
DocumentHandlersOverride(callInfo, id, targetId);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
|
||||
@@ -131,6 +131,18 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Delete);
|
||||
}
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult GenerateDocumentHandlerUi()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.GenerateDocumentHandlerUi);
|
||||
}
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult DocumentHandlers()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.DocumentHandlers);
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public DocumentTemplatePackageController Actions { get { return MVC.API.DocumentTemplatePackage; } }
|
||||
@@ -159,6 +171,8 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public readonly string BulkGenerate = "BulkGenerate";
|
||||
public readonly string Generate = "Generate";
|
||||
public readonly string Delete = "Delete";
|
||||
public readonly string GenerateDocumentHandlerUi = "GenerateDocumentHandlerUi";
|
||||
public readonly string DocumentHandlers = "DocumentHandlers";
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
@@ -176,6 +190,8 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public const string BulkGenerate = "BulkGenerate";
|
||||
public const string Generate = "Generate";
|
||||
public const string Delete = "Delete";
|
||||
public const string GenerateDocumentHandlerUi = "GenerateDocumentHandlerUi";
|
||||
public const string DocumentHandlers = "DocumentHandlers";
|
||||
}
|
||||
|
||||
|
||||
@@ -297,6 +313,25 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public readonly string id = "id";
|
||||
public readonly string redirect = "redirect";
|
||||
}
|
||||
static readonly ActionParamsClass_GenerateDocumentHandlerUi s_params_GenerateDocumentHandlerUi = new ActionParamsClass_GenerateDocumentHandlerUi();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_GenerateDocumentHandlerUi GenerateDocumentHandlerUiParams { get { return s_params_GenerateDocumentHandlerUi; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_GenerateDocumentHandlerUi
|
||||
{
|
||||
public readonly string id = "id";
|
||||
public readonly string targetId = "targetId";
|
||||
public readonly string handlerId = "handlerId";
|
||||
}
|
||||
static readonly ActionParamsClass_DocumentHandlers s_params_DocumentHandlers = new ActionParamsClass_DocumentHandlers();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_DocumentHandlers DocumentHandlersParams { get { return s_params_DocumentHandlers; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_DocumentHandlers
|
||||
{
|
||||
public readonly string id = "id";
|
||||
public readonly string targetId = "targetId";
|
||||
}
|
||||
static readonly ViewsClass s_views = new ViewsClass();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ViewsClass Views { get { return s_views; } }
|
||||
@@ -482,6 +517,33 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void GenerateDocumentHandlerUiOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string targetId, string handlerId);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult GenerateDocumentHandlerUi(string id, string targetId, string handlerId)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.GenerateDocumentHandlerUi);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "targetId", targetId);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "handlerId", handlerId);
|
||||
GenerateDocumentHandlerUiOverride(callInfo, id, targetId, handlerId);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void DocumentHandlersOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string targetId);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult DocumentHandlers(string id, string targetId)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.DocumentHandlers);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "targetId", targetId);
|
||||
DocumentHandlersOverride(callInfo, id, targetId);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
selectListItems.Add(new SelectListItem() { Selected = true, Value = string.Empty, Text = "Generate Document" });
|
||||
selectListItems.AddRange(Model.Templates.ToSelectListItems());
|
||||
selectListItems.AddRange(Model.TemplatePackages.ToSelectListItems());
|
||||
<div id="Document_Generation_Container" data-targetid="@Model.Target.AttachmentReferenceId" data-targettype="@Model.Target.HasAttachmentType" data-generatepdfurl="@Url.Action(MVC.API.DocumentTemplate.Generate())" data-generatepackageurl="@Url.Action(MVC.API.DocumentTemplatePackage.Generate())" data-handlerspresent="@(Model.HandlersPresent ? "true" : "false")" data-handlersurl="@Url.Action(MVC.API.DocumentTemplate.DocumentHandlers())">
|
||||
<div id="Document_Generation_Container" data-targetid="@Model.Target.AttachmentReferenceId" data-targettype="@Model.Target.HasAttachmentType" data-generatepdfurl="@Url.Action(MVC.API.DocumentTemplate.Generate())" data-generatepackageurl="@Url.Action(MVC.API.DocumentTemplatePackage.Generate())" data-handlerspresent="@(Model.HandlersPresent ? "true" : "false")" data-handlersurl="@Url.Action(MVC.API.DocumentTemplate.DocumentHandlers())" data-handlerspackageurl="@Url.Action(MVC.API.DocumentTemplatePackage.DocumentHandlers())">
|
||||
@Html.DropDownList("Document_Generate", selectListItems)
|
||||
@if (Model.HandlersPresent)
|
||||
{
|
||||
|
||||
@@ -125,6 +125,17 @@ WriteLiteral(" data-handlersurl=\"");
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(" data-handlerspackageurl=\"");
|
||||
|
||||
|
||||
#line 8 "..\..\Views\Shared\_GenerateDocumentControl.cshtml"
|
||||
Write(Url.Action(MVC.API.DocumentTemplatePackage.DocumentHandlers()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
Reference in New Issue
Block a user