a0e18ef963
Document Template import status and Device Enrolment status fixes. Attachment download fixes for SignalR foreverFrame transport. Database queries for Devices, Jobs and Users updated. Device attributes (model, profile, batch) now shown in various places.
810 lines
31 KiB
C#
810 lines
31 KiB
C#
#pragma warning disable 1591
|
|
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// This code was generated by a tool.
|
|
// Runtime Version:4.0.30319.34014
|
|
//
|
|
// Changes to this file may cause incorrect behavior and will be lost if
|
|
// the code is regenerated.
|
|
// </auto-generated>
|
|
//------------------------------------------------------------------------------
|
|
|
|
namespace Disco.Web.Views.User.UserParts
|
|
{
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Net;
|
|
using System.Text;
|
|
using System.Web;
|
|
using System.Web.Helpers;
|
|
using System.Web.Mvc;
|
|
using System.Web.Mvc.Ajax;
|
|
using System.Web.Mvc.Html;
|
|
using System.Web.Routing;
|
|
using System.Web.Security;
|
|
using System.Web.UI;
|
|
using System.Web.WebPages;
|
|
using Disco;
|
|
using Disco.BI.Extensions;
|
|
using Disco.Models.Repository;
|
|
using Disco.Services;
|
|
using Disco.Services.Authorization;
|
|
using Disco.Services.Web;
|
|
using Disco.Web;
|
|
using Disco.Web.Extensions;
|
|
|
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
|
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/User/UserParts/_Resources.cshtml")]
|
|
public partial class Resources : Disco.Services.Web.WebViewPage<Disco.Web.Models.User.ShowModel>
|
|
{
|
|
public Resources()
|
|
{
|
|
}
|
|
public override void Execute()
|
|
{
|
|
|
|
#line 2 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
|
|
Authorization.Require(Claims.User.ShowAttachments);
|
|
|
|
var canAddAttachments = Authorization.Has(Claims.User.Actions.AddAttachments);
|
|
var canRemoveAnyAttachments = Authorization.Has(Claims.User.Actions.RemoveAnyAttachments);
|
|
var canRemoveOwnAttachments = Authorization.Has(Claims.User.Actions.RemoveOwnAttachments);
|
|
|
|
Html.BundleDeferred("~/Style/Shadowbox");
|
|
Html.BundleDeferred("~/ClientScripts/Modules/Shadowbox");
|
|
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
|
|
|
|
if (canAddAttachments)
|
|
{
|
|
Html.BundleDeferred("~/ClientScripts/Modules/Silverlight");
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n<div");
|
|
|
|
WriteLiteral(" id=\"UserDetailTab-Resources\"");
|
|
|
|
WriteLiteral(" class=\"UserPart\"");
|
|
|
|
WriteLiteral(">\r\n <table");
|
|
|
|
WriteLiteral(" id=\"userShowResources\"");
|
|
|
|
WriteLiteral(">\r\n <tr>\r\n <td");
|
|
|
|
WriteLiteral(" id=\"Attachments\"");
|
|
|
|
WriteAttribute("class", Tuple.Create(" class=\"", 810), Tuple.Create("\"", 885)
|
|
|
|
#line 21 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 818), Tuple.Create<System.Object, System.Int32>(canAddAttachments ? "canAddAttachments" : "cannotAddAttachments"
|
|
|
|
#line default
|
|
#line hidden
|
|
, 818), false)
|
|
);
|
|
|
|
WriteLiteral(">\r\n <div");
|
|
|
|
WriteLiteral(" class=\"attachmentOutput\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 23 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 23 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
if (Model.User.UserAttachments != null)
|
|
{
|
|
foreach (var ua in Model.User.UserAttachments)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <a");
|
|
|
|
WriteAttribute("href", Tuple.Create(" href=\"", 1147), Tuple.Create("\"", 1205)
|
|
|
|
#line 27 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 1154), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.User.AttachmentDownload(ua.Id))
|
|
|
|
#line default
|
|
#line hidden
|
|
, 1154), false)
|
|
);
|
|
|
|
WriteLiteral(" data-attachmentid=\"");
|
|
|
|
|
|
#line 27 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
Write(ua.Id);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\"");
|
|
|
|
WriteLiteral(" data-mimetype=\"");
|
|
|
|
|
|
#line 27 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
Write(ua.MimeType);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\"");
|
|
|
|
WriteLiteral(">\r\n <span");
|
|
|
|
WriteLiteral(" class=\"icon\"");
|
|
|
|
WriteAttribute("title", Tuple.Create(" title=\"", 1311), Tuple.Create("\"", 1331)
|
|
|
|
#line 28 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 1319), Tuple.Create<System.Object, System.Int32>(ua.Filename
|
|
|
|
#line default
|
|
#line hidden
|
|
, 1319), false)
|
|
);
|
|
|
|
WriteLiteral(">\r\n <img");
|
|
|
|
WriteLiteral(" alt=\"Attachment Thumbnail\"");
|
|
|
|
WriteAttribute("src", Tuple.Create(" src=\"", 1398), Tuple.Create("\"", 1458)
|
|
|
|
#line 29 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 1404), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.User.AttachmentThumbnail(ua.Id))
|
|
|
|
#line default
|
|
#line hidden
|
|
, 1404), false)
|
|
);
|
|
|
|
WriteLiteral(" /></span>\r\n <span");
|
|
|
|
WriteLiteral(" class=\"comments\"");
|
|
|
|
WriteAttribute("title", Tuple.Create(" title=\"", 1521), Tuple.Create("\"", 1541)
|
|
|
|
#line 30 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 1529), Tuple.Create<System.Object, System.Int32>(ua.Comments
|
|
|
|
#line default
|
|
#line hidden
|
|
, 1529), false)
|
|
);
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 31 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 31 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
if (!string.IsNullOrEmpty(ua.DocumentTemplateId))
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 32 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
Write(ua.DocumentTemplate.Description);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 32 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 34 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
Write(ua.Comments);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 34 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
}
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </span><span");
|
|
|
|
WriteLiteral(" class=\"author\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 35 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
Write(ua.TechUser.ToStringFriendly());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</span>");
|
|
|
|
|
|
#line 35 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
if (canRemoveAnyAttachments || (canRemoveOwnAttachments && ua.TechUserId == CurrentUser.UserId))
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("<span");
|
|
|
|
WriteLiteral(" class=\"remove fa fa-times-circle\"");
|
|
|
|
WriteLiteral("></span>");
|
|
|
|
|
|
#line 36 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
}
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("<span");
|
|
|
|
WriteLiteral(" class=\"timestamp\"");
|
|
|
|
WriteLiteral(" data-livestamp=\"");
|
|
|
|
|
|
#line 36 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
Write(ua.Timestamp.ToUnixEpoc());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\"");
|
|
|
|
WriteAttribute("title", Tuple.Create(" title=\"", 2212), Tuple.Create("\"", 2250)
|
|
|
|
#line 36 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 2220), Tuple.Create<System.Object, System.Int32>(ua.Timestamp.ToFullDateTime()
|
|
|
|
#line default
|
|
#line hidden
|
|
, 2220), false)
|
|
);
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 36 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
Write(ua.Timestamp.ToFullDateTime());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</span>\r\n </a> \r\n");
|
|
|
|
|
|
#line 38 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
}
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </div>\r\n");
|
|
|
|
|
|
#line 41 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 41 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
if (canAddAttachments)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" class=\"attachmentInput clearfix\"");
|
|
|
|
WriteLiteral(">\r\n <span");
|
|
|
|
WriteLiteral(" class=\"action upload fa fa-upload\"");
|
|
|
|
WriteLiteral(" title=\"Attach File\"");
|
|
|
|
WriteLiteral("></span><span");
|
|
|
|
WriteLiteral(" class=\"action photo fa fa-camera\"");
|
|
|
|
WriteLiteral(" title=\"Capture Image\"");
|
|
|
|
WriteLiteral("></span>\r\n </div>\r\n");
|
|
|
|
|
|
#line 46 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(@">
|
|
Shadowbox.init({
|
|
skipSetup: true,
|
|
modal: true
|
|
});
|
|
$(function () {
|
|
var $Attachments = $('#Attachments');
|
|
var $attachmentOutput = $Attachments.find('.attachmentOutput');
|
|
var $dialogUpload = null;
|
|
var $dialogRemoveAttachment = null;
|
|
|
|
// Connect to Hub
|
|
var hub = $.connection.userUpdates;
|
|
|
|
// Map Functions
|
|
hub.client.addAttachment = onAddAttachment;
|
|
hub.client.removeAttachment = onRemoveAttachment;
|
|
|
|
$.connection.hub.qs = { UserId: '");
|
|
|
|
|
|
#line 65 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
Write(Model.User.UserId.Replace(@"\", @"\\"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(@"' };
|
|
$.connection.hub.error(onHubError);
|
|
|
|
// Start Connection
|
|
$.connection.hub.start().fail(onHubError);
|
|
|
|
function onHubError(error) {
|
|
alert('Live-update Error: ' + error);
|
|
}
|
|
|
|
function onAddAttachment(id, quick) {
|
|
var data = { id: id };
|
|
$.ajax({
|
|
url: '");
|
|
|
|
|
|
#line 78 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
Write(Url.Action(MVC.API.User.Attachment()));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(@"',
|
|
dataType: 'json',
|
|
data: data,
|
|
success: function (d) {
|
|
if (d.Result == 'OK') {
|
|
var a = d.Attachment;
|
|
");
|
|
|
|
|
|
#line 84 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 84 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
if (canRemoveAnyAttachments)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
WriteLiteral("buildAttachment(a, true, quick);");
|
|
|
|
WriteLiteral("\r\n");
|
|
|
|
|
|
#line 87 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
}
|
|
else if (canRemoveOwnAttachments)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
WriteLiteral("buildAttachment(a, (a.AuthorId === \'");
|
|
|
|
|
|
#line 90 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
Write(CurrentUser.UserId);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\'), quick);");
|
|
|
|
WriteLiteral("\r\n");
|
|
|
|
|
|
#line 91 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
WriteLiteral("buildAttachment(a, false, quick);");
|
|
|
|
WriteLiteral("\r\n");
|
|
|
|
|
|
#line 95 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(@" } else {
|
|
alert('Unable to add attachment: ' + d.Result);
|
|
}
|
|
},
|
|
error: function (jqXHR, textStatus, errorThrown) {
|
|
alert('Unable to add attachment: ' + textStatus);
|
|
}
|
|
});
|
|
}
|
|
function buildAttachment(a, canRemove, quick) {
|
|
var t = '<a><span class=""icon""><img alt=""Attachment Thumbnail"" /></span><span class=""comments""></span><span class=""author""></span>';
|
|
if (canRemove)
|
|
t += '<span class=""remove fa fa-times-circle""></span>';
|
|
t += '<span class=""timestamp""></span></a>';
|
|
|
|
var e = $(t);
|
|
|
|
e.attr('data-attachmentid', a.Id).attr('data-mimetype', a.MimeType).attr('href', '");
|
|
|
|
|
|
#line 113 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
Write(Url.Action(MVC.API.User.AttachmentDownload()));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("/\' + a.Id);\r\n e.find(\'.icon img\').attr(\'src\', \'");
|
|
|
|
|
|
#line 114 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
Write(Url.Action(MVC.API.User.AttachmentThumbnail()));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("/\' + a.Id);\r\n e.find(\'.comments\').text(a.Description);" +
|
|
"\r\n e.find(\'.author\').text(a.Author);\r\n " +
|
|
" e.find(\'.timestamp\').text(a.TimestampFull).attr(\'title\', a.Timestam" +
|
|
"pFull).livestamp(a.TimestampUnixEpoc);\r\n if (canRemov" +
|
|
"e)\r\n e.find(\'.remove\').click(removeAttachment);\r\n" +
|
|
" if (!quick)\r\n e.hide(" +
|
|
");\r\n $attachmentOutput.append(e);\r\n " +
|
|
" onUpdate();\r\n if (!quick)\r\n " +
|
|
" e.show(\'slow\');\r\n if (a.MimeType.toLo" +
|
|
"werCase().indexOf(\'image/\') == 0)\r\n e.shadowbox({" +
|
|
" gallery: \'attachments\', player: \'img\', title: a.Description });\r\n " +
|
|
" else\r\n e.click(onDownload);\r\n " +
|
|
" }\r\n\r\n function onDownload() {\r\n " +
|
|
" var $this = $(this);\r\n var url = " +
|
|
"$this.attr(\'href\');\r\n\r\n if ($.connection && $.connect" +
|
|
"ion.hub && $.connection.hub.transport &&\r\n " +
|
|
" $.connection.hub.transport.name == \'foreverFrame\') {\r\n " +
|
|
" // SignalR active with foreverFrame transport - use popup window" +
|
|
"\r\n window.open(url, \'_blank\', \'height=150,width=2" +
|
|
"50,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no\');\r\n " +
|
|
" } else {\r\n // use iFram" +
|
|
"e\r\n if (!$attachmentDownloadHost) {\r\n " +
|
|
" $attachmentDownloadHost = $(\'<iframe>\')\r\n " +
|
|
" .attr({ \'src\': url, \'title\': \'Attachment Download Host\'" +
|
|
" })\r\n .addClass(\'hidden\')\r\n " +
|
|
" .appendTo(\'body\')\r\n " +
|
|
" .contents();\r\n } else {\r\n " +
|
|
" $attachmentDownloadHost[0].location.href = url;\r\n " +
|
|
" }\r\n }\r\n\r\n " +
|
|
" return false;\r\n }\r\n\r\n function o" +
|
|
"nRemoveAttachment(id) {\r\n var a = $attachmentOutput.f" +
|
|
"ind(\'a[data-attachmentid=\' + id + \']\');\r\n\r\n a.hide(30" +
|
|
"0).delay(300).queue(function () {\r\n var $this = $" +
|
|
"(this);\r\n if ($this.attr(\'data-mimetype\').toLower" +
|
|
"Case().indexOf(\'image/\') == 0)\r\n Shadowbox.re" +
|
|
"moveCache(this);\r\n $this.find(\'.timestamp\').lives" +
|
|
"tamp(\'destroy\');\r\n $this.remove();\r\n " +
|
|
" onUpdate();\r\n });\r\n " +
|
|
" }\r\n\r\n function onUpdate() {\r\n " +
|
|
" var attachmentCount = $attachmentOutput.children(\'a\').length;\r\n " +
|
|
" var tabHeading = \'Attachments [\' + attachmentCount + \']\';\r\n " +
|
|
" $(\'#UserDetailTab-ResourcesLink\').text(tabHeading);\r\n" +
|
|
" }\r\n\r\n");
|
|
|
|
|
|
#line 175 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 175 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
if (canAddAttachments)
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n //#region Add Attachments\r\n if (" +
|
|
"!document.DiscoFunctions) {\r\n document.DiscoFunctions" +
|
|
" = {};\r\n }\r\n document.DiscoFunctio" +
|
|
"ns.addAttachment = function (Id) { return; /* Silverlight notification, do nothi" +
|
|
"ng use SignalR */ };\r\n\r\n var $attachmentInput = $Attachme" +
|
|
"nts.find(\'.attachmentInput\');\r\n $attachmentInput.find(\'.p" +
|
|
"hoto\').click(function () {\r\n showDialog(\'/WebCam\');\r\n" +
|
|
" });\r\n $attachmentInput.find(\'.upl" +
|
|
"oad\').click(function () {\r\n showDialog(\'/File\');\r\n " +
|
|
" });\r\n\r\n var silverlightOnLoadNavigat" +
|
|
"ion = null;\r\n var silverlightIsLoaded = null;\r\n\r\n " +
|
|
" function showDialog(navigationPath) {\r\n " +
|
|
" if (!$dialogUpload) {\r\n $dialogUpload = $(\'#di" +
|
|
"alogUpload\').dialog({\r\n autoOpen: false,\r\n " +
|
|
" draggable: false,\r\n " +
|
|
" modal: true,\r\n resizable: false,\r\n " +
|
|
" width: 860,\r\n " +
|
|
" height: 550,\r\n close: function () {\r\n " +
|
|
" var sl = $(\'#silverlightUploadAttachment\').get" +
|
|
"(0);\r\n if (sl.content)\r\n " +
|
|
" sl.content.Navigator.Navigate(\'/Hidden\');\r\n " +
|
|
" }\r\n });\r\n\r\n " +
|
|
" Silverlight.createObject(\'");
|
|
|
|
|
|
#line 210 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
Write(Links.ClientBin.Disco_Silverlight_AttachmentUpload_xap);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(@"',
|
|
$('#silverlightHostUploadAttachment').get(0),
|
|
'silverlightUploadAttachment',
|
|
{ width: '840px', height: '500px', background: 'white', version: '4.0.60310.0' },
|
|
{
|
|
onLoad: function () {
|
|
if (silverlightOnLoadNavigation) {
|
|
$('#silverlightUploadAttachment').get(0).content.Navigator.Navigate(silverlightOnLoadNavigation);
|
|
silverlightIsLoaded = true;
|
|
}
|
|
}
|
|
},
|
|
'UploadUrl=");
|
|
|
|
|
|
#line 222 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
Write(Url.Action(MVC.API.User.AttachmentUpload(Model.User.UserId, null)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(@"');
|
|
}
|
|
|
|
$dialogUpload.dialog('open');
|
|
if (silverlightIsLoaded) {
|
|
$('#silverlightUploadAttachment').get(0).content.Navigator.Navigate(navigationPath);
|
|
} else {
|
|
silverlightOnLoadNavigation = navigationPath;
|
|
}
|
|
};
|
|
|
|
//#endregion
|
|
");
|
|
|
|
|
|
#line 234 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 235 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
if (canRemoveAnyAttachments || canRemoveOwnAttachments)
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(@"
|
|
//#region Remove Attachments
|
|
|
|
$attachmentOutput.find('span.remove').click(removeAttachment);
|
|
|
|
function removeAttachment() {
|
|
$this = $(this).closest('a');
|
|
|
|
var data = { id: $this.attr('data-attachmentid') };
|
|
|
|
if (!$dialogRemoveAttachment) {
|
|
$dialogRemoveAttachment = $('#dialogRemoveAttachment').dialog({
|
|
resizable: false,
|
|
height: 140,
|
|
modal: true,
|
|
autoOpen: false
|
|
});
|
|
}
|
|
|
|
$dialogRemoveAttachment.dialog(""enable"");
|
|
$dialogRemoveAttachment.dialog('option', 'buttons', {
|
|
""Remove"": function () {
|
|
$dialogRemoveAttachment.dialog(""disable"");
|
|
$dialogRemoveAttachment.dialog(""option"", ""buttons"", null);
|
|
$.ajax({
|
|
url: '");
|
|
|
|
|
|
#line 261 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
Write(Url.Action(MVC.API.User.AttachmentRemove()));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(@"',
|
|
dataType: 'json',
|
|
data: data,
|
|
success: function (d) {
|
|
if (d == 'OK') {
|
|
// Do nothing, await SignalR notification
|
|
} else {
|
|
alert('Unable to remove attachment: ' + d);
|
|
}
|
|
$dialogRemoveAttachment.dialog(""close"");
|
|
},
|
|
error: function (jqXHR, textStatus, errorThrown) {
|
|
alert('Unable to remove attachment: ' + textStatus);
|
|
$dialogRemoveAttachment.dialog(""close"");
|
|
}
|
|
});
|
|
},
|
|
Cancel: function () {
|
|
$dialogRemoveAttachment.dialog(""close"");
|
|
}
|
|
});
|
|
|
|
$dialogRemoveAttachment.dialog('open');
|
|
|
|
return false;
|
|
}
|
|
|
|
//#endregion
|
|
");
|
|
|
|
|
|
#line 289 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(@"
|
|
$attachmentOutput.children('a').each(function () {
|
|
$this = $(this);
|
|
if ($this.attr('data-mimetype').toLowerCase().indexOf('image/') == 0)
|
|
$this.shadowbox({ gallery: 'attachments', player: 'img', title: $this.find('.comments').text() });
|
|
else
|
|
$this.click(onDownload);
|
|
});
|
|
});
|
|
</script>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<script>
|
|
$('#UserDetailTabItems').append('<li><a href=""#UserDetailTab-Resources"" id=""UserDetailTab-ResourcesLink"">Attachments [");
|
|
|
|
|
|
#line 304 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
Write(Model.User.UserAttachments == null ? 0 : Model.User.UserAttachments.Count);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("]</a></li>\');\r\n </script>\r\n</div>\r\n");
|
|
|
|
|
|
#line 307 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
if (canAddAttachments)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"dialogUpload\"");
|
|
|
|
WriteLiteral(" class=\"dialog\"");
|
|
|
|
WriteLiteral(" title=\"Upload Attachment\"");
|
|
|
|
WriteLiteral(">\r\n <div");
|
|
|
|
WriteLiteral(" id=\"silverlightHostUploadAttachment\"");
|
|
|
|
WriteLiteral(">\r\n </div>\r\n </div>\r\n");
|
|
|
|
|
|
#line 313 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 314 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
if (canRemoveAnyAttachments || canRemoveOwnAttachments)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"dialogRemoveAttachment\"");
|
|
|
|
WriteLiteral(" class=\"dialog\"");
|
|
|
|
WriteLiteral(" title=\"Remove this Attachment?\"");
|
|
|
|
WriteLiteral(">\r\n <p>\r\n <i");
|
|
|
|
WriteLiteral(" class=\"fa fa-exclamation-triangle fa-lg\"");
|
|
|
|
WriteLiteral("></i> Are you sure?\r\n </p>\r\n </div>\r\n");
|
|
|
|
|
|
#line 321 "..\..\Views\User\UserParts\_Resources.cshtml"
|
|
}
|
|
|
|
#line default
|
|
#line hidden
|
|
}
|
|
}
|
|
}
|
|
#pragma warning restore 1591
|