feature: Upload Online Attachments front end

This commit is contained in:
Gary Sharp
2025-06-15 18:01:01 +10:00
parent cc1f224456
commit 662e1ed231
34 changed files with 808 additions and 264 deletions
@@ -7,6 +7,7 @@ using Disco.Services.Devices.Importing;
using Disco.Services.Exporting;
using Disco.Services.Interop;
using Disco.Services.Interop.ActiveDirectory;
using Disco.Services.Interop.DiscoServices.Upload;
using Disco.Services.Logging;
using Disco.Services.Users;
using Disco.Services.Web;
@@ -16,6 +17,7 @@ using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using System.Web.Caching;
using System.Web.Mvc;
@@ -602,6 +604,38 @@ namespace Disco.Web.Areas.API.Controllers
return Json("Invalid Attachment Number", JsonRequestBehavior.AllowGet);
}
[DiscoAuthorize(Claims.Device.Actions.AddAttachments)]
[HttpPost, ValidateAntiForgeryToken]
public virtual async Task<ActionResult> AttachmentOnlineUploadSession(string id)
{
var device = Database.Devices.Find(id) ?? throw new InvalidOperationException("Unknown Device Serial Number");
try
{
if (!Database.DiscoConfiguration.IsActivated)
throw new InvalidOperationException("Activation is required to use this feature (See: Configuration > System)");
var (uri, expiration) = await UploadOnlineService.CreateSession(CurrentUser, device);
UploadOnlineSyncTask.ScheduleInOneHour();
return Json(new
{
Success = true,
Expiration = expiration.ToUnixEpoc(),
SessionUri = uri.ToString(),
});
}
catch (InvalidOperationException ex)
{
return Json(new
{
Success = false,
ErrorMessage = ex.Message,
});
}
}
#endregion
#region Importing
@@ -5,6 +5,7 @@ using Disco.Services;
using Disco.Services.Authorization;
using Disco.Services.Exporting;
using Disco.Services.Interop;
using Disco.Services.Interop.DiscoServices.Upload;
using Disco.Services.Jobs;
using Disco.Services.Jobs.JobLists;
using Disco.Services.Jobs.Statistics;
@@ -16,6 +17,7 @@ using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Threading.Tasks;
using System.Web.Caching;
using System.Web.Mvc;
@@ -2015,6 +2017,38 @@ namespace Disco.Web.Areas.API.Controllers
return Json("Invalid Attachment Number", JsonRequestBehavior.AllowGet);
}
[DiscoAuthorize(Claims.Job.Actions.AddAttachments)]
[HttpPost, ValidateAntiForgeryToken]
public virtual async Task<ActionResult> AttachmentOnlineUploadSession(int id)
{
var job = Database.Jobs.Find(id) ?? throw new InvalidOperationException("Unknown Job Id");
try
{
if (!Database.DiscoConfiguration.IsActivated)
throw new InvalidOperationException("Activation is required to use this feature (See: Configuration > System)");
var (uri, expiration) = await UploadOnlineService.CreateSession(CurrentUser, job);
UploadOnlineSyncTask.ScheduleInOneHour();
return Json(new
{
Success = true,
Expiration = expiration.ToUnixEpoc(),
SessionUri = uri.ToString(),
});
}
catch (InvalidOperationException ex)
{
return Json(new
{
Success = false,
ErrorMessage = ex.Message,
});
}
}
#endregion
#region Job Components
@@ -2,12 +2,15 @@
using Disco.Services.Authorization;
using Disco.Services.Interop;
using Disco.Services.Interop.ActiveDirectory;
using Disco.Services.Interop.DiscoServices.Upload;
using Disco.Services.Plugins.Features.DetailsProvider;
using Disco.Services.Users;
using Disco.Services.Web;
using System;
using System.Data.Entity;
using System.DirectoryServices.ActiveDirectory;
using System.Linq;
using System.Threading.Tasks;
using System.Web.Mvc;
namespace Disco.Web.Areas.API.Controllers
@@ -52,9 +55,9 @@ namespace Disco.Web.Areas.API.Controllers
}
[DiscoAuthorize(Claims.User.Actions.AddAttachments), ValidateAntiForgeryToken]
public virtual ActionResult AttachmentUpload(string id, string Domain, string comments)
public virtual ActionResult AttachmentUpload(string id, string domain, string comments)
{
id = ActiveDirectory.ParseDomainAccountId(id, Domain);
id = ActiveDirectory.ParseDomainAccountId(id, domain);
var u = Database.Users.Find(id);
if (u != null)
@@ -117,9 +120,9 @@ namespace Disco.Web.Areas.API.Controllers
}
[DiscoAuthorize(Claims.User.ShowAttachments)]
public virtual ActionResult Attachments(string id, string Domain)
public virtual ActionResult Attachments(string id, string domain)
{
id = ActiveDirectory.ParseDomainAccountId(id, Domain);
id = ActiveDirectory.ParseDomainAccountId(id, domain);
var u = Database.Users.Include("UserAttachments.DocumentTemplate").Include("UserAttachments.TechUser").Where(m => m.UserId == id).FirstOrDefault();
if (u != null)
@@ -153,31 +156,65 @@ namespace Disco.Web.Areas.API.Controllers
return Json("Invalid Attachment Number", JsonRequestBehavior.AllowGet);
}
[DiscoAuthorize(Claims.User.Actions.AddAttachments)]
[HttpPost, ValidateAntiForgeryToken]
public virtual async Task<ActionResult> AttachmentOnlineUploadSession(string id, string domain)
{
var userId = ActiveDirectory.ParseDomainAccountId(id, domain);
if (!UserService.TryGetUser(userId, Database, false,out var user))
throw new InvalidOperationException("Unknown User");
try
{
if (!Database.DiscoConfiguration.IsActivated)
throw new InvalidOperationException("Activation is required to use this feature (See: Configuration > System)");
var (uri, expiration) = await UploadOnlineService.CreateSession(CurrentUser, user);
UploadOnlineSyncTask.ScheduleInOneHour();
return Json(new
{
Success = true,
Expiration = expiration.ToUnixEpoc(),
SessionUri = uri.ToString(),
});
}
catch (InvalidOperationException ex)
{
return Json(new
{
Success = false,
ErrorMessage = ex.Message,
});
}
}
#endregion
[DiscoAuthorize(Claims.User.Actions.GenerateDocuments)]
public virtual ActionResult GeneratePdf(string id, string Domain, string DocumentTemplateId)
public virtual ActionResult GeneratePdf(string id, string domain, string DocumentTemplateId)
{
if (string.IsNullOrEmpty(id))
throw new ArgumentNullException(nameof(id));
if (string.IsNullOrEmpty(DocumentTemplateId))
throw new ArgumentNullException(nameof(DocumentTemplateId));
var userId = ActiveDirectory.ParseDomainAccountId(id, Domain);
var userId = ActiveDirectory.ParseDomainAccountId(id, domain);
// Obsolete: Use API\DocumentTemplate\Generate instead
return RedirectToAction(MVC.API.DocumentTemplate.Generate(DocumentTemplateId, userId));
}
[DiscoAuthorize(Claims.User.Actions.GenerateDocuments)]
public virtual ActionResult GeneratePdfPackage(string id, string Domain, string DocumentTemplatePackageId)
public virtual ActionResult GeneratePdfPackage(string id, string domain, string DocumentTemplatePackageId)
{
if (string.IsNullOrEmpty(id))
throw new ArgumentNullException(nameof(id));
if (string.IsNullOrEmpty(DocumentTemplatePackageId))
throw new ArgumentNullException(nameof(DocumentTemplatePackageId));
var userId = ActiveDirectory.ParseDomainAccountId(id, Domain);
var userId = ActiveDirectory.ParseDomainAccountId(id, domain);
// Obsolete: Use API\DocumentTemplatePackage\Generate instead
return RedirectToAction(MVC.API.DocumentTemplatePackage.Generate(DocumentTemplatePackageId, userId));
@@ -161,6 +161,94 @@
};
// #endregion
// #region Online Upload
self.onlineUpload = async function () {
const onlineUploadUrl = self.$host.attr('data-onlineuploadurl');
const qrCodeUrl = self.$host.attr('data-qrcodeurl');
const $button = self.$host.find('.attachmentInput span.online-upload');
if ($button.hasClass('fa-spinner'))
return;
$button
.removeClass('fa-qrcode')
.addClass('fa-spinner fa-spin d-green');
if (!window.QRCode) {
const qrCodeElement = document.createElement('script');
qrCodeElement.src = qrCodeUrl;
qrCodeElement.type = 'text/javascript';
qrCodeElement.onload = function () {
self.onlineUploadDisplay();
};
document.body.appendChild(qrCodeElement);
}
const formData = new FormData();
formData.append('__RequestVerificationToken', self.$host.find('input[name="__RequestVerificationToken"]').val());
const result = await fetch(onlineUploadUrl, {
method: 'POST',
body: formData
});
if (!result.ok) {
alert('Error creating online upload session: ' + result.statusText);
return;
}
const resultModel = await result.json();
if (!resultModel.Success) {
alert('Unable to create online upload session: ' + result.ErrorMessage);
return;
}
self.onlineUploadSession = resultModel;
self.onlineUploadDisplay();
$button
.removeClass('fa-spinner fa-spin d-green')
.addClass('fa-qrcode');
}
self.onlineUploadDisplay = function () {
if (!!window.QRCode && !!self.onlineUploadSession) {
var dialog = $('<div>')
.attr({
title: 'Online Upload',
'class': 'dialog Disco-AttachmentUpload-OnlineUploadDialog'
});
var qrCode = QRCode({
msg: self.onlineUploadSession.SessionUri,
ecl: 'L'
});
dialog.append(qrCode);
$('<input type="text" readonly>')
.val(self.onlineUploadSession.SessionUri)
.appendTo(dialog);
$('<div class="info-box"><p class="fa-p"><i class="fa fa-info-circle information"></i> Scan the QR Code or send the link to upload files</p></div>')
.appendTo(dialog);
var expiration = new Date(self.onlineUploadSession.Expiration);
var sessionExpiration = setTimeout(function () {
dialog.dialog('close');
}, expiration.getTime() - new Date().getTime());
dialog.dialog({
resizable: false,
width: 500,
modal: true,
autoOpen: true,
close: function () {
if (!!sessionExpiration) {
window.clearTimeout(sessionExpiration);
}
dialog.dialog('destroy').remove();
}
});
}
}
// #endregion
// #region Helpers
self.getFileComments = function (fileName, thumbnailHandler, complete) {
var result = false;
File diff suppressed because one or more lines are too long
@@ -161,6 +161,94 @@
};
// #endregion
// #region Online Upload
self.onlineUpload = async function () {
const onlineUploadUrl = self.$host.attr('data-onlineuploadurl');
const qrCodeUrl = self.$host.attr('data-qrcodeurl');
const $button = self.$host.find('.attachmentInput span.online-upload');
if ($button.hasClass('fa-spinner'))
return;
$button
.removeClass('fa-qrcode')
.addClass('fa-spinner fa-spin d-green');
if (!window.QRCode) {
const qrCodeElement = document.createElement('script');
qrCodeElement.src = qrCodeUrl;
qrCodeElement.type = 'text/javascript';
qrCodeElement.onload = function () {
self.onlineUploadDisplay();
};
document.body.appendChild(qrCodeElement);
}
const formData = new FormData();
formData.append('__RequestVerificationToken', self.$host.find('input[name="__RequestVerificationToken"]').val());
const result = await fetch(onlineUploadUrl, {
method: 'POST',
body: formData
});
if (!result.ok) {
alert('Error creating online upload session: ' + result.statusText);
return;
}
const resultModel = await result.json();
if (!resultModel.Success) {
alert('Unable to create online upload session: ' + result.ErrorMessage);
return;
}
self.onlineUploadSession = resultModel;
self.onlineUploadDisplay();
$button
.removeClass('fa-spinner fa-spin d-green')
.addClass('fa-qrcode');
}
self.onlineUploadDisplay = function () {
if (!!window.QRCode && !!self.onlineUploadSession) {
var dialog = $('<div>')
.attr({
title: 'Online Upload',
'class': 'dialog Disco-AttachmentUpload-OnlineUploadDialog'
});
var qrCode = QRCode({
msg: self.onlineUploadSession.SessionUri,
ecl: 'L'
});
dialog.append(qrCode);
$('<input type="text" readonly>')
.val(self.onlineUploadSession.SessionUri)
.appendTo(dialog);
$('<div class="info-box"><p class="fa-p"><i class="fa fa-info-circle information"></i> Scan the QR Code or send the link to upload files</p></div>')
.appendTo(dialog);
var expiration = new Date(self.onlineUploadSession.Expiration);
var sessionExpiration = setTimeout(function () {
dialog.dialog('close');
}, expiration.getTime() - new Date().getTime());
dialog.dialog({
resizable: false,
width: 500,
modal: true,
autoOpen: true,
close: function () {
if (!!sessionExpiration) {
window.clearTimeout(sessionExpiration);
}
dialog.dialog('destroy').remove();
}
});
}
}
// #endregion
// #region Helpers
self.getFileComments = function (fileName, thumbnailHandler, complete) {
var result = false;
File diff suppressed because one or more lines are too long
@@ -5711,6 +5711,13 @@ body > .FlagAssignment_Tooltip span.added {
font-style: italic;
font-size: 0.9em;
}
div.Disco-AttachmentUpload-OnlineUploadDialog {
text-align: center;
}
div.Disco-AttachmentUpload-OnlineUploadDialog input {
width: 100%;
box-sizing: border-box;
}
#Document_Generation_Container #Document_Generate {
padding: 0;
}
File diff suppressed because one or more lines are too long
+7 -5
View File
@@ -391,25 +391,27 @@
padding: 3px;
}
#deviceShowResources #Attachments div.attachmentInput span.action {
color: #333;
display: block;
margin: 0 4px 0 0;
font-size: 1.5em;
cursor: pointer;
float: right;
border: 1px solid #fff;
padding: 0.5em;
}
#deviceShowResources #Attachments div.attachmentInput span.action:hover {
#deviceShowResources #Attachments div.attachmentInput span.action:not(.fa-spin) {
color: #333;
border: 1px solid #fff;
}
#deviceShowResources #Attachments div.attachmentInput span.action:not(.fa-spin):hover {
color: #335A87;
background-color: #ededed;
border: 1px solid #ccc;
}
#deviceShowResources #Attachments div.attachmentInput span.action.disabled {
#deviceShowResources #Attachments div.attachmentInput span.action:not(.fa-spin).disabled {
color: rgba(51, 51, 51, 0.2);
cursor: default;
}
#deviceShowResources #Attachments div.attachmentInput span.action.disabled:hover {
#deviceShowResources #Attachments div.attachmentInput span.action:not(.fa-spin).disabled:hover {
color: rgba(51, 51, 51, 0.2);
background-color: inherit;
border: 1px solid #fff;
+16 -13
View File
@@ -378,29 +378,32 @@
padding: 3px;
span.action {
color: @HeaderBackgroundColour;
display: block;
margin: 0 4px 0 0;
font-size: 1.5em;
cursor: pointer;
float: right;
border: 1px solid @white;
padding: .5em;
&:hover {
color: @HyperLinkColour;
background-color: @SubtleColour;
border: 1px solid @SubtleBorderColour;
}
&.disabled {
color: fade(@HeaderBackgroundColour, 20%);
cursor: default;
&:not(.fa-spin) {
color: @HeaderBackgroundColour;
border: 1px solid @white;
&:hover {
color: @HyperLinkColour;
background-color: @SubtleColour;
border: 1px solid @SubtleBorderColour;
}
&.disabled {
color: fade(@HeaderBackgroundColour, 20%);
background-color: inherit;
border: 1px solid @white;
cursor: default;
&:hover {
color: fade(@HeaderBackgroundColour, 20%);
background-color: inherit;
border: 1px solid @white;
}
}
}
}
File diff suppressed because one or more lines are too long
+7 -5
View File
@@ -506,25 +506,27 @@
padding: 5px;
}
#jobShowResources #Attachments div.attachmentInput span.action {
color: #333;
display: block;
margin: 0 4px 0 0;
font-size: 1.5em;
cursor: pointer;
float: right;
border: 1px solid #fff;
padding: 0.5em;
}
#jobShowResources #Attachments div.attachmentInput span.action:hover {
#jobShowResources #Attachments div.attachmentInput span.action:not(.fa-spin) {
color: #333;
border: 1px solid #fff;
}
#jobShowResources #Attachments div.attachmentInput span.action:not(.fa-spin):hover {
color: #335A87;
background-color: #ededed;
border: 1px solid #ccc;
}
#jobShowResources #Attachments div.attachmentInput span.action.disabled {
#jobShowResources #Attachments div.attachmentInput span.action:not(.fa-spin).disabled {
color: rgba(51, 51, 51, 0.2);
cursor: default;
}
#jobShowResources #Attachments div.attachmentInput span.action.disabled:hover {
#jobShowResources #Attachments div.attachmentInput span.action:not(.fa-spin).disabled:hover {
color: rgba(51, 51, 51, 0.2);
background-color: inherit;
border: 1px solid #fff;
+16 -12
View File
@@ -528,29 +528,33 @@
padding: 5px;
span.action {
color: @HeaderBackgroundColour;
display: block;
margin: 0 4px 0 0;
font-size: 1.5em;
cursor: pointer;
float: right;
border: 1px solid @white;
padding: .5em;
&:hover {
color: @HyperLinkColour;
background-color: @SubtleColour;
border: 1px solid @SubtleBorderColour;
}
&:not(.fa-spin) {
color: @HeaderBackgroundColour;
border: 1px solid @white;
&.disabled {
color: fade(@HeaderBackgroundColour, 20%);
cursor: default;
&:hover {
color: @HyperLinkColour;
background-color: @SubtleColour;
border: 1px solid @SubtleBorderColour;
}
&.disabled {
color: fade(@HeaderBackgroundColour, 20%);
background-color: inherit;
border: 1px solid @white;
cursor: default;
&:hover {
color: fade(@HeaderBackgroundColour, 20%);
background-color: inherit;
border: 1px solid @white;
}
}
}
}
File diff suppressed because one or more lines are too long
+7
View File
@@ -1279,6 +1279,13 @@ body > .FlagAssignment_Tooltip span.added {
font-style: italic;
font-size: 0.9em;
}
div.Disco-AttachmentUpload-OnlineUploadDialog {
text-align: center;
}
div.Disco-AttachmentUpload-OnlineUploadDialog input {
width: 100%;
box-sizing: border-box;
}
#Document_Generation_Container #Document_Generate {
padding: 0;
}
+9
View File
@@ -1300,6 +1300,15 @@ body > .FlagAssignment_Tooltip {
}
}
div.Disco-AttachmentUpload-OnlineUploadDialog {
text-align: center;
input {
width: 100%;
box-sizing: border-box;
}
}
#Document_Generation_Container {
#Document_Generate {
padding: 0;
File diff suppressed because one or more lines are too long
+7 -5
View File
@@ -453,25 +453,27 @@
padding: 3px;
}
#userShowResources #Attachments div.attachmentInput span.action {
color: #333;
display: block;
margin: 0 4px 0 0;
font-size: 1.5em;
cursor: pointer;
float: right;
border: 1px solid #fff;
padding: 0.5em;
}
#userShowResources #Attachments div.attachmentInput span.action:hover {
#userShowResources #Attachments div.attachmentInput span.action:not(.fa-spin) {
color: #333;
border: 1px solid #fff;
}
#userShowResources #Attachments div.attachmentInput span.action:not(.fa-spin):hover {
color: #335A87;
background-color: #ededed;
border: 1px solid #ccc;
}
#userShowResources #Attachments div.attachmentInput span.action.disabled {
#userShowResources #Attachments div.attachmentInput span.action:not(.fa-spin).disabled {
color: rgba(51, 51, 51, 0.2);
cursor: default;
}
#userShowResources #Attachments div.attachmentInput span.action.disabled:hover {
#userShowResources #Attachments div.attachmentInput span.action:not(.fa-spin).disabled:hover {
color: rgba(51, 51, 51, 0.2);
background-color: inherit;
border: 1px solid #fff;
+16 -13
View File
@@ -480,29 +480,32 @@
padding: 3px;
span.action {
color: @HeaderBackgroundColour;
display: block;
margin: 0 4px 0 0;
font-size: 1.5em;
cursor: pointer;
float: right;
border: 1px solid @white;
padding: .5em;
&:hover {
color: @HyperLinkColour;
background-color: @SubtleColour;
border: 1px solid @SubtleBorderColour;
}
&.disabled {
color: fade(@HeaderBackgroundColour, 20%);
cursor: default;
&:not(.fa-spin) {
color: @HeaderBackgroundColour;
border: 1px solid @white;
&:hover {
color: @HyperLinkColour;
background-color: @SubtleColour;
border: 1px solid @SubtleBorderColour;
}
&.disabled {
color: fade(@HeaderBackgroundColour, 20%);
background-color: inherit;
border: 1px solid @white;
cursor: default;
&:hover {
color: fade(@HeaderBackgroundColour, 20%);
background-color: inherit;
border: 1px solid @white;
}
}
}
}
File diff suppressed because one or more lines are too long
+3
View File
@@ -1712,6 +1712,9 @@
<DependentUpon>Knockout.js</DependentUpon>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="ClientSource\Scripts\Modules\qrcode.min.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="ClientSource\Scripts\Modules\Shadowbox.js" />
<Content Include="ClientSource\Scripts\Modules\Shadowbox.js" Condition=" '$(Configuration)' == 'Debug' " />
<Content Include="ClientSource\Scripts\Modules\Shadowbox.min.js">
@@ -496,7 +496,7 @@ namespace Disco.Web.Areas.API.Controllers
public class ActionParamsClass_AttachmentUpload
{
public readonly string id = "id";
public readonly string Comments = "Comments";
public readonly string comments = "comments";
}
static readonly ActionParamsClass_Attachment s_params_Attachment = new ActionParamsClass_Attachment();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
@@ -841,15 +841,15 @@ namespace Disco.Web.Areas.API.Controllers
}
[NonAction]
partial void AttachmentUploadOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string Comments);
partial void AttachmentUploadOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string comments);
[NonAction]
public override System.Web.Mvc.ActionResult AttachmentUpload(int id, string Comments)
public override System.Web.Mvc.ActionResult AttachmentUpload(int id, string comments)
{
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.AttachmentUpload);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "Comments", Comments);
AttachmentUploadOverride(callInfo, id, Comments);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "comments", comments);
AttachmentUploadOverride(callInfo, id, comments);
return callInfo;
}
@@ -193,6 +193,13 @@ namespace Disco.Web.Areas.API.Controllers
}
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public virtual System.Threading.Tasks.Task<System.Web.Mvc.ActionResult> AttachmentOnlineUploadSession()
{
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.AttachmentOnlineUploadSession);
return System.Threading.Tasks.Task.FromResult(callInfo as System.Web.Mvc.ActionResult);
}
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public virtual System.Web.Mvc.ActionResult ImportBegin()
{
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.ImportBegin);
@@ -265,6 +272,7 @@ namespace Disco.Web.Areas.API.Controllers
public readonly string Attachment = "Attachment";
public readonly string Attachments = "Attachments";
public readonly string AttachmentRemove = "AttachmentRemove";
public readonly string AttachmentOnlineUploadSession = "AttachmentOnlineUploadSession";
public readonly string ImportBegin = "ImportBegin";
public readonly string ImportParse = "ImportParse";
public readonly string ImportApply = "ImportApply";
@@ -299,6 +307,7 @@ namespace Disco.Web.Areas.API.Controllers
public const string Attachment = "Attachment";
public const string Attachments = "Attachments";
public const string AttachmentRemove = "AttachmentRemove";
public const string AttachmentOnlineUploadSession = "AttachmentOnlineUploadSession";
public const string ImportBegin = "ImportBegin";
public const string ImportParse = "ImportParse";
public const string ImportApply = "ImportApply";
@@ -514,6 +523,14 @@ namespace Disco.Web.Areas.API.Controllers
{
public readonly string id = "id";
}
static readonly ActionParamsClass_AttachmentOnlineUploadSession s_params_AttachmentOnlineUploadSession = new ActionParamsClass_AttachmentOnlineUploadSession();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ActionParamsClass_AttachmentOnlineUploadSession AttachmentOnlineUploadSessionParams { get { return s_params_AttachmentOnlineUploadSession; } }
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class ActionParamsClass_AttachmentOnlineUploadSession
{
public readonly string id = "id";
}
static readonly ActionParamsClass_ImportBegin s_params_ImportBegin = new ActionParamsClass_ImportBegin();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ActionParamsClass_ImportBegin ImportBeginParams { get { return s_params_ImportBegin; } }
@@ -876,6 +893,18 @@ namespace Disco.Web.Areas.API.Controllers
return callInfo;
}
[NonAction]
partial void AttachmentOnlineUploadSessionOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id);
[NonAction]
public override System.Threading.Tasks.Task<System.Web.Mvc.ActionResult> AttachmentOnlineUploadSession(string id)
{
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.AttachmentOnlineUploadSession);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
AttachmentOnlineUploadSessionOverride(callInfo, id);
return System.Threading.Tasks.Task.FromResult(callInfo as System.Web.Mvc.ActionResult);
}
[NonAction]
partial void ImportBeginOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, System.Web.HttpPostedFileBase ImportFile, bool HasHeader);
@@ -427,6 +427,13 @@ namespace Disco.Web.Areas.API.Controllers
}
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public virtual System.Threading.Tasks.Task<System.Web.Mvc.ActionResult> AttachmentOnlineUploadSession()
{
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.AttachmentOnlineUploadSession);
return System.Threading.Tasks.Task.FromResult(callInfo as System.Web.Mvc.ActionResult);
}
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public virtual System.Web.Mvc.ActionResult ComponentAdd()
{
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.ComponentAdd);
@@ -550,6 +557,7 @@ namespace Disco.Web.Areas.API.Controllers
public readonly string Attachment = "Attachment";
public readonly string Attachments = "Attachments";
public readonly string AttachmentRemove = "AttachmentRemove";
public readonly string AttachmentOnlineUploadSession = "AttachmentOnlineUploadSession";
public readonly string ComponentAdd = "ComponentAdd";
public readonly string ComponentUpdate = "ComponentUpdate";
public readonly string ComponentRemove = "ComponentRemove";
@@ -626,6 +634,7 @@ namespace Disco.Web.Areas.API.Controllers
public const string Attachment = "Attachment";
public const string Attachments = "Attachments";
public const string AttachmentRemove = "AttachmentRemove";
public const string AttachmentOnlineUploadSession = "AttachmentOnlineUploadSession";
public const string ComponentAdd = "ComponentAdd";
public const string ComponentUpdate = "ComponentUpdate";
public const string ComponentRemove = "ComponentRemove";
@@ -1225,6 +1234,14 @@ namespace Disco.Web.Areas.API.Controllers
{
public readonly string id = "id";
}
static readonly ActionParamsClass_AttachmentOnlineUploadSession s_params_AttachmentOnlineUploadSession = new ActionParamsClass_AttachmentOnlineUploadSession();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ActionParamsClass_AttachmentOnlineUploadSession AttachmentOnlineUploadSessionParams { get { return s_params_AttachmentOnlineUploadSession; } }
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class ActionParamsClass_AttachmentOnlineUploadSession
{
public readonly string id = "id";
}
static readonly ActionParamsClass_ComponentAdd s_params_ComponentAdd = new ActionParamsClass_ComponentAdd();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ActionParamsClass_ComponentAdd ComponentAddParams { get { return s_params_ComponentAdd; } }
@@ -2144,6 +2161,18 @@ namespace Disco.Web.Areas.API.Controllers
return callInfo;
}
[NonAction]
partial void AttachmentOnlineUploadSessionOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id);
[NonAction]
public override System.Threading.Tasks.Task<System.Web.Mvc.ActionResult> AttachmentOnlineUploadSession(int id)
{
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.AttachmentOnlineUploadSession);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
AttachmentOnlineUploadSessionOverride(callInfo, id);
return System.Threading.Tasks.Task.FromResult(callInfo as System.Web.Mvc.ActionResult);
}
[NonAction]
partial void ComponentAddOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string Description, string Cost);
@@ -97,6 +97,13 @@ namespace Disco.Web.Areas.API.Controllers
}
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public virtual System.Threading.Tasks.Task<System.Web.Mvc.ActionResult> AttachmentOnlineUploadSession()
{
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.AttachmentOnlineUploadSession);
return System.Threading.Tasks.Task.FromResult(callInfo as System.Web.Mvc.ActionResult);
}
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public virtual System.Web.Mvc.ActionResult GeneratePdf()
{
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.GeneratePdf);
@@ -135,6 +142,7 @@ namespace Disco.Web.Areas.API.Controllers
public readonly string Attachment = "Attachment";
public readonly string Attachments = "Attachments";
public readonly string AttachmentRemove = "AttachmentRemove";
public readonly string AttachmentOnlineUploadSession = "AttachmentOnlineUploadSession";
public readonly string GeneratePdf = "GeneratePdf";
public readonly string GeneratePdfPackage = "GeneratePdfPackage";
public readonly string Photo = "Photo";
@@ -149,6 +157,7 @@ namespace Disco.Web.Areas.API.Controllers
public const string Attachment = "Attachment";
public const string Attachments = "Attachments";
public const string AttachmentRemove = "AttachmentRemove";
public const string AttachmentOnlineUploadSession = "AttachmentOnlineUploadSession";
public const string GeneratePdf = "GeneratePdf";
public const string GeneratePdfPackage = "GeneratePdfPackage";
public const string Photo = "Photo";
@@ -178,7 +187,7 @@ namespace Disco.Web.Areas.API.Controllers
public class ActionParamsClass_AttachmentUpload
{
public readonly string id = "id";
public readonly string Domain = "Domain";
public readonly string domain = "domain";
public readonly string comments = "comments";
}
static readonly ActionParamsClass_Attachment s_params_Attachment = new ActionParamsClass_Attachment();
@@ -196,7 +205,7 @@ namespace Disco.Web.Areas.API.Controllers
public class ActionParamsClass_Attachments
{
public readonly string id = "id";
public readonly string Domain = "Domain";
public readonly string domain = "domain";
}
static readonly ActionParamsClass_AttachmentRemove s_params_AttachmentRemove = new ActionParamsClass_AttachmentRemove();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
@@ -206,6 +215,15 @@ namespace Disco.Web.Areas.API.Controllers
{
public readonly string id = "id";
}
static readonly ActionParamsClass_AttachmentOnlineUploadSession s_params_AttachmentOnlineUploadSession = new ActionParamsClass_AttachmentOnlineUploadSession();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ActionParamsClass_AttachmentOnlineUploadSession AttachmentOnlineUploadSessionParams { get { return s_params_AttachmentOnlineUploadSession; } }
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class ActionParamsClass_AttachmentOnlineUploadSession
{
public readonly string id = "id";
public readonly string domain = "domain";
}
static readonly ActionParamsClass_GeneratePdf s_params_GeneratePdf = new ActionParamsClass_GeneratePdf();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ActionParamsClass_GeneratePdf GeneratePdfParams { get { return s_params_GeneratePdf; } }
@@ -213,7 +231,7 @@ namespace Disco.Web.Areas.API.Controllers
public class ActionParamsClass_GeneratePdf
{
public readonly string id = "id";
public readonly string Domain = "Domain";
public readonly string domain = "domain";
public readonly string DocumentTemplateId = "DocumentTemplateId";
}
static readonly ActionParamsClass_GeneratePdfPackage s_params_GeneratePdfPackage = new ActionParamsClass_GeneratePdfPackage();
@@ -223,7 +241,7 @@ namespace Disco.Web.Areas.API.Controllers
public class ActionParamsClass_GeneratePdfPackage
{
public readonly string id = "id";
public readonly string Domain = "Domain";
public readonly string domain = "domain";
public readonly string DocumentTemplatePackageId = "DocumentTemplatePackageId";
}
static readonly ActionParamsClass_Photo s_params_Photo = new ActionParamsClass_Photo();
@@ -278,16 +296,16 @@ namespace Disco.Web.Areas.API.Controllers
}
[NonAction]
partial void AttachmentUploadOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string Domain, string comments);
partial void AttachmentUploadOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string domain, string comments);
[NonAction]
public override System.Web.Mvc.ActionResult AttachmentUpload(string id, string Domain, string comments)
public override System.Web.Mvc.ActionResult AttachmentUpload(string id, string domain, string comments)
{
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.AttachmentUpload);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "Domain", Domain);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "domain", domain);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "comments", comments);
AttachmentUploadOverride(callInfo, id, Domain, comments);
AttachmentUploadOverride(callInfo, id, domain, comments);
return callInfo;
}
@@ -304,15 +322,15 @@ namespace Disco.Web.Areas.API.Controllers
}
[NonAction]
partial void AttachmentsOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string Domain);
partial void AttachmentsOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string domain);
[NonAction]
public override System.Web.Mvc.ActionResult Attachments(string id, string Domain)
public override System.Web.Mvc.ActionResult Attachments(string id, string domain)
{
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Attachments);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "Domain", Domain);
AttachmentsOverride(callInfo, id, Domain);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "domain", domain);
AttachmentsOverride(callInfo, id, domain);
return callInfo;
}
@@ -329,30 +347,43 @@ namespace Disco.Web.Areas.API.Controllers
}
[NonAction]
partial void GeneratePdfOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string Domain, string DocumentTemplateId);
partial void AttachmentOnlineUploadSessionOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string domain);
[NonAction]
public override System.Web.Mvc.ActionResult GeneratePdf(string id, string Domain, string DocumentTemplateId)
public override System.Threading.Tasks.Task<System.Web.Mvc.ActionResult> AttachmentOnlineUploadSession(string id, string domain)
{
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.AttachmentOnlineUploadSession);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "domain", domain);
AttachmentOnlineUploadSessionOverride(callInfo, id, domain);
return System.Threading.Tasks.Task.FromResult(callInfo as System.Web.Mvc.ActionResult);
}
[NonAction]
partial void GeneratePdfOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string domain, string DocumentTemplateId);
[NonAction]
public override System.Web.Mvc.ActionResult GeneratePdf(string id, string domain, string DocumentTemplateId)
{
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.GeneratePdf);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "Domain", Domain);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "domain", domain);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DocumentTemplateId", DocumentTemplateId);
GeneratePdfOverride(callInfo, id, Domain, DocumentTemplateId);
GeneratePdfOverride(callInfo, id, domain, DocumentTemplateId);
return callInfo;
}
[NonAction]
partial void GeneratePdfPackageOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string Domain, string DocumentTemplatePackageId);
partial void GeneratePdfPackageOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string domain, string DocumentTemplatePackageId);
[NonAction]
public override System.Web.Mvc.ActionResult GeneratePdfPackage(string id, string Domain, string DocumentTemplatePackageId)
public override System.Web.Mvc.ActionResult GeneratePdfPackage(string id, string domain, string DocumentTemplatePackageId)
{
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.GeneratePdfPackage);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "Domain", Domain);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "domain", domain);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DocumentTemplatePackageId", DocumentTemplatePackageId);
GeneratePdfPackageOverride(callInfo, id, Domain, DocumentTemplatePackageId);
GeneratePdfPackageOverride(callInfo, id, domain, DocumentTemplatePackageId);
return callInfo;
}
+2
View File
@@ -396,6 +396,7 @@ namespace Links
public static readonly string Knockout_js = T4MVCHelpers.IsProduction() && T4Extensions.FileExists(UrlPath + "/Knockout.min.js") ? Url("Knockout.min.js") : Url("Knockout.js");
public static readonly string Knockout_min_js = Url("Knockout.min.js");
public static readonly string Knockout_js_ = T4MVCHelpers.IsProduction() && T4Extensions.FileExists(UrlPath + "/Knockout.min.js") ? Url("Knockout.min.js") : Url("Knockout.js");
public static readonly string qrcode_min_js = Url("qrcode.min.js");
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public static class Shadowbox {
public const string UrlPath = "~/ClientSource/Scripts/Modules/Shadowbox";
@@ -1186,6 +1187,7 @@ namespace Links
public const string jQueryUI_TimePicker_js_ = "~/ClientSource/Scripts/Modules/jQueryUI-TimePicker.js";
public const string Knockout_js = "~/ClientSource/Scripts/Modules/Knockout.js";
public const string Knockout_js_ = "~/ClientSource/Scripts/Modules/Knockout.js";
public const string qrcode_min_js = "~/ClientSource/Scripts/Modules/qrcode.min.js";
public const string Shadowbox_js = "~/ClientSource/Scripts/Modules/Shadowbox.js";
public const string Shadowbox_js_ = "~/ClientSource/Scripts/Modules/Shadowbox.js";
public const string Timeline_js = "~/ClientSource/Scripts/Modules/Timeline.js";
+12 -1
View File
@@ -1,5 +1,6 @@
using Disco.Services.Interop.ActiveDirectory;
using System;
using System.Threading.Tasks;
using System.Web.Mvc;
namespace Disco.Web.Controllers
@@ -18,7 +19,7 @@ namespace Disco.Web.Controllers
userDomain = null; // Url doesn't contain Domain if it is the default.
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", UserId.Substring(slashIndex + 1));
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "Domain", userDomain);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "domain", userDomain);
}
[NonAction]
@@ -59,6 +60,16 @@ namespace Disco.Web.Areas.API.Controllers
return callInfo;
}
[NonAction]
public virtual ActionResult AttachmentOnlineUploadSession(string id)
{
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.AttachmentOnlineUploadSession);
Disco.Web.Controllers.UserController.T4MVCAddUserIdRouteValues(callInfo, id);
return callInfo;
}
[NonAction]
public virtual ActionResult GeneratePdf(string id, string DocumentTemplateId)
{
@@ -19,7 +19,7 @@
<table id="deviceShowResources">
<tr>
<td id="AttachmentsContainer">
<div id="Attachments" class="@(canAddAttachments ? "canAddAttachments" : "cannotAddAttachments")" data-uploadurl="@(Url.Action(MVC.API.Device.AttachmentUpload(Model.Device.SerialNumber, null)))">
<div id="Attachments" class="@(canAddAttachments ? "canAddAttachments" : "cannotAddAttachments")" data-uploadurl="@(Url.Action(MVC.API.Device.AttachmentUpload(Model.Device.SerialNumber, null)))" data-onlineuploadurl="@(Url.Action(MVC.API.Device.AttachmentOnlineUploadSession(Model.Device.SerialNumber)))" data-qrcodeurl="@Url.Content("~/ClientSource/Scripts/Modules/qrcode.min.js")">
@Html.AntiForgeryToken()
<div class="Disco-AttachmentUpload-DropTarget">
<h2>Drop Attachments Here</h2>
@@ -47,7 +47,7 @@
{
<div class="Disco-AttachmentUpload-Progress"></div>
<div class="attachmentInput clearfix">
<span class="action enabled upload fa fa-upload disabled" title="Attach File"></span><span class="action enabled photo fa fa-camera disabled" title="Capture Image"></span>
<span class="action enabled upload fa fa-upload disabled" title="Attach File"></span><span class="action enabled photo fa fa-camera disabled" title="Capture Image"></span><span class="action enabled online-upload fa fa-qrcode disabled" title="Upload with Online Services"></span>
</div>
}
<script type="text/javascript">
@@ -239,6 +239,12 @@
var attachmentUploader = new document.Disco.AttachmentUploader($Attachments);
var $attachmentInput = $Attachments.find('.attachmentInput');
$attachmentInput.find('.online-upload').on('click', function () {
if ($(this).hasClass('disabled'))
alert('Disconnected from the Disco ICT Server, please refresh this page and try again');
else
attachmentUploader.onlineUpload();
});
if (window.location.protocol != 'https:') {
$attachmentInput.find('.photo')
.removeClass('enabled')
@@ -103,6 +103,28 @@ WriteLiteral(" data-uploadurl=\"");
#line hidden
WriteLiteral("\"");
WriteLiteral(" data-onlineuploadurl=\"");
#line 22 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(Url.Action(MVC.API.Device.AttachmentOnlineUploadSession(Model.Device.SerialNumber)));
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(" data-qrcodeurl=\"");
#line 22 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(Url.Content("~/ClientSource/Scripts/Modules/qrcode.min.js"));
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
@@ -143,14 +165,14 @@ WriteLiteral(">\r\n");
#line hidden
WriteLiteral(" <a");
WriteAttribute("href", Tuple.Create(" href=\"", 1582), Tuple.Create("\"", 1642)
WriteAttribute("href", Tuple.Create(" href=\"", 1770), Tuple.Create("\"", 1830)
#line 32 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1589), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Device.AttachmentDownload(da.Id))
, Tuple.Create(Tuple.Create("", 1777), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Device.AttachmentDownload(da.Id))
#line default
#line hidden
, 1589), false)
, 1777), false)
);
WriteLiteral(" data-attachmentid=\"");
@@ -179,42 +201,42 @@ WriteLiteral(">\r\n <span");
WriteLiteral(" class=\"icon\"");
WriteAttribute("title", Tuple.Create(" title=\"", 1752), Tuple.Create("\"", 1772)
WriteAttribute("title", Tuple.Create(" title=\"", 1940), Tuple.Create("\"", 1960)
#line 33 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1760), Tuple.Create<System.Object, System.Int32>(da.Filename
, Tuple.Create(Tuple.Create("", 1948), Tuple.Create<System.Object, System.Int32>(da.Filename
#line default
#line hidden
, 1760), false)
, 1948), false)
);
WriteLiteral(">\r\n <img");
WriteLiteral(" alt=\"Attachment Thumbnail\"");
WriteAttribute("src", Tuple.Create(" src=\"", 1843), Tuple.Create("\"", 1905)
WriteAttribute("src", Tuple.Create(" src=\"", 2031), Tuple.Create("\"", 2093)
#line 34 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1849), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Device.AttachmentThumbnail(da.Id))
, Tuple.Create(Tuple.Create("", 2037), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Device.AttachmentThumbnail(da.Id))
#line default
#line hidden
, 1849), false)
, 2037), false)
);
WriteLiteral(" /></span>\r\n <span");
WriteLiteral(" class=\"comments\"");
WriteAttribute("title", Tuple.Create(" title=\"", 1972), Tuple.Create("\"", 2009)
WriteAttribute("title", Tuple.Create(" title=\"", 2160), Tuple.Create("\"", 2197)
#line 35 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1980), Tuple.Create<System.Object, System.Int32>(da.Comments ?? da.Filename
, Tuple.Create(Tuple.Create("", 2168), Tuple.Create<System.Object, System.Int32>(da.Comments ?? da.Filename
#line default
#line hidden
, 1980), false)
, 2168), false)
);
WriteLiteral(">\r\n");
@@ -298,14 +320,14 @@ WriteLiteral("<span");
WriteLiteral(" class=\"timestamp\"");
WriteAttribute("title", Tuple.Create(" title=\"", 2700), Tuple.Create("\"", 2738)
WriteAttribute("title", Tuple.Create(" title=\"", 2888), Tuple.Create("\"", 2926)
#line 41 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 2708), Tuple.Create<System.Object, System.Int32>(da.Timestamp.ToFullDateTime()
, Tuple.Create(Tuple.Create("", 2896), Tuple.Create<System.Object, System.Int32>(da.Timestamp.ToFullDateTime()
#line default
#line hidden
, 2708), false)
, 2896), false)
);
WriteLiteral(" data-livestamp=\"");
@@ -376,6 +398,12 @@ WriteLiteral(" class=\"action enabled photo fa fa-camera disabled\"");
WriteLiteral(" title=\"Capture Image\"");
WriteLiteral("></span><span");
WriteLiteral(" class=\"action enabled online-upload fa fa-qrcode disabled\"");
WriteLiteral(" title=\"Upload with Online Services\"");
WriteLiteral("></span>\r\n </div>\r\n");
@@ -655,40 +683,45 @@ WriteLiteral("/\' + a.Id + \'?v=\' + retryCount);\r\n
WriteLiteral("\r\n //#region Add Attachments\r\n " +
" var attachmentUploader = new document.Disco.AttachmentUploader($Attachments)" +
";\r\n\r\n var $attachmentInput = $Attachments.find(\'.atta" +
"chmentInput\');\r\n if (window.location.protocol != \'htt" +
"ps:\') {\r\n $attachmentInput.find(\'.photo\')\r\n " +
" .removeClass(\'enabled\')\r\n " +
" .addClass(\'disabled\')\r\n .attr(\'tit" +
"le\', \'Capture Image: this functionality is only available over a HTTPS connectio" +
"n\');\r\n }\r\n $attachmentInpu" +
"t.find(\'.photo\').click(function () {\r\n if (!$(thi" +
"s).hasClass(\'enabled\'))\r\n alert(\'This functio" +
"nality is only available over a HTTPS connection\');\r\n " +
" else if ($(this).hasClass(\'disabled\'))\r\n " +
" alert(\'Disconnected from the Disco ICT Server, please refresh this page and try" +
" again\');\r\n else\r\n " +
" attachmentUploader.uploadImage();\r\n });\r\n " +
" $attachmentInput.find(\'.upload\').click(function () {\r\n " +
" if ($(this).hasClass(\'disabled\'))\r\n " +
" alert(\'Disconnected from the Disco ICT Server, please refresh " +
"this page and try again\');\r\n else\r\n " +
" attachmentUploader.uploadFiles();\r\n " +
" });\r\n\r\n var resourcesTab;\r\n " +
" $(document).on(\'dragover\', function () {\r\n " +
" if (!resourcesTab) {\r\n var tabs = $Attachmen" +
"ts.closest(\'.ui-tabs\');\r\n resourcesTab = {\r\n " +
" tabs: tabs,\r\n " +
" resourcesIndex: tabs.children(\'ul.ui-tabs-nav\').find(\'a[href=\"#Devic" +
"eDetailTab-Resources\"]\').closest(\'li\').index()\r\n " +
" };\r\n }\r\n var s" +
"electedIndex = resourcesTab.tabs.tabs(\'option\', \'active\');\r\n " +
" if (resourcesTab.resourcesIndex !== selectedIndex)\r\n " +
" resourcesTab.tabs.tabs(\'option\', \'active\', resourcesTab.reso" +
"urcesIndex);\r\n });\r\n //#en" +
"dregion\r\n ");
"chmentInput\');\r\n $attachmentInput.find(\'.online-uploa" +
"d\').on(\'click\', function () {\r\n if ($(this).hasCl" +
"ass(\'disabled\'))\r\n alert(\'Disconnected from t" +
"he Disco ICT Server, please refresh this page and try again\');\r\n " +
" else\r\n attachmentUploader.onl" +
"ineUpload();\r\n });\r\n if (w" +
"indow.location.protocol != \'https:\') {\r\n $attachm" +
"entInput.find(\'.photo\')\r\n .removeClass(\'enabl" +
"ed\')\r\n .addClass(\'disabled\')\r\n " +
" .attr(\'title\', \'Capture Image: this functionality is only a" +
"vailable over a HTTPS connection\');\r\n }\r\n " +
" $attachmentInput.find(\'.photo\').click(function () {\r\n " +
" if (!$(this).hasClass(\'enabled\'))\r\n " +
" alert(\'This functionality is only available over a HTTPS connection\'" +
");\r\n else if ($(this).hasClass(\'disabled\'))\r\n " +
" alert(\'Disconnected from the Disco ICT Server, p" +
"lease refresh this page and try again\');\r\n else\r\n" +
" attachmentUploader.uploadImage();\r\n " +
" });\r\n $attachmentInput.find(\'.uplo" +
"ad\').click(function () {\r\n if ($(this).hasClass(\'" +
"disabled\'))\r\n alert(\'Disconnected from the Di" +
"sco ICT Server, please refresh this page and try again\');\r\n " +
" else\r\n attachmentUploader.uploadFi" +
"les();\r\n });\r\n\r\n var resou" +
"rcesTab;\r\n $(document).on(\'dragover\', function () {\r\n" +
" if (!resourcesTab) {\r\n " +
" var tabs = $Attachments.closest(\'.ui-tabs\');\r\n " +
" resourcesTab = {\r\n tabs: tabs" +
",\r\n resourcesIndex: tabs.children(\'ul.ui-" +
"tabs-nav\').find(\'a[href=\"#DeviceDetailTab-Resources\"]\').closest(\'li\').index()\r\n " +
" };\r\n }\r\n " +
" var selectedIndex = resourcesTab.tabs.tabs(\'option\', \'" +
"active\');\r\n if (resourcesTab.resourcesIndex !== s" +
"electedIndex)\r\n resourcesTab.tabs.tabs(\'optio" +
"n\', \'active\', resourcesTab.resourcesIndex);\r\n });\r\n " +
" //#endregion\r\n ");
#line 277 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 283 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
}
@@ -697,7 +730,7 @@ WriteLiteral("\r\n //#region Add Attachments\r\n
WriteLiteral(" ");
#line 278 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 284 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
if (canRemoveAnyAttachments || canRemoveOwnAttachments)
{
@@ -730,7 +763,7 @@ WriteLiteral(@"
url: '");
#line 303 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 309 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(Url.Action(MVC.API.Device.AttachmentRemove()));
@@ -758,7 +791,7 @@ WriteLiteral("\',\r\n dataType: \'jso
"endregion\r\n ");
#line 330 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 336 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
}
@@ -795,7 +828,7 @@ WriteLiteral("></i>&nbsp;Are you sure?\r\n </p>\r\n </div>\r\n <scr
"etailTab-ResourcesLink\">Attachments [");
#line 351 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 357 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(Model.Device.DeviceAttachments == null ? 0 : Model.Device.DeviceAttachments.Count);
@@ -53,7 +53,7 @@
@if (canShowAttachments)
{
<td id="AttachmentsContainer">
<div id="Attachments" class="@(canAddAttachments ? "canAddAttachments" : "cannotAddAttachments")" data-uploadurl="@(Url.Action(MVC.API.Job.AttachmentUpload(Model.Job.Id, null)))">
<div id="Attachments" class="@(canAddAttachments ? "canAddAttachments" : "cannotAddAttachments")" data-uploadurl="@(Url.Action(MVC.API.Job.AttachmentUpload(Model.Job.Id, null)))" data-onlineuploadurl="@(Url.Action(MVC.API.Job.AttachmentOnlineUploadSession(Model.Job.Id)))" data-qrcodeurl="@Url.Content("~/ClientSource/Scripts/Modules/qrcode.min.js")">
@Html.AntiForgeryToken()
<div class="Disco-AttachmentUpload-DropTarget">
<h2>Drop Attachments Here</h2>
@@ -79,7 +79,7 @@
{
<div class="Disco-AttachmentUpload-Progress"></div>
<div class="attachmentInput clearfix">
<span class="action enabled upload fa fa-upload disabled" title="Attach File"></span><span class="action enabled photo fa fa-camera disabled" title="Capture Image"></span>
<span class="action enabled upload fa fa-upload disabled" title="Attach File"></span><span class="action enabled photo fa fa-camera disabled" title="Capture Image"></span><span class="action enabled online-upload fa fa-qrcode disabled" title="Upload with Online Services"></span>
</div>
}
</div>
@@ -322,6 +322,12 @@
var attachmentUploader = new document.Disco.AttachmentUploader($Attachments);
var $attachmentInput = $Attachments.find('.attachmentInput');
$attachmentInput.find('.online-upload').on('click', function () {
if ($(this).hasClass('disabled'))
alert('Disconnected from the Disco ICT Server, please refresh this page and try again');
else
attachmentUploader.onlineUpload();
});
if (window.location.protocol != 'https:') {
$attachmentInput.find('.photo')
.removeClass('enabled')
@@ -344,6 +344,28 @@ WriteLiteral(" data-uploadurl=\"");
#line hidden
WriteLiteral("\"");
WriteLiteral(" data-onlineuploadurl=\"");
#line 56 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.AttachmentOnlineUploadSession(Model.Job.Id)));
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(" data-qrcodeurl=\"");
#line 56 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Content("~/ClientSource/Scripts/Modules/qrcode.min.js"));
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
@@ -382,14 +404,14 @@ WriteLiteral(">\r\n");
#line hidden
WriteLiteral(" <a");
WriteAttribute("href", Tuple.Create(" href=\"", 3557), Tuple.Create("\"", 3614)
WriteAttribute("href", Tuple.Create(" href=\"", 3729), Tuple.Create("\"", 3786)
#line 64 "..\..\Views\Job\JobParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 3564), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentDownload(ja.Id))
, Tuple.Create(Tuple.Create("", 3736), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentDownload(ja.Id))
#line default
#line hidden
, 3564), false)
, 3736), false)
);
WriteLiteral(" data-attachmentid=\"");
@@ -418,28 +440,28 @@ WriteLiteral(">\r\n <span");
WriteLiteral(" class=\"icon\"");
WriteAttribute("title", Tuple.Create(" title=\"", 3724), Tuple.Create("\"", 3744)
WriteAttribute("title", Tuple.Create(" title=\"", 3896), Tuple.Create("\"", 3916)
#line 65 "..\..\Views\Job\JobParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 3732), Tuple.Create<System.Object, System.Int32>(ja.Filename
, Tuple.Create(Tuple.Create("", 3904), Tuple.Create<System.Object, System.Int32>(ja.Filename
#line default
#line hidden
, 3732), false)
, 3904), false)
);
WriteLiteral(">\r\n <img");
WriteLiteral(" alt=\"Attachment Thumbnail\"");
WriteAttribute("src", Tuple.Create(" src=\"", 3815), Tuple.Create("\"", 3874)
WriteAttribute("src", Tuple.Create(" src=\"", 3987), Tuple.Create("\"", 4046)
#line 66 "..\..\Views\Job\JobParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 3821), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id))
, Tuple.Create(Tuple.Create("", 3993), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id))
#line default
#line hidden
, 3821), false)
, 3993), false)
);
WriteLiteral(" />\r\n </span>\r\n <sp" +
@@ -447,14 +469,14 @@ WriteLiteral(" />\r\n </span>\r\n
WriteLiteral(" class=\"comments\"");
WriteAttribute("title", Tuple.Create(" title=\"", 3975), Tuple.Create("\"", 3995)
WriteAttribute("title", Tuple.Create(" title=\"", 4147), Tuple.Create("\"", 4167)
#line 68 "..\..\Views\Job\JobParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 3983), Tuple.Create<System.Object, System.Int32>(ja.Comments
, Tuple.Create(Tuple.Create("", 4155), Tuple.Create<System.Object, System.Int32>(ja.Comments
#line default
#line hidden
, 3983), false)
, 4155), false)
);
WriteLiteral(">\r\n");
@@ -549,14 +571,14 @@ WriteLiteral(" data-livestamp=\"");
#line hidden
WriteLiteral("\"");
WriteAttribute("title", Tuple.Create(" title=\"", 4680), Tuple.Create("\"", 4718)
WriteAttribute("title", Tuple.Create(" title=\"", 4852), Tuple.Create("\"", 4890)
#line 74 "..\..\Views\Job\JobParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 4688), Tuple.Create<System.Object, System.Int32>(ja.Timestamp.ToFullDateTime()
, Tuple.Create(Tuple.Create("", 4860), Tuple.Create<System.Object, System.Int32>(ja.Timestamp.ToFullDateTime()
#line default
#line hidden
, 4688), false)
, 4860), false)
);
WriteLiteral(">");
@@ -615,6 +637,12 @@ WriteLiteral(" class=\"action enabled photo fa fa-camera disabled\"");
WriteLiteral(" title=\"Capture Image\"");
WriteLiteral("></span><span");
WriteLiteral(" class=\"action enabled online-upload fa fa-qrcode disabled\"");
WriteLiteral(" title=\"Upload with Online Services\"");
WriteLiteral("></span>\r\n </div>\r\n");
@@ -1038,33 +1066,38 @@ WriteLiteral("\');\r\n\r\n //#region Attachments\r\n var $
#line hidden
WriteLiteral("\r\n //#region Add Attachments\r\n var attachmentUploader = new" +
" document.Disco.AttachmentUploader($Attachments);\r\n\r\n var $attachment" +
"Input = $Attachments.find(\'.attachmentInput\');\r\n if (window.location." +
"protocol != \'https:\') {\r\n $attachmentInput.find(\'.photo\')\r\n " +
" .removeClass(\'enabled\')\r\n .addClass(\'disabled\')" +
"\r\n .attr(\'title\', \'Capture Image: this functionality is only " +
"available over a HTTPS connection\');\r\n }\r\n $attachmentInpu" +
"t.find(\'.photo\').click(function () {\r\n if (!$(this).hasClass(\'ena" +
"bled\'))\r\n alert(\'This functionality is only available over a " +
"HTTPS connection\');\r\n else if ($(this).hasClass(\'disabled\'))\r\n " +
" alert(\'Disconnected from the Disco ICT Server, please refresh t" +
"his page and try again\');\r\n else\r\n attachmentU" +
"ploader.uploadImage();\r\n });\r\n $attachmentInput.find(\'.upl" +
"oad\').click(function () {\r\n if ($(this).hasClass(\'disabled\'))\r\n " +
" alert(\'Disconnected from the Disco ICT Server, please refresh " +
"this page and try again\');\r\n else\r\n attachment" +
"Uploader.uploadFiles();\r\n });\r\n\r\n var resourcesTab;\r\n " +
" $(document).on(\'dragover\', function () {\r\n if (!resourcesT" +
"ab) {\r\n var tabs = $Attachments.closest(\'.ui-tabs\');\r\n " +
" resourcesTab = {\r\n tabs: tabs,\r\n " +
" resourcesIndex: tabs.children(\'ul.ui-tabs-nav\').find(\'a[href=\"#jobDe" +
"tailTab-Resources\"]\').closest(\'li\').index()\r\n };\r\n " +
" }\r\n var selectedIndex = resourcesTab.tabs.tabs(\'option\', \'ac" +
"tive\');\r\n if (resourcesTab.resourcesIndex !== selectedIndex)\r\n " +
" resourcesTab.tabs.tabs(\'option\', \'active\', resourcesTab.resourc" +
"esIndex);\r\n });\r\n //#endregion\r\n ");
"Input = $Attachments.find(\'.attachmentInput\');\r\n $attachmentInput.fin" +
"d(\'.online-upload\').on(\'click\', function () {\r\n if ($(this).hasCl" +
"ass(\'disabled\'))\r\n alert(\'Disconnected from the Disco ICT Ser" +
"ver, please refresh this page and try again\');\r\n else\r\n " +
" attachmentUploader.onlineUpload();\r\n });\r\n if (w" +
"indow.location.protocol != \'https:\') {\r\n $attachmentInput.find(\'." +
"photo\')\r\n .removeClass(\'enabled\')\r\n .addCl" +
"ass(\'disabled\')\r\n .attr(\'title\', \'Capture Image: this functio" +
"nality is only available over a HTTPS connection\');\r\n }\r\n " +
"$attachmentInput.find(\'.photo\').click(function () {\r\n if (!$(this" +
").hasClass(\'enabled\'))\r\n alert(\'This functionality is only av" +
"ailable over a HTTPS connection\');\r\n else if ($(this).hasClass(\'d" +
"isabled\'))\r\n alert(\'Disconnected from the Disco ICT Server, p" +
"lease refresh this page and try again\');\r\n else\r\n " +
" attachmentUploader.uploadImage();\r\n });\r\n $attachmentI" +
"nput.find(\'.upload\').click(function () {\r\n if ($(this).hasClass(\'" +
"disabled\'))\r\n alert(\'Disconnected from the Disco ICT Server, " +
"please refresh this page and try again\');\r\n else\r\n " +
" attachmentUploader.uploadFiles();\r\n });\r\n\r\n var resou" +
"rcesTab;\r\n $(document).on(\'dragover\', function () {\r\n " +
"if (!resourcesTab) {\r\n var tabs = $Attachments.closest(\'.ui-t" +
"abs\');\r\n resourcesTab = {\r\n tabs: tabs" +
",\r\n resourcesIndex: tabs.children(\'ul.ui-tabs-nav\').find(" +
"\'a[href=\"#jobDetailTab-Resources\"]\').closest(\'li\').index()\r\n " +
"};\r\n }\r\n var selectedIndex = resourcesTab.tabs.tab" +
"s(\'option\', \'active\');\r\n if (resourcesTab.resourcesIndex !== sele" +
"ctedIndex)\r\n resourcesTab.tabs.tabs(\'option\', \'active\', resou" +
"rcesTab.resourcesIndex);\r\n });\r\n //#endregion\r\n " +
" ");
#line 360 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 366 "..\..\Views\Job\JobParts\Resources.cshtml"
}
@@ -1073,13 +1106,13 @@ WriteLiteral("\r\n //#region Add Attachments\r\n var attac
WriteLiteral("\r\n");
#line 362 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 368 "..\..\Views\Job\JobParts\Resources.cshtml"
#line default
#line hidden
#line 362 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 368 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canRemoveAnyAttachments || canRemoveOwnAttachments)
{
@@ -1114,7 +1147,7 @@ WriteLiteral(@"
url: '");
#line 389 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 395 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.AttachmentRemove()));
@@ -1150,7 +1183,7 @@ WriteLiteral(@"',
");
#line 416 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 422 "..\..\Views\Job\JobParts\Resources.cshtml"
}
@@ -1160,7 +1193,7 @@ WriteLiteral("\r\n function addAttachment(key, quick) {\r\n
"id: key };\r\n $.ajax({\r\n url: \'");
#line 421 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 427 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.Attachment()));
@@ -1171,13 +1204,13 @@ WriteLiteral("\',\r\n dataType: \'json\',\r\n
"\'OK\') {\r\n var a = d.Attachment;\r\n");
#line 427 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 433 "..\..\Views\Job\JobParts\Resources.cshtml"
#line default
#line hidden
#line 427 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 433 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canRemoveAnyAttachments)
{
@@ -1191,7 +1224,7 @@ WriteLiteral("buildAttachment(a, true, quick);");
WriteLiteral("\r\n");
#line 430 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 436 "..\..\Views\Job\JobParts\Resources.cshtml"
}
else if (canRemoveOwnAttachments)
{
@@ -1204,7 +1237,7 @@ WriteLiteral(" ");
WriteLiteral("buildAttachment(a, (a.AuthorId === \'");
#line 433 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 439 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(CurrentUser.UserId);
@@ -1215,7 +1248,7 @@ WriteLiteral("\'), quick);");
WriteLiteral("\r\n");
#line 434 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 440 "..\..\Views\Job\JobParts\Resources.cshtml"
}
else
{
@@ -1230,7 +1263,7 @@ WriteLiteral("buildAttachment(a, false, quick);");
WriteLiteral("\r\n");
#line 438 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 444 "..\..\Views\Job\JobParts\Resources.cshtml"
}
@@ -1257,7 +1290,7 @@ WriteLiteral(@" } else {
e.attr('data-attachmentid', a.Id).attr('data-mimetype', a.MimeType).attr('href', '");
#line 457 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 463 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.AttachmentDownload()));
@@ -1289,7 +1322,7 @@ WriteLiteral(@"/' + a.Id);
img.attr('src', '");
#line 480 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 486 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.AttachmentThumbnail()));
@@ -1336,14 +1369,14 @@ WriteLiteral("/\' + a.Id + \'?v=\' + retryCount);\r\n };\
"script>\r\n");
#line 550 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 556 "..\..\Views\Job\JobParts\Resources.cshtml"
}
#line default
#line hidden
#line 551 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 557 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canShowLogs || canShowAttachments)
{
@@ -1353,7 +1386,7 @@ WriteLiteral("/\' + a.Id + \'?v=\' + retryCount);\r\n };\
WriteLiteral(" <script>\r\n $(function () {\r\n var jobId = parseInt(\'");
#line 555 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 561 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Model.Job.Id);
@@ -1363,7 +1396,7 @@ WriteLiteral("\');\r\n\r\n //#region LiveEvents\r\n var hu
"dates;\r\n\r\n // Map Functions\r\n");
#line 561 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 567 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canShowLogs)
{
@@ -1374,14 +1407,14 @@ WriteLiteral("\r\n hub.client.addLog = document.DiscoFunctions.liveLo
" ");
#line 565 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 571 "..\..\Views\Job\JobParts\Resources.cshtml"
}
#line default
#line hidden
#line 566 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 572 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canShowAttachments)
{
@@ -1402,7 +1435,7 @@ WriteLiteral(@"
");
#line 579 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 585 "..\..\Views\Job\JobParts\Resources.cshtml"
}
@@ -1444,7 +1477,7 @@ WriteLiteral("\r\n $.connection.hub.qs = { JobId: jobId };\r\n
"egion\r\n });\r\n </script>\r\n");
#line 632 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 638 "..\..\Views\Job\JobParts\Resources.cshtml"
}
#line default
@@ -19,7 +19,7 @@
<table id="userShowResources">
<tr>
<td id="AttachmentsContainer">
<div id="Attachments" class="@(canAddAttachments ? "canAddAttachments" : "cannotAddAttachments")" data-uploadurl="@(Url.Action(MVC.API.User.AttachmentUpload(Model.User.UserId, null)))">
<div id="Attachments" class="@(canAddAttachments ? "canAddAttachments" : "cannotAddAttachments")" data-uploadurl="@(Url.Action(MVC.API.User.AttachmentUpload(Model.User.UserId, null)))" data-onlineuploadurl="@(Url.Action(MVC.API.User.AttachmentOnlineUploadSession(Model.User.UserId)))" data-qrcodeurl="@Url.Content("~/ClientSource/Scripts/Modules/qrcode.min.js")">
@Html.AntiForgeryToken()
<div class="Disco-AttachmentUpload-DropTarget">
<h2>Drop Attachments Here</h2>
@@ -48,7 +48,7 @@
{
<div class="Disco-AttachmentUpload-Progress"></div>
<div class="attachmentInput clearfix">
<span class="action enabled upload fa fa-upload disabled" title="Attach File"></span><span class="action enabled photo fa fa-camera disabled" title="Capture Image"></span>
<span class="action enabled upload fa fa-upload disabled" title="Attach File"></span><span class="action enabled photo fa fa-camera disabled" title="Capture Image"></span><span class="action enabled online-upload fa fa-qrcode disabled" title="Upload with Online Services"></span>
</div>
}
<script type="text/javascript">
@@ -237,6 +237,12 @@
var attachmentUploader = new document.Disco.AttachmentUploader($Attachments);
var $attachmentInput = $Attachments.find('.attachmentInput');
$attachmentInput.find('.online-upload').on('click', function () {
if ($(this).hasClass('disabled'))
alert('Disconnected from the Disco ICT Server, please refresh this page and try again');
else
attachmentUploader.onlineUpload();
});
if (window.location.protocol != 'https:') {
$attachmentInput.find('.photo')
.removeClass('enabled')
@@ -103,6 +103,28 @@ WriteLiteral(" data-uploadurl=\"");
#line hidden
WriteLiteral("\"");
WriteLiteral(" data-onlineuploadurl=\"");
#line 22 "..\..\Views\User\UserParts\_Resources.cshtml"
Write(Url.Action(MVC.API.User.AttachmentOnlineUploadSession(Model.User.UserId)));
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(" data-qrcodeurl=\"");
#line 22 "..\..\Views\User\UserParts\_Resources.cshtml"
Write(Url.Content("~/ClientSource/Scripts/Modules/qrcode.min.js"));
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
@@ -143,14 +165,14 @@ WriteLiteral(">\r\n");
#line hidden
WriteLiteral(" <a");
WriteAttribute("href", Tuple.Create(" href=\"", 1552), Tuple.Create("\"", 1610)
WriteAttribute("href", Tuple.Create(" href=\"", 1730), Tuple.Create("\"", 1788)
#line 32 "..\..\Views\User\UserParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1559), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.User.AttachmentDownload(ua.Id))
, Tuple.Create(Tuple.Create("", 1737), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.User.AttachmentDownload(ua.Id))
#line default
#line hidden
, 1559), false)
, 1737), false)
);
WriteLiteral(" data-attachmentid=\"");
@@ -179,28 +201,28 @@ WriteLiteral(">\r\n <span");
WriteLiteral(" class=\"icon\"");
WriteAttribute("title", Tuple.Create(" title=\"", 1724), Tuple.Create("\"", 1744)
WriteAttribute("title", Tuple.Create(" title=\"", 1902), Tuple.Create("\"", 1922)
#line 33 "..\..\Views\User\UserParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1732), Tuple.Create<System.Object, System.Int32>(ua.Filename
, Tuple.Create(Tuple.Create("", 1910), Tuple.Create<System.Object, System.Int32>(ua.Filename
#line default
#line hidden
, 1732), false)
, 1910), false)
);
WriteLiteral(">\r\n <img");
WriteLiteral(" alt=\"Attachment Thumbnail\"");
WriteAttribute("src", Tuple.Create(" src=\"", 1819), Tuple.Create("\"", 1879)
WriteAttribute("src", Tuple.Create(" src=\"", 1997), Tuple.Create("\"", 2057)
#line 34 "..\..\Views\User\UserParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1825), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.User.AttachmentThumbnail(ua.Id))
, Tuple.Create(Tuple.Create("", 2003), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.User.AttachmentThumbnail(ua.Id))
#line default
#line hidden
, 1825), false)
, 2003), false)
);
WriteLiteral(" />\r\n </span>\r\n " +
@@ -208,14 +230,14 @@ WriteLiteral(" />\r\n </span>\r\n
WriteLiteral(" class=\"comments\"");
WriteAttribute("title", Tuple.Create(" title=\"", 1988), Tuple.Create("\"", 2008)
WriteAttribute("title", Tuple.Create(" title=\"", 2166), Tuple.Create("\"", 2186)
#line 36 "..\..\Views\User\UserParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1996), Tuple.Create<System.Object, System.Int32>(ua.Comments
, Tuple.Create(Tuple.Create("", 2174), Tuple.Create<System.Object, System.Int32>(ua.Comments
#line default
#line hidden
, 1996), false)
, 2174), false)
);
WriteLiteral(">\r\n");
@@ -310,14 +332,14 @@ WriteLiteral(" data-livestamp=\"");
#line hidden
WriteLiteral("\"");
WriteAttribute("title", Tuple.Create(" title=\"", 2717), Tuple.Create("\"", 2755)
WriteAttribute("title", Tuple.Create(" title=\"", 2895), Tuple.Create("\"", 2933)
#line 42 "..\..\Views\User\UserParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 2725), Tuple.Create<System.Object, System.Int32>(ua.Timestamp.ToFullDateTime()
, Tuple.Create(Tuple.Create("", 2903), Tuple.Create<System.Object, System.Int32>(ua.Timestamp.ToFullDateTime()
#line default
#line hidden
, 2725), false)
, 2903), false)
);
WriteLiteral(">");
@@ -377,6 +399,12 @@ WriteLiteral(" class=\"action enabled photo fa fa-camera disabled\"");
WriteLiteral(" title=\"Capture Image\"");
WriteLiteral("></span><span");
WriteLiteral(" class=\"action enabled online-upload fa fa-qrcode disabled\"");
WriteLiteral(" title=\"Upload with Online Services\"");
WriteLiteral("></span>\r\n </div>\r\n");
@@ -653,40 +681,45 @@ WriteLiteral("/\' + a.Id + \'?v=\' + retryCount);\r\n
WriteLiteral("\r\n //#region Add Attachments\r\n " +
" var attachmentUploader = new document.Disco.AttachmentUploader($Attachments)" +
";\r\n\r\n var $attachmentInput = $Attachments.find(\'.atta" +
"chmentInput\');\r\n if (window.location.protocol != \'htt" +
"ps:\') {\r\n $attachmentInput.find(\'.photo\')\r\n " +
" .removeClass(\'enabled\')\r\n " +
" .addClass(\'disabled\')\r\n .attr(\'tit" +
"le\', \'Capture Image: this functionality is only available over a HTTPS connectio" +
"n\');\r\n }\r\n $attachmentInpu" +
"t.find(\'.photo\').click(function () {\r\n if (!$(thi" +
"s).hasClass(\'enabled\'))\r\n alert(\'This functio" +
"nality is only available over a HTTPS connection\');\r\n " +
" else if ($(this).hasClass(\'disabled\'))\r\n " +
" alert(\'Disconnected from the Disco ICT Server, please refresh this page and try" +
" again\');\r\n else\r\n " +
" attachmentUploader.uploadImage();\r\n });\r\n " +
" $attachmentInput.find(\'.upload\').click(function () {\r\n " +
" if ($(this).hasClass(\'disabled\'))\r\n " +
" alert(\'Disconnected from the Disco ICT Server, please refresh " +
"this page and try again\');\r\n else\r\n " +
" attachmentUploader.uploadFiles();\r\n " +
" });\r\n\r\n var resourcesTab;\r\n " +
" $(document).on(\'dragover\', function () {\r\n " +
" if (!resourcesTab) {\r\n var tabs = $Attachmen" +
"ts.closest(\'.ui-tabs\');\r\n resourcesTab = {\r\n " +
" tabs: tabs,\r\n " +
" resourcesIndex: tabs.children(\'ul.ui-tabs-nav\').find(\'a[href=\"#UserD" +
"etailTab-Resources\"]\').closest(\'li\').index()\r\n " +
" };\r\n }\r\n var sel" +
"ectedIndex = resourcesTab.tabs.tabs(\'option\', \'active\');\r\n " +
" if (resourcesTab.resourcesIndex !== selectedIndex)\r\n " +
" resourcesTab.tabs.tabs(\'option\', \'active\', resourcesTab.resour" +
"cesIndex);\r\n });\r\n //#endr" +
"egion\r\n ");
"chmentInput\');\r\n $attachmentInput.find(\'.online-uploa" +
"d\').on(\'click\', function () {\r\n if ($(this).hasCl" +
"ass(\'disabled\'))\r\n alert(\'Disconnected from t" +
"he Disco ICT Server, please refresh this page and try again\');\r\n " +
" else\r\n attachmentUploader.onl" +
"ineUpload();\r\n });\r\n if (w" +
"indow.location.protocol != \'https:\') {\r\n $attachm" +
"entInput.find(\'.photo\')\r\n .removeClass(\'enabl" +
"ed\')\r\n .addClass(\'disabled\')\r\n " +
" .attr(\'title\', \'Capture Image: this functionality is only a" +
"vailable over a HTTPS connection\');\r\n }\r\n " +
" $attachmentInput.find(\'.photo\').click(function () {\r\n " +
" if (!$(this).hasClass(\'enabled\'))\r\n " +
" alert(\'This functionality is only available over a HTTPS connection\'" +
");\r\n else if ($(this).hasClass(\'disabled\'))\r\n " +
" alert(\'Disconnected from the Disco ICT Server, p" +
"lease refresh this page and try again\');\r\n else\r\n" +
" attachmentUploader.uploadImage();\r\n " +
" });\r\n $attachmentInput.find(\'.uplo" +
"ad\').click(function () {\r\n if ($(this).hasClass(\'" +
"disabled\'))\r\n alert(\'Disconnected from the Di" +
"sco ICT Server, please refresh this page and try again\');\r\n " +
" else\r\n attachmentUploader.uploadFi" +
"les();\r\n });\r\n\r\n var resou" +
"rcesTab;\r\n $(document).on(\'dragover\', function () {\r\n" +
" if (!resourcesTab) {\r\n " +
" var tabs = $Attachments.closest(\'.ui-tabs\');\r\n " +
" resourcesTab = {\r\n tabs: tabs" +
",\r\n resourcesIndex: tabs.children(\'ul.ui-" +
"tabs-nav\').find(\'a[href=\"#UserDetailTab-Resources\"]\').closest(\'li\').index()\r\n " +
" };\r\n }\r\n " +
" var selectedIndex = resourcesTab.tabs.tabs(\'option\', \'ac" +
"tive\');\r\n if (resourcesTab.resourcesIndex !== sel" +
"ectedIndex)\r\n resourcesTab.tabs.tabs(\'option\'" +
", \'active\', resourcesTab.resourcesIndex);\r\n });\r\n " +
" //#endregion\r\n ");
#line 275 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 281 "..\..\Views\User\UserParts\_Resources.cshtml"
}
@@ -695,7 +728,7 @@ WriteLiteral("\r\n //#region Add Attachments\r\n
WriteLiteral(" ");
#line 276 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 282 "..\..\Views\User\UserParts\_Resources.cshtml"
if (canRemoveAnyAttachments || canRemoveOwnAttachments)
{
@@ -729,7 +762,7 @@ WriteLiteral(@"
url: '");
#line 302 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 308 "..\..\Views\User\UserParts\_Resources.cshtml"
Write(Url.Action(MVC.API.User.AttachmentRemove()));
@@ -757,7 +790,7 @@ WriteLiteral("\',\r\n dataType: \'jso
"/#endregion\r\n ");
#line 330 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 336 "..\..\Views\User\UserParts\_Resources.cshtml"
}
@@ -781,7 +814,7 @@ WriteLiteral(@"
$('#UserDetailTabItems').append('<li><a href=""#UserDetailTab-Resources"" id=""UserDetailTab-ResourcesLink"">Attachments [");
#line 346 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 352 "..\..\Views\User\UserParts\_Resources.cshtml"
Write(Model.User.UserAttachments == null ? 0 : Model.User.UserAttachments.Count);
@@ -790,7 +823,7 @@ WriteLiteral(@"
WriteLiteral("]</a></li>\');\r\n </script>\r\n</div>\r\n");
#line 349 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 355 "..\..\Views\User\UserParts\_Resources.cshtml"
if (canRemoveAnyAttachments || canRemoveOwnAttachments)
{
@@ -812,7 +845,7 @@ WriteLiteral(" class=\"fa fa-exclamation-triangle fa-lg\"");
WriteLiteral("></i>&nbsp;Are you sure?\r\n </p>\r\n </div>\r\n");
#line 356 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 362 "..\..\Views\User\UserParts\_Resources.cshtml"
}
#line default