bug fix #171 device batch attachments not working
This commit is contained in:
@@ -189,6 +189,10 @@
|
|||||||
<Compile Include="Migrations\202412180604170_DBv25.Designer.cs">
|
<Compile Include="Migrations\202412180604170_DBv25.Designer.cs">
|
||||||
<DependentUpon>202412180604170_DBv25.cs</DependentUpon>
|
<DependentUpon>202412180604170_DBv25.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Migrations\202503140520548_DBv26.cs" />
|
||||||
|
<Compile Include="Migrations\202503140520548_DBv26.Designer.cs">
|
||||||
|
<DependentUpon>202503140520548_DBv26.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Migrations\Configuration.cs" />
|
<Compile Include="Migrations\Configuration.cs" />
|
||||||
<Compile Include="Migrations\DiscoDataMigrator.cs" />
|
<Compile Include="Migrations\DiscoDataMigrator.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
@@ -279,6 +283,9 @@
|
|||||||
<EmbeddedResource Include="Migrations\202412180604170_DBv25.resx">
|
<EmbeddedResource Include="Migrations\202412180604170_DBv25.resx">
|
||||||
<DependentUpon>202412180604170_DBv25.cs</DependentUpon>
|
<DependentUpon>202412180604170_DBv25.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Migrations\202503140520548_DBv26.resx">
|
||||||
|
<DependentUpon>202503140520548_DBv26.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Properties\Resources.resx">
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
<Generator>ResXFileCodeGenerator</Generator>
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
namespace Disco.Data.Migrations
|
||||||
|
{
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
using System.Data.Entity.Migrations.Infrastructure;
|
||||||
|
using System.Resources;
|
||||||
|
|
||||||
|
public sealed partial class DBv26 : IMigrationMetadata
|
||||||
|
{
|
||||||
|
private readonly ResourceManager Resources = new ResourceManager(typeof(DBv26));
|
||||||
|
|
||||||
|
string IMigrationMetadata.Id
|
||||||
|
{
|
||||||
|
get { return "202503140520548_DBv26"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Source
|
||||||
|
{
|
||||||
|
get { return null; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Target
|
||||||
|
{
|
||||||
|
get { return Resources.GetString("Target"); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
namespace Disco.Data.Migrations
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
|
||||||
|
public partial class DBv26 : DbMigration
|
||||||
|
{
|
||||||
|
public override void Up()
|
||||||
|
{
|
||||||
|
AlterColumn("dbo.DeviceBatchAttachments", "Comments", c => c.String(maxLength: 500));
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Down()
|
||||||
|
{
|
||||||
|
AlterColumn("dbo.DeviceBatchAttachments", "Comments", c => c.String(nullable: false, maxLength: 500));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
@@ -16,7 +16,7 @@ namespace Disco.Models.Repository
|
|||||||
[Required, StringLength(500)]
|
[Required, StringLength(500)]
|
||||||
public string MimeType { get; set; }
|
public string MimeType { get; set; }
|
||||||
public DateTime Timestamp { get; set; }
|
public DateTime Timestamp { get; set; }
|
||||||
[Required, StringLength(500)]
|
[StringLength(500)]
|
||||||
public string Comments { get; set; }
|
public string Comments { get; set; }
|
||||||
|
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
|
|||||||
@@ -652,7 +652,8 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
[DiscoAuthorize(Claims.Config.DeviceBatch.Configure)]
|
[DiscoAuthorize(Claims.Config.DeviceBatch.Configure)]
|
||||||
public virtual ActionResult AttachmentUpload(int id, string Comments)
|
[HttpPost, ValidateAntiForgeryToken]
|
||||||
|
public virtual ActionResult AttachmentUpload(int id, string comments)
|
||||||
{
|
{
|
||||||
var batch = Database.DeviceBatches.Find(id);
|
var batch = Database.DeviceBatches.Find(id);
|
||||||
if (batch != null)
|
if (batch != null)
|
||||||
@@ -666,14 +667,14 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
if (string.IsNullOrEmpty(contentType) || contentType.Equals("unknown/unknown", StringComparison.OrdinalIgnoreCase))
|
if (string.IsNullOrEmpty(contentType) || contentType.Equals("unknown/unknown", StringComparison.OrdinalIgnoreCase))
|
||||||
contentType = MimeTypes.ResolveMimeType(file.FileName);
|
contentType = MimeTypes.ResolveMimeType(file.FileName);
|
||||||
|
|
||||||
var attachment = new Disco.Models.Repository.DeviceBatchAttachment()
|
var attachment = new DeviceBatchAttachment()
|
||||||
{
|
{
|
||||||
DeviceBatchId = batch.Id,
|
DeviceBatchId = batch.Id,
|
||||||
TechUserId = CurrentUser.UserId,
|
TechUserId = CurrentUser.UserId,
|
||||||
Filename = file.FileName,
|
Filename = file.FileName,
|
||||||
MimeType = contentType,
|
MimeType = contentType,
|
||||||
Timestamp = DateTime.Now,
|
Timestamp = DateTime.Now,
|
||||||
Comments = Comments
|
Comments = comments
|
||||||
};
|
};
|
||||||
Database.DeviceBatchAttachments.Add(attachment);
|
Database.DeviceBatchAttachments.Add(attachment);
|
||||||
Database.SaveChanges();
|
Database.SaveChanges();
|
||||||
|
|||||||
@@ -668,8 +668,8 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>Attachments:</th>
|
<th>Attachments:</th>
|
||||||
<td>
|
<td>
|
||||||
|
<div id="DeviceBatch_Attachments" class="@(canConfig ? "canAddAttachments" : "cannotAddAttachments")" data-uploadurl="@(Url.Action(MVC.API.DeviceBatch.AttachmentUpload(Model.DeviceBatch.Id, null)))">
|
||||||
<div id="DeviceBatch_Attachments" class="@(canConfig ? "canAddAttachments" : "cannotAddAttachments")">
|
@Html.AntiForgeryToken()
|
||||||
<div class="Disco-AttachmentUpload-DropTarget">
|
<div class="Disco-AttachmentUpload-DropTarget">
|
||||||
<h2>Drop Attachments Here</h2>
|
<h2>Drop Attachments Here</h2>
|
||||||
</div>
|
</div>
|
||||||
@@ -694,7 +694,7 @@
|
|||||||
{
|
{
|
||||||
<div class="Disco-AttachmentUpload-Progress"></div>
|
<div class="Disco-AttachmentUpload-Progress"></div>
|
||||||
<div class="attachmentInput clearfix">
|
<div class="attachmentInput clearfix">
|
||||||
<span class="action upload fa fa-upload disabled" title="Attach File"></span><span class="action 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>
|
||||||
</div>
|
</div>
|
||||||
<div id="dialogRemoveAttachment" class="dialog" title="Remove this Attachment?">
|
<div id="dialogRemoveAttachment" class="dialog" title="Remove this Attachment?">
|
||||||
<p>
|
<p>
|
||||||
@@ -726,20 +726,20 @@
|
|||||||
$.connection.hub.disconnected(onHubFailed);
|
$.connection.hub.disconnected(onHubFailed);
|
||||||
|
|
||||||
$.connection.hub.reconnecting(function () {
|
$.connection.hub.reconnecting(function () {
|
||||||
$Attachments.find('span.action').addClass('disabled');
|
$Attachments.find('span.action.enabled').addClass('disabled');
|
||||||
});
|
});
|
||||||
$.connection.hub.reconnected(function () {
|
$.connection.hub.reconnected(function () {
|
||||||
$Attachments.find('span.action').removeClass('disabled');
|
$Attachments.find('span.action.enabled').removeClass('disabled');
|
||||||
});
|
});
|
||||||
|
|
||||||
// Start Connection
|
// Start Connection
|
||||||
$.connection.hub.start(function () {
|
$.connection.hub.start(function () {
|
||||||
$Attachments.find('span.action').removeClass('disabled');
|
$Attachments.find('span.action.enabled').removeClass('disabled');
|
||||||
}).fail(onHubFailed);
|
}).fail(onHubFailed);
|
||||||
|
|
||||||
function onHubFailed(error) {
|
function onHubFailed(error) {
|
||||||
// Disable UI
|
// Disable UI
|
||||||
$Attachments.find('span.action').addClass('disabled');
|
$Attachments.find('span.action.enabled').addClass('disabled');
|
||||||
|
|
||||||
// Show Dialog Message
|
// Show Dialog Message
|
||||||
if ($('.disconnected-dialog').length == 0) {
|
if ($('.disconnected-dialog').length == 0) {
|
||||||
@@ -876,14 +876,19 @@
|
|||||||
@if (canConfig)
|
@if (canConfig)
|
||||||
{<text>
|
{<text>
|
||||||
//#region Add Attachments
|
//#region Add Attachments
|
||||||
var attachmentUploader = new document.Disco.AttachmentUploader(
|
var attachmentUploader = new document.Disco.AttachmentUploader($Attachments);
|
||||||
'@(Url.Action(MVC.API.DeviceBatch.AttachmentUpload(Model.DeviceBatch.Id, null)))',
|
|
||||||
$Attachments.find('.Disco-AttachmentUpload-DropTarget'),
|
|
||||||
$Attachments.find('.Disco-AttachmentUpload-Progress'));
|
|
||||||
|
|
||||||
var $attachmentInput = $Attachments.find('.attachmentInput');
|
var $attachmentInput = $Attachments.find('.attachmentInput');
|
||||||
|
if (window.location.protocol != 'https:') {
|
||||||
|
$attachmentInput.find('.photo')
|
||||||
|
.removeClass('enabled')
|
||||||
|
.addClass('disabled')
|
||||||
|
.attr('title', 'Capture Image: this functionality is only available over a HTTPS connection');
|
||||||
|
}
|
||||||
$attachmentInput.find('.photo').click(function () {
|
$attachmentInput.find('.photo').click(function () {
|
||||||
if ($(this).hasClass('disabled'))
|
if (!$(this).hasClass('enabled'))
|
||||||
|
alert('This functionality is only available over a HTTPS connection');
|
||||||
|
else if ($(this).hasClass('disabled'))
|
||||||
alert('Disconnected from the Disco ICT Server, please refresh this page and try again');
|
alert('Disconnected from the Disco ICT Server, please refresh this page and try again');
|
||||||
else
|
else
|
||||||
attachmentUploader.uploadImage();
|
attachmentUploader.uploadImage();
|
||||||
|
|||||||
@@ -2001,21 +2001,43 @@ WriteLiteral("><None Specified></span>");
|
|||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>Attachments:</th>" +
|
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>Attachments:</th>" +
|
||||||
"\r\n <td>\r\n\r\n <div");
|
"\r\n <td>\r\n <div");
|
||||||
|
|
||||||
WriteLiteral(" id=\"DeviceBatch_Attachments\"");
|
WriteLiteral(" id=\"DeviceBatch_Attachments\"");
|
||||||
|
|
||||||
WriteAttribute("class", Tuple.Create(" class=\"", 34487), Tuple.Create("\"", 34554)
|
WriteAttribute("class", Tuple.Create(" class=\"", 34485), Tuple.Create("\"", 34552)
|
||||||
|
|
||||||
#line 672 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
#line 671 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
, Tuple.Create(Tuple.Create("", 34495), Tuple.Create<System.Object, System.Int32>(canConfig ? "canAddAttachments" : "cannotAddAttachments"
|
, Tuple.Create(Tuple.Create("", 34493), Tuple.Create<System.Object, System.Int32>(canConfig ? "canAddAttachments" : "cannotAddAttachments"
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
, 34495), false)
|
, 34493), false)
|
||||||
);
|
);
|
||||||
|
|
||||||
WriteLiteral(">\r\n <div");
|
WriteLiteral(" data-uploadurl=\"");
|
||||||
|
|
||||||
|
|
||||||
|
#line 671 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
|
Write(Url.Action(MVC.API.DeviceBatch.AttachmentUpload(Model.DeviceBatch.Id, null)));
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral("\"");
|
||||||
|
|
||||||
|
WriteLiteral(">\r\n");
|
||||||
|
|
||||||
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
|
#line 672 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
|
Write(Html.AntiForgeryToken());
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral("\r\n <div");
|
||||||
|
|
||||||
WriteLiteral(" class=\"Disco-AttachmentUpload-DropTarget\"");
|
WriteLiteral(" class=\"Disco-AttachmentUpload-DropTarget\"");
|
||||||
|
|
||||||
@@ -2044,14 +2066,14 @@ WriteLiteral(">\r\n");
|
|||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral(" <a");
|
WriteLiteral(" <a");
|
||||||
|
|
||||||
WriteAttribute("href", Tuple.Create(" href=\"", 35033), Tuple.Create("\"", 35106)
|
WriteAttribute("href", Tuple.Create(" href=\"", 35174), Tuple.Create("\"", 35247)
|
||||||
|
|
||||||
#line 681 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
#line 681 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
, Tuple.Create(Tuple.Create("", 35040), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceBatch.AttachmentDownload(attachment.Id))
|
, Tuple.Create(Tuple.Create("", 35181), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceBatch.AttachmentDownload(attachment.Id))
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
, 35040), false)
|
, 35181), false)
|
||||||
);
|
);
|
||||||
|
|
||||||
WriteLiteral(" data-attachmentid=\"");
|
WriteLiteral(" data-attachmentid=\"");
|
||||||
@@ -2080,28 +2102,28 @@ WriteLiteral(">\r\n <span");
|
|||||||
|
|
||||||
WriteLiteral(" class=\"icon\"");
|
WriteLiteral(" class=\"icon\"");
|
||||||
|
|
||||||
WriteAttribute("title", Tuple.Create(" title=\"", 35236), Tuple.Create("\"", 35264)
|
WriteAttribute("title", Tuple.Create(" title=\"", 35377), Tuple.Create("\"", 35405)
|
||||||
|
|
||||||
#line 682 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
#line 682 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
, Tuple.Create(Tuple.Create("", 35244), Tuple.Create<System.Object, System.Int32>(attachment.Filename
|
, Tuple.Create(Tuple.Create("", 35385), Tuple.Create<System.Object, System.Int32>(attachment.Filename
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
, 35244), false)
|
, 35385), false)
|
||||||
);
|
);
|
||||||
|
|
||||||
WriteLiteral(">\r\n <img");
|
WriteLiteral(">\r\n <img");
|
||||||
|
|
||||||
WriteLiteral(" alt=\"Attachment Thumbnail\"");
|
WriteLiteral(" alt=\"Attachment Thumbnail\"");
|
||||||
|
|
||||||
WriteAttribute("src", Tuple.Create(" src=\"", 35339), Tuple.Create("\"", 35414)
|
WriteAttribute("src", Tuple.Create(" src=\"", 35480), Tuple.Create("\"", 35555)
|
||||||
|
|
||||||
#line 683 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
#line 683 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
, Tuple.Create(Tuple.Create("", 35345), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceBatch.AttachmentThumbnail(attachment.Id))
|
, Tuple.Create(Tuple.Create("", 35486), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceBatch.AttachmentThumbnail(attachment.Id))
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
, 35345), false)
|
, 35486), false)
|
||||||
);
|
);
|
||||||
|
|
||||||
WriteLiteral(" />\r\n </span>\r\n " +
|
WriteLiteral(" />\r\n </span>\r\n " +
|
||||||
@@ -2109,14 +2131,14 @@ WriteLiteral(" />\r\n </span>\r\n
|
|||||||
|
|
||||||
WriteLiteral(" class=\"comments\"");
|
WriteLiteral(" class=\"comments\"");
|
||||||
|
|
||||||
WriteAttribute("title", Tuple.Create(" title=\"", 35523), Tuple.Create("\"", 35551)
|
WriteAttribute("title", Tuple.Create(" title=\"", 35664), Tuple.Create("\"", 35692)
|
||||||
|
|
||||||
#line 685 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
#line 685 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
, Tuple.Create(Tuple.Create("", 35531), Tuple.Create<System.Object, System.Int32>(attachment.Comments
|
, Tuple.Create(Tuple.Create("", 35672), Tuple.Create<System.Object, System.Int32>(attachment.Comments
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
, 35531), false)
|
, 35672), false)
|
||||||
);
|
);
|
||||||
|
|
||||||
WriteLiteral(">\r\n");
|
WriteLiteral(">\r\n");
|
||||||
@@ -2168,14 +2190,14 @@ WriteLiteral("<span");
|
|||||||
|
|
||||||
WriteLiteral(" class=\"timestamp\"");
|
WriteLiteral(" class=\"timestamp\"");
|
||||||
|
|
||||||
WriteAttribute("title", Tuple.Create(" title=\"", 35857), Tuple.Create("\"", 35903)
|
WriteAttribute("title", Tuple.Create(" title=\"", 35998), Tuple.Create("\"", 36044)
|
||||||
|
|
||||||
#line 688 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
#line 688 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
, Tuple.Create(Tuple.Create("", 35865), Tuple.Create<System.Object, System.Int32>(attachment.Timestamp.ToFullDateTime()
|
, Tuple.Create(Tuple.Create("", 36006), Tuple.Create<System.Object, System.Int32>(attachment.Timestamp.ToFullDateTime()
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
, 35865), false)
|
, 36006), false)
|
||||||
);
|
);
|
||||||
|
|
||||||
WriteLiteral(" data-livestamp=\"");
|
WriteLiteral(" data-livestamp=\"");
|
||||||
@@ -2236,13 +2258,13 @@ WriteLiteral(" class=\"attachmentInput clearfix\"");
|
|||||||
|
|
||||||
WriteLiteral(">\r\n <span");
|
WriteLiteral(">\r\n <span");
|
||||||
|
|
||||||
WriteLiteral(" class=\"action upload fa fa-upload disabled\"");
|
WriteLiteral(" class=\"action enabled upload fa fa-upload disabled\"");
|
||||||
|
|
||||||
WriteLiteral(" title=\"Attach File\"");
|
WriteLiteral(" title=\"Attach File\"");
|
||||||
|
|
||||||
WriteLiteral("></span><span");
|
WriteLiteral("></span><span");
|
||||||
|
|
||||||
WriteLiteral(" class=\"action photo fa fa-camera disabled\"");
|
WriteLiteral(" class=\"action enabled photo fa fa-camera disabled\"");
|
||||||
|
|
||||||
WriteLiteral(" title=\"Capture Image\"");
|
WriteLiteral(" title=\"Capture Image\"");
|
||||||
|
|
||||||
@@ -2305,39 +2327,39 @@ WriteLiteral(@">
|
|||||||
WriteLiteral("\' };\r\n $.connection.hub.error(onHubFailed);\r\n " +
|
WriteLiteral("\' };\r\n $.connection.hub.error(onHubFailed);\r\n " +
|
||||||
" $.connection.hub.disconnected(onHubFailed);\r\n\r\n " +
|
" $.connection.hub.disconnected(onHubFailed);\r\n\r\n " +
|
||||||
" $.connection.hub.reconnecting(function () {\r\n " +
|
" $.connection.hub.reconnecting(function () {\r\n " +
|
||||||
" $Attachments.find(\'span.action\').addClass(\'disabled\');\r\n " +
|
" $Attachments.find(\'span.action.enabled\').addClass(\'disabled\');\r\n " +
|
||||||
" });\r\n $.connection.hub.reconnected(fun" +
|
" });\r\n $.connection.hub.reconne" +
|
||||||
"ction () {\r\n $Attachments.find(\'span.action\').rem" +
|
"cted(function () {\r\n $Attachments.find(\'span.acti" +
|
||||||
"oveClass(\'disabled\');\r\n });\r\n\r\n " +
|
"on.enabled\').removeClass(\'disabled\');\r\n });\r\n\r\n " +
|
||||||
" // Start Connection\r\n $.connection.hub.start(fu" +
|
" // Start Connection\r\n $.connect" +
|
||||||
"nction () {\r\n $Attachments.find(\'span.action\').re" +
|
"ion.hub.start(function () {\r\n $Attachments.find(\'" +
|
||||||
"moveClass(\'disabled\');\r\n }).fail(onHubFailed);\r\n\r\n " +
|
"span.action.enabled\').removeClass(\'disabled\');\r\n }).f" +
|
||||||
" function onHubFailed(error) {\r\n " +
|
"ail(onHubFailed);\r\n\r\n function onHubFailed(error) {\r\n" +
|
||||||
" // Disable UI\r\n $Attachments.find(\'span.a" +
|
" // Disable UI\r\n $" +
|
||||||
"ction\').addClass(\'disabled\');\r\n\r\n // Show Dialog " +
|
"Attachments.find(\'span.action.enabled\').addClass(\'disabled\');\r\n\r\n " +
|
||||||
"Message\r\n if ($(\'.disconnected-dialog\').length ==" +
|
" // Show Dialog Message\r\n if ($(\'" +
|
||||||
" 0) {\r\n $(\'<div>\')\r\n " +
|
".disconnected-dialog\').length == 0) {\r\n $(\'<d" +
|
||||||
" .addClass(\'dialog disconnected-dialog\')\r\n " +
|
"iv>\')\r\n .addClass(\'dialog disconnected-di" +
|
||||||
" .html(\'<h3><span class=\"fa-stack fa-lg\"><i class=\"fa fa-wifi fa-" +
|
"alog\')\r\n .html(\'<h3><span class=\"fa-stack" +
|
||||||
"stack-1x\"></i><i class=\"fa fa-ban fa-stack-2x error\"></i></span>Disconnected fro" +
|
" fa-lg\"><i class=\"fa fa-wifi fa-stack-1x\"></i><i class=\"fa fa-ban fa-stack-2x er" +
|
||||||
"m the Disco ICT Server</h3><div>This page is not receiving live updates. Please " +
|
"ror\"></i></span>Disconnected from the Disco ICT Server</h3><div>This page is not" +
|
||||||
"ensure you are connected to the server, then refresh this page to enable feature" +
|
" receiving live updates. Please ensure you are connected to the server, then ref" +
|
||||||
"s.</div>\')\r\n .dialog({\r\n " +
|
"resh this page to enable features.</div>\')\r\n " +
|
||||||
" resizable: false,\r\n " +
|
" .dialog({\r\n resizable: false,\r\n " +
|
||||||
" title: \'Disconnected\',\r\n wi" +
|
" title: \'Disconnected\',\r\n " +
|
||||||
"dth: 400,\r\n modal: true,\r\n " +
|
" width: 400,\r\n " +
|
||||||
" buttons: {\r\n " +
|
" modal: true,\r\n buttons: {\r\n " +
|
||||||
" \'Refresh Now\': function () {\r\n " +
|
" \'Refresh Now\': function () {\r\n " +
|
||||||
" $(this).dialog(\'option\', \'buttons\', null);\r\n " +
|
" $(this).dialog(\'option\', \'buttons" +
|
||||||
" window.location.reload(true);\r\n " +
|
"\', null);\r\n window.location.r" +
|
||||||
" },\r\n " +
|
"eload(true);\r\n },\r\n " +
|
||||||
" \'Close\': function () {\r\n $(" +
|
" \'Close\': function () {\r\n " +
|
||||||
"this).dialog(\'destroy\');\r\n }\r\n " +
|
" $(this).dialog(\'destroy\');\r\n " +
|
||||||
" }\r\n " +
|
" }\r\n }\r\n " +
|
||||||
" });\r\n }\r\n }\r\n\r\n " +
|
" });\r\n }\r\n " +
|
||||||
" function onAddAttachment(id, quick) {\r\n " +
|
" }\r\n\r\n function onAddAttachmen" +
|
||||||
" var data = { id: id };\r\n $.ajax({" +
|
"t(id, quick) {\r\n var data = { id: id };\r\n " +
|
||||||
"\r\n url: \'");
|
" $.ajax({\r\n url: \'");
|
||||||
|
|
||||||
|
|
||||||
#line 770 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
#line 770 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
@@ -2507,51 +2529,47 @@ WriteLiteral("/\' + a.Id + \'?v=\' + retryCount);\r\n
|
|||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral("\r\n //#region Add Attachments\r\n " +
|
WriteLiteral("\r\n //#region Add Attachments\r\n " +
|
||||||
" var attachmentUploader = new document.Disco.AttachmentUploader(\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 //#endregion\r\n " +
|
||||||
|
"//#region Remove Attachments\r\n $attachmentOutput.find" +
|
||||||
|
"(\'span.remove\').click(removeAttachment);\r\n\r\n function" +
|
||||||
|
" removeAttachment() {\r\n $this = $(this).closest(\'" +
|
||||||
|
"a\');\r\n\r\n var data = { id: $this.attr(\'data-attach" +
|
||||||
|
"mentid\') };\r\n\r\n if (!$dialogRemoveAttachment) {\r\n" +
|
||||||
|
" $dialogRemoveAttachment = $(\'#dialogRemoveAt" +
|
||||||
|
"tachment\').dialog({\r\n resizable: false,\r\n" +
|
||||||
|
" height: 140,\r\n " +
|
||||||
|
" modal: true,\r\n autoOpen: fa" +
|
||||||
|
"lse\r\n });\r\n }\r" +
|
||||||
|
"\n\r\n $dialogRemoveAttachment.dialog(\"enable\");\r\n " +
|
||||||
|
" $dialogRemoveAttachment.dialog(\'option\', \'buttons\'" +
|
||||||
|
", {\r\n \"Remove\": function () {\r\n " +
|
||||||
|
" $dialogRemoveAttachment.dialog(\"disable\");\r\n " +
|
||||||
|
" $dialogRemoveAttachment.dialog(\"option\", \"buttons\"" +
|
||||||
|
", null);\r\n $.ajax({\r\n " +
|
||||||
|
" url: \'");
|
||||||
|
|
||||||
|
|
||||||
#line 880 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
#line 926 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
Write(Url.Action(MVC.API.DeviceBatch.AttachmentUpload(Model.DeviceBatch.Id, null)));
|
|
||||||
|
|
||||||
|
|
||||||
#line default
|
|
||||||
#line hidden
|
|
||||||
WriteLiteral("\',\r\n $Attachments.find(\'.Disco-AttachmentUpload-DropTa" +
|
|
||||||
"rget\'),\r\n $Attachments.find(\'.Disco-AttachmentUpload-" +
|
|
||||||
"Progress\'));\r\n\r\n var $attachmentInput = $Attachments." +
|
|
||||||
"find(\'.attachmentInput\');\r\n $attachmentInput.find(\'.p" +
|
|
||||||
"hoto\').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.upload" +
|
|
||||||
"Image();\r\n });\r\n $attachme" +
|
|
||||||
"ntInput.find(\'.upload\').click(function () {\r\n if " +
|
|
||||||
"($(this).hasClass(\'disabled\'))\r\n alert(\'Disco" +
|
|
||||||
"nnected from the Disco ICT Server, please refresh this page and try again\');\r\n " +
|
|
||||||
" else\r\n attachme" +
|
|
||||||
"ntUploader.uploadFiles();\r\n });\r\n " +
|
|
||||||
" //#endregion\r\n //#region Remove Attachments\r\n" +
|
|
||||||
" $attachmentOutput.find(\'span.remove\').click(removeAt" +
|
|
||||||
"tachment);\r\n\r\n function removeAttachment() {\r\n " +
|
|
||||||
" $this = $(this).closest(\'a\');\r\n\r\n " +
|
|
||||||
" var data = { id: $this.attr(\'data-attachmentid\') };\r\n\r\n " +
|
|
||||||
" if (!$dialogRemoveAttachment) {\r\n " +
|
|
||||||
" $dialogRemoveAttachment = $(\'#dialogRemoveAttachment\').dialog({\r\n " +
|
|
||||||
" resizable: false,\r\n " +
|
|
||||||
" height: 140,\r\n modal: true,\r\n " +
|
|
||||||
" autoOpen: false\r\n " +
|
|
||||||
" });\r\n }\r\n\r\n " +
|
|
||||||
" $dialogRemoveAttachment.dialog(\"enable\");\r\n " +
|
|
||||||
"$dialogRemoveAttachment.dialog(\'option\', \'buttons\', {\r\n " +
|
|
||||||
" \"Remove\": function () {\r\n $dia" +
|
|
||||||
"logRemoveAttachment.dialog(\"disable\");\r\n " +
|
|
||||||
"$dialogRemoveAttachment.dialog(\"option\", \"buttons\", null);\r\n " +
|
|
||||||
" $.ajax({\r\n url: \'" +
|
|
||||||
"");
|
|
||||||
|
|
||||||
|
|
||||||
#line 921 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
||||||
Write(Url.Action(MVC.API.DeviceBatch.AttachmentRemove()));
|
Write(Url.Action(MVC.API.DeviceBatch.AttachmentRemove()));
|
||||||
|
|
||||||
|
|
||||||
@@ -2579,7 +2597,7 @@ WriteLiteral("\',\r\n dataType: \'jso
|
|||||||
"endregion\r\n ");
|
"endregion\r\n ");
|
||||||
|
|
||||||
|
|
||||||
#line 948 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
#line 953 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2602,13 +2620,13 @@ WriteLiteral(@"
|
|||||||
");
|
");
|
||||||
|
|
||||||
|
|
||||||
#line 963 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
#line 968 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 963 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
#line 968 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
if (hideAdvanced)
|
if (hideAdvanced)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -2642,7 +2660,7 @@ WriteLiteral(@">Show Advanced Options</button>
|
|||||||
");
|
");
|
||||||
|
|
||||||
|
|
||||||
#line 979 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
#line 984 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2658,7 +2676,7 @@ WriteLiteral(">\r\n <th>Linked Groups:\r\n </th>\r\n
|
|||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 985 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
#line 990 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
Write(Html.Partial(MVC.Config.Shared.Views.LinkedGroupInstance, new LinkedGroupModel()
|
Write(Html.Partial(MVC.Config.Shared.Views.LinkedGroupInstance, new LinkedGroupModel()
|
||||||
{
|
{
|
||||||
CanConfigure = canConfig,
|
CanConfigure = canConfig,
|
||||||
@@ -2676,7 +2694,7 @@ WriteLiteral("\r\n");
|
|||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 993 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
#line 998 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
Write(Html.Partial(MVC.Config.Shared.Views.LinkedGroupInstance, new LinkedGroupModel()
|
Write(Html.Partial(MVC.Config.Shared.Views.LinkedGroupInstance, new LinkedGroupModel()
|
||||||
{
|
{
|
||||||
CanConfigure = canConfig,
|
CanConfigure = canConfig,
|
||||||
@@ -2692,13 +2710,13 @@ WriteLiteral(" ");
|
|||||||
WriteLiteral("\r\n");
|
WriteLiteral("\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 1001 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
#line 1006 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 1001 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
#line 1006 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
if (canConfig)
|
if (canConfig)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -2706,14 +2724,14 @@ WriteLiteral("\r\n");
|
|||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 1003 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
#line 1008 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
Write(Html.Partial(MVC.Config.Shared.Views.LinkedGroupShared));
|
Write(Html.Partial(MVC.Config.Shared.Views.LinkedGroupShared));
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 1003 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
#line 1008 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2723,7 +2741,7 @@ WriteLiteral("\r\n");
|
|||||||
WriteLiteral(" </div>\r\n </td>\r\n </tr>\r\n </table>\r\n</div>\r\n");
|
WriteLiteral(" </div>\r\n </td>\r\n </tr>\r\n </table>\r\n</div>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 1010 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
#line 1015 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
Write(Html.Partial(MVC.Config.Shared.Views._DeviceGroupDocumentBulkGenerate, Model));
|
Write(Html.Partial(MVC.Config.Shared.Views._DeviceGroupDocumentBulkGenerate, Model));
|
||||||
|
|
||||||
|
|
||||||
@@ -2736,13 +2754,13 @@ WriteLiteral(" class=\"actionBar\"");
|
|||||||
WriteLiteral(">\r\n");
|
WriteLiteral(">\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 1012 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
#line 1017 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 1012 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
#line 1017 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
if (Model.CanDelete)
|
if (Model.CanDelete)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -2750,14 +2768,14 @@ WriteLiteral(">\r\n");
|
|||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 1014 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
#line 1019 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
Write(Html.ActionLinkButton("Delete", MVC.API.DeviceBatch.Delete(Model.DeviceBatch.Id, true), "buttonDelete"));
|
Write(Html.ActionLinkButton("Delete", MVC.API.DeviceBatch.Delete(Model.DeviceBatch.Id, true), "buttonDelete"));
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 1014 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
#line 1019 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2767,7 +2785,7 @@ WriteLiteral(">\r\n");
|
|||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 1016 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
#line 1021 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
if (Model.DeviceCount > 0)
|
if (Model.DeviceCount > 0)
|
||||||
{
|
{
|
||||||
if (Authorization.Has(Claims.Device.Actions.Export))
|
if (Authorization.Has(Claims.Device.Actions.Export))
|
||||||
@@ -2777,14 +2795,14 @@ WriteLiteral(" ");
|
|||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 1020 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
#line 1025 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
Write(Html.ActionLinkButton("Export Devices", MVC.Device.Export(null, Disco.Models.Services.Devices.DeviceExportTypes.Batch, Model.DeviceBatch.Id)));
|
Write(Html.ActionLinkButton("Export Devices", MVC.Device.Export(null, Disco.Models.Services.Devices.DeviceExportTypes.Batch, Model.DeviceBatch.Id)));
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 1020 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
#line 1025 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
|
|
||||||
}
|
}
|
||||||
if (Authorization.Has(Claims.Device.Search) && Model.DeviceCount > 0)
|
if (Authorization.Has(Claims.Device.Search) && Model.DeviceCount > 0)
|
||||||
@@ -2794,14 +2812,14 @@ WriteLiteral(" ");
|
|||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 1024 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
#line 1029 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
Write(Html.ActionLinkButton(string.Format("View {0} Device{1}", Model.DeviceCount, (Model.DeviceCount != 1 ? "s" : null)), MVC.Search.Query(Model.DeviceBatch.Id.ToString(), "DeviceBatch")));
|
Write(Html.ActionLinkButton(string.Format("View {0} Device{1}", Model.DeviceCount, (Model.DeviceCount != 1 ? "s" : null)), MVC.Search.Query(Model.DeviceBatch.Id.ToString(), "DeviceBatch")));
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 1024 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
#line 1029 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1018,6 +1018,7 @@ h1.Config_DocumentTemplates {
|
|||||||
.deviceBatches #DeviceBatch_Attachments {
|
.deviceBatches #DeviceBatch_Attachments {
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
.deviceBatches #DeviceBatch_Attachments div.attachmentOutput {
|
.deviceBatches #DeviceBatch_Attachments div.attachmentOutput {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
@@ -1197,6 +1197,7 @@ h1.Config_DocumentTemplates {
|
|||||||
#DeviceBatch_Attachments {
|
#DeviceBatch_Attachments {
|
||||||
border: 1px solid @SubtleBorderColour;
|
border: 1px solid @SubtleBorderColour;
|
||||||
background-color: @white;
|
background-color: @white;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
div.attachmentOutput {
|
div.attachmentOutput {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user