Permissions & Authorization for Users #24

Initial Release; Includes Database and MVC refactoring
This commit is contained in:
Gary Sharp
2013-10-10 19:13:16 +11:00
parent 172ce5524a
commit a099d68915
458 changed files with 40221 additions and 12130 deletions
+2
View File
@@ -1,5 +1,7 @@
@model Disco.Web.Models.Job.CreateModel
@{
Authorization.Require(Claims.Job.Actions.Create);
Layout = "~/Views/Shared/_DialogLayout.cshtml";
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), "Create");
}
+35 -31
View File
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Views.Job
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
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/Job/Create.cshtml")]
public partial class Create : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.CreateModel>
public partial class Create : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.CreateModel>
{
public Create()
{
@@ -43,6 +45,8 @@ namespace Disco.Web.Views.Job
#line 2 "..\..\Views\Job\Create.cshtml"
Authorization.Require(Claims.Job.Actions.Create);
Layout = "~/Views/Shared/_DialogLayout.cshtml";
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), "Create");
@@ -56,13 +60,13 @@ WriteLiteral(" id=\"createJob_Container\"");
WriteLiteral(">\r\n");
#line 7 "..\..\Views\Job\Create.cshtml"
#line 9 "..\..\Views\Job\Create.cshtml"
#line default
#line hidden
#line 7 "..\..\Views\Job\Create.cshtml"
#line 9 "..\..\Views\Job\Create.cshtml"
using (Html.BeginForm(MVC.Job.Create(), FormMethod.Post))
{
@@ -70,42 +74,42 @@ WriteLiteral(">\r\n");
#line default
#line hidden
#line 9 "..\..\Views\Job\Create.cshtml"
#line 11 "..\..\Views\Job\Create.cshtml"
Write(Html.HiddenFor(m => m.DeviceSerialNumber));
#line default
#line hidden
#line 9 "..\..\Views\Job\Create.cshtml"
#line 11 "..\..\Views\Job\Create.cshtml"
#line default
#line hidden
#line 10 "..\..\Views\Job\Create.cshtml"
#line 12 "..\..\Views\Job\Create.cshtml"
Write(Html.HiddenFor(m => m.UserId));
#line default
#line hidden
#line 10 "..\..\Views\Job\Create.cshtml"
#line 12 "..\..\Views\Job\Create.cshtml"
#line default
#line hidden
#line 11 "..\..\Views\Job\Create.cshtml"
#line 13 "..\..\Views\Job\Create.cshtml"
Write(Html.HiddenFor(m => m.QuickLogDestinationUrl));
#line default
#line hidden
#line 11 "..\..\Views\Job\Create.cshtml"
#line 13 "..\..\Views\Job\Create.cshtml"
@@ -113,28 +117,28 @@ WriteLiteral(">\r\n");
#line default
#line hidden
#line 13 "..\..\Views\Job\Create.cshtml"
#line 15 "..\..\Views\Job\Create.cshtml"
Write(Html.Partial(MVC.Job.Views._CreateSubject, Model));
#line default
#line hidden
#line 13 "..\..\Views\Job\Create.cshtml"
#line 15 "..\..\Views\Job\Create.cshtml"
#line default
#line hidden
#line 14 "..\..\Views\Job\Create.cshtml"
#line 16 "..\..\Views\Job\Create.cshtml"
Write(Html.ValidationSummary(true));
#line default
#line hidden
#line 14 "..\..\Views\Job\Create.cshtml"
#line 16 "..\..\Views\Job\Create.cshtml"
@@ -154,7 +158,7 @@ WriteLiteral(">\r\n <h3>Type</h3>\r\n");
WriteLiteral(" ");
#line 19 "..\..\Views\Job\Create.cshtml"
#line 21 "..\..\Views\Job\Create.cshtml"
Write(Html.ValidationMessageFor(m => m.Type));
@@ -165,7 +169,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 20 "..\..\Views\Job\Create.cshtml"
#line 22 "..\..\Views\Job\Create.cshtml"
Write(CommonHelpers.RadioButtonList("Type", Model.JobTypes.ToSelectListItems(Model.Type), 3));
@@ -176,7 +180,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 21 "..\..\Views\Job\Create.cshtml"
#line 23 "..\..\Views\Job\Create.cshtml"
Write(Html.ValidationMessageFor(m => m.SubTypes));
@@ -189,13 +193,13 @@ WriteLiteral(" id=\"createJob_SubTypes\"");
WriteLiteral(">\r\n");
#line 24 "..\..\Views\Job\Create.cshtml"
#line 26 "..\..\Views\Job\Create.cshtml"
#line default
#line hidden
#line 24 "..\..\Views\Job\Create.cshtml"
#line 26 "..\..\Views\Job\Create.cshtml"
foreach (var jt in Model.JobTypes)
{
@@ -204,15 +208,15 @@ WriteLiteral(">\r\n");
#line hidden
WriteLiteral(" <div");
WriteAttribute("id", Tuple.Create(" id=\"", 1037), Tuple.Create("\"", 1068)
, Tuple.Create(Tuple.Create("", 1042), Tuple.Create("createJob_SubType_", 1042), true)
WriteAttribute("id", Tuple.Create(" id=\"", 1098), Tuple.Create("\"", 1129)
, Tuple.Create(Tuple.Create("", 1103), Tuple.Create("createJob_SubType_", 1103), true)
#line 26 "..\..\Views\Job\Create.cshtml"
, Tuple.Create(Tuple.Create("", 1060), Tuple.Create<System.Object, System.Int32>(jt.Id
#line 28 "..\..\Views\Job\Create.cshtml"
, Tuple.Create(Tuple.Create("", 1121), Tuple.Create<System.Object, System.Int32>(jt.Id
#line default
#line hidden
, 1060), false)
, 1121), false)
);
WriteLiteral(" class=\"createJob_SubType\"");
@@ -226,7 +230,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 28 "..\..\Views\Job\Create.cshtml"
#line 30 "..\..\Views\Job\Create.cshtml"
Write(CommonHelpers.CheckBoxList("SubTypes", Model.JobSubTypes.Where(jst => jst.JobTypeId == jt.Id).ToList().ToSelectListItems(Model.SubTypes), 3));
@@ -235,7 +239,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n </div>\r\n </div> \r\n");
#line 31 "..\..\Views\Job\Create.cshtml"
#line 33 "..\..\Views\Job\Create.cshtml"
}
@@ -254,7 +258,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 35 "..\..\Views\Job\Create.cshtml"
#line 37 "..\..\Views\Job\Create.cshtml"
Write(Html.ValidationMessageFor(m => m.DeviceHeld));
@@ -265,7 +269,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 36 "..\..\Views\Job\Create.cshtml"
#line 38 "..\..\Views\Job\Create.cshtml"
Write(Html.HiddenFor(m => m.DeviceHeld));
@@ -318,7 +322,7 @@ WriteLiteral(">\r\n <table>\r\n <tr>\r\n
WriteLiteral(" ");
#line 58 "..\..\Views\Job\Create.cshtml"
#line 60 "..\..\Views\Job\Create.cshtml"
Write(Html.EditorFor(m => m.Comments));
@@ -360,7 +364,7 @@ WriteLiteral(">\r\n <h3>Task Time</h3>\r\n");
WriteLiteral(" ");
#line 70 "..\..\Views\Job\Create.cshtml"
#line 72 "..\..\Views\Job\Create.cshtml"
Write(Html.ValidationMessageFor(m => m.QuickLogTaskTimeMinutes));
@@ -456,7 +460,7 @@ WriteLiteral(" />\r\n Minutes\r\n </span>\r\n
" </div>\r\n");
#line 82 "..\..\Views\Job\Create.cshtml"
#line 84 "..\..\Views\Job\Create.cshtml"
}
@@ -1,5 +1,7 @@
@model Disco.Web.Models.Job.CreateRedirectModel
@{
Authorization.Require(Claims.Job.Actions.Create);
Layout = null;
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), "Create - Redirecting...");
}
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Views.Job
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
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/Job/Create_Redirect.cshtml")]
public partial class Create_Redirect : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.CreateRedirectModel>
public partial class Create_Redirect : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.CreateRedirectModel>
{
public Create_Redirect()
{
@@ -43,6 +45,8 @@ namespace Disco.Web.Views.Job
#line 2 "..\..\Views\Job\Create_Redirect.cshtml"
Authorization.Require(Claims.Job.Actions.Create);
Layout = null;
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), "Create - Redirecting...");
@@ -53,14 +57,14 @@ WriteLiteral("\r\n<a");
WriteLiteral(" id=\"redirectLink\"");
WriteAttribute("href", Tuple.Create(" href=\"", 188), Tuple.Create("\"", 214)
WriteAttribute("href", Tuple.Create(" href=\"", 249), Tuple.Create("\"", 275)
#line 6 "..\..\Views\Job\Create_Redirect.cshtml"
, Tuple.Create(Tuple.Create("", 195), Tuple.Create<System.Object, System.Int32>(Model.RedirectLink
#line 8 "..\..\Views\Job\Create_Redirect.cshtml"
, Tuple.Create(Tuple.Create("", 256), Tuple.Create<System.Object, System.Int32>(Model.RedirectLink
#line default
#line hidden
, 195), false)
, 256), false)
);
WriteLiteral(@">Redirecting...</a>
+118 -111
View File
@@ -1,129 +1,136 @@
@model Disco.Web.Models.Job.IndexModel
@{
ViewBag.Title = "Jobs";
Html.BundleDeferred("~/ClientScripts/Modules/Highcharts");
if (Authorization.Has(Claims.Job.ShowDailyChart))
{
Html.BundleDeferred("~/ClientScripts/Modules/Highcharts");
}
}
<div class="clearfix columnHost">
<div class="column50">
<h2>Search Jobs</h2>
@Html.Partial(MVC.Shared.Views._SearchDialog, "jobs")
</div>
<div class="column50">
<h2>Daily Opened &amp; Closed Jobs</h2>
<div id="chartHostJobDailyOpenedClosed" style="height: 175px;">
@if (Authorization.Has(Claims.Job.Search))
{
<div class="column50">
<h2>Search Jobs</h2>
@Html.Partial(MVC.Shared.Views._SearchDialog, "jobs")
</div>
@{
var jsonData = new HtmlString(Json.Encode(Model.DailyOpenedClosedStatistics));
}
<script type="text/javascript">
(function () {
var chartData;
}
@if (Authorization.Has(Claims.Job.ShowDailyChart))
{
<div class="column50">
<h2>Daily Opened &amp; Closed Jobs</h2>
<div id="chartHostJobDailyOpenedClosed" style="height: 175px;">
</div>
@{
var jsonData = new HtmlString(Json.Encode(Model.DailyOpenedClosedStatistics));
}
<script type="text/javascript">
(function () {
var chartData;
function buildChart() {
$(function () {
function buildChart() {
$(function () {
var data = chartData;
var data = chartData;
var dataTotalOpenJobs = [];
var dataOpenedJobs = [];
var dataClosedJobs = [];
for (var i = 0; i < data.length; i++) {
var dataItem = data[i];
var dataItemDate = new Date(parseInt(dataItem.Timestamp.substr(6, dataItem.Timestamp.length - 8))).getTime(); // $.datepicker.parseDate('yy-mm-dd', dataItem.Timestamp.substr(0, 10)).getTime();
dataTotalOpenJobs.push([dataItemDate, dataItem.TotalJobs]);
dataOpenedJobs.push([dataItemDate, dataItem.OpenedJobs]);
dataClosedJobs.push([dataItemDate, dataItem.ClosedJobs]);
}
Highcharts.setOptions({
global: {
useUTC: false
var dataTotalOpenJobs = [];
var dataOpenedJobs = [];
var dataClosedJobs = [];
for (var i = 0; i < data.length; i++) {
var dataItem = data[i];
var dataItemDate = new Date(parseInt(dataItem.Timestamp.substr(6, dataItem.Timestamp.length - 8))).getTime(); // $.datepicker.parseDate('yy-mm-dd', dataItem.Timestamp.substr(0, 10)).getTime();
dataTotalOpenJobs.push([dataItemDate, dataItem.TotalJobs]);
dataOpenedJobs.push([dataItemDate, dataItem.OpenedJobs]);
dataClosedJobs.push([dataItemDate, dataItem.ClosedJobs]);
}
});
new Highcharts.Chart({
chart: {
renderTo: 'chartHostJobDailyOpenedClosed',
height: 175,
animation: false
},
colors: ['#BBBBBB', '#005fab', '#DB761D'],
title: {
text: null
},
plotOptions: {
series: {
marker: {
radius: 3
},
Highcharts.setOptions({
global: {
useUTC: false
}
});
new Highcharts.Chart({
chart: {
renderTo: 'chartHostJobDailyOpenedClosed',
height: 175,
animation: false
}
},
legend: {
align: 'left',
verticalAlign: 'top',
y: 0,
floating: true,
borderWidth: 0
},
xAxis: {
type: 'datetime',
tickInterval: 7 * 24 * 3600 * 1000, // week
tickWidth: 1,
gridLineWidth: 1,
dateTimeLabelFormats: {
week: '%e %b'
}
},
yAxis: [{
},
colors: ['#BBBBBB', '#005fab', '#DB761D'],
title: {
text: null
},
labels: {
plotOptions: {
series: {
marker: {
radius: 3
},
animation: false
}
},
legend: {
align: 'left',
verticalAlign: 'top',
y: 0,
floating: true,
borderWidth: 0
},
xAxis: {
type: 'datetime',
tickInterval: 7 * 24 * 3600 * 1000, // week
tickWidth: 1,
gridLineWidth: 1,
dateTimeLabelFormats: {
week: '%e %b'
}
},
yAxis: [{
title: {
text: null
},
labels: {
enabled: false
},
min: 0
}, {
title: {
text: null
},
labels: {
enabled: false
},
min: 0
}],
series: [{
name: 'Total Open Jobs',
data: dataTotalOpenJobs,
yAxis: 1
}, {
name: 'Closed Jobs',
data: dataClosedJobs
}, {
name: 'Opened Jobs',
data: dataOpenedJobs
}],
credits: {
enabled: false
},
min: 0
}, {
title: {
text: null
},
labels: {
enabled: false
},
min: 0
}],
series: [{
name: 'Total Open Jobs',
data: dataTotalOpenJobs,
yAxis: 1
}, {
name: 'Closed Jobs',
data: dataClosedJobs
}, {
name: 'Opened Jobs',
data: dataOpenedJobs
}],
credits: {
enabled: false
}
}
});
});
});
}
chartData = $.parseJSON('@(jsonData)');
buildChart();
}());
}
chartData = $.parseJSON('@(jsonData)');
buildChart();
}());
</script>
</div>
</script>
</div>
}
</div>
<h2>Open Jobs Awaiting Technician Action (@Model.OpenJobs.Items.Count)</h2>
@Html.Partial(MVC.Shared.Views._JobTable, Model.OpenJobs, new ViewDataDictionary())
<h2>Long Running Jobs (@Model.LongRunningJobs.Items.Count)</h2>
@Html.Partial(MVC.Shared.Views._JobTable, Model.LongRunningJobs, new ViewDataDictionary())
@*<h2>
Jobs with Devices Ready for Return (@Model.ReadyForReturnJobs.Items.Count)</h2>
@Html.Partial(MVC.Shared.Views._JobTable, Model.ReadyForReturnJobs, new ViewDataDictionary())
<h2>
Jobs Waiting for User Action (@Model.WaitingForUserActionJobs.Items.Count)</h2>
@Html.Partial(MVC.Shared.Views._JobTable, Model.WaitingForUserActionJobs, new ViewDataDictionary())
<h2>
Recently Closed Jobs (@Model.RecentlyClosedJobs.Items.Count)</h2>
@Html.Partial(MVC.Shared.Views._JobTable, Model.RecentlyClosedJobs, new ViewDataDictionary())*@
@if (Authorization.Has(Claims.Job.Lists.AwaitingTechnicianAction))
{
<h2>Open Jobs Awaiting Technician Action (@Model.OpenJobs.Items.Count)</h2>
@Html.Partial(MVC.Shared.Views._JobTable, Model.OpenJobs, new ViewDataDictionary())
}
@if (Authorization.Has(Claims.Job.Lists.LongRunningJobs))
{
<h2>Long Running Jobs (@Model.LongRunningJobs.Items.Count)</h2>
@Html.Partial(MVC.Shared.Views._JobTable, Model.LongRunningJobs, new ViewDataDictionary())
}
+185 -90
View File
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Views.Job
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
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/Job/Index.cshtml")]
public partial class Index : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.IndexModel>
public partial class Index : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.IndexModel>
{
public Index()
{
@@ -44,7 +46,11 @@ namespace Disco.Web.Views.Job
#line 2 "..\..\Views\Job\Index.cshtml"
ViewBag.Title = "Jobs";
Html.BundleDeferred("~/ClientScripts/Modules/Highcharts");
if (Authorization.Has(Claims.Job.ShowDailyChart))
{
Html.BundleDeferred("~/ClientScripts/Modules/Highcharts");
}
#line default
@@ -53,118 +59,176 @@ WriteLiteral("\r\n<div");
WriteLiteral(" class=\"clearfix columnHost\"");
WriteLiteral(">\r\n <div");
WriteLiteral(" class=\"column50\"");
WriteLiteral(">\r\n <h2>Search Jobs</h2>\r\n");
WriteLiteral(" ");
WriteLiteral(">\r\n");
#line 9 "..\..\Views\Job\Index.cshtml"
Write(Html.Partial(MVC.Shared.Views._SearchDialog, "jobs"));
#line 11 "..\..\Views\Job\Index.cshtml"
#line default
#line hidden
#line 11 "..\..\Views\Job\Index.cshtml"
if (Authorization.Has(Claims.Job.Search))
{
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n <div");
WriteLiteral(" <div");
WriteLiteral(" class=\"column50\"");
WriteLiteral(">\r\n <h2>Daily Opened &amp; Closed Jobs</h2>\r\n <div");
WriteLiteral(">\r\n <h2>Search Jobs</h2>\r\n");
WriteLiteral(" ");
#line 15 "..\..\Views\Job\Index.cshtml"
Write(Html.Partial(MVC.Shared.Views._SearchDialog, "jobs"));
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n");
#line 17 "..\..\Views\Job\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 18 "..\..\Views\Job\Index.cshtml"
if (Authorization.Has(Claims.Job.ShowDailyChart))
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"column50\"");
WriteLiteral(">\r\n <h2>Daily Opened &amp; Closed Jobs</h2>\r\n <div");
WriteLiteral(" id=\"chartHostJobDailyOpenedClosed\"");
WriteLiteral(" style=\"height: 175px;\"");
WriteLiteral(">\r\n </div>\r\n");
WriteLiteral(">\r\n </div>\r\n");
#line 15 "..\..\Views\Job\Index.cshtml"
#line 24 "..\..\Views\Job\Index.cshtml"
#line default
#line hidden
#line 15 "..\..\Views\Job\Index.cshtml"
var jsonData = new HtmlString(Json.Encode(Model.DailyOpenedClosedStatistics));
#line 24 "..\..\Views\Job\Index.cshtml"
var jsonData = new HtmlString(Json.Encode(Model.DailyOpenedClosedStatistics));
#line default
#line hidden
WriteLiteral("\r\n <script");
WriteLiteral("\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n (function () {\r\n var chartData;\r\n\r\n " +
"function buildChart() {\r\n $(function () {\r\n\r\n " +
" var data = chartData;\r\n\r\n var dataTotalOpenJobs =" +
" [];\r\n var dataOpenedJobs = [];\r\n " +
"var dataClosedJobs = [];\r\n for (var i = 0; i < data.lengt" +
"h; i++) {\r\n var dataItem = data[i];\r\n " +
" var dataItemDate = new Date(parseInt(dataItem.Timestamp.substr(6, da" +
"taItem.Timestamp.length - 8))).getTime(); // $.datepicker.parseDate(\'yy-mm-dd\', " +
"dataItem.Timestamp.substr(0, 10)).getTime();\r\n dataTo" +
"talOpenJobs.push([dataItemDate, dataItem.TotalJobs]);\r\n " +
" dataOpenedJobs.push([dataItemDate, dataItem.OpenedJobs]);\r\n " +
" dataClosedJobs.push([dataItemDate, dataItem.ClosedJobs]);\r\n " +
" }\r\n Highcharts.setOptions({\r\n " +
" global: {\r\n useUTC: false\r\n " +
" }\r\n });\r\n new H" +
"ighcharts.Chart({\r\n chart: {\r\n " +
" renderTo: \'chartHostJobDailyOpenedClosed\',\r\n " +
" height: 175,\r\n animation: false\r\n " +
" },\r\n colors: [\'#BBBBBB\', \'#005fab\', " +
"\'#DB761D\'],\r\n title: {\r\n " +
" text: null\r\n },\r\n plotO" +
"ptions: {\r\n series: {\r\n " +
" marker: {\r\n radius: 3\r\n " +
" },\r\n animation: f" +
"alse\r\n }\r\n },\r\n " +
" legend: {\r\n align: \'left\',\r\n" +
" verticalAlign: \'top\',\r\n " +
" y: 0,\r\n floating: true,\r\n " +
" borderWidth: 0\r\n },\r\n " +
" xAxis: {\r\n type: \'datetime\',\r\n " +
" tickInterval: 7 * 24 * 3600 * 1000, // week\r\n " +
" tickWidth: 1,\r\n gridLineWidt" +
"h: 1,\r\n dateTimeLabelFormats: {\r\n " +
" week: \'%e %b\'\r\n }\r\n " +
" },\r\n yAxis: [{\r\n " +
" title: {\r\n text: null\r\n " +
" },\r\n labels: {\r\n " +
" enabled: false\r\n },\r\n " +
" min: 0\r\n }, {\r\n " +
" title: {\r\n text: null" +
"\r\n },\r\n labels: {\r" +
"\n enabled: false\r\n " +
" },\r\n min: 0\r\n }]," +
"\r\n series: [{\r\n name: " +
"\'Total Open Jobs\',\r\n data: dataTotalOpenJobs,\r\n " +
" yAxis: 1\r\n }, {\r\n " +
" name: \'Closed Jobs\',\r\n " +
"data: dataClosedJobs\r\n }, {\r\n " +
" name: \'Opened Jobs\',\r\n data: dataOpenedJo" +
"bs\r\n }],\r\n credits: {\r\n " +
" enabled: false\r\n }\r\n " +
" });\r\n });\r\n }\r\n " +
" chartData = $.parseJSON(\'");
WriteLiteral(">\r\n (function () {\r\n var chartData;\r\n\r\n " +
" function buildChart() {\r\n $(function () {\r\n\r\n" +
" var data = chartData;\r\n\r\n " +
" var dataTotalOpenJobs = [];\r\n var dataOpenedJobs = [" +
"];\r\n var dataClosedJobs = [];\r\n " +
" for (var i = 0; i < data.length; i++) {\r\n v" +
"ar dataItem = data[i];\r\n var dataItemDate = new D" +
"ate(parseInt(dataItem.Timestamp.substr(6, dataItem.Timestamp.length - 8))).getTi" +
"me(); // $.datepicker.parseDate(\'yy-mm-dd\', dataItem.Timestamp.substr(0, 10)).ge" +
"tTime();\r\n dataTotalOpenJobs.push([dataItemDate, " +
"dataItem.TotalJobs]);\r\n dataOpenedJobs.push([data" +
"ItemDate, dataItem.OpenedJobs]);\r\n dataClosedJobs" +
".push([dataItemDate, dataItem.ClosedJobs]);\r\n }\r\n " +
" Highcharts.setOptions({\r\n " +
" global: {\r\n useUTC: false\r\n " +
" }\r\n });\r\n n" +
"ew Highcharts.Chart({\r\n chart: {\r\n " +
" renderTo: \'chartHostJobDailyOpenedClosed\',\r\n " +
" height: 175,\r\n animation" +
": false\r\n },\r\n col" +
"ors: [\'#BBBBBB\', \'#005fab\', \'#DB761D\'],\r\n title: " +
"{\r\n text: null\r\n " +
" },\r\n plotOptions: {\r\n " +
" series: {\r\n marker: {\r\n " +
" radius: 3\r\n " +
" },\r\n animation: false\r\n " +
" }\r\n },\r\n " +
" legend: {\r\n align: \'left\',\r\n" +
" verticalAlign: \'top\',\r\n " +
" y: 0,\r\n floating: true,\r\n " +
" borderWidth: 0\r\n }" +
",\r\n xAxis: {\r\n " +
" type: \'datetime\',\r\n tickInterval: 7 * 24 * 3" +
"600 * 1000, // week\r\n tickWidth: 1,\r\n " +
" gridLineWidth: 1,\r\n " +
" dateTimeLabelFormats: {\r\n week: \'%e %b" +
"\'\r\n }\r\n },\r\n " +
" yAxis: [{\r\n tit" +
"le: {\r\n text: null\r\n " +
" },\r\n labels: {\r\n " +
" enabled: false\r\n }," +
"\r\n min: 0\r\n }," +
" {\r\n title: {\r\n " +
" text: null\r\n },\r\n " +
" labels: {\r\n enabled: fa" +
"lse\r\n },\r\n " +
" min: 0\r\n }],\r\n se" +
"ries: [{\r\n name: \'Total Open Jobs\',\r\n " +
" data: dataTotalOpenJobs,\r\n " +
" yAxis: 1\r\n }, {\r\n " +
" name: \'Closed Jobs\',\r\n data: da" +
"taClosedJobs\r\n }, {\r\n " +
" name: \'Opened Jobs\',\r\n data: dataOpen" +
"edJobs\r\n }],\r\n cre" +
"dits: {\r\n enabled: false\r\n " +
" }\r\n });\r\n });\r\n " +
" }\r\n chartData = $.parseJSON(\'");
#line 110 "..\..\Views\Job\Index.cshtml"
Write(jsonData);
#line 119 "..\..\Views\Job\Index.cshtml"
Write(jsonData);
#line default
#line hidden
WriteLiteral("\');\r\n buildChart();\r\n }());\r\n\r\n </script>\r\n <" +
"/div>\r\n</div>\r\n<h2>Open Jobs Awaiting Technician Action (");
WriteLiteral("\');\r\n buildChart();\r\n }());\r\n\r\n </sc" +
"ript>\r\n </div>\r\n");
#line 117 "..\..\Views\Job\Index.cshtml"
Write(Model.OpenJobs.Items.Count);
#line 125 "..\..\Views\Job\Index.cshtml"
}
#line default
#line hidden
WriteLiteral("</div>\r\n");
#line 127 "..\..\Views\Job\Index.cshtml"
if (Authorization.Has(Claims.Job.Lists.AwaitingTechnicianAction))
{
#line default
#line hidden
WriteLiteral(" <h2>Open Jobs Awaiting Technician Action (");
#line 129 "..\..\Views\Job\Index.cshtml"
Write(Model.OpenJobs.Items.Count);
#line default
@@ -172,17 +236,39 @@ WriteLiteral("\');\r\n buildChart();\r\n }());\r\n\r\n
WriteLiteral(")</h2>\r\n");
#line 118 "..\..\Views\Job\Index.cshtml"
#line 130 "..\..\Views\Job\Index.cshtml"
#line default
#line hidden
#line 130 "..\..\Views\Job\Index.cshtml"
Write(Html.Partial(MVC.Shared.Views._JobTable, Model.OpenJobs, new ViewDataDictionary()));
#line default
#line hidden
WriteLiteral("\r\n<h2>Long Running Jobs (");
#line 130 "..\..\Views\Job\Index.cshtml"
}
#line 119 "..\..\Views\Job\Index.cshtml"
Write(Model.LongRunningJobs.Items.Count);
#line default
#line hidden
#line 132 "..\..\Views\Job\Index.cshtml"
if (Authorization.Has(Claims.Job.Lists.LongRunningJobs))
{
#line default
#line hidden
WriteLiteral(" <h2>Long Running Jobs (");
#line 134 "..\..\Views\Job\Index.cshtml"
Write(Model.LongRunningJobs.Items.Count);
#line default
@@ -190,16 +276,25 @@ WriteLiteral("\r\n<h2>Long Running Jobs (");
WriteLiteral(")</h2>\r\n");
#line 120 "..\..\Views\Job\Index.cshtml"
#line 135 "..\..\Views\Job\Index.cshtml"
#line default
#line hidden
#line 135 "..\..\Views\Job\Index.cshtml"
Write(Html.Partial(MVC.Shared.Views._JobTable, Model.LongRunningJobs, new ViewDataDictionary()));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral("\r\n");
#line 135 "..\..\Views\Job\Index.cshtml"
}
#line default
#line hidden
}
}
}
+183 -145
View File
@@ -1,21 +1,31 @@
@model Disco.Web.Models.Job.ShowModel
@{
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-NumberFormatter");
Authorization.Require(Claims.Job.ShowNonWarrantyComponents);
var hasEdit = Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.EditComponents);
var hasAdd = Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.AddComponents);
if (hasEdit)
{
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-NumberFormatter");
}
}
<table id="jobComponents">
<tr>
<th>
Description
<th>Description
</th>
<th>
Cost
</th>
<th class="actions">
&nbsp;
<th>Cost
</th>
@if (hasEdit)
{
<th class="actions">&nbsp;
</th>
}
</tr>
@foreach (var jc in Model.Job.JobComponents)
@if (hasEdit)
{
foreach (var jc in Model.Job.JobComponents)
{
<tr data-jobcomponentid="@jc.Id">
<td>
<input type="text" class="description" value="@jc.Description" />
@@ -27,161 +37,189 @@
<span class="remove"></span>
</td>
</tr>
}
}
else
{
foreach (var jc in Model.Job.JobComponents)
{
<tr data-jobcomponentid="@jc.Id">
<td>
<span class="description">@jc.Description</span>
</td>
<td>
<span class="cost">@jc.Cost.ToString("C")</span>
</td>
</tr>
}
}
<tr>
<td>
<a href="#" id="jobComponentsAdd">Add Component</a>
@if (hasEdit && hasAdd)
{
<a href="#" id="jobComponentsAdd">Add Component</a>
}
&nbsp;
</td>
<td colspan="2" class="totalCost">
Total: <span id="jobComponentsTotalCost"></span>
<td colspan="@(hasEdit ? 2 : 1)" class="totalCost">Total: <span id="jobComponentsTotalCost">
@if (!hasEdit)
{
@Model.Job.JobComponentsTotalCost().ToString("C")
}
</span>
</td>
</tr>
</table>
<div id="dialogRemoveComponent" title="Remove this Component?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
Are you sure?</p>
</div>
<script type="text/javascript">
$(function () {
var $jobComponents = $('#jobComponents');
@if (hasEdit)
{
<div id="dialogRemoveComponent" title="Remove this Component?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
Are you sure?
</p>
</div>
<script type="text/javascript">
$(function () {
var $jobComponents = $('#jobComponents');
$jobComponents.on('change', 'input', updateComponent);
$jobComponents.on('focus', 'input', function () { $(this).select() });
$jobComponents.on('change', 'input', updateComponent);
$jobComponents.on('focus', 'input', function () { $(this).select() });
$jobComponents.on('click', 'span.remove', removeComponent);
$jobComponents.on('click', 'span.remove', removeComponent);
$('#jobComponentsAdd').click(function () {
var jc = $('<tr><td><input type="text" class="description" /></td><td><input type="text" class="cost" /></td><td><span class="remove"></span></td></tr>');
jc.find('input').focus(function () { $(this).select() })
jc.insertBefore($jobComponents.find('tr').last());
jc.find('input.description').focus();
return false;
});
$('#jobComponentsAdd').click(function () {
var jc = $('<tr><td><input type="text" class="description" /></td><td><input type="text" class="cost" /></td><td><span class="remove"></span></td></tr>');
jc.find('input').focus(function () { $(this).select() })
jc.insertBefore($jobComponents.find('tr').last());
jc.find('input.description').focus();
return false;
});
$('#dialogRemoveComponent').dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: false
});
$('#dialogRemoveComponent').dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: false
});
function removeComponent() {
var componentRow = $(this).closest('tr');
var id = componentRow.attr('data-jobcomponentid');
if (id) {
var data = { id: id };
function removeComponent() {
var componentRow = $(this).closest('tr');
var id = componentRow.attr('data-jobcomponentid');
if (id) {
var data = { id: id };
var $dialogRemoveComponent = $('#dialogRemoveComponent');
$dialogRemoveComponent.dialog("enable");
$dialogRemoveComponent.dialog('option', 'buttons', {
"Remove": function () {
$dialogRemoveComponent.dialog("disable");
$dialogRemoveComponent.dialog("option", "buttons", null);
$.ajax({
url: '@Url.Action(MVC.API.Job.ComponentRemove())',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
componentRow.remove();
updateTotalCost();
} else {
alert('Unable to remove component: ' + d);
var $dialogRemoveComponent = $('#dialogRemoveComponent');
$dialogRemoveComponent.dialog("enable");
$dialogRemoveComponent.dialog('option', 'buttons', {
"Remove": function () {
$dialogRemoveComponent.dialog("disable");
$dialogRemoveComponent.dialog("option", "buttons", null);
$.ajax({
url: '@Url.Action(MVC.API.Job.ComponentRemove())',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
componentRow.remove();
updateTotalCost();
} else {
alert('Unable to remove component: ' + d);
}
$dialogRemoveComponent.dialog("close");
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to remove component: ' + textStatus);
$dialogRemoveComponent.dialog("close");
}
$dialogRemoveComponent.dialog("close");
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to remove component: ' + textStatus);
$dialogRemoveComponent.dialog("close");
}
});
},
Cancel: function () {
$dialogRemoveComponent.dialog("close");
}
});
},
Cancel: function () {
$dialogRemoveComponent.dialog("close");
}
});
$dialogRemoveComponent.dialog('open');
} else {
// New - Remove
componentRow.remove();
updateTotalCost();
}
}
function updateTotalCost() {
var totalCost = 0;
$jobComponents.find('input.cost').each(function () {
var v = $(this).val();
v = $.parseNumber(v, { format: '#,##0.00', locale: 'au' });
if (!isNaN(v))
totalCost += v;
});
var totalCostFormatted = $.formatNumber(totalCost, { format: '#,##0.00', locale: 'au' });
$('#jobComponentsTotalCost').text('$' + totalCostFormatted);
}
function updateComponent() {
var componentRow = $(this).closest('tr');
$dialogRemoveComponent.dialog('open');
componentRow.find('input').attr('disabled', true).addClass('updating');
} else {
// New - Remove
componentRow.remove();
var id = componentRow.attr('data-jobcomponentid');
if (id) {
// Update
var data = {
id: id,
Description: componentRow.find('input.description').val(),
Cost: componentRow.find('input.cost').val()
};
$.ajax({
url: '@Url.Action(MVC.API.Job.ComponentUpdate())',
dataType: 'json',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to update component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update component: ' + textStatus);
}
});
} else {
// Add
var data = {
id: id,
Description: componentRow.find('input.description').val(),
Cost: componentRow.find('input.cost').val()
};
$.ajax({
url: '@Url.Action(MVC.API.Job.ComponentAdd(Model.Job.Id, null, null))',
dataType: 'json',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.attr('data-jobcomponentid', d.Component.Id);
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to add component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to add component: ' + textStatus);
}
});
}
updateTotalCost();
}
}
function updateTotalCost() {
var totalCost = 0;
$jobComponents.find('input.cost').each(function () {
var v = $(this).val();
v = $.parseNumber(v, { format: '#,##0.00', locale: 'au' });
if (!isNaN(v))
totalCost += v;
});
var totalCostFormatted = $.formatNumber(totalCost, { format: '#,##0.00', locale: 'au' });
$('#jobComponentsTotalCost').text('$' + totalCostFormatted);
}
function updateComponent() {
var componentRow = $(this).closest('tr');
componentRow.find('input').attr('disabled', true).addClass('updating');
var id = componentRow.attr('data-jobcomponentid');
if (id) {
// Update
var data = {
id: id,
Description: componentRow.find('input.description').val(),
Cost: componentRow.find('input.cost').val()
};
$.ajax({
url: '@Url.Action(MVC.API.Job.ComponentUpdate())',
dataType: 'json',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to update component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update component: ' + textStatus);
}
});
} else {
// Add
var data = {
id: id,
Description: componentRow.find('input.description').val(),
Cost: componentRow.find('input.cost').val()
};
$.ajax({
url: '@Url.Action(MVC.API.Job.ComponentAdd(Model.Job.Id, null, null))',
dataType: 'json',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.attr('data-jobcomponentid', d.Component.Id);
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to add component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to add component: ' + textStatus);
}
});
}
updateTotalCost();
}
updateTotalCost();
});
</script>
});
</script>
}
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Views.Job.JobParts
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
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/Job/JobParts/Components.cshtml")]
public partial class Components : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
public partial class Components : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.ShowModel>
{
public Components()
{
@@ -43,8 +45,16 @@ namespace Disco.Web.Views.Job.JobParts
#line 2 "..\..\Views\Job\JobParts\Components.cshtml"
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-NumberFormatter");
Authorization.Require(Claims.Job.ShowNonWarrantyComponents);
var hasEdit = Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.EditComponents);
var hasAdd = Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.AddComponents);
if (hasEdit)
{
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-NumberFormatter");
}
#line default
#line hidden
@@ -52,23 +62,50 @@ WriteLiteral("\r\n<table");
WriteLiteral(" id=\"jobComponents\"");
WriteLiteral(">\r\n <tr>\r\n <th>\r\n Description\r\n </th>\r\n <th>\r\n" +
" Cost\r\n </th>\r\n <th");
WriteLiteral(">\r\n <tr>\r\n <th>Description\r\n </th>\r\n <th>Cost\r\n </" +
"th>\r\n");
#line 19 "..\..\Views\Job\JobParts\Components.cshtml"
#line default
#line hidden
#line 19 "..\..\Views\Job\JobParts\Components.cshtml"
if (hasEdit)
{
#line default
#line hidden
WriteLiteral(" <th");
WriteLiteral(" class=\"actions\"");
WriteLiteral(">\r\n &nbsp;\r\n </th>\r\n </tr>\r\n");
WriteLiteral(">&nbsp;\r\n </th>\r\n");
#line 17 "..\..\Views\Job\JobParts\Components.cshtml"
#line 23 "..\..\Views\Job\JobParts\Components.cshtml"
}
#line default
#line hidden
WriteLiteral(" </tr>\r\n");
#line 25 "..\..\Views\Job\JobParts\Components.cshtml"
#line default
#line hidden
#line 17 "..\..\Views\Job\JobParts\Components.cshtml"
foreach (var jc in Model.Job.JobComponents)
#line 25 "..\..\Views\Job\JobParts\Components.cshtml"
if (hasEdit)
{
foreach (var jc in Model.Job.JobComponents)
{
#line default
@@ -78,7 +115,7 @@ WriteLiteral(" <tr");
WriteLiteral(" data-jobcomponentid=\"");
#line 19 "..\..\Views\Job\JobParts\Components.cshtml"
#line 29 "..\..\Views\Job\JobParts\Components.cshtml"
Write(jc.Id);
@@ -92,14 +129,14 @@ WriteLiteral(" type=\"text\"");
WriteLiteral(" class=\"description\"");
WriteAttribute("value", Tuple.Create(" value=\"", 513), Tuple.Create("\"", 536)
WriteAttribute("value", Tuple.Create(" value=\"", 853), Tuple.Create("\"", 876)
#line 21 "..\..\Views\Job\JobParts\Components.cshtml"
, Tuple.Create(Tuple.Create("", 521), Tuple.Create<System.Object, System.Int32>(jc.Description
#line 31 "..\..\Views\Job\JobParts\Components.cshtml"
, Tuple.Create(Tuple.Create("", 861), Tuple.Create<System.Object, System.Int32>(jc.Description
#line default
#line hidden
, 521), false)
, 861), false)
);
WriteLiteral(" />\r\n </td>\r\n <td>\r\n <input");
@@ -108,14 +145,14 @@ WriteLiteral(" type=\"text\"");
WriteLiteral(" class=\"cost\"");
WriteAttribute("value", Tuple.Create(" value=\"", 626), Tuple.Create("\"", 656)
WriteAttribute("value", Tuple.Create(" value=\"", 966), Tuple.Create("\"", 996)
#line 24 "..\..\Views\Job\JobParts\Components.cshtml"
, Tuple.Create(Tuple.Create("", 634), Tuple.Create<System.Object, System.Int32>(jc.Cost.ToString("C")
#line 34 "..\..\Views\Job\JobParts\Components.cshtml"
, Tuple.Create(Tuple.Create("", 974), Tuple.Create<System.Object, System.Int32>(jc.Cost.ToString("C")
#line default
#line hidden
, 634), false)
, 974), false)
);
WriteLiteral(" />\r\n </td>\r\n <td>\r\n <span");
@@ -125,170 +162,310 @@ WriteLiteral(" class=\"remove\"");
WriteLiteral("></span>\r\n </td>\r\n </tr>\r\n");
#line 30 "..\..\Views\Job\JobParts\Components.cshtml"
#line 40 "..\..\Views\Job\JobParts\Components.cshtml"
}
}
else
{
foreach (var jc in Model.Job.JobComponents)
{
#line default
#line hidden
WriteLiteral(" <tr");
WriteLiteral(" data-jobcomponentid=\"");
#line 46 "..\..\Views\Job\JobParts\Components.cshtml"
Write(jc.Id);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n <td>\r\n <span");
WriteLiteral(" class=\"description\"");
WriteLiteral(">");
#line 48 "..\..\Views\Job\JobParts\Components.cshtml"
Write(jc.Description);
#line default
#line hidden
WriteLiteral("</span>\r\n </td>\r\n <td>\r\n <span");
WriteLiteral(" class=\"cost\"");
WriteLiteral(">");
#line 51 "..\..\Views\Job\JobParts\Components.cshtml"
Write(jc.Cost.ToString("C"));
#line default
#line hidden
WriteLiteral("</span>\r\n </td>\r\n </tr>\r\n");
#line 54 "..\..\Views\Job\JobParts\Components.cshtml"
}
}
#line default
#line hidden
WriteLiteral(" <tr>\r\n <td>\r\n <a");
WriteLiteral("\r\n <tr>\r\n <td>\r\n");
#line 59 "..\..\Views\Job\JobParts\Components.cshtml"
#line default
#line hidden
#line 59 "..\..\Views\Job\JobParts\Components.cshtml"
if (hasEdit && hasAdd)
{
#line default
#line hidden
WriteLiteral(" <a");
WriteLiteral(" href=\"#\"");
WriteLiteral(" id=\"jobComponentsAdd\"");
WriteLiteral(">Add Component</a>\r\n </td>\r\n <td");
WriteLiteral(">Add Component</a>\r\n");
WriteLiteral(" colspan=\"2\"");
#line 62 "..\..\Views\Job\JobParts\Components.cshtml"
}
#line default
#line hidden
WriteLiteral(" &nbsp;\r\n </td>\r\n <td");
WriteAttribute("colspan", Tuple.Create(" colspan=\"", 1708), Tuple.Create("\"", 1736)
#line 65 "..\..\Views\Job\JobParts\Components.cshtml"
, Tuple.Create(Tuple.Create("", 1718), Tuple.Create<System.Object, System.Int32>(hasEdit ? 2 : 1
#line default
#line hidden
, 1718), false)
);
WriteLiteral(" class=\"totalCost\"");
WriteLiteral(">\r\n Total: <span");
WriteLiteral(">Total: <span");
WriteLiteral(" id=\"jobComponentsTotalCost\"");
WriteLiteral("></span>\r\n </td>\r\n </tr>\r\n</table>\r\n<div");
WriteLiteral(">\r\n");
#line 66 "..\..\Views\Job\JobParts\Components.cshtml"
#line default
#line hidden
#line 66 "..\..\Views\Job\JobParts\Components.cshtml"
if (!hasEdit)
{
#line default
#line hidden
#line 68 "..\..\Views\Job\JobParts\Components.cshtml"
Write(Model.Job.JobComponentsTotalCost().ToString("C"));
#line default
#line hidden
#line 68 "..\..\Views\Job\JobParts\Components.cshtml"
}
#line default
#line hidden
WriteLiteral(" </span>\r\n </td>\r\n </tr>\r\n</table>\r\n");
#line 74 "..\..\Views\Job\JobParts\Components.cshtml"
if (hasEdit)
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" id=\"dialogRemoveComponent\"");
WriteLiteral(" title=\"Remove this Component?\"");
WriteLiteral(">\r\n <p>\r\n <span");
WriteLiteral(">\r\n <p>\r\n <span");
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
WriteLiteral(" style=\"float: left; margin: 0 7px 20px 0;\"");
WriteLiteral("></span>\r\n Are you sure?</p>\r\n</div>\r\n<script");
WriteLiteral("></span>\r\n Are you sure?\r\n </p>\r\n </div>\r\n");
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n var $jobComponents = $(\'#jobComponents\');\r\n\r\n " +
" $jobComponents.on(\'change\', \'input\', updateComponent);\r\n $jobComponen" +
"ts.on(\'focus\', \'input\', function () { $(this).select() });\r\n\r\n\r\n $jobComp" +
"onents.on(\'click\', \'span.remove\', removeComponent);\r\n\r\n $(\'#jobComponents" +
"Add\').click(function () {\r\n var jc = $(\'<tr><td><input type=\"text\" cl" +
"ass=\"description\" /></td><td><input type=\"text\" class=\"cost\" /></td><td><span cl" +
"ass=\"remove\"></span></td></tr>\');\r\n jc.find(\'input\').focus(function (" +
") { $(this).select() })\r\n jc.insertBefore($jobComponents.find(\'tr\').l" +
"ast());\r\n jc.find(\'input.description\').focus();\r\n return f" +
"alse;\r\n });\r\n\r\n $(\'#dialogRemoveComponent\').dialog({\r\n " +
"resizable: false,\r\n height: 140,\r\n modal: true,\r\n " +
" autoOpen: false\r\n });\r\n\r\n function removeComponent() {\r\n " +
" var componentRow = $(this).closest(\'tr\');\r\n var id = componentRo" +
"w.attr(\'data-jobcomponentid\');\r\n if (id) {\r\n var data " +
"= { id: id };\r\n\r\n var $dialogRemoveComponent = $(\'#dialogRemoveCo" +
"mponent\');\r\n $dialogRemoveComponent.dialog(\"enable\");\r\n " +
" $dialogRemoveComponent.dialog(\'option\', \'buttons\', {\r\n " +
"\"Remove\": function () {\r\n $dialogRemoveComponent.dialog(\"" +
"disable\");\r\n $dialogRemoveComponent.dialog(\"option\", \"but" +
"tons\", null);\r\n $.ajax({\r\n url" +
": \'");
WriteLiteral(">\r\n $(function () {\r\n var $jobComponents = $(\'#jobComponents\');" +
"\r\n\r\n $jobComponents.on(\'change\', \'input\', updateComponent);\r\n " +
" $jobComponents.on(\'focus\', \'input\', function () { $(this).select() });\r\n\r\n\r\n" +
" $jobComponents.on(\'click\', \'span.remove\', removeComponent);\r\n\r\n " +
" $(\'#jobComponentsAdd\').click(function () {\r\n var jc = $(\'<" +
"tr><td><input type=\"text\" class=\"description\" /></td><td><input type=\"text\" clas" +
"s=\"cost\" /></td><td><span class=\"remove\"></span></td></tr>\');\r\n j" +
"c.find(\'input\').focus(function () { $(this).select() })\r\n jc.inse" +
"rtBefore($jobComponents.find(\'tr\').last());\r\n jc.find(\'input.desc" +
"ription\').focus();\r\n return false;\r\n });\r\n\r\n " +
" $(\'#dialogRemoveComponent\').dialog({\r\n resizable: false,\r\n " +
" height: 140,\r\n modal: true,\r\n autoOpen:" +
" false\r\n });\r\n\r\n function removeComponent() {\r\n " +
" var componentRow = $(this).closest(\'tr\');\r\n var id = compone" +
"ntRow.attr(\'data-jobcomponentid\');\r\n if (id) {\r\n " +
" var data = { id: id };\r\n\r\n var $dialogRemoveComponent = $(" +
"\'#dialogRemoveComponent\');\r\n $dialogRemoveComponent.dialog(\"e" +
"nable\");\r\n $dialogRemoveComponent.dialog(\'option\', \'buttons\'," +
" {\r\n \"Remove\": function () {\r\n " +
" $dialogRemoveComponent.dialog(\"disable\");\r\n $dialogR" +
"emoveComponent.dialog(\"option\", \"buttons\", null);\r\n $" +
".ajax({\r\n url: \'");
#line 83 "..\..\Views\Job\JobParts\Components.cshtml"
Write(Url.Action(MVC.API.Job.ComponentRemove()));
#line 120 "..\..\Views\Job\JobParts\Components.cshtml"
Write(Url.Action(MVC.API.Job.ComponentRemove()));
#line default
#line hidden
WriteLiteral("\',\r\n dataType: \'json\',\r\n da" +
"ta: data,\r\n success: function (d) {\r\n " +
" if (d == \'OK\') {\r\n componentR" +
"ow.remove();\r\n updateTotalCost();\r\n " +
" } else {\r\n alert(\'Unabl" +
"e to remove component: \' + d);\r\n }\r\n " +
" $dialogRemoveComponent.dialog(\"close\");\r\n " +
" },\r\n error: function (jqXHR, textStatus, erro" +
"rThrown) {\r\n alert(\'Unable to remove component: \'" +
" + textStatus);\r\n $dialogRemoveComponent.dialog(\"" +
"close\");\r\n }\r\n });\r\n " +
" },\r\n Cancel: function () {\r\n " +
" $dialogRemoveComponent.dialog(\"close\");\r\n }\r\n " +
" });\r\n\r\n $dialogRemoveComponent.dialog(\'open\');\r\n\r\n } " +
"else {\r\n // New - Remove\r\n componentRow.remove();\r" +
"\n updateTotalCost();\r\n }\r\n }\r\n function " +
"updateTotalCost() {\r\n var totalCost = 0;\r\n\r\n $jobComponent" +
"s.find(\'input.cost\').each(function () {\r\n var v = $(this).val();\r" +
"\n v = $.parseNumber(v, { format: \'#,##0.00\', locale: \'au\' });\r\n " +
" if (!isNaN(v))\r\n totalCost += v;\r\n }" +
");\r\n var totalCostFormatted = $.formatNumber(totalCost, { format: \'#," +
"##0.00\', locale: \'au\' });\r\n $(\'#jobComponentsTotalCost\').text(\'$\' + t" +
"otalCostFormatted);\r\n }\r\n function updateComponent() {\r\n " +
" var componentRow = $(this).closest(\'tr\');\r\n\r\n componentRow.find(\'in" +
"put\').attr(\'disabled\', true).addClass(\'updating\');\r\n\r\n var id = compo" +
"nentRow.attr(\'data-jobcomponentid\');\r\n if (id) {\r\n // " +
"Update\r\n var data = {\r\n id: id,\r\n " +
" Description: componentRow.find(\'input.description\').val(),\r\n " +
" Cost: componentRow.find(\'input.cost\').val()\r\n };\r\n " +
" $.ajax({\r\n url: \'");
WriteLiteral("\',\r\n dataType: \'json\',\r\n " +
" data: data,\r\n success: function (d) {\r\n " +
" if (d == \'OK\') {\r\n " +
" componentRow.remove();\r\n update" +
"TotalCost();\r\n } else {\r\n " +
" alert(\'Unable to remove component: \' + d);\r\n " +
" }\r\n $dialogRemoveComponen" +
"t.dialog(\"close\");\r\n },\r\n " +
" error: function (jqXHR, textStatus, errorThrown) {\r\n " +
" alert(\'Unable to remove component: \' + textStatus);\r\n " +
" $dialogRemoveComponent.dialog(\"close\");\r\n " +
" }\r\n });\r\n }," +
"\r\n Cancel: function () {\r\n $di" +
"alogRemoveComponent.dialog(\"close\");\r\n }\r\n " +
" });\r\n\r\n $dialogRemoveComponent.dialog(\'open\');\r\n\r\n " +
" } else {\r\n // New - Remove\r\n com" +
"ponentRow.remove();\r\n updateTotalCost();\r\n }\r\n" +
" }\r\n function updateTotalCost() {\r\n var tot" +
"alCost = 0;\r\n\r\n $jobComponents.find(\'input.cost\').each(function (" +
") {\r\n var v = $(this).val();\r\n v = $.parse" +
"Number(v, { format: \'#,##0.00\', locale: \'au\' });\r\n if (!isNaN" +
"(v))\r\n totalCost += v;\r\n });\r\n " +
" var totalCostFormatted = $.formatNumber(totalCost, { format: \'#,##0.00\', loc" +
"ale: \'au\' });\r\n $(\'#jobComponentsTotalCost\').text(\'$\' + totalCost" +
"Formatted);\r\n }\r\n function updateComponent() {\r\n " +
" var componentRow = $(this).closest(\'tr\');\r\n\r\n componentRow." +
"find(\'input\').attr(\'disabled\', true).addClass(\'updating\');\r\n\r\n va" +
"r id = componentRow.attr(\'data-jobcomponentid\');\r\n if (id) {\r\n " +
" // Update\r\n var data = {\r\n " +
" id: id,\r\n Description: componentRow.find(\'input.des" +
"cription\').val(),\r\n Cost: componentRow.find(\'input.cost\')" +
".val()\r\n };\r\n $.ajax({\r\n " +
" url: \'");
#line 140 "..\..\Views\Job\JobParts\Components.cshtml"
Write(Url.Action(MVC.API.Job.ComponentUpdate()));
#line 177 "..\..\Views\Job\JobParts\Components.cshtml"
Write(Url.Action(MVC.API.Job.ComponentUpdate()));
#line default
#line hidden
WriteLiteral(@"',
dataType: 'json',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to update component: ' + d.Result);
dataType: 'json',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to update component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update component: ' + textStatus);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update component: ' + textStatus);
}
});
} else {
// Add
var data = {
id: id,
Description: componentRow.find('input.description').val(),
Cost: componentRow.find('input.cost').val()
};
$.ajax({
url: '");
});
} else {
// Add
var data = {
id: id,
Description: componentRow.find('input.description').val(),
Cost: componentRow.find('input.cost').val()
};
$.ajax({
url: '");
#line 164 "..\..\Views\Job\JobParts\Components.cshtml"
Write(Url.Action(MVC.API.Job.ComponentAdd(Model.Job.Id, null, null)));
#line 201 "..\..\Views\Job\JobParts\Components.cshtml"
Write(Url.Action(MVC.API.Job.ComponentAdd(Model.Job.Id, null, null)));
#line default
#line hidden
WriteLiteral(@"',
dataType: 'json',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.attr('data-jobcomponentid', d.Component.Id);
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to add component: ' + d.Result);
dataType: 'json',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.attr('data-jobcomponentid', d.Component.Id);
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to add component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to add component: ' + textStatus);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to add component: ' + textStatus);
}
});
});
}
updateTotalCost();
}
updateTotalCost();
}
updateTotalCost();
});
</script>
});
</script>
");
#line 225 "..\..\Views\Job\JobParts\Components.cshtml"
}
#line default
#line hidden
}
}
}
+44 -33
View File
@@ -1,6 +1,9 @@
@model Disco.Web.Models.Job.ShowModel
@{
Authorization.Require(Claims.Job.ShowFlags);
var validFlags = Model.Job.ValidFlagsGrouped();
var canEdit = Authorization.Has(Claims.Job.Properties.Flags);
}
<div id="jobDetailTab-Flags" class="jobPart">
<table id="jobFlags">
@@ -15,45 +18,47 @@
@foreach (var flagItem in flagGroup.Value)
{
<div>
<input type="checkbox" value="@flagItem.Item1" id="jobFlag_@(flagItem.Item1)" @(flagItem.Item3 ? new HtmlString("checked=\"checked\"") : new HtmlString(string.Empty)) /><label id="jobFlagLabel_@(flagItem.Item1)" for="jobFlag_@(flagItem.Item1)">@flagItem.Item2</label></div>
<input type="checkbox" value="@flagItem.Item1" id="jobFlag_@(flagItem.Item1)" @(flagItem.Item3 ? new HtmlString("checked=\"checked\"") : new HtmlString(string.Empty)) @(canEdit ? new HtmlString(string.Empty) : new HtmlString("disabled=\"disabled\"")) /><label id="jobFlagLabel_@(flagItem.Item1)" for="jobFlag_@(flagItem.Item1)">@flagItem.Item2</label>
</div>
}
</td>
</tr>
}
</table>
<div id="dialogFlagsAction" title="Add Flag">
@using (Html.BeginForm(MVC.API.Job.UpdateFlag(Model.Job.Id, null, null, true)))
{
<input id="dialogFlagsActionFlag" type="hidden" name="Flag" value="0" />
<h3>
Reason:</h3>
<p>
<textarea name="Reason" class="block"></textarea>
</p>
}
</div>
<script type="text/javascript">
$('#jobDetailTabItems').append('<li><a href="#jobDetailTab-Flags">Flags</a></li>');
$(function () {
var $flagCheckboxes = $('#jobFlags').find('input[type="checkbox"]');
var $dialogFlagsAction = $('#dialogFlagsAction');
var $flagCheckbox;
@if (canEdit)
{
<div id="dialogFlagsAction" title="Add Flag">
@using (Html.BeginForm(MVC.API.Job.UpdateFlag(Model.Job.Id, null, null, true)))
{
<input id="dialogFlagsActionFlag" type="hidden" name="Flag" value="0" />
<h3>Reason:</h3>
<p>
<textarea name="Reason" class="block"></textarea>
</p>
}
</div>
<script type="text/javascript">
$('#jobDetailTabItems').append('<li><a href="#jobDetailTab-Flags">Flags</a></li>');
$(function () {
var $flagCheckboxes = $('#jobFlags').find('input[type="checkbox"]');
var $dialogFlagsAction = $('#dialogFlagsAction');
var $flagCheckbox;
var updateFlags = function () {
$flagCheckbox = $(this);
var flagValue = $flagCheckbox.val();
var updateFlags = function () {
$flagCheckbox = $(this);
var flagValue = $flagCheckbox.val();
if ($flagCheckbox.is(':checked')) {
// Add
$('#dialogFlagsActionFlag').val(flagValue);
var title = 'Add Flag: ' + $flagCheckbox.closest('tr').find('th .flagGroupName').text() + ': ' + $('#jobFlagLabel_' + flagValue).text();
$dialogFlagsAction.dialog('option', 'title', title);
$dialogFlagsAction.dialog('open');
} else {
// Remove
var $ajaxLoading = $flagCheckbox.closest('tr').find('span.ajaxLoading');
$ajaxLoading.show();
$.getJSON('@(Url.Action(MVC.API.Job.UpdateFlag(Model.Job.Id, null, null, false)))', { Flag: '-' + flagValue }, function (response, result) {
if ($flagCheckbox.is(':checked')) {
// Add
$('#dialogFlagsActionFlag').val(flagValue);
var title = 'Add Flag: ' + $flagCheckbox.closest('tr').find('th .flagGroupName').text() + ': ' + $('#jobFlagLabel_' + flagValue).text();
$dialogFlagsAction.dialog('option', 'title', title);
$dialogFlagsAction.dialog('open');
} else {
// Remove
var $ajaxLoading = $flagCheckbox.closest('tr').find('span.ajaxLoading');
$ajaxLoading.show();
$.getJSON('@(Url.Action(MVC.API.Job.UpdateFlag(Model.Job.Id, null, null, false)))', { Flag: '-' + flagValue }, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Flag:\n' + response);
$ajaxLoading.hide();
@@ -86,5 +91,11 @@
$flagCheckboxes.click(updateFlags);
});
</script>
</script>
}else
{
<script>
$('#jobDetailTabItems').append('<li><a href="#jobDetailTab-Flags">Flags</a></li>');
</script>
}
</div>
+120 -69
View File
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Views.Job.JobParts
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
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/Job/JobParts/Flags.cshtml")]
public partial class Flags : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
public partial class Flags : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.ShowModel>
{
public Flags()
{
@@ -43,7 +45,10 @@ namespace Disco.Web.Views.Job.JobParts
#line 2 "..\..\Views\Job\JobParts\Flags.cshtml"
Authorization.Require(Claims.Job.ShowFlags);
var validFlags = Model.Job.ValidFlagsGrouped();
var canEdit = Authorization.Has(Claims.Job.Properties.Flags);
#line default
@@ -61,13 +66,13 @@ WriteLiteral(" id=\"jobFlags\"");
WriteLiteral(">\r\n");
#line 7 "..\..\Views\Job\JobParts\Flags.cshtml"
#line 10 "..\..\Views\Job\JobParts\Flags.cshtml"
#line default
#line hidden
#line 7 "..\..\Views\Job\JobParts\Flags.cshtml"
#line 10 "..\..\Views\Job\JobParts\Flags.cshtml"
foreach (var flagGroup in validFlags)
{
@@ -81,7 +86,7 @@ WriteLiteral(" class=\"flagGroupName\"");
WriteLiteral(">");
#line 11 "..\..\Views\Job\JobParts\Flags.cshtml"
#line 14 "..\..\Views\Job\JobParts\Flags.cshtml"
Write(flagGroup.Key);
@@ -92,7 +97,7 @@ WriteLiteral("</span><br />\r\n");
WriteLiteral(" ");
#line 12 "..\..\Views\Job\JobParts\Flags.cshtml"
#line 15 "..\..\Views\Job\JobParts\Flags.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -101,13 +106,13 @@ WriteLiteral(" ");
WriteLiteral("\r\n </th>\r\n <td>\r\n");
#line 15 "..\..\Views\Job\JobParts\Flags.cshtml"
#line 18 "..\..\Views\Job\JobParts\Flags.cshtml"
#line default
#line hidden
#line 15 "..\..\Views\Job\JobParts\Flags.cshtml"
#line 18 "..\..\Views\Job\JobParts\Flags.cshtml"
foreach (var flagItem in flagGroup.Value)
{
@@ -118,73 +123,82 @@ WriteLiteral(" <div>\r\n <inpu
WriteLiteral(" type=\"checkbox\"");
WriteAttribute("value", Tuple.Create(" value=\"", 609), Tuple.Create("\"", 632)
WriteAttribute("value", Tuple.Create(" value=\"", 728), Tuple.Create("\"", 751)
#line 18 "..\..\Views\Job\JobParts\Flags.cshtml"
, Tuple.Create(Tuple.Create("", 617), Tuple.Create<System.Object, System.Int32>(flagItem.Item1
#line 21 "..\..\Views\Job\JobParts\Flags.cshtml"
, Tuple.Create(Tuple.Create("", 736), Tuple.Create<System.Object, System.Int32>(flagItem.Item1
#line default
#line hidden
, 617), false)
, 736), false)
);
WriteAttribute("id", Tuple.Create(" id=\"", 633), Tuple.Create("\"", 663)
, Tuple.Create(Tuple.Create("", 638), Tuple.Create("jobFlag_", 638), true)
WriteAttribute("id", Tuple.Create(" id=\"", 752), Tuple.Create("\"", 782)
, Tuple.Create(Tuple.Create("", 757), Tuple.Create("jobFlag_", 757), true)
#line 18 "..\..\Views\Job\JobParts\Flags.cshtml"
, Tuple.Create(Tuple.Create("", 646), Tuple.Create<System.Object, System.Int32>(flagItem.Item1
#line 21 "..\..\Views\Job\JobParts\Flags.cshtml"
, Tuple.Create(Tuple.Create("", 765), Tuple.Create<System.Object, System.Int32>(flagItem.Item1
#line default
#line hidden
, 646), false)
, 765), false)
);
WriteLiteral(" ");
#line 18 "..\..\Views\Job\JobParts\Flags.cshtml"
#line 21 "..\..\Views\Job\JobParts\Flags.cshtml"
Write(flagItem.Item3 ? new HtmlString("checked=\"checked\"") : new HtmlString(string.Empty));
#line default
#line hidden
WriteLiteral(" ");
#line 21 "..\..\Views\Job\JobParts\Flags.cshtml"
Write(canEdit ? new HtmlString(string.Empty) : new HtmlString("disabled=\"disabled\""));
#line default
#line hidden
WriteLiteral(" /><label");
WriteAttribute("id", Tuple.Create(" id=\"", 762), Tuple.Create("\"", 797)
, Tuple.Create(Tuple.Create("", 767), Tuple.Create("jobFlagLabel_", 767), true)
WriteAttribute("id", Tuple.Create(" id=\"", 965), Tuple.Create("\"", 1000)
, Tuple.Create(Tuple.Create("", 970), Tuple.Create("jobFlagLabel_", 970), true)
#line 18 "..\..\Views\Job\JobParts\Flags.cshtml"
, Tuple.Create(Tuple.Create("", 780), Tuple.Create<System.Object, System.Int32>(flagItem.Item1
#line 21 "..\..\Views\Job\JobParts\Flags.cshtml"
, Tuple.Create(Tuple.Create("", 983), Tuple.Create<System.Object, System.Int32>(flagItem.Item1
#line default
#line hidden
, 780), false)
, 983), false)
);
WriteAttribute("for", Tuple.Create(" for=\"", 798), Tuple.Create("\"", 829)
, Tuple.Create(Tuple.Create("", 804), Tuple.Create("jobFlag_", 804), true)
WriteAttribute("for", Tuple.Create(" for=\"", 1001), Tuple.Create("\"", 1032)
, Tuple.Create(Tuple.Create("", 1007), Tuple.Create("jobFlag_", 1007), true)
#line 18 "..\..\Views\Job\JobParts\Flags.cshtml"
, Tuple.Create(Tuple.Create("", 812), Tuple.Create<System.Object, System.Int32>(flagItem.Item1
#line 21 "..\..\Views\Job\JobParts\Flags.cshtml"
, Tuple.Create(Tuple.Create("", 1015), Tuple.Create<System.Object, System.Int32>(flagItem.Item1
#line default
#line hidden
, 812), false)
, 1015), false)
);
WriteLiteral(">");
#line 18 "..\..\Views\Job\JobParts\Flags.cshtml"
Write(flagItem.Item2);
#line 21 "..\..\Views\Job\JobParts\Flags.cshtml"
Write(flagItem.Item2);
#line default
#line hidden
WriteLiteral("</label></div>\r\n");
WriteLiteral("</label>\r\n </div>\r\n");
#line 19 "..\..\Views\Job\JobParts\Flags.cshtml"
#line 23 "..\..\Views\Job\JobParts\Flags.cshtml"
}
@@ -193,13 +207,29 @@ WriteLiteral("</label></div>\r\n");
WriteLiteral(" </td>\r\n </tr>\r\n");
#line 22 "..\..\Views\Job\JobParts\Flags.cshtml"
#line 26 "..\..\Views\Job\JobParts\Flags.cshtml"
}
#line default
#line hidden
WriteLiteral(" </table>\r\n <div");
WriteLiteral(" </table>\r\n");
#line 28 "..\..\Views\Job\JobParts\Flags.cshtml"
#line default
#line hidden
#line 28 "..\..\Views\Job\JobParts\Flags.cshtml"
if (canEdit)
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" id=\"dialogFlagsAction\"");
@@ -208,20 +238,20 @@ WriteLiteral(" title=\"Add Flag\"");
WriteLiteral(">\r\n");
#line 25 "..\..\Views\Job\JobParts\Flags.cshtml"
#line 31 "..\..\Views\Job\JobParts\Flags.cshtml"
#line default
#line hidden
#line 25 "..\..\Views\Job\JobParts\Flags.cshtml"
using (Html.BeginForm(MVC.API.Job.UpdateFlag(Model.Job.Id, null, null, true)))
{
#line 31 "..\..\Views\Job\JobParts\Flags.cshtml"
using (Html.BeginForm(MVC.API.Job.UpdateFlag(Model.Job.Id, null, null, true)))
{
#line default
#line hidden
WriteLiteral(" <input");
WriteLiteral(" <input");
WriteLiteral(" id=\"dialogFlagsActionFlag\"");
@@ -233,53 +263,55 @@ WriteLiteral(" value=\"0\"");
WriteLiteral(" />\r\n");
WriteLiteral(" <h3>\r\n Reason:</h3>\r\n");
WriteLiteral(" <h3>Reason:</h3>\r\n");
WriteLiteral(" <p>\r\n <textarea");
WriteLiteral(" <p>\r\n <textarea");
WriteLiteral(" name=\"Reason\"");
WriteLiteral(" class=\"block\"");
WriteLiteral("></textarea>\r\n </p>\r\n");
WriteLiteral("></textarea>\r\n </p>\r\n");
#line 33 "..\..\Views\Job\JobParts\Flags.cshtml"
}
#line 38 "..\..\Views\Job\JobParts\Flags.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n <script");
WriteLiteral(" </div>\r\n");
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$('#jobDetailTabItems').append('<li><a href=""#jobDetailTab-Flags"">Flags</a></li>');
$(function () {
var $flagCheckboxes = $('#jobFlags').find('input[type=""checkbox""]');
var $dialogFlagsAction = $('#dialogFlagsAction');
var $flagCheckbox;
$('#jobDetailTabItems').append('<li><a href=""#jobDetailTab-Flags"">Flags</a></li>');
$(function () {
var $flagCheckboxes = $('#jobFlags').find('input[type=""checkbox""]');
var $dialogFlagsAction = $('#dialogFlagsAction');
var $flagCheckbox;
var updateFlags = function () {
$flagCheckbox = $(this);
var flagValue = $flagCheckbox.val();
var updateFlags = function () {
$flagCheckbox = $(this);
var flagValue = $flagCheckbox.val();
if ($flagCheckbox.is(':checked')) {
// Add
$('#dialogFlagsActionFlag').val(flagValue);
var title = 'Add Flag: ' + $flagCheckbox.closest('tr').find('th .flagGroupName').text() + ': ' + $('#jobFlagLabel_' + flagValue).text();
$dialogFlagsAction.dialog('option', 'title', title);
$dialogFlagsAction.dialog('open');
} else {
// Remove
var $ajaxLoading = $flagCheckbox.closest('tr').find('span.ajaxLoading');
$ajaxLoading.show();
$.getJSON('");
if ($flagCheckbox.is(':checked')) {
// Add
$('#dialogFlagsActionFlag').val(flagValue);
var title = 'Add Flag: ' + $flagCheckbox.closest('tr').find('th .flagGroupName').text() + ': ' + $('#jobFlagLabel_' + flagValue).text();
$dialogFlagsAction.dialog('option', 'title', title);
$dialogFlagsAction.dialog('open');
} else {
// Remove
var $ajaxLoading = $flagCheckbox.closest('tr').find('span.ajaxLoading');
$ajaxLoading.show();
$.getJSON('");
#line 56 "..\..\Views\Job\JobParts\Flags.cshtml"
Write(Url.Action(MVC.API.Job.UpdateFlag(Model.Job.Id, null, null, false)));
#line 61 "..\..\Views\Job\JobParts\Flags.cshtml"
Write(Url.Action(MVC.API.Job.UpdateFlag(Model.Job.Id, null, null, false)));
#line default
@@ -317,10 +349,29 @@ WriteLiteral(@"', { Flag: '-' + flagValue }, function (response, result) {
$flagCheckboxes.click(updateFlags);
});
</script>
</div>
</script>
");
#line 95 "..\..\Views\Job\JobParts\Flags.cshtml"
}else
{
#line default
#line hidden
WriteLiteral(" <script>\r\n $(\'#jobDetailTabItems\').append(\'<li><a href=\"#jobDe" +
"tailTab-Flags\">Flags</a></li>\');\r\n </script>\r\n");
#line 100 "..\..\Views\Job\JobParts\Flags.cshtml"
}
#line default
#line hidden
WriteLiteral("</div>\r\n");
}
}
}
+261 -53
View File
@@ -1,11 +1,15 @@
@model Disco.Web.Models.Job.ShowModel
@{
Authorization.Require(Claims.Job.ShowNonWarrantyInsurance);
}
<table id="jobNonWarrantyInsurance">
@if (Model.Job.JobMetaNonWarranty.IsInsuranceClaim)
{
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
{
if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.InsuranceDetails))
{
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
<tr>
<th style="width: 230px;">
Date of Loss or Damage
<th style="width: 230px;">Date of Loss or Damage
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaInsurance.LossOrDamageDate)
@@ -25,8 +29,7 @@
</td>
</tr>
<tr>
<th>
Event Location
<th>Event Location
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaInsurance.EventLocation)
@@ -45,8 +48,7 @@
</td>
</tr>
<tr>
<th>
Description
<th>Description
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaInsurance.Description)
@@ -65,8 +67,7 @@
</td>
</tr>
<tr>
<th style="width: 200px;">
&nbsp;
<th style="width: 200px;">&nbsp;
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaInsurance.ThirdPartyCaused)@Html.LabelFor(m => m.Job.JobMetaInsurance.ThirdPartyCaused)
@@ -74,15 +75,13 @@
@AjaxHelpers.AjaxLoader()
<div id="Job_JobMetaInsurance_ThirdPartyCaused_Details" style="padding-left: 25px;">
<div>
<h5>
Third Party Name</h5>
<h5>Third Party Name</h5>
@Html.EditorFor(m => m.Job.JobMetaInsurance.ThirdPartyCausedName)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
</div>
<div>
<h5>
Why Third Parties Fault</h5>
<h5>Why Third Parties Fault</h5>
@Html.EditorFor(m => m.Job.JobMetaInsurance.ThirdPartyCausedWhy)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
@@ -133,8 +132,7 @@
</td>
</tr>
<tr>
<th>
Witnessed by (Name/Address)
<th>Witnessed by (Name/Address)
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaInsurance.WitnessesNamesAddresses)
@@ -153,8 +151,7 @@
</td>
</tr>
<tr>
<th>
Burglary/Theft - Method of Entry
<th>Burglary/Theft - Method of Entry
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaInsurance.BurglaryTheftMethodOfEntry)
@@ -173,8 +170,7 @@
</td>
</tr>
<tr>
<th style="width: 200px;">
Property Last Seen
<th style="width: 200px;">Property Last Seen
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaInsurance.PropertyLastSeenDate)
@@ -194,8 +190,7 @@
</td>
</tr>
<tr>
<th style="width: 200px;">
&nbsp;
<th style="width: 200px;">&nbsp;
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaInsurance.PoliceNotified)@Html.LabelFor(m => m.Job.JobMetaInsurance.PoliceNotified)
@@ -203,21 +198,18 @@
@AjaxHelpers.AjaxLoader()
<div id="Job_JobMetaInsurance_PoliceNotified_Details" style="padding-left: 25px;">
<div>
<h5>
Station</h5>
<h5>Station</h5>
@Html.EditorFor(m => m.Job.JobMetaInsurance.PoliceNotifiedStation)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
</div>
<div>
<h5>
Date</h5>
<h5>Date</h5>
@Html.EditorFor(m => m.Job.JobMetaInsurance.PoliceNotifiedDate)
@AjaxHelpers.AjaxLoader()
</div>
<div>
<h5>
Crime Report #</h5>
<h5>Crime Report #</h5>
@Html.EditorFor(m => m.Job.JobMetaInsurance.PoliceNotifiedCrimeReportNo)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
@@ -277,8 +269,7 @@
</td>
</tr>
<tr>
<th>
Action to Recover/Reduce Loss
<th>Action to Recover/Reduce Loss
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaInsurance.RecoverReduceAction)
@@ -297,8 +288,7 @@
</td>
</tr>
<tr>
<th>
Other Interested Parties
<th>Other Interested Parties
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaInsurance.OtherInterestedParties)
@@ -317,8 +307,7 @@
</td>
</tr>
<tr>
<th style="width: 200px;">
Date of Purchase
<th style="width: 200px;">Date of Purchase
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaInsurance.DateOfPurchase)
@@ -339,8 +328,214 @@
</td>
</tr>
<tr>
<th>
Claim Form Sent Date
<th>Claim Form Sent Date
</th>
<td>
@CommonHelpers.FriendlyDate(Model.Job.JobMetaInsurance.ClaimFormSentDate, "Not Sent", "Job_JobMetaInsurance_ClaimFormSentDate")
<span id="Job_JobMetaInsurance_ClaimFormSentUserId">@(string.IsNullOrEmpty(Model.Job.JobMetaInsurance.ClaimFormSentUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaInsurance.ClaimFormSentUser.ToString()))</span>
<script>
$(function () {
var updateUrl = '@(Url.Action(MVC.API.Job.Update(Model.Job.Id, null)))';
var jobOpenDate = '@(Model.Job.OpenedDate.ToJavascriptDateTime())';
document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Claim Form Sent Date', 'Job_JobMetaInsurance_ClaimFormSentDate', 'Job_JobMetaInsurance_ClaimFormSentUserId', 'InsuranceClaimFormSentDate', 'Not Sent', jobOpenDate, false);
});
</script>
</td>
</tr>
}
else
{
<tr>
<th style="width: 230px;">Date of Loss or Damage
</th>
<td>
@CommonHelpers.FriendlyDate(Model.Job.JobMetaInsurance.LossOrDamageDate, "Unknown", null)
</td>
</tr>
<tr>
<th>Event Location
</th>
<td>
@if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.EventLocation))
{
<span class="smallMessage">&lt;Unknown/None&gt;</span>
}
else
{
@Model.Job.JobMetaInsurance.EventLocation
}
</td>
</tr>
<tr>
<th>Description
</th>
<td>
@if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.Description))
{
<span class="smallMessage">&lt;None&gt;</span>
}
else
{
@Model.Job.JobMetaInsurance.Description
}
</td>
</tr>
<tr>
<th style="width: 200px;">Caused by Third Party
</th>
<td>
@if (Model.Job.JobMetaInsurance.ThirdPartyCaused)
{
<div id="Job_JobMetaInsurance_ThirdPartyCaused_Details" style="padding-left: 25px;">
<div>
<h5>Third Party Name</h5>
@if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.ThirdPartyCausedName))
{
<span class="smallMessage">&lt;Unknown&gt;</span>
}
else
{
@Model.Job.JobMetaInsurance.ThirdPartyCausedName
}
</div>
<div>
<h5>Why Third Parties Fault</h5>
@if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.ThirdPartyCausedWhy))
{
<span class="smallMessage">&lt;Unknown&gt;</span>
}
else
{
@Model.Job.JobMetaInsurance.ThirdPartyCausedWhy
}
</div>
</div>
}
else
{
<span class="smallMessage">&lt;Not Caused by Third Party&gt;</span>
}
</td>
</tr>
<tr>
<th>Witnessed by (Name/Address)
</th>
<td>
@if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.WitnessesNamesAddresses))
{
<span class="smallMessage">&lt;Unknown/None&gt;</span>
}
else
{
@Model.Job.JobMetaInsurance.WitnessesNamesAddresses
}
</td>
</tr>
<tr>
<th>Burglary/Theft - Method of Entry
</th>
<td>
@if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.BurglaryTheftMethodOfEntry))
{
<span class="smallMessage">&lt;Unknown/None&gt;</span>
}
else
{
@Model.Job.JobMetaInsurance.BurglaryTheftMethodOfEntry
}
</td>
</tr>
<tr>
<th style="width: 200px;">Property Last Seen
</th>
<td>
@CommonHelpers.FriendlyDate(Model.Job.JobMetaInsurance.PropertyLastSeenDate, "Unknown", null)
</td>
</tr>
<tr>
<th style="width: 200px;">&nbsp;
Police Notified
</th>
<td>
@if (Model.Job.JobMetaInsurance.PoliceNotified)
{
<div id="Job_JobMetaInsurance_PoliceNotified_Details" style="padding-left: 25px;">
<div>
<h5>Station</h5>
@if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.PoliceNotifiedStation))
{
<span class="smallMessage">&lt;Unknown&gt;</span>
}
else
{
@Model.Job.JobMetaInsurance.PoliceNotifiedStation
}
</div>
<div>
<h5>Date</h5>
@CommonHelpers.FriendlyDate(Model.Job.JobMetaInsurance.PoliceNotifiedDate, "Unknown", null)
</div>
<div>
<h5>Crime Report #</h5>
@if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.PoliceNotifiedCrimeReportNo))
{
<span class="smallMessage">&lt;Unknown&gt;</span>
}
else
{
@Model.Job.JobMetaInsurance.PoliceNotifiedCrimeReportNo
}
</div>
</div>
}
else
{
<span class="smallMessage">&lt;Not Notified&gt;</span>
}
</td>
</tr>
<tr>
<th>Action to Recover/Reduce Loss
</th>
<td>
@if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.RecoverReduceAction))
{
<span class="smallMessage">&lt;Unknown/None&gt;</span>
}
else
{
@Model.Job.JobMetaInsurance.RecoverReduceAction
}
</td>
</tr>
<tr>
<th>Other Interested Parties
</th>
<td>
@if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.OtherInterestedParties))
{
<span class="smallMessage">&lt;Unknown/None&gt;</span>
}
else
{
@Model.Job.JobMetaInsurance.OtherInterestedParties
}
</td>
</tr>
<tr>
<th style="width: 200px;">Date of Purchase
</th>
<td>
@CommonHelpers.FriendlyDate(Model.Job.JobMetaInsurance.DateOfPurchase, "Unknown", null)
</td>
</tr>
}
}
@if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.InsuranceClaimFormSent))
{
<tr>
<th>Claim Form Sent Date
</th>
<td>
@CommonHelpers.FriendlyDate(Model.Job.JobMetaInsurance.ClaimFormSentDate, "Not Sent", "Job_JobMetaInsurance_ClaimFormSentDate")
@@ -356,21 +551,34 @@
</td>
</tr>
}
<tr>
<th>
Insurance Claim
</th>
<td>
<div style="padding: 8px; text-align: center">
@if (Model.Job.JobMetaNonWarranty.IsInsuranceClaim)
{
@Html.ActionLinkButton("Remove Insurance Claim", MVC.API.Job.UpdateNonWarrantyIsInsuranceClaim(Model.Job.Id, false, true))
}
else
{
@Html.ActionLinkButton("Add Insurance Claim", MVC.API.Job.UpdateNonWarrantyIsInsuranceClaim(Model.Job.Id, true, true))
}
</div>
</td>
</tr>
else
{
<tr>
<th>Claim Form Sent Date
</th>
<td>
@CommonHelpers.FriendlyDate(Model.Job.JobMetaInsurance.ClaimFormSentDate, "Not Sent", "Job_JobMetaInsurance_ClaimFormSentDate")
<span id="Job_JobMetaInsurance_ClaimFormSentUserId">@(string.IsNullOrEmpty(Model.Job.JobMetaInsurance.ClaimFormSentUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaInsurance.ClaimFormSentUser.ToString()))</span>
</td>
</tr>
}
@if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.IsInsuranceClaim))
{
<tr>
<th>Insurance Claim
</th>
<td>
<div style="padding: 8px; text-align: center">
@if (Model.Job.JobMetaNonWarranty.IsInsuranceClaim)
{
@Html.ActionLinkButton("Remove Insurance Claim", MVC.API.Job.UpdateNonWarrantyIsInsuranceClaim(Model.Job.Id, false, true))
}
else
{
@Html.ActionLinkButton("Add Insurance Claim", MVC.API.Job.UpdateNonWarrantyIsInsuranceClaim(Model.Job.Id, true, true))
}
</div>
</td>
</tr>
}
</table>
File diff suppressed because it is too large Load Diff
@@ -1,18 +1,26 @@
@model Disco.Web.Models.Job.ShowModel
@using Disco.Models.Repository;
@{
Authorization.Require(Claims.Job.Show);
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
}
@switch (Model.Job.JobTypeId)
{
case JobType.JobTypeIds.HWar:
@Html.Partial(MVC.Job.Views.JobParts.Warranty);
if (Authorization.Has(Claims.Job.ShowWarranty))
{
@Html.Partial(MVC.Job.Views.JobParts.Warranty);
}
break;
case JobType.JobTypeIds.HNWar:
@Html.Partial(MVC.Job.Views.JobParts.NonWarranty);
break;
case JobType.JobTypeIds.UMgmt:
@Html.Partial(MVC.Job.Views.JobParts.Flags);
if (Authorization.Has(Claims.Job.ShowFlags))
{
@Html.Partial(MVC.Job.Views.JobParts.Flags);
}
break;
default:
break;
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -33,12 +33,14 @@ namespace Disco.Web.Views.Job.JobParts
#line default
#line hidden
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/Job/JobParts/JobMetaAdditions.cshtml")]
public partial class JobMetaAdditions : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
public partial class JobMetaAdditions : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.ShowModel>
{
public JobMetaAdditions()
{
@@ -48,6 +50,8 @@ namespace Disco.Web.Views.Job.JobParts
#line 3 "..\..\Views\Job\JobParts\JobMetaAdditions.cshtml"
Authorization.Require(Claims.Job.Show);
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
@@ -56,24 +60,27 @@ namespace Disco.Web.Views.Job.JobParts
WriteLiteral("\r\n");
#line 6 "..\..\Views\Job\JobParts\JobMetaAdditions.cshtml"
#line 8 "..\..\Views\Job\JobParts\JobMetaAdditions.cshtml"
switch (Model.Job.JobTypeId)
{
case JobType.JobTypeIds.HWar:
if (Authorization.Has(Claims.Job.ShowWarranty))
{
#line default
#line hidden
#line 9 "..\..\Views\Job\JobParts\JobMetaAdditions.cshtml"
Write(Html.Partial(MVC.Job.Views.JobParts.Warranty));
#line 13 "..\..\Views\Job\JobParts\JobMetaAdditions.cshtml"
Write(Html.Partial(MVC.Job.Views.JobParts.Warranty));
#line default
#line hidden
#line 9 "..\..\Views\Job\JobParts\JobMetaAdditions.cshtml"
;
#line 13 "..\..\Views\Job\JobParts\JobMetaAdditions.cshtml"
;
}
break;
case JobType.JobTypeIds.HNWar:
@@ -81,31 +88,34 @@ WriteLiteral("\r\n");
#line default
#line hidden
#line 12 "..\..\Views\Job\JobParts\JobMetaAdditions.cshtml"
#line 17 "..\..\Views\Job\JobParts\JobMetaAdditions.cshtml"
Write(Html.Partial(MVC.Job.Views.JobParts.NonWarranty));
#line default
#line hidden
#line 12 "..\..\Views\Job\JobParts\JobMetaAdditions.cshtml"
#line 17 "..\..\Views\Job\JobParts\JobMetaAdditions.cshtml"
;
break;
case JobType.JobTypeIds.UMgmt:
if (Authorization.Has(Claims.Job.ShowFlags))
{
#line default
#line hidden
#line 15 "..\..\Views\Job\JobParts\JobMetaAdditions.cshtml"
Write(Html.Partial(MVC.Job.Views.JobParts.Flags));
#line 22 "..\..\Views\Job\JobParts\JobMetaAdditions.cshtml"
Write(Html.Partial(MVC.Job.Views.JobParts.Flags));
#line default
#line hidden
#line 15 "..\..\Views\Job\JobParts\JobMetaAdditions.cshtml"
;
#line 22 "..\..\Views\Job\JobParts\JobMetaAdditions.cshtml"
;
}
break;
default:
break;
+38 -15
View File
@@ -1,16 +1,39 @@
@model Disco.Web.Models.Job.ShowModel
<div id="jobDetailTab-Components" class="jobPart">
@Html.Partial(MVC.Job.Views.JobParts.Components)
</div>
<div id="jobDetailTab-NonWarrantyFinance" class="jobPart">
@Html.Partial(MVC.Job.Views.JobParts.NonWarrantyFinance)
</div>
<div id="jobDetailTab-NonWarrantyRepairs" class="jobPart">
@Html.Partial(MVC.Job.Views.JobParts.Repairs)
</div>
<div id="jobDetailTab-NonWarrantyInsurance" class="jobPart">
@Html.Partial(MVC.Job.Views.JobParts.Insurance)
</div>
<script type="text/javascript">
$('#jobDetailTabItems').append('<li><a href="#jobDetailTab-Components">Components</a></li><li><a href="#jobDetailTab-NonWarrantyFinance">Finance</a></li><li><a href="#jobDetailTab-NonWarrantyRepairs">Repairs</a></li><li><a href="#jobDetailTab-NonWarrantyInsurance">Insurance</a></li>');
</script>
@{
Authorization.Require(Claims.Job.Show);
}
@if (Authorization.Has(Claims.Job.ShowNonWarrantyComponents))
{
<div id="jobDetailTab-Components" class="jobPart">
@Html.Partial(MVC.Job.Views.JobParts.Components)
</div>
}
@if (Authorization.Has(Claims.Job.ShowNonWarrantyFinance))
{
<div id="jobDetailTab-NonWarrantyFinance" class="jobPart">
@Html.Partial(MVC.Job.Views.JobParts.NonWarrantyFinance)
</div>
}
@if (Authorization.Has(Claims.Job.ShowNonWarrantyRepairs))
{
<div id="jobDetailTab-NonWarrantyRepairs" class="jobPart">
@Html.Partial(MVC.Job.Views.JobParts.Repairs)
</div>
}
@if (Authorization.Has(Claims.Job.ShowNonWarrantyInsurance))
{
<div id="jobDetailTab-NonWarrantyInsurance" class="jobPart">
@Html.Partial(MVC.Job.Views.JobParts.Insurance)
</div>
}
@if (Authorization.HasAny(Claims.Job.ShowNonWarrantyComponents, Claims.Job.ShowNonWarrantyFinance, Claims.Job.ShowNonWarrantyRepairs, Claims.Job.ShowNonWarrantyInsurance))
{
<script type="text/javascript">
var addTabItems = '';
@if (Authorization.Has(Claims.Job.ShowNonWarrantyComponents)){<text>addTabItems += '<li><a href="#jobDetailTab-Components">Components</a></li>';</text>}
@if (Authorization.Has(Claims.Job.ShowNonWarrantyFinance)){<text>addTabItems += '<li><a href="#jobDetailTab-NonWarrantyFinance">Finance</a></li>';</text>}
@if (Authorization.Has(Claims.Job.ShowNonWarrantyRepairs)){<text>addTabItems += '<li><a href="#jobDetailTab-NonWarrantyRepairs">Repairs</a></li>';</text>}
@if (Authorization.Has(Claims.Job.ShowNonWarrantyInsurance)){<text>addTabItems += '<li><a href="#jobDetailTab-NonWarrantyInsurance">Insurance</a></li>';</text>}
$('#jobDetailTabItems').append(addTabItems);
</script>
}
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,19 +28,39 @@ namespace Disco.Web.Views.Job.JobParts
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
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/Job/JobParts/NonWarranty.cshtml")]
public partial class NonWarranty : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
public partial class NonWarranty : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.ShowModel>
{
public NonWarranty()
{
}
public override void Execute()
{
WriteLiteral("<div");
#line 2 "..\..\Views\Job\JobParts\NonWarranty.cshtml"
Authorization.Require(Claims.Job.Show);
#line default
#line hidden
WriteLiteral("\r\n");
#line 5 "..\..\Views\Job\JobParts\NonWarranty.cshtml"
if (Authorization.Has(Claims.Job.ShowNonWarrantyComponents))
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" id=\"jobDetailTab-Components\"");
@@ -48,16 +68,33 @@ WriteLiteral(" class=\"jobPart\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
WriteLiteral(" ");
#line 3 "..\..\Views\Job\JobParts\NonWarranty.cshtml"
Write(Html.Partial(MVC.Job.Views.JobParts.Components));
#line 8 "..\..\Views\Job\JobParts\NonWarranty.cshtml"
Write(Html.Partial(MVC.Job.Views.JobParts.Components));
#line default
#line hidden
WriteLiteral("\r\n</div>\r\n<div");
WriteLiteral("\r\n </div>\r\n");
#line 10 "..\..\Views\Job\JobParts\NonWarranty.cshtml"
}
#line default
#line hidden
#line 11 "..\..\Views\Job\JobParts\NonWarranty.cshtml"
if (Authorization.Has(Claims.Job.ShowNonWarrantyFinance))
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" id=\"jobDetailTab-NonWarrantyFinance\"");
@@ -65,16 +102,33 @@ WriteLiteral(" class=\"jobPart\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
WriteLiteral(" ");
#line 6 "..\..\Views\Job\JobParts\NonWarranty.cshtml"
Write(Html.Partial(MVC.Job.Views.JobParts.NonWarrantyFinance));
#line 14 "..\..\Views\Job\JobParts\NonWarranty.cshtml"
Write(Html.Partial(MVC.Job.Views.JobParts.NonWarrantyFinance));
#line default
#line hidden
WriteLiteral("\r\n</div>\r\n<div");
WriteLiteral("\r\n </div>\r\n");
#line 16 "..\..\Views\Job\JobParts\NonWarranty.cshtml"
}
#line default
#line hidden
#line 17 "..\..\Views\Job\JobParts\NonWarranty.cshtml"
if (Authorization.Has(Claims.Job.ShowNonWarrantyRepairs))
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" id=\"jobDetailTab-NonWarrantyRepairs\"");
@@ -82,16 +136,33 @@ WriteLiteral(" class=\"jobPart\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
WriteLiteral(" ");
#line 9 "..\..\Views\Job\JobParts\NonWarranty.cshtml"
Write(Html.Partial(MVC.Job.Views.JobParts.Repairs));
#line 20 "..\..\Views\Job\JobParts\NonWarranty.cshtml"
Write(Html.Partial(MVC.Job.Views.JobParts.Repairs));
#line default
#line hidden
WriteLiteral("\r\n</div>\r\n<div");
WriteLiteral("\r\n </div>\r\n");
#line 22 "..\..\Views\Job\JobParts\NonWarranty.cshtml"
}
#line default
#line hidden
#line 23 "..\..\Views\Job\JobParts\NonWarranty.cshtml"
if (Authorization.Has(Claims.Job.ShowNonWarrantyInsurance))
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" id=\"jobDetailTab-NonWarrantyInsurance\"");
@@ -99,24 +170,134 @@ WriteLiteral(" class=\"jobPart\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
WriteLiteral(" ");
#line 12 "..\..\Views\Job\JobParts\NonWarranty.cshtml"
Write(Html.Partial(MVC.Job.Views.JobParts.Insurance));
#line 26 "..\..\Views\Job\JobParts\NonWarranty.cshtml"
Write(Html.Partial(MVC.Job.Views.JobParts.Insurance));
#line default
#line hidden
WriteLiteral("\r\n</div>\r\n<script");
WriteLiteral("\r\n </div>\r\n");
#line 28 "..\..\Views\Job\JobParts\NonWarranty.cshtml"
}
#line default
#line hidden
#line 29 "..\..\Views\Job\JobParts\NonWarranty.cshtml"
if (Authorization.HasAny(Claims.Job.ShowNonWarrantyComponents, Claims.Job.ShowNonWarrantyFinance, Claims.Job.ShowNonWarrantyRepairs, Claims.Job.ShowNonWarrantyInsurance))
{
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$('#jobDetailTabItems').append('<li><a href=""#jobDetailTab-Components"">Components</a></li><li><a href=""#jobDetailTab-NonWarrantyFinance"">Finance</a></li><li><a href=""#jobDetailTab-NonWarrantyRepairs"">Repairs</a></li><li><a href=""#jobDetailTab-NonWarrantyInsurance"">Insurance</a></li>');
</script>
");
WriteLiteral(">\r\n var addTabItems = \'\';\r\n");
#line 33 "..\..\Views\Job\JobParts\NonWarranty.cshtml"
#line default
#line hidden
#line 33 "..\..\Views\Job\JobParts\NonWarranty.cshtml"
if (Authorization.Has(Claims.Job.ShowNonWarrantyComponents)){
#line default
#line hidden
WriteLiteral("addTabItems += \'<li><a");
WriteLiteral(" href=\"#jobDetailTab-Components\"");
WriteLiteral(">Components</a></li>\';");
#line 33 "..\..\Views\Job\JobParts\NonWarranty.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 34 "..\..\Views\Job\JobParts\NonWarranty.cshtml"
if (Authorization.Has(Claims.Job.ShowNonWarrantyFinance)){
#line default
#line hidden
WriteLiteral("addTabItems += \'<li><a");
WriteLiteral(" href=\"#jobDetailTab-NonWarrantyFinance\"");
WriteLiteral(">Finance</a></li>\';");
#line 34 "..\..\Views\Job\JobParts\NonWarranty.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 35 "..\..\Views\Job\JobParts\NonWarranty.cshtml"
if (Authorization.Has(Claims.Job.ShowNonWarrantyRepairs)){
#line default
#line hidden
WriteLiteral("addTabItems += \'<li><a");
WriteLiteral(" href=\"#jobDetailTab-NonWarrantyRepairs\"");
WriteLiteral(">Repairs</a></li>\';");
#line 35 "..\..\Views\Job\JobParts\NonWarranty.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 36 "..\..\Views\Job\JobParts\NonWarranty.cshtml"
if (Authorization.Has(Claims.Job.ShowNonWarrantyInsurance)){
#line default
#line hidden
WriteLiteral("addTabItems += \'<li><a");
WriteLiteral(" href=\"#jobDetailTab-NonWarrantyInsurance\"");
WriteLiteral(">Insurance</a></li>\';");
#line 36 "..\..\Views\Job\JobParts\NonWarranty.cshtml"
}
#line default
#line hidden
WriteLiteral(" $(\'#jobDetailTabItems\').append(addTabItems);\r\n </script>\r\n");
#line 39 "..\..\Views\Job\JobParts\NonWarranty.cshtml"
}
#line default
#line hidden
}
}
}
@@ -1,6 +1,8 @@
@model Disco.Web.Models.Job.ShowModel
@{
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
Authorization.Require(Claims.Job.ShowNonWarrantyFinance);
}
<table id="jobNonWarrantyFinance">
<tr>
@@ -43,48 +45,62 @@
<th>Purchase Order Reference
</th>
<td>
@Html.TextBoxFor(m => m.Job.JobMetaNonWarranty.PurchaseOrderReference)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var $purchaseOrderReference = $('#Job_JobMetaNonWarranty_PurchaseOrderReference');
var $ajaxSave = $purchaseOrderReference.next('.ajaxSave');
$purchaseOrderReference
.watermark('No Reference')
.focus(function () { $purchaseOrderReference.select() })
.keydown(function (e) {
$ajaxSave.show();
if (e.which == 13) {
$(this).blur();
}
}).blur(function () {
$ajaxSave.hide();
})
.change(function () {
$ajaxSave.hide();
$ajaxLoading = $ajaxSave.next('.ajaxLoading').show();
var data = { PurchaseOrderReference: $purchaseOrderReference.val() };
$.ajax({
url: '@Url.Action(MVC.API.Job.UpdateNonWarrantyPurchaseOrderReference(Model.Job.Id, null))',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
} else {
$ajaxLoading.hide();
alert('Unable to update purchase order reference: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update purchase order reference: ' + textStatus);
$ajaxLoading.hide();
@if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.PurchaseOrderReference))
{
@Html.TextBoxFor(m => m.Job.JobMetaNonWarranty.PurchaseOrderReference)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var $purchaseOrderReference = $('#Job_JobMetaNonWarranty_PurchaseOrderReference');
var $ajaxSave = $purchaseOrderReference.next('.ajaxSave');
$purchaseOrderReference
.watermark('No Reference')
.focus(function () { $purchaseOrderReference.select() })
.keydown(function (e) {
$ajaxSave.show();
if (e.which == 13) {
$(this).blur();
}
}).blur(function () {
$ajaxSave.hide();
})
.change(function () {
$ajaxSave.hide();
$ajaxLoading = $ajaxSave.next('.ajaxLoading').show();
var data = { PurchaseOrderReference: $purchaseOrderReference.val() };
$.ajax({
url: '@Url.Action(MVC.API.Job.UpdateNonWarrantyPurchaseOrderReference(Model.Job.Id, null))',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
} else {
$ajaxLoading.hide();
alert('Unable to update purchase order reference: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update purchase order reference: ' + textStatus);
$ajaxLoading.hide();
}
});
});
});
});
</script>
</script>
}
else
{
if (string.IsNullOrWhiteSpace(Model.Job.JobMetaNonWarranty.PurchaseOrderReference))
{
<span class="smallMessage">&lt;Unknown/None&gt;</span>
}
else
{
@Model.Job.JobMetaNonWarranty.PurchaseOrderReference
}
}
</td>
</tr>
<tr>
@@ -107,15 +123,21 @@
</tr>
</table>
<script>
$(function(){
$(function () {
var updateUrl = '@(Url.Action(MVC.API.Job.Update(Model.Job.Id, null)))';
var jobOpenDate = '@(Model.Job.OpenedDate.ToJavascriptDateTime())';
document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Accounting Charge Required', 'Job_JobMetaNonWarranty_AccountingChargeRequiredDate', 'Job_JobMetaNonWarranty_AccountingChargeRequiredUser', 'NonWarrantyAccountingChargeRequired', 'Not Required', jobOpenDate, false);
document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Accounting Charge Added', 'Job_JobMetaNonWarranty_AccountingChargeAddedDate', 'Job_JobMetaNonWarranty_AccountingChargeAddedUser', 'NonWarrantyAccountingChargeAdded', 'Not Added', jobOpenDate, false);
document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Accounting Charge Paid', 'Job_JobMetaNonWarranty_AccountingChargePaidDate', 'Job_JobMetaNonWarranty_AccountingChargePaidUser', 'NonWarrantyAccountingChargePaid', 'Not Paid', jobOpenDate, false);
document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Purchase Order Raised', 'Job_JobMetaNonWarranty_PurchaseOrderRaisedDate', 'Job_JobMetaNonWarranty_PurchaseOrderRaisedUser', 'NonWarrantyPurchaseOrderRaised', 'Not Raised', jobOpenDate, true);
document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Purchase Order Sent', 'Job_JobMetaNonWarranty_PurchaseOrderSentDate', 'Job_JobMetaNonWarranty_PurchaseOrderSentUser', 'NonWarrantyPurchaseOrderSent', 'Not Sent', jobOpenDate, true);
document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Invoice Received', 'Job_JobMetaNonWarranty_InvoiceReceivedDate', 'Job_JobMetaNonWarranty_InvoiceReceivedUser', 'NonWarrantyInvoiceReceived', 'Not Received', jobOpenDate, true);
@if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.AccountingChargeRequired))
{<text>document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Accounting Charge Required', 'Job_JobMetaNonWarranty_AccountingChargeRequiredDate', 'Job_JobMetaNonWarranty_AccountingChargeRequiredUser', 'NonWarrantyAccountingChargeRequired', 'Not Required', jobOpenDate, false);</text>}
@if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.AccountingChargeAdded))
{<text>document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Accounting Charge Added', 'Job_JobMetaNonWarranty_AccountingChargeAddedDate', 'Job_JobMetaNonWarranty_AccountingChargeAddedUser', 'NonWarrantyAccountingChargeAdded', 'Not Added', jobOpenDate, false);</text>}
@if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.AccountingChargePaid))
{<text>document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Accounting Charge Paid', 'Job_JobMetaNonWarranty_AccountingChargePaidDate', 'Job_JobMetaNonWarranty_AccountingChargePaidUser', 'NonWarrantyAccountingChargePaid', 'Not Paid', jobOpenDate, false);</text>}
@if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.PurchaseOrderRaised))
{<text>document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Purchase Order Raised', 'Job_JobMetaNonWarranty_PurchaseOrderRaisedDate', 'Job_JobMetaNonWarranty_PurchaseOrderRaisedUser', 'NonWarrantyPurchaseOrderRaised', 'Not Raised', jobOpenDate, true);</text>}
@if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.PurchaseOrderSent))
{<text>document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Purchase Order Sent', 'Job_JobMetaNonWarranty_PurchaseOrderSentDate', 'Job_JobMetaNonWarranty_PurchaseOrderSentUser', 'NonWarrantyPurchaseOrderSent', 'Not Sent', jobOpenDate, true);</text>}
@if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.InvoiceReceived))
{<text>document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Invoice Received', 'Job_JobMetaNonWarranty_InvoiceReceivedDate', 'Job_JobMetaNonWarranty_InvoiceReceivedUser', 'NonWarrantyInvoiceReceived', 'Not Received', jobOpenDate, true);</text>}
});
</script>
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Views.Job.JobParts
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
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/Job/JobParts/NonWarrantyFinance.cshtml")]
public partial class NonWarrantyFinance : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
public partial class NonWarrantyFinance : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.ShowModel>
{
public NonWarrantyFinance()
{
@@ -45,6 +47,8 @@ namespace Disco.Web.Views.Job.JobParts
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
Authorization.Require(Claims.Job.ShowNonWarrantyFinance);
#line default
#line hidden
@@ -61,7 +65,7 @@ WriteLiteral(">Accounting Charge Required\r\n </th>\r\n <td>\r\n")
WriteLiteral(" ");
#line 10 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 12 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.AccountingChargeRequiredDate, "Not Required", "Job_JobMetaNonWarranty_AccountingChargeRequiredDate"));
@@ -74,7 +78,7 @@ WriteLiteral(" id=\"Job_JobMetaNonWarranty_AccountingChargeRequiredUser\"");
WriteLiteral(">");
#line 11 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 13 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargeRequiredUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargeRequiredUser.ToString()));
@@ -85,7 +89,7 @@ WriteLiteral("</span>\r\n");
WriteLiteral(" ");
#line 12 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 14 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -100,7 +104,7 @@ WriteLiteral(">Accounting Charge Added\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 19 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 21 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.AccountingChargeAddedDate, "Not Added", "Job_JobMetaNonWarranty_AccountingChargeAddedDate"));
@@ -113,7 +117,7 @@ WriteLiteral(" id=\"Job_JobMetaNonWarranty_AccountingChargeAddedUser\"");
WriteLiteral(">");
#line 20 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 22 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargeAddedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargeAddedUser.ToString()));
@@ -124,7 +128,7 @@ WriteLiteral("</span>\r\n");
WriteLiteral(" ");
#line 21 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 23 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -139,7 +143,7 @@ WriteLiteral(">Accounting Charge Paid\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 28 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 30 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.AccountingChargePaidDate, "Not Paid", "Job_JobMetaNonWarranty_AccountingChargePaidDate"));
@@ -152,7 +156,7 @@ WriteLiteral(" id=\"Job_JobMetaNonWarranty_AccountingChargePaidUser\"");
WriteLiteral(">");
#line 29 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 31 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargePaidUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargePaidUser.ToString()));
@@ -163,7 +167,7 @@ WriteLiteral("</span>\r\n");
WriteLiteral(" ");
#line 30 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 32 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -178,7 +182,7 @@ WriteLiteral(">Purchase Order Raised\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 37 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 39 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.PurchaseOrderRaisedDate, "Not Raised", "Job_JobMetaNonWarranty_PurchaseOrderRaisedDate"));
@@ -191,7 +195,7 @@ WriteLiteral(" id=\"Job_JobMetaNonWarranty_PurchaseOrderRaisedUser\"");
WriteLiteral(">");
#line 38 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 40 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.PurchaseOrderRaisedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.PurchaseOrderRaisedUser.ToString()));
@@ -202,7 +206,7 @@ WriteLiteral("</span>\r\n");
WriteLiteral(" ");
#line 39 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 41 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -211,93 +215,159 @@ WriteLiteral(" ");
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>Purchase Order Reference\r\n " +
" </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 46 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Html.TextBoxFor(m => m.Job.JobMetaNonWarranty.PurchaseOrderReference));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 47 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxSave());
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 48 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 48 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.PurchaseOrderReference))
{
#line default
#line hidden
#line 50 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Html.TextBoxFor(m => m.Job.JobMetaNonWarranty.PurchaseOrderReference));
#line default
#line hidden
WriteLiteral("\r\n <script");
#line 50 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line default
#line hidden
#line 51 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxSave());
#line default
#line hidden
#line 51 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line default
#line hidden
#line 52 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 52 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
var $purchaseOrderReference = $('#Job_JobMetaNonWarranty_PurchaseOrderReference');
var $ajaxSave = $purchaseOrderReference.next('.ajaxSave');
$purchaseOrderReference
.watermark('No Reference')
.focus(function () { $purchaseOrderReference.select() })
.keydown(function (e) {
$ajaxSave.show();
if (e.which == 13) {
$(this).blur();
}
}).blur(function () {
$ajaxSave.hide();
})
.change(function () {
$ajaxSave.hide();
$ajaxLoading = $ajaxSave.next('.ajaxLoading').show();
var data = { PurchaseOrderReference: $purchaseOrderReference.val() };
$.ajax({
url: '");
$(function () {
var $purchaseOrderReference = $('#Job_JobMetaNonWarranty_PurchaseOrderReference');
var $ajaxSave = $purchaseOrderReference.next('.ajaxSave');
$purchaseOrderReference
.watermark('No Reference')
.focus(function () { $purchaseOrderReference.select() })
.keydown(function (e) {
$ajaxSave.show();
if (e.which == 13) {
$(this).blur();
}
}).blur(function () {
$ajaxSave.hide();
})
.change(function () {
$ajaxSave.hide();
$ajaxLoading = $ajaxSave.next('.ajaxLoading').show();
var data = { PurchaseOrderReference: $purchaseOrderReference.val() };
$.ajax({
url: '");
#line 69 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyPurchaseOrderReference(Model.Job.Id, null)));
#line 73 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyPurchaseOrderReference(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral(@"',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
} else {
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
} else {
$ajaxLoading.hide();
alert('Unable to update purchase order reference: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update purchase order reference: ' + textStatus);
$ajaxLoading.hide();
alert('Unable to update purchase order reference: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update purchase order reference: ' + textStatus);
$ajaxLoading.hide();
}
});
});
});
});
</script>
</td>
</tr>
<tr>
<th");
</script>
");
#line 92 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
}
else
{
if (string.IsNullOrWhiteSpace(Model.Job.JobMetaNonWarranty.PurchaseOrderReference))
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;Unknown/None&gt;</span>\r\n");
#line 98 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
}
else
{
#line default
#line hidden
#line 101 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Model.Job.JobMetaNonWarranty.PurchaseOrderReference);
#line default
#line hidden
#line 101 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
}
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th");
WriteLiteral(" style=\"width: 200px;\"");
@@ -306,7 +376,7 @@ WriteLiteral(">Purchase Order Sent\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 94 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 110 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.PurchaseOrderSentDate, "Not Sent", "Job_JobMetaNonWarranty_PurchaseOrderSentDate"));
@@ -319,7 +389,7 @@ WriteLiteral(" id=\"Job_JobMetaNonWarranty_PurchaseOrderSentUser\"");
WriteLiteral(">");
#line 95 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 111 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.PurchaseOrderSentUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.PurchaseOrderSentUser.ToString()));
@@ -330,7 +400,7 @@ WriteLiteral("</span>\r\n");
WriteLiteral(" ");
#line 96 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 112 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -345,7 +415,7 @@ WriteLiteral(">Invoice Received\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 103 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 119 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.InvoiceReceivedDate, "Not Received", "Job_JobMetaNonWarranty_InvoiceReceivedDate"));
@@ -358,7 +428,7 @@ WriteLiteral(" id=\"Job_JobMetaNonWarranty_InvoiceReceivedUser\"");
WriteLiteral(">");
#line 104 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 120 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.InvoiceReceivedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.InvoiceReceivedUser.ToString()));
@@ -369,17 +439,17 @@ WriteLiteral("</span>\r\n");
WriteLiteral(" ");
#line 105 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 121 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n</table>\r\n<script>\r\n $(function(){\r\n var up" +
"dateUrl = \'");
WriteLiteral("\r\n </td>\r\n </tr>\r\n</table>\r\n<script>\r\n $(function () {\r\n var " +
"updateUrl = \'");
#line 111 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 127 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Url.Action(MVC.API.Job.Update(Model.Job.Id, null)));
@@ -388,34 +458,139 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n</table>\r\n<script>\r\n $(fu
WriteLiteral("\';\r\n var jobOpenDate = \'");
#line 112 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 128 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Model.Job.OpenedDate.ToJavascriptDateTime());
#line default
#line hidden
WriteLiteral("\';\r\n\r\n document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, \'Account" +
"ing Charge Required\', \'Job_JobMetaNonWarranty_AccountingChargeRequiredDate\', \'Jo" +
"b_JobMetaNonWarranty_AccountingChargeRequiredUser\', \'NonWarrantyAccountingCharge" +
"Required\', \'Not Required\', jobOpenDate, false);\r\n document.DiscoFunctions" +
".DateDialogCreateUpdater(updateUrl, \'Accounting Charge Added\', \'Job_JobMetaNonWa" +
"rranty_AccountingChargeAddedDate\', \'Job_JobMetaNonWarranty_AccountingChargeAdded" +
"User\', \'NonWarrantyAccountingChargeAdded\', \'Not Added\', jobOpenDate, false);\r\n " +
" document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, \'Accounting Cha" +
"rge Paid\', \'Job_JobMetaNonWarranty_AccountingChargePaidDate\', \'Job_JobMetaNonWar" +
"ranty_AccountingChargePaidUser\', \'NonWarrantyAccountingChargePaid\', \'Not Paid\', " +
"jobOpenDate, false);\r\n document.DiscoFunctions.DateDialogCreateUpdater(up" +
"dateUrl, \'Purchase Order Raised\', \'Job_JobMetaNonWarranty_PurchaseOrderRaisedDat" +
"e\', \'Job_JobMetaNonWarranty_PurchaseOrderRaisedUser\', \'NonWarrantyPurchaseOrderR" +
"aised\', \'Not Raised\', jobOpenDate, true);\r\n document.DiscoFunctions.DateD" +
"ialogCreateUpdater(updateUrl, \'Purchase Order Sent\', \'Job_JobMetaNonWarranty_Pur" +
"chaseOrderSentDate\', \'Job_JobMetaNonWarranty_PurchaseOrderSentUser\', \'NonWarrant" +
"yPurchaseOrderSent\', \'Not Sent\', jobOpenDate, true);\r\n document.DiscoFunc" +
"tions.DateDialogCreateUpdater(updateUrl, \'Invoice Received\', \'Job_JobMetaNonWarr" +
"anty_InvoiceReceivedDate\', \'Job_JobMetaNonWarranty_InvoiceReceivedUser\', \'NonWar" +
"rantyInvoiceReceived\', \'Not Received\', jobOpenDate, true);\r\n });\r\n</script>\r\n" +
WriteLiteral("\';\r\n\r\n");
#line 130 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line default
#line hidden
#line 130 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.AccountingChargeRequired))
{
#line default
#line hidden
WriteLiteral(@"document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Accounting Charge Required', 'Job_JobMetaNonWarranty_AccountingChargeRequiredDate', 'Job_JobMetaNonWarranty_AccountingChargeRequiredUser', 'NonWarrantyAccountingChargeRequired', 'Not Required', jobOpenDate, false);");
#line 131 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 132 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.AccountingChargeAdded))
{
#line default
#line hidden
WriteLiteral(@"document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Accounting Charge Added', 'Job_JobMetaNonWarranty_AccountingChargeAddedDate', 'Job_JobMetaNonWarranty_AccountingChargeAddedUser', 'NonWarrantyAccountingChargeAdded', 'Not Added', jobOpenDate, false);");
#line 133 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 134 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.AccountingChargePaid))
{
#line default
#line hidden
WriteLiteral("document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, \'Accounting Charge Pai" +
"d\', \'Job_JobMetaNonWarranty_AccountingChargePaidDate\', \'Job_JobMetaNonWarranty_A" +
"ccountingChargePaidUser\', \'NonWarrantyAccountingChargePaid\', \'Not Paid\', jobOpen" +
"Date, false);");
#line 135 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 136 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.PurchaseOrderRaised))
{
#line default
#line hidden
WriteLiteral("document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, \'Purchase Order Raised" +
"\', \'Job_JobMetaNonWarranty_PurchaseOrderRaisedDate\', \'Job_JobMetaNonWarranty_Pur" +
"chaseOrderRaisedUser\', \'NonWarrantyPurchaseOrderRaised\', \'Not Raised\', jobOpenDa" +
"te, true);");
#line 137 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 138 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.PurchaseOrderSent))
{
#line default
#line hidden
WriteLiteral("document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, \'Purchase Order Sent\'," +
" \'Job_JobMetaNonWarranty_PurchaseOrderSentDate\', \'Job_JobMetaNonWarranty_Purchas" +
"eOrderSentUser\', \'NonWarrantyPurchaseOrderSent\', \'Not Sent\', jobOpenDate, true);" +
"");
#line 139 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 140 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.InvoiceReceived))
{
#line default
#line hidden
WriteLiteral("document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, \'Invoice Received\', \'J" +
"ob_JobMetaNonWarranty_InvoiceReceivedDate\', \'Job_JobMetaNonWarranty_InvoiceRecei" +
"vedUser\', \'NonWarrantyInvoiceReceived\', \'Not Received\', jobOpenDate, true);");
#line 141 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
}
#line default
#line hidden
WriteLiteral(" });\r\n</script>\r\n");
}
}
}
+53 -33
View File
@@ -1,59 +1,77 @@
@model Disco.Web.Models.Job.ShowModel
@{
Authorization.Require(Claims.Job.ShowNonWarrantyFinance);
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
}
<table id="jobNonWarrantyRepairs">
<tr>
<th style="width: 200px;">
Repairer Name
<th style="width: 200px;">Repairer Name
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaNonWarranty.RepairerName)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#Job_JobMetaNonWarranty_RepairerName'),
'Unknown',
'@Url.Action(MVC.API.Job.UpdateNonWarrantyRepairerName(Model.Job.Id, null))',
@if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.RepairerName))
{
@Html.EditorFor(m => m.Job.JobMetaNonWarranty.RepairerName)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#Job_JobMetaNonWarranty_RepairerName'),
'Unknown',
'@Url.Action(MVC.API.Job.UpdateNonWarrantyRepairerName(Model.Job.Id, null))',
'RepairerName'
);
});
</script>
});
</script>
}
else
{
if (string.IsNullOrWhiteSpace(Model.Job.JobMetaNonWarranty.RepairerName))
{<span class="smallMessage">&lt;Unknown/None&gt;</span>}
else
{@Model.Job.JobMetaNonWarranty.RepairerName}
}
</td>
</tr>
<tr>
<th style="width: 200px;">
Repair Logged
<th style="width: 200px;">Repair Logged
</th>
<td>
@CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.RepairerLoggedDate, "Not Logged", "Job_JobMetaNonWarranty_RepairerLoggedDate")
</td>
</tr>
<tr>
<th style="width: 200px;">
Repair Reference
<th style="width: 200px;">Repair Reference
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaNonWarranty.RepairerReference)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#Job_JobMetaNonWarranty_RepairerReference'),
'Unknown',
'@Url.Action(MVC.API.Job.UpdateNonWarrantyRepairerReference(Model.Job.Id, null))',
@if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.RepairerReference))
{
@Html.EditorFor(m => m.Job.JobMetaNonWarranty.RepairerReference)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#Job_JobMetaNonWarranty_RepairerReference'),
'Unknown',
'@Url.Action(MVC.API.Job.UpdateNonWarrantyRepairerReference(Model.Job.Id, null))',
'RepairerReference'
);
});
</script>
});
</script>
}
else
{
if (string.IsNullOrWhiteSpace(Model.Job.JobMetaNonWarranty.RepairerReference))
{<span class="smallMessage">&lt;Unknown/None&gt;</span>}
else
{@Model.Job.JobMetaNonWarranty.RepairerReference}
}
</td>
</tr>
<tr>
<th style="width: 200px;">
Repair Completed
<th style="width: 200px;">Repair Completed
</th>
<td>
@CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.RepairerCompletedDate, "Not Completed", "Job_JobMetaNonWarranty_RepairerCompletedDate")
@@ -65,7 +83,9 @@
var updateUrl = '@(Url.Action(MVC.API.Job.Update(Model.Job.Id, null)))';
var jobOpenDate = '@(Model.Job.OpenedDate.ToJavascriptDateTime())';
document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Repairer Name', 'Job_JobMetaNonWarranty_RepairerLoggedDate', null, 'NonWarrantyRepairerLoggedDate', 'Not Logged', jobOpenDate, false);
document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Repair Completed', 'Job_JobMetaNonWarranty_RepairerCompletedDate', null, 'NonWarrantyRepairerCompletedDate', 'Not Completed', jobOpenDate, false);
@if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.RepairerLoggedDate))
{<text>document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Repairer Name', 'Job_JobMetaNonWarranty_RepairerLoggedDate', null, 'NonWarrantyRepairerLoggedDate', 'Not Logged', jobOpenDate, false);</text>}
@if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.RepairerCompletedDate))
{<text>document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Repair Completed', 'Job_JobMetaNonWarranty_RepairerCompletedDate', null, 'NonWarrantyRepairerCompletedDate', 'Not Completed', jobOpenDate, false);</text>}
});
</script>
</script>
+248 -69
View File
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Views.Job.JobParts
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
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/Job/JobParts/Repairs.cshtml")]
public partial class Repairs : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
public partial class Repairs : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.ShowModel>
{
public Repairs()
{
@@ -43,6 +45,8 @@ namespace Disco.Web.Views.Job.JobParts
#line 2 "..\..\Views\Job\JobParts\Repairs.cshtml"
Authorization.Require(Claims.Job.ShowNonWarrantyFinance);
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
@@ -56,67 +60,134 @@ WriteLiteral(">\r\n <tr>\r\n <th");
WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">\r\n Repairer Name\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 11 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.RepairerName));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
WriteLiteral(">Repairer Name\r\n </th>\r\n <td>\r\n");
#line 12 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(AjaxHelpers.AjaxSave());
#line default
#line hidden
#line 12 "..\..\Views\Job\JobParts\Repairs.cshtml"
if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.RepairerName))
{
#line default
#line hidden
#line 14 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.RepairerName));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 13 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line 14 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line default
#line hidden
#line 15 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(AjaxHelpers.AjaxSave());
#line default
#line hidden
WriteLiteral("\r\n <script");
#line 15 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line default
#line hidden
#line 16 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 16 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n document.DiscoFunctions.P" +
"ropertyChangeHelper(\r\n $(\'#Job_JobMetaNonWarranty_Rep" +
"airerName\'),\r\n \'Unknown\',\r\n " +
" \'");
WriteLiteral(@">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#Job_JobMetaNonWarranty_RepairerName'),
'Unknown',
'");
#line 19 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyRepairerName(Model.Job.Id, null)));
#line 22 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyRepairerName(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral("\',\r\n \'RepairerName\'\r\n );\r\n " +
" });\r\n </script>\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
" <th");
" });\r\n </script>\r\n");
#line 27 "..\..\Views\Job\JobParts\Repairs.cshtml"
}
else
{
if (string.IsNullOrWhiteSpace(Model.Job.JobMetaNonWarranty.RepairerName))
{
#line default
#line hidden
WriteLiteral("<span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;Unknown/None&gt;</span>");
#line 31 "..\..\Views\Job\JobParts\Repairs.cshtml"
}
else
{
#line default
#line hidden
#line 33 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Model.Job.JobMetaNonWarranty.RepairerName);
#line default
#line hidden
#line 33 "..\..\Views\Job\JobParts\Repairs.cshtml"
}
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th");
WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">\r\n Repair Logged\r\n </th>\r\n <td>\r\n");
WriteLiteral(">Repair Logged\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 31 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 41 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.RepairerLoggedDate, "Not Logged", "Job_JobMetaNonWarranty_RepairerLoggedDate"));
@@ -126,67 +197,134 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th");
WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">\r\n Repair Reference\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
WriteLiteral(">Repair Reference\r\n </th>\r\n <td>\r\n");
#line 39 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.RepairerReference));
#line 48 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line default
#line hidden
#line 48 "..\..\Views\Job\JobParts\Repairs.cshtml"
if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.RepairerReference))
{
#line default
#line hidden
#line 50 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.RepairerReference));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 40 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(AjaxHelpers.AjaxSave());
#line 50 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line default
#line hidden
#line 51 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(AjaxHelpers.AjaxSave());
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 41 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line 51 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line default
#line hidden
#line 52 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n <script");
#line 52 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n document.DiscoFunctions.P" +
"ropertyChangeHelper(\r\n $(\'#Job_JobMetaNonWarranty_Rep" +
"airerReference\'),\r\n \'Unknown\',\r\n " +
" \'");
WriteLiteral(@">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#Job_JobMetaNonWarranty_RepairerReference'),
'Unknown',
'");
#line 47 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyRepairerReference(Model.Job.Id, null)));
#line 58 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyRepairerReference(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral("\',\r\n \'RepairerReference\'\r\n );\r\n" +
" });\r\n </script>\r\n </td>\r\n </tr>\r\n <tr>\r\n" +
" <th");
" });\r\n </script>\r\n");
#line 63 "..\..\Views\Job\JobParts\Repairs.cshtml"
}
else
{
if (string.IsNullOrWhiteSpace(Model.Job.JobMetaNonWarranty.RepairerReference))
{
#line default
#line hidden
WriteLiteral("<span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;Unknown/None&gt;</span>");
#line 67 "..\..\Views\Job\JobParts\Repairs.cshtml"
}
else
{
#line default
#line hidden
#line 69 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Model.Job.JobMetaNonWarranty.RepairerReference);
#line default
#line hidden
#line 69 "..\..\Views\Job\JobParts\Repairs.cshtml"
}
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th");
WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">\r\n Repair Completed\r\n </th>\r\n <td>\r\n");
WriteLiteral(">Repair Completed\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 59 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 77 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.RepairerCompletedDate, "Not Completed", "Job_JobMetaNonWarranty_RepairerCompletedDate"));
@@ -196,7 +334,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n</table>\r\n<script>\r\n $(fu
"updateUrl = \'");
#line 65 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 83 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Url.Action(MVC.API.Job.Update(Model.Job.Id, null)));
@@ -205,18 +343,59 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n</table>\r\n<script>\r\n $(fu
WriteLiteral("\';\r\n var jobOpenDate = \'");
#line 66 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 84 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Model.Job.OpenedDate.ToJavascriptDateTime());
#line default
#line hidden
WriteLiteral(@"';
WriteLiteral("\';\r\n\r\n");
document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Repairer Name', 'Job_JobMetaNonWarranty_RepairerLoggedDate', null, 'NonWarrantyRepairerLoggedDate', 'Not Logged', jobOpenDate, false);
document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Repair Completed', 'Job_JobMetaNonWarranty_RepairerCompletedDate', null, 'NonWarrantyRepairerCompletedDate', 'Not Completed', jobOpenDate, false);
});
</script>");
#line 86 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line default
#line hidden
#line 86 "..\..\Views\Job\JobParts\Repairs.cshtml"
if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.RepairerLoggedDate))
{
#line default
#line hidden
WriteLiteral("document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, \'Repairer Name\', \'Job_" +
"JobMetaNonWarranty_RepairerLoggedDate\', null, \'NonWarrantyRepairerLoggedDate\', \'" +
"Not Logged\', jobOpenDate, false);");
#line 87 "..\..\Views\Job\JobParts\Repairs.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 88 "..\..\Views\Job\JobParts\Repairs.cshtml"
if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.RepairerCompletedDate))
{
#line default
#line hidden
WriteLiteral("document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, \'Repair Completed\', \'J" +
"ob_JobMetaNonWarranty_RepairerCompletedDate\', null, \'NonWarrantyRepairerComplete" +
"dDate\', \'Not Completed\', jobOpenDate, false);");
#line 89 "..\..\Views\Job\JobParts\Repairs.cshtml"
}
#line default
#line hidden
WriteLiteral(" });\r\n</script>\r\n");
}
}
+570 -366
View File
@@ -1,226 +1,320 @@
@model Disco.Web.Models.Job.ShowModel
@{
Html.BundleDeferred("~/Style/Shadowbox");
Html.BundleDeferred("~/ClientScripts/Modules/Shadowbox");
Authorization.RequireAny(Claims.Job.ShowLogs, Claims.Job.ShowAttachments);
var canShowLogs = Authorization.Has(Claims.Job.ShowLogs);
var canShowAttachments = Authorization.Has(Claims.Job.ShowAttachments);
var canAddLogs = Authorization.Has(Claims.Job.Actions.AddLogs);
var canRemoveAnyLogs = Authorization.Has(Claims.Job.Actions.RemoveAnyLogs);
var canRemoveOwnLogs = Authorization.Has(Claims.Job.Actions.RemoveOwnLogs);
var canAddAttachments = Authorization.Has(Claims.Job.Actions.AddAttachments);
var canRemoveAnyAttachments = Authorization.Has(Claims.Job.Actions.RemoveAnyAttachments);
var canRemoveOwnAttachments = Authorization.Has(Claims.Job.Actions.RemoveOwnAttachments);
if (canShowAttachments)
{
Html.BundleDeferred("~/Style/Shadowbox");
Html.BundleDeferred("~/ClientScripts/Modules/Shadowbox");
}
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
}
<table id="jobShowResources">
<tr>
<td id="Comments">
<div class="commentOutput">
@foreach (var jl in Model.Job.JobLogs.OrderBy(m => m.Timestamp))
<tr class="@(canShowLogs ? "canShowLogs" : "cannotShowLogs") @(canShowAttachments ? "canShowAttachments" : "cannotShowAttachments")">
@if (canShowLogs)
{
<td id="Comments" class="@(canAddLogs ? "canAddLogs" : "cannotAddLogs")">
<div class="commentOutput">
@foreach (var jl in Model.Job.JobLogs.OrderBy(m => m.Timestamp))
{
<div data-logid="@jl.Id">
<span class="author">@jl.TechUser.ToString()</span>@if (canRemoveAnyLogs || (canRemoveOwnLogs && jl.TechUserId == CurrentUser.Id))
{<text><span class="remove"></span></text>}<span class="timestamp" title="@jl.Timestamp.ToFullDateTime()">@jl.Timestamp.ToFuzzy()</span>
<span class="comment">@jl.Comments.ToMultilineJobRefString()</span>
</div>
}
</div>
@if (canAddLogs)
{
<div data-logid="@jl.Id">
<span class="author">@jl.TechUser.ToString()</span><span class="remove"></span><span class="timestamp" title="@jl.Timestamp.ToFullDateTime()">@jl.Timestamp.ToFuzzy()</span>
<span class="comment">@jl.Comments.ToMultilineJobRefString()</span>
<div class="commentInput clearfix">
<textarea class="commentInput" accesskey="l"></textarea>
<span class="action post commentInputPost"></span>
</div>
}
</div>
<div class="commentInput clearfix">
<textarea class="commentInput" accesskey="l"></textarea>
<span class="action post commentInputPost"></span>
</div>
</td>
<td id="Attachments">
<div class="attachmentOutput">
@foreach (var ja in Model.Job.JobAttachments)
</td>
}
@if (canShowAttachments)
{
<td id="Attachments" class="@(canAddAttachments ? "canAddAttachments" : "cannotAddAttachments")">
<div class="attachmentOutput">
@foreach (var ja in Model.Job.JobAttachments)
{
<a href="@Url.Action(MVC.API.Job.AttachmentDownload(ja.Id))" data-attachmentid="@ja.Id" data-mimetype="@ja.MimeType">
<span class="icon" title="@ja.Filename">
<img alt="Attachment Thumbnail" src="@(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id)))" /></span>
<span class="comments" title="@ja.Comments">
@{if (!string.IsNullOrEmpty(ja.DocumentTemplateId))
{ @ja.DocumentTemplate.Description}
else
{ @ja.Comments }}
</span><span class="author">@ja.TechUser.ToString()</span>@if (canRemoveAnyAttachments || (canRemoveOwnAttachments && ja.TechUserId == CurrentUser.Id))
{<text><span class="remove"></span></text>}<span class="timestamp" title="@ja.Timestamp.ToFullDateTime()">@ja.Timestamp.ToFuzzy()</span>
</a>
}
</div>
@if (canAddAttachments)
{
<a href="@Url.Action(MVC.API.Job.AttachmentDownload(ja.Id))" data-attachmentid="@ja.Id" data-mimetype="@ja.MimeType">
<span class="icon" title="@ja.Filename">
<img alt="Attachment Thumbnail" src="@(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id)))" /></span>
<span class="comments" title="@ja.Comments">
@{if (!string.IsNullOrEmpty(ja.DocumentTemplateId))
{ @ja.DocumentTemplate.Description}
else
{ @ja.Comments }}
</span><span class="author">@ja.TechUser.ToString()</span><span class="remove"></span><span class="timestamp" title="@ja.Timestamp.ToFullDateTime()">@ja.Timestamp.ToFuzzy()</span>
</a>
<div class="attachmentInput clearfix">
<span class="action upload"></span><span class="action photo"></span>
</div>
}
</div>
<div class="attachmentInput clearfix">
<span class="action upload"></span><span class="action photo"></span>
</div>
</td>
</td>
}
</tr>
</table>
<div id="dialogUpload" class="hiddenDialog" title="Upload Attachment">
<div id="silverlightHostUploadAttachment">
@if (canShowLogs && (canRemoveAnyLogs || canRemoveOwnLogs))
{
<div id="dialogRemoveLog" class="hiddenDialog" title="Remove this Comment?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
Are you sure?
</p>
</div>
</div>
<div id="dialogRemoveLog" class="hiddenDialog" title="Remove this Comment?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
Are you sure?
</p>
</div>
<div id="dialogRemoveAttachment" class="hiddenDialog" title="Remove this Attachment?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
Are you sure?
</p>
</div>
<script>
Shadowbox.init({
skipSetup: true,
modal: true
});
$(function () {
var jobId = parseInt('@(Model.Job.Id)');
//#region Comments
var $Comments = $('#Comments');
var $CommentOutput = $Comments.find('.commentOutput');
var $CommentOutputContainer = $Comments.find('.commentOutputContainer');
var $CommentInput = $Comments.find('textarea.commentInput');
var $dialogRemoveLog;
window.setTimeout(function () {
$CommentOutput[0].scrollTop = $CommentOutput[0].scrollHeight; // Scroll to Bottom
}, 0);
$('#jobDetailTabs').on('tabsactivate', function (event, ui) {
if (ui.newPanel && ui.newPanel.is('#jobDetailTab-Resources')) {
$CommentOutput[0].scrollTop = $CommentOutput[0].scrollHeight; // Scroll to Bottom
}
});
$Comments.find('.commentInputPost').click(postComment);
$CommentInput.keypress(function (e) {
if (e.which == 13 && !e.shiftKey) {
postComment();
return false;
}
});
$CommentOutput.find('span.remove').click(removePost);
function postComment() {
var comment = $CommentInput.val();
if (comment != '') {
var data = { comment: comment }
$.ajax({
url: '@Url.Action(MVC.API.Job.CommentPost(Model.Job.Id, null))',
dataType: 'json',
data: data,
success: function (d) {
if (d.Result == 'OK') {
// Should be added via Repository Notifications
// addComment(d.Comment, false);
$CommentInput.val('').attr('disabled', false).focus();
} else {
alert('Unable to post comment: ' + d.Result);
$CommentInput.attr('disabled', false);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to post comment: ' + textStatus);
$CommentInput.attr('disabled', false);
}
});
}
}
function removePost() {
$this = $(this);
var data = { id: $this.closest('div').attr('data-logid') };
if (!$dialogRemoveLog) {
$dialogRemoveLog = $('#dialogRemoveLog').dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: false
});
}
$dialogRemoveLog.dialog("enable").dialog('option', 'buttons', {
"Remove": function () {
$dialogRemoveLog.dialog("disable");
$dialogRemoveLog.dialog("option", "buttons", null);
$.ajax({
url: '@Url.Action(MVC.API.Job.CommentRemove())',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
// Should be removed via Repository Notifications
//$this.closest('div').slideUp(300).delay(300).queue(function () {
// $(this).remove();
//});
} else {
alert('Unable to remove comment: ' + d);
}
$dialogRemoveLog.dialog("close");
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to remove comment: ' + textStatus);
$dialogRemoveLog.dialog("close");
}
});
},
"Cancel": function () {
$dialogRemoveLog.dialog("close");
}
}).dialog('open');
return false;
}
function loadLiveComment(key) {
if (key.JobId == jobId) {
$.ajax({
url: '@Url.Action(MVC.API.Job.Comment())',
dataType: 'json',
data: { id: key.Id },
success: function (d) {
if (d && d.JobId == jobId) {
addComment(d, false);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to load live comment ' + id + ': ' + textStatus);
}
});
}
}
function addComment(c, quick) {
var e = $('<div><span class="author" /><span class="remove" /><span class="timestamp" /><span class="comment" /></div>');
e.attr('data-logid', c.Id);
e.find('.author').text(c.Author);
e.find('.timestamp').text(c.TimestampFuzzy).attr('title', c.TimestampFull);
e.find('.remove').click(removePost);
var eComment = e.find('.comment').text(c.Comments);
var commentHtml = eComment.text().replace(/\r\n|\r|\n/g, '<br />');
commentHtml = commentHtml.replace(/\#(\d+)/g, '<a href="@Url.Action(MVC.Job.Show(null))?id=$1">#$1</a>');
eComment.html(commentHtml);
$CommentOutput.append(e);
if (!quick) {
e.animate({ backgroundColor: '#ffff99' }, 500, function () {
e.animate({ backgroundColor: '#f4f4f4' }, 500);
});
$CommentOutput.animate({ scrollTop: $CommentOutput[0].scrollHeight }, 250)
}
}
//#endregion
//#region Attachments
}
@if (canShowAttachments && canAddAttachments)
{
<div id="dialogUpload" class="hiddenDialog" title="Upload Attachment">
<div id="silverlightHostUploadAttachment">
</div>
</div>
}
@if (canShowAttachments && (canRemoveAnyAttachments || canRemoveOwnAttachments))
{
<div id="dialogRemoveAttachment" class="hiddenDialog" title="Remove this Attachment?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
Are you sure?
</p>
</div>
}
@if (canShowLogs)
{
<script>
if (!document.DiscoFunctions) {
document.DiscoFunctions = {};
}
// For Silverlight Backwards-compatibility
// - Repository notifications now handles this
document.DiscoFunctions.addAttachment = function () { };
var $Attachments = $('#Attachments');
var $attachmentOutput = $Attachments.find('.attachmentOutput');
var $dialogUpload, $dialogRemoveAttachment;
$(function () {
var jobId = parseInt('@(Model.Job.Id)');
$attachmentOutput.find('span.remove').click(removeLocalAttachment);
//#region Comments
var $Comments = $('#Comments');
var $CommentOutput = $Comments.find('.commentOutput');
var $CommentOutputContainer = $Comments.find('.commentOutputContainer');
var onLoadNavigation = null;
var isLoaded = null;
Silverlight.createObject(
'@(Links.ClientBin.Disco_Silverlight_AttachmentUpload_xap)',
window.setTimeout(function () {
$CommentOutput[0].scrollTop = $CommentOutput[0].scrollHeight; // Scroll to Bottom
}, 0);
$('#jobDetailTabs').on('tabsactivate', function (event, ui) {
if (ui.newPanel && ui.newPanel.is('#jobDetailTab-Resources')) {
$CommentOutput[0].scrollTop = $CommentOutput[0].scrollHeight; // Scroll to Bottom
}
});
@if (canAddLogs)
{<text>
//#region Add Logs
var $CommentInput = $Comments.find('textarea.commentInput');
$Comments.find('.commentInputPost').click(postComment);
$CommentInput.keypress(function (e) {
if (e.which == 13 && !e.shiftKey) {
postComment();
return false;
}
});
function postComment() {
var comment = $CommentInput.val();
if (comment != '') {
var data = { comment: comment }
$.ajax({
url: '@Url.Action(MVC.API.Job.CommentPost(Model.Job.Id, null))',
dataType: 'json',
data: data,
success: function (d) {
if (d.Result == 'OK') {
// Should be added via Repository Notifications
// addComment(d.Comment, false);
$CommentInput.val('').attr('disabled', false).focus();
} else {
alert('Unable to post comment: ' + d.Result);
$CommentInput.attr('disabled', false);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to post comment: ' + textStatus);
$CommentInput.attr('disabled', false);
}
});
}
}
//#endregion
</text>}
@if (canRemoveAnyLogs || canRemoveOwnLogs)
{<text>
//#region Remove Logs
var $dialogRemoveLog;
$CommentOutput.find('span.remove').click(removePost);
function removePost() {
$this = $(this);
var data = { id: $this.closest('div').attr('data-logid') };
if (!$dialogRemoveLog) {
$dialogRemoveLog = $('#dialogRemoveLog').dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: false
});
}
$dialogRemoveLog.dialog("enable").dialog('option', 'buttons', {
"Remove": function () {
$dialogRemoveLog.dialog("disable");
$dialogRemoveLog.dialog("option", "buttons", null);
$.ajax({
url: '@Url.Action(MVC.API.Job.CommentRemove())',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
// Should be removed via Repository Notifications
//$this.closest('div').slideUp(300).delay(300).queue(function () {
// $(this).remove();
//});
} else {
alert('Unable to remove comment: ' + d);
}
$dialogRemoveLog.dialog("close");
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to remove comment: ' + textStatus);
$dialogRemoveLog.dialog("close");
}
});
},
"Cancel": function () {
$dialogRemoveLog.dialog("close");
}
}).dialog('open');
return false;
}
//#endregion
</text>}
function loadLiveComment(key) {
if (key.JobId == jobId) {
$.ajax({
url: '@Url.Action(MVC.API.Job.Comment())',
dataType: 'json',
data: { id: key.Id },
success: function (d) {
if (d && d.JobId == jobId) {
@if (canRemoveAnyLogs)
{<text>addComment(d, false, true);</text>}
else if (canRemoveOwnLogs)
{<text>addComment(d, false, (d.AuthorId === '@(CurrentUser.Id)'));</text>}
else
{<text>addComment(d, false, false);</text>}
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to load live comment ' + id + ': ' + textStatus);
}
});
}
}
function liveRemoveComment(key) {
$CommentOutput.children('div[data-logid="' + key + '"]').slideUp(300).delay(300).queue(function () {
$(this).remove();
});
}
function addComment(c, quick, canRemove) {
var t = '<div><span class="author" />';
if (canRemove)
t += '<span class="remove" />';
t += '<span class="timestamp" /><span class="comment" /></div>';
var e = $(t);
e.attr('data-logid', c.Id);
e.find('.author').text(c.Author);
e.find('.timestamp').text(c.TimestampFuzzy).attr('title', c.TimestampFull);
if (canRemove)
e.find('.remove').click(removePost);
var eComment = e.find('.comment').text(c.Comments);
var commentHtml = eComment.text().replace(/\r\n|\r|\n/g, '<br />');
commentHtml = commentHtml.replace(/\#(\d+)/g, '<a href="@Url.Action(MVC.Job.Show(null))?id=$1">#$1</a>');
eComment.html(commentHtml);
$CommentOutput.append(e);
if (!quick) {
e.animate({ backgroundColor: '#ffff99' }, 500, function () {
e.animate({ backgroundColor: '#f4f4f4' }, 500);
});
$CommentOutput.animate({ scrollTop: $CommentOutput[0].scrollHeight }, 250)
}
}
// Add Globally Available Functions
document.DiscoFunctions.liveLoadComment = loadLiveComment;
document.DiscoFunctions.liveRemoveComment = liveRemoveComment;
//#endregion
});
</script>
}
@if (canShowAttachments)
{
<script>
Shadowbox.init({
skipSetup: true,
modal: true
});
if (!document.DiscoFunctions) {
document.DiscoFunctions = {};
}
$(function () {
var jobId = parseInt('@(Model.Job.Id)');
//#region Attachments
var $Attachments = $('#Attachments');
var $attachmentOutput = $Attachments.find('.attachmentOutput');
@if (canAddAttachments)
{<text>
//#region Add Attachments
// For Silverlight Backwards-compatibility
// - Repository notifications now handles this
document.DiscoFunctions.addAttachment = function () { };
var $dialogUpload;
var onLoadNavigation = null;
var isLoaded = null;
Silverlight.createObject(
'@(Links.ClientBin.Disco_Silverlight_AttachmentUpload_xap)',
$('#silverlightHostUploadAttachment').get(0),
'silverlightUploadAttachment',
{ width: '840px', height: '500px', background: 'white', version: '4.0.60310.0' },
@@ -235,189 +329,299 @@
'UploadUrl=@(Url.Action(MVC.API.Job.AttachmentUpload(Model.Job.Id, null)))'
);
var $attachmentInput = $Attachments.find('.attachmentInput');
$attachmentInput.find('.photo').click(function () {
showDialog('/WebCam');
});
$attachmentInput.find('.upload').click(function () {
showDialog('/File');
});
var $attachmentInput = $Attachments.find('.attachmentInput');
$attachmentInput.find('.photo').click(function () {
showDialog('/WebCam');
});
$attachmentInput.find('.upload').click(function () {
showDialog('/File');
});
var silverlightUploadAttachment = $('#silverlightUploadAttachment').get(0);
function showDialog(navigationPath) {
if (!$dialogUpload) {
$dialogUpload = $('#dialogUpload').dialog({
autoOpen: false,
draggable: false,
modal: true,
resizable: false,
width: 860,
height: 550,
close: function () {
silverlightUploadAttachment.content.Navigator.Navigate('/Hidden');
}
});
}
$dialogUpload.dialog('open');
if (isLoaded) {
silverlightUploadAttachment.content.Navigator.Navigate(navigationPath);
} else {
onLoadNavigation = navigationPath;
}
};
function addAttachment(key, quick) {
if (key.JobId == jobId) {
var data = { id: key.Id };
$.ajax({
url: '@Url.Action(MVC.API.Job.Attachment())',
dataType: 'json',
data: data,
success: function (d) {
if (d.Result == 'OK') {
var a = d.Attachment;
if (parseInt(a.ParentId) == jobId) {
var e = $('<a><span class="icon"><img alt="Attachment Thumbnail" /></span><span class="comments"></span><span class="author"></span><span class="remove"></span><span class="timestamp"></span></a>');
e.attr('data-attachmentid', a.Id).attr('data-mimetype', a.MimeType).attr('href', '@(Url.Action(MVC.API.Job.AttachmentDownload()))/' + a.Id);
e.find('.icon img').attr('src', '@(Url.Action(MVC.API.Job.AttachmentThumbnail()))/' + a.Id);
e.find('.comments').text(a.Comments);
e.find('.author').text(a.Author);
e.find('.timestamp').text(a.TimestampFuzzy).attr('title', a.TimestampFull);
e.find('.remove').click(removeLocalAttachment);
if (!quick)
e.hide();
$attachmentOutput.append(e);
if (!quick)
e.show('slow');
if (a.MimeType.toLowerCase().indexOf('image/') == 0)
e.shadowbox({ gallery: 'attachments', player: 'img', title: a.Comments });
}
} else {
alert('Unable to add attachment: ' + d.Result);
var silverlightUploadAttachment = $('#silverlightUploadAttachment').get(0);
function showDialog(navigationPath) {
if (!$dialogUpload) {
$dialogUpload = $('#dialogUpload').dialog({
autoOpen: false,
draggable: false,
modal: true,
resizable: false,
width: 860,
height: 550,
close: function () {
silverlightUploadAttachment.content.Navigator.Navigate('/Hidden');
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to add attachment: ' + textStatus);
}
});
}
}
function removeAttachment(key) {
if (key.JobId == jobId) {
var $element = $attachmentOutput.find('a[data-attachmentid="' + key.Id + '"]');
if ($element.length > 0) {
$element.hide(300).delay(300).queue(function () {
if ($element.attr('data-mimetype').toLowerCase().indexOf('image/') == 0)
Shadowbox.removeCache(this);
$element.remove();
});
}
}
}
$dialogUpload.dialog('open');
if (isLoaded) {
silverlightUploadAttachment.content.Navigator.Navigate(navigationPath);
} else {
onLoadNavigation = navigationPath;
}
};
function removeLocalAttachment() {
$this = $(this).closest('a');
//#endregion
</text>}
var data = { id: $this.attr('data-attachmentid') };
@if (canRemoveAnyAttachments || canRemoveOwnAttachments)
{<text>
//#region Remove Attachments
if (!$dialogRemoveAttachment) {
$dialogRemoveAttachment = $('#dialogRemoveAttachment').dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: false
});
var $dialogRemoveAttachment;
$attachmentOutput.find('span.remove').click(removeLocalAttachment);
function removeLocalAttachment() {
$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").dialog('option', 'buttons', {
"Remove": function () {
$dialogRemoveAttachment.dialog("disable");
$dialogRemoveAttachment.dialog("option", "buttons", null);
$.ajax({
url: '@Url.Action(MVC.API.Job.AttachmentRemove())',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
// Should be removed via Repository Notifications
//$this.hide(300).delay(300).queue(function () {
// var $this = $(this);
// if ($this.attr('data-mimetype').toLowerCase().indexOf('image/') == 0)
// Shadowbox.removeCache(this);
// $this.remove();
//});
} 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");
}
}).dialog('open');
return false;
}
$dialogRemoveAttachment.dialog("enable").dialog('option', 'buttons', {
"Remove": function () {
$dialogRemoveAttachment.dialog("disable");
$dialogRemoveAttachment.dialog("option", "buttons", null);
//#endregion
</text>}
function addAttachment(key, quick) {
if (key.JobId == jobId) {
var data = { id: key.Id };
$.ajax({
url: '@Url.Action(MVC.API.Job.AttachmentRemove())',
url: '@Url.Action(MVC.API.Job.Attachment())',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
// Should be removed via Repository Notifications
//$this.hide(300).delay(300).queue(function () {
// var $this = $(this);
// if ($this.attr('data-mimetype').toLowerCase().indexOf('image/') == 0)
// Shadowbox.removeCache(this);
// $this.remove();
//});
if (d.Result == 'OK') {
var a = d.Attachment;
@if (canRemoveAnyAttachments)
{<text>buildAttachment(a, true);</text>}
else if (canRemoveOwnAttachments)
{<text>buildAttachment(a, (a.AuthorId === '@(CurrentUser.Id)'));</text>}
else
{<text>buildAttachment(a, false);</text>}
} else {
alert('Unable to remove attachment: ' + d);
alert('Unable to add attachment: ' + d.Result);
}
$dialogRemoveAttachment.dialog("close");
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to remove attachment: ' + textStatus);
$dialogRemoveAttachment.dialog("close");
alert('Unable to add attachment: ' + textStatus);
}
});
},
"Cancel": function () {
$dialogRemoveAttachment.dialog("close");
}
}).dialog('open');
return false;
}
$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() });
});
//#endregion
//#region LiveEvents
function liveMessageRecieved(d) {
if (d) {
window.setTimeout(function () {
switch (d.EntityTypeName) {
case 'JobAttachment':
switch (d.EventType) {
case 0: // Added
addAttachment(d.EntityKey, false);
break;
case 1: // Removed
removeAttachment(d.EntityKey);
break;
}
break;
case 'JobLog':
switch (d.EventType) {
case 0: // Added
loadLiveComment(d.EntityKey);
break;
case 1: // Removed
if (d.EntityKey.JobId == jobId) {
$CommentOutput.children('div[data-logid="' + d.EntityKey.Id + '"]').slideUp(300).delay(300).queue(function () {
$(this).remove();
});
}
break;
}
break;
}
}, 100);
}
}
var liveMessagesConnection = $.connection('@(Url.Content("~/API/Repository/Notifications"))', { addToGroups: 'JobLog,JobAttachment' })
liveMessagesConnection.received(liveMessageRecieved);
liveMessagesConnection.error(function (e) {
if (e)
alert('Error: ' + JSON.stringify(e));
function buildAttachment(a, canRemove) {
if (parseInt(a.ParentId) == jobId) {
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"></span>';
t += '<span class="timestamp"></span></a>';
var e = $(t);
e.attr('data-attachmentid', a.Id).attr('data-mimetype', a.MimeType).attr('href', '@(Url.Action(MVC.API.Job.AttachmentDownload()))/' + a.Id);
e.find('.icon img').attr('src', '@(Url.Action(MVC.API.Job.AttachmentThumbnail()))/' + a.Id);
e.find('.comments').text(a.Comments);
e.find('.author').text(a.Author);
e.find('.timestamp').text(a.TimestampFuzzy).attr('title', a.TimestampFull);
if (canRemove)
e.find('.remove').click(removeLocalAttachment);
if (!quick)
e.hide();
$attachmentOutput.append(e);
if (!quick)
e.show('slow');
if (a.MimeType.toLowerCase().indexOf('image/') == 0)
e.shadowbox({ gallery: 'attachments', player: 'img', title: a.Comments });
}
}
function removeAttachment(key) {
if (key.JobId == jobId) {
var $element = $attachmentOutput.find('a[data-attachmentid="' + key.Id + '"]');
if ($element.length > 0) {
$element.hide(300).delay(300).queue(function () {
if ($element.attr('data-mimetype').toLowerCase().indexOf('image/') == 0)
Shadowbox.removeCache(this);
$element.remove();
});
}
}
}
$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() });
});
// Add Globally Available Functions
document.DiscoFunctions.liveAddAttachment = addAttachment;
document.DiscoFunctions.liveRemoveAttachment = removeAttachment;
//#endregion
});
liveMessagesConnection.start();
//#endregion
});
</script>
</script>
}
@if (canShowLogs && canShowAttachments)
{
<script>
$(function () {
var jobId = parseInt('@(Model.Job.Id)');
//#region LiveEvents
function liveMessageRecieved(d) {
if (d) {
window.setTimeout(function () {
switch (d.EntityTypeName) {
case 'JobAttachment':
switch (d.EventType) {
case 0: // Added
document.DiscoFunctions.liveAddAttachment(d.EntityKey, false);
break;
case 1: // Removed
document.DiscoFunctions.liveRemoveAttachment(d.EntityKey);
break;
}
break;
case 'JobLog':
switch (d.EventType) {
case 0: // Added
document.DiscoFunctions.liveLoadComment(d.EntityKey);
break;
case 1: // Removed
if (d.EntityKey.JobId == jobId) {
document.DiscoFunctions.liveRemoveComment(d.EntityKey.Id);
}
break;
}
break;
}
}, 100);
}
}
var liveMessagesConnection = $.connection('@(Url.Content("~/API/Repository/Notifications"))', { addToGroups: 'JobLog,JobAttachment' })
liveMessagesConnection.received(liveMessageRecieved);
liveMessagesConnection.error(function (e) {
if (e)
alert('Error: ' + JSON.stringify(e));
});
liveMessagesConnection.start();
//#endregion
});
</script>
}
else if (canShowLogs)
{
<script>
$(function () {
var jobId = parseInt('@(Model.Job.Id)');
//#region LiveEvents
function liveMessageRecieved(d) {
if (d) {
window.setTimeout(function () {
switch (d.EventType) {
case 0: // Added
document.DiscoFunctions.liveLoadComment(d.EntityKey);
break;
case 1: // Removed
if (d.EntityKey.JobId == jobId) {
document.DiscoFunctions.liveRemoveComment(d.EntityKey.Id);
}
break;
}
}, 100);
}
}
var liveMessagesConnection = $.connection('@(Url.Content("~/API/Repository/Notifications"))', { addToGroups: 'JobLog' })
liveMessagesConnection.received(liveMessageRecieved);
liveMessagesConnection.error(function (e) {
if (e)
alert('Error: ' + JSON.stringify(e));
});
liveMessagesConnection.start();
//#endregion
});
</script>
}
else if (canShowAttachments)
{
<script>
$(function () {
var jobId = parseInt('@(Model.Job.Id)');
//#region LiveEvents
function liveMessageRecieved(d) {
if (d) {
window.setTimeout(function () {
switch (d.EventType) {
case 0: // Added
document.DiscoFunctions.liveAddAttachment(d.EntityKey, false);
break;
case 1: // Removed
document.DiscoFunctions.liveRemoveAttachment(d.EntityKey);
break;
}
}, 100);
}
}
var liveMessagesConnection = $.connection('@(Url.Content("~/API/Repository/Notifications"))', { addToGroups: 'JobAttachment' })
liveMessagesConnection.received(liveMessageRecieved);
liveMessagesConnection.error(function (e) {
if (e)
alert('Error: ' + JSON.stringify(e));
});
liveMessagesConnection.start();
//#endregion
});
</script>
}
File diff suppressed because it is too large Load Diff
+122 -77
View File
@@ -1,127 +1,172 @@
@model Disco.Web.Models.Job.ShowModel
@{
Authorization.Require(Claims.Job.ShowWarranty);
}
<div id="jobDetailTab-Warranty" class="jobPart">
<table id="jobNonWarrantyFinance">
<tr>
<th style="width: 200px;">
Warranty Provider
<th style="width: 200px;">Warranty Provider
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaWarranty.ExternalName)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#Job_JobMetaWarranty_ExternalName'),
'Unknown',
'@Url.Action(MVC.API.Job.UpdateWarrantyExternalName(Model.Job.Id, null))',
@if (Authorization.Has(Claims.Job.Properties.WarrantyProperties.ExternalName))
{
@Html.EditorFor(m => m.Job.JobMetaWarranty.ExternalName)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#Job_JobMetaWarranty_ExternalName'),
'Unknown',
'@Url.Action(MVC.API.Job.UpdateWarrantyExternalName(Model.Job.Id, null))',
'ExternalName'
);
});
</script>
});
</script>
}
else
{
if (string.IsNullOrWhiteSpace(Model.Job.JobMetaWarranty.ExternalName))
{<span class="smallMessage">&lt;Unknown/None&gt;</span>}
else
{<span id="Job_JobMetaWarranty_ExternalName">@Model.Job.JobMetaWarranty.ExternalName</span>}
}
</td>
</tr>
<tr>
<th style="width: 200px;">
Warranty Logged
<th style="width: 200px;">Warranty Logged
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaWarranty.ExternalLoggedDate)
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var dateField = $('#Job_JobMetaWarranty_ExternalLoggedDate');
document.DiscoFunctions.DateChangeHelper(
dateField,
'Unknown',
'@(Url.Action(MVC.API.Job.UpdateWarrantyExternalLoggedDate(Model.Job.Id, null)))',
@if (Authorization.Has(Claims.Job.Properties.WarrantyProperties.ExternalLoggedDate))
{
@Html.EditorFor(m => m.Job.JobMetaWarranty.ExternalLoggedDate)
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var dateField = $('#Job_JobMetaWarranty_ExternalLoggedDate');
document.DiscoFunctions.DateChangeHelper(
dateField,
'Unknown',
'@(Url.Action(MVC.API.Job.UpdateWarrantyExternalLoggedDate(Model.Job.Id, null)))',
'ExternalLoggedDate',
null
);
});
</script>
});
</script>
}
else
{
@CommonHelpers.FriendlyDate(Model.Job.JobMetaWarranty.ExternalLoggedDate, "Unknown/None", null)
}
</td>
</tr>
<tr>
<th style="width: 200px;">
Warranty Reference
<th style="width: 200px;">Warranty Reference
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaWarranty.ExternalReference)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#Job_JobMetaWarranty_ExternalReference'),
'Unknown',
'@Url.Action(MVC.API.Job.UpdateWarrantyExternalReference(Model.Job.Id, null))',
@if (Authorization.Has(Claims.Job.Properties.WarrantyProperties.ExternalReference))
{
@Html.EditorFor(m => m.Job.JobMetaWarranty.ExternalReference)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#Job_JobMetaWarranty_ExternalReference'),
'Unknown',
'@Url.Action(MVC.API.Job.UpdateWarrantyExternalReference(Model.Job.Id, null))',
'ExternalReference'
);
});
</script>
});
</script>
}
else
{
if (string.IsNullOrWhiteSpace(Model.Job.JobMetaWarranty.ExternalReference))
{<span class="smallMessage">&lt;Unknown/None&gt;</span>}
else
{@Model.Job.JobMetaWarranty.ExternalReference}
}
</td>
</tr>
<tr>
<th style="width: 200px;">
Warranty Completed
<th style="width: 200px;">Warranty Completed
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaWarranty.ExternalCompletedDate)
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var dateField = $('#Job_JobMetaWarranty_ExternalCompletedDate');
document.DiscoFunctions.DateChangeHelper(
dateField,
'Unknown',
'@(Url.Action(MVC.API.Job.UpdateWarrantyExternalCompletedDate(Model.Job.Id, null)))',
@if (Authorization.Has(Claims.Job.Properties.WarrantyProperties.ExternalCompletedDate))
{
@Html.EditorFor(m => m.Job.JobMetaWarranty.ExternalCompletedDate)
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var dateField = $('#Job_JobMetaWarranty_ExternalCompletedDate');
document.DiscoFunctions.DateChangeHelper(
dateField,
'Unknown',
'@(Url.Action(MVC.API.Job.UpdateWarrantyExternalCompletedDate(Model.Job.Id, null)))',
'ExternalCompletedDate',
null
);
});
</script>
</td>
</tr>
<tr id="jobWarrantyProviderDetailContainer" style="display: none">
<th style="width: 200px;">
Provider Details
</th>
<td>
<div id="jobWarrantyProviderDetailLoading">
<span class="ajaxHelperIcon ajaxLoading" title="Loading..."></span> Loading...
</div>
<div id="jobWarrantyProviderDetailHost" class="clearfix" style="display: none">
</div>
});
</script>
}
else
{
@CommonHelpers.FriendlyDate(Model.Job.JobMetaWarranty.ExternalCompletedDate, "Unknown/None", null)
}
</td>
</tr>
@if (Authorization.Has(Claims.Job.Properties.WarrantyProperties.ProviderDetails))
{
<tr id="jobWarrantyProviderDetailContainer" style="display: none">
<th style="width: 200px;">Provider Details
</th>
<td>
<div id="jobWarrantyProviderDetailLoading">
<span class="ajaxHelperIcon ajaxLoading" title="Loading..."></span>Loading...
</div>
<div id="jobWarrantyProviderDetailHost" class="clearfix" style="display: none">
</div>
</td>
</tr>
}
</table>
</div>
<script type="text/javascript">
$('#jobDetailTabItems').append('<li><a href="#jobDetailTab-Warranty">Warranty</a></li>');
@if (Authorization.Has(Claims.Job.Properties.WarrantyProperties.ProviderDetails))
{<text>
$(function () {
var warrantyProviderDetailLoaded = false;
$('#jobDetailTabs').on('tabsactivate', function (e, ui) {
if ($(ui.newPanel).is('#jobDetailTab-Warranty')) {
if (!warrantyProviderDetailLoaded) {
var warrantyExternalName = $('#Job_JobMetaWarranty_ExternalName').val();
if (warrantyExternalName) {
$('#jobWarrantyProviderDetailContainer').show();
$('#jobWarrantyProviderDetailLoading span').show();
$('#jobWarrantyProviderDetailHost').load(
'@(Url.Action(MVC.Job.WarrantyProviderJobDetails()))',
{ id: '@(Model.Job.Id)' },
function () {
$('#jobWarrantyProviderDetailLoading').hide();
$(this).slideDown();
}
);
var warrantyExternalName;
var $warrantyExternalName = $('#Job_JobMetaWarranty_ExternalName');
if ($warrantyExternalName.length > 0) {
if ($warrantyExternalName[0].nodeName === 'INPUT')
warrantyExternalName = $warrantyExternalName.val();
else
warrantyExternalName = $warrantyExternalName.text();
if (warrantyExternalName) {
$('#jobWarrantyProviderDetailContainer').show();
$('#jobWarrantyProviderDetailLoading span').show();
$('#jobWarrantyProviderDetailHost').load(
'@(Url.Action(MVC.Job.WarrantyProviderJobDetails()))',
{ id: '@(Model.Job.Id)' },
function () {
$('#jobWarrantyProviderDetailLoading').hide();
$(this).slideDown();
}
);
warrantyProviderDetailLoaded = true;
warrantyProviderDetailLoaded = true;
}
}
}
}
});
});
</text>}
</script>
+439 -137
View File
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,19 +28,29 @@ namespace Disco.Web.Views.Job.JobParts
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
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/Job/JobParts/Warranty.cshtml")]
public partial class Warranty : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
public partial class Warranty : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.ShowModel>
{
public Warranty()
{
}
public override void Execute()
{
WriteLiteral("<div");
#line 2 "..\..\Views\Job\JobParts\Warranty.cshtml"
Authorization.Require(Claims.Job.ShowWarranty);
#line default
#line hidden
WriteLiteral("\r\n<div");
WriteLiteral(" id=\"jobDetailTab-Warranty\"");
@@ -54,228 +64,482 @@ WriteLiteral(">\r\n <tr>\r\n <th");
WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">\r\n Warranty Provider\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 9 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaWarranty.ExternalName));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 10 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(AjaxHelpers.AjaxSave());
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
WriteLiteral(">Warranty Provider\r\n </th>\r\n <td>\r\n");
#line 11 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 11 "..\..\Views\Job\JobParts\Warranty.cshtml"
if (Authorization.Has(Claims.Job.Properties.WarrantyProperties.ExternalName))
{
#line default
#line hidden
#line 13 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaWarranty.ExternalName));
#line default
#line hidden
WriteLiteral("\r\n <script");
#line 13 "..\..\Views\Job\JobParts\Warranty.cshtml"
#line default
#line hidden
#line 14 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(AjaxHelpers.AjaxSave());
#line default
#line hidden
#line 14 "..\..\Views\Job\JobParts\Warranty.cshtml"
#line default
#line hidden
#line 15 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 15 "..\..\Views\Job\JobParts\Warranty.cshtml"
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n document.DiscoFun" +
"ctions.PropertyChangeHelper(\r\n $(\'#Job_JobMetaWarrant" +
"y_ExternalName\'),\r\n \'Unknown\',\r\n " +
" \'");
WriteLiteral(@">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#Job_JobMetaWarranty_ExternalName'),
'Unknown',
'");
#line 17 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(Url.Action(MVC.API.Job.UpdateWarrantyExternalName(Model.Job.Id, null)));
#line 21 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(Url.Action(MVC.API.Job.UpdateWarrantyExternalName(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral("\',\r\n \'ExternalName\'\r\n );\r\n " +
" });\r\n </script>\r\n </td>\r\n </tr>\r" +
"\n <tr>\r\n <th");
WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">\r\n Warranty Logged\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
" });\r\n </script>\r\n");
#line 29 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaWarranty.ExternalLoggedDate));
#line 26 "..\..\Views\Job\JobParts\Warranty.cshtml"
}
else
{
if (string.IsNullOrWhiteSpace(Model.Job.JobMetaWarranty.ExternalName))
{
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral("<span");
WriteLiteral(" ");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;Unknown/None&gt;</span>");
#line 30 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(AjaxHelpers.AjaxLoader());
}
else
{
#line default
#line hidden
WriteLiteral("<span");
WriteLiteral(" id=\"Job_JobMetaWarranty_ExternalName\"");
WriteLiteral(">");
#line 32 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(Model.Job.JobMetaWarranty.ExternalName);
#line default
#line hidden
WriteLiteral("\r\n <script");
WriteLiteral("</span>");
#line 32 "..\..\Views\Job\JobParts\Warranty.cshtml"
}
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th");
WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">Warranty Logged\r\n </th>\r\n <td>\r\n");
#line 40 "..\..\Views\Job\JobParts\Warranty.cshtml"
#line default
#line hidden
#line 40 "..\..\Views\Job\JobParts\Warranty.cshtml"
if (Authorization.Has(Claims.Job.Properties.WarrantyProperties.ExternalLoggedDate))
{
#line default
#line hidden
#line 42 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaWarranty.ExternalLoggedDate));
#line default
#line hidden
#line 42 "..\..\Views\Job\JobParts\Warranty.cshtml"
#line default
#line hidden
#line 43 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 43 "..\..\Views\Job\JobParts\Warranty.cshtml"
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
var dateField = $('#Job_JobMetaWarranty_ExternalLoggedDate');
document.DiscoFunctions.DateChangeHelper(
dateField,
'Unknown',
'");
$(function () {
var dateField = $('#Job_JobMetaWarranty_ExternalLoggedDate');
document.DiscoFunctions.DateChangeHelper(
dateField,
'Unknown',
'");
#line 37 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(Url.Action(MVC.API.Job.UpdateWarrantyExternalLoggedDate(Model.Job.Id, null)));
#line 50 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(Url.Action(MVC.API.Job.UpdateWarrantyExternalLoggedDate(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral("\',\r\n \'ExternalLoggedDate\',\r\n null\r\n" +
" );\r\n });\r\n </script>\r\n" +
" </td>\r\n </tr>\r\n <tr>\r\n <th");
" );\r\n });\r\n </s" +
"cript>\r\n");
#line 56 "..\..\Views\Job\JobParts\Warranty.cshtml"
}
else
{
#line default
#line hidden
#line 59 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaWarranty.ExternalLoggedDate, "Unknown/None", null));
#line default
#line hidden
#line 59 "..\..\Views\Job\JobParts\Warranty.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th");
WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">\r\n Warranty Reference\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
WriteLiteral(">Warranty Reference\r\n </th>\r\n <td>\r\n");
#line 50 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaWarranty.ExternalReference));
#line 67 "..\..\Views\Job\JobParts\Warranty.cshtml"
#line default
#line hidden
#line 67 "..\..\Views\Job\JobParts\Warranty.cshtml"
if (Authorization.Has(Claims.Job.Properties.WarrantyProperties.ExternalReference))
{
#line default
#line hidden
#line 69 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaWarranty.ExternalReference));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 51 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(AjaxHelpers.AjaxSave());
#line 69 "..\..\Views\Job\JobParts\Warranty.cshtml"
#line default
#line hidden
#line 70 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(AjaxHelpers.AjaxSave());
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 52 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line 70 "..\..\Views\Job\JobParts\Warranty.cshtml"
#line default
#line hidden
#line 71 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n <script");
#line 71 "..\..\Views\Job\JobParts\Warranty.cshtml"
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n document.DiscoFun" +
"ctions.PropertyChangeHelper(\r\n $(\'#Job_JobMetaWarrant" +
"y_ExternalReference\'),\r\n \'Unknown\',\r\n " +
" \'");
WriteLiteral(@">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#Job_JobMetaWarranty_ExternalReference'),
'Unknown',
'");
#line 58 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(Url.Action(MVC.API.Job.UpdateWarrantyExternalReference(Model.Job.Id, null)));
#line 77 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(Url.Action(MVC.API.Job.UpdateWarrantyExternalReference(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral("\',\r\n \'ExternalReference\'\r\n );\r\n" +
" });\r\n </script>\r\n </td>\r\n <" +
"/tr>\r\n <tr>\r\n <th");
" });\r\n </script>\r\n");
#line 82 "..\..\Views\Job\JobParts\Warranty.cshtml"
}
else
{
if (string.IsNullOrWhiteSpace(Model.Job.JobMetaWarranty.ExternalReference))
{
#line default
#line hidden
WriteLiteral("<span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;Unknown/None&gt;</span>");
#line 86 "..\..\Views\Job\JobParts\Warranty.cshtml"
}
else
{
#line default
#line hidden
#line 88 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(Model.Job.JobMetaWarranty.ExternalReference);
#line default
#line hidden
#line 88 "..\..\Views\Job\JobParts\Warranty.cshtml"
}
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th");
WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">\r\n Warranty Completed\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
WriteLiteral(">Warranty Completed\r\n </th>\r\n <td>\r\n");
#line 70 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaWarranty.ExternalCompletedDate));
#line 96 "..\..\Views\Job\JobParts\Warranty.cshtml"
#line default
#line hidden
#line 96 "..\..\Views\Job\JobParts\Warranty.cshtml"
if (Authorization.Has(Claims.Job.Properties.WarrantyProperties.ExternalCompletedDate))
{
#line default
#line hidden
#line 98 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaWarranty.ExternalCompletedDate));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 71 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line 98 "..\..\Views\Job\JobParts\Warranty.cshtml"
#line default
#line hidden
#line 99 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n <script");
#line 99 "..\..\Views\Job\JobParts\Warranty.cshtml"
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
var dateField = $('#Job_JobMetaWarranty_ExternalCompletedDate');
document.DiscoFunctions.DateChangeHelper(
dateField,
'Unknown',
'");
$(function () {
var dateField = $('#Job_JobMetaWarranty_ExternalCompletedDate');
document.DiscoFunctions.DateChangeHelper(
dateField,
'Unknown',
'");
#line 78 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(Url.Action(MVC.API.Job.UpdateWarrantyExternalCompletedDate(Model.Job.Id, null)));
#line 106 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(Url.Action(MVC.API.Job.UpdateWarrantyExternalCompletedDate(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral("\',\r\n \'ExternalCompletedDate\',\r\n nul" +
"l\r\n );\r\n });\r\n </script" +
">\r\n </td>\r\n </tr>\r\n <tr");
"l\r\n );\r\n });\r\n " +
"</script>\r\n");
#line 112 "..\..\Views\Job\JobParts\Warranty.cshtml"
}
else
{
#line default
#line hidden
#line 115 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaWarranty.ExternalCompletedDate, "Unknown/None", null));
#line default
#line hidden
#line 115 "..\..\Views\Job\JobParts\Warranty.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n");
#line 119 "..\..\Views\Job\JobParts\Warranty.cshtml"
#line default
#line hidden
#line 119 "..\..\Views\Job\JobParts\Warranty.cshtml"
if (Authorization.Has(Claims.Job.Properties.WarrantyProperties.ProviderDetails))
{
#line default
#line hidden
WriteLiteral(" <tr");
WriteLiteral(" id=\"jobWarrantyProviderDetailContainer\"");
WriteLiteral(" style=\"display: none\"");
WriteLiteral(">\r\n <th");
WriteLiteral(">\r\n <th");
WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">\r\n Provider Details\r\n </th>\r\n <td>\r\n " +
" <div");
WriteLiteral(">Provider Details\r\n </th>\r\n <td>\r\n " +
" <div");
WriteLiteral(" id=\"jobWarrantyProviderDetailLoading\"");
WriteLiteral(">\r\n <span");
WriteLiteral(">\r\n <span");
WriteLiteral(" class=\"ajaxHelperIcon ajaxLoading\"");
WriteLiteral(" title=\"Loading...\"");
WriteLiteral("></span> Loading...\r\n </div>\r\n <div");
WriteLiteral("></span>Loading...\r\n </div>\r\n <div");
WriteLiteral(" id=\"jobWarrantyProviderDetailHost\"");
@@ -283,57 +547,95 @@ WriteLiteral(" class=\"clearfix\"");
WriteLiteral(" style=\"display: none\"");
WriteLiteral(">\r\n </div>\r\n </td>\r\n </tr>\r\n </table>\r\n</div>" +
"\r\n<script");
WriteLiteral(">\r\n </div>\r\n </td>\r\n </tr>\r\n");
#line 132 "..\..\Views\Job\JobParts\Warranty.cshtml"
}
#line default
#line hidden
WriteLiteral(" </table>\r\n</div>\r\n<script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$('#jobDetailTabItems').append('<li><a href=""#jobDetailTab-Warranty"">Warranty</a></li>');
WriteLiteral(">\r\n $(\'#jobDetailTabItems\').append(\'<li><a href=\"#jobDetailTab-Warranty\">Warra" +
"nty</a></li>\');\r\n");
#line 137 "..\..\Views\Job\JobParts\Warranty.cshtml"
#line default
#line hidden
#line 137 "..\..\Views\Job\JobParts\Warranty.cshtml"
if (Authorization.Has(Claims.Job.Properties.WarrantyProperties.ProviderDetails))
{
#line default
#line hidden
WriteLiteral(@"
$(function () {
var warrantyProviderDetailLoaded = false;
$('#jobDetailTabs').on('tabsactivate', function (e, ui) {
if ($(ui.newPanel).is('#jobDetailTab-Warranty')) {
if (!warrantyProviderDetailLoaded) {
var warrantyExternalName = $('#Job_JobMetaWarranty_ExternalName').val();
if (warrantyExternalName) {
$('#jobWarrantyProviderDetailContainer').show();
$('#jobWarrantyProviderDetailLoading span').show();
$('#jobWarrantyProviderDetailHost').load(
'");
var warrantyExternalName;
var $warrantyExternalName = $('#Job_JobMetaWarranty_ExternalName');
if ($warrantyExternalName.length > 0) {
if ($warrantyExternalName[0].nodeName === 'INPUT')
warrantyExternalName = $warrantyExternalName.val();
else
warrantyExternalName = $warrantyExternalName.text();
if (warrantyExternalName) {
$('#jobWarrantyProviderDetailContainer').show();
$('#jobWarrantyProviderDetailLoading span').show();
$('#jobWarrantyProviderDetailHost').load(
'");
#line 113 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(Url.Action(MVC.Job.WarrantyProviderJobDetails()));
#line 156 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(Url.Action(MVC.Job.WarrantyProviderJobDetails()));
#line default
#line hidden
WriteLiteral("\',\r\n { id: \'");
WriteLiteral("\',\r\n { id: \'");
#line 114 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(Model.Job.Id);
#line 157 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(Model.Job.Id);
#line default
#line hidden
WriteLiteral(@"' },
function () {
$('#jobWarrantyProviderDetailLoading').hide();
$(this).slideDown();
}
);
function () {
$('#jobWarrantyProviderDetailLoading').hide();
$(this).slideDown();
}
);
warrantyProviderDetailLoaded = true;
warrantyProviderDetailLoaded = true;
}
}
}
}
});
});
</script>
");
");
#line 171 "..\..\Views\Job\JobParts\Warranty.cshtml"
}
#line default
#line hidden
WriteLiteral("</script>\r\n");
}
}
+138 -99
View File
@@ -1,5 +1,7 @@
@model Disco.Web.Models.Job.ShowModel
@{
Authorization.Require(Claims.Job.Show);
}
<table id="Job_Show_Subjects">
<tr>
<td id="Job_Show_Job">
@@ -17,7 +19,9 @@
<td>
<span title="Expected to Close">Expected:</span>
</td>
<td>@Html.TextBoxFor(m => m.Job.ExpectedClosedDate, new { @class = "small discreet" }) @AjaxHelpers.AjaxSave() @AjaxHelpers.AjaxLoader()
<td>@if (Authorization.Has(Claims.Job.Properties.ExpectedClosedDate))
{
@Html.TextBoxFor(m => m.Job.ExpectedClosedDate, new { @class = "small discreet" }) @AjaxHelpers.AjaxSave() @AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var $ajaxSave = $('#Job_ExpectedClosedDate').next('.ajaxSave');
@@ -58,6 +62,11 @@
});
});
</script>
}
else
{
@CommonHelpers.FriendlyDate(Model.Job.ExpectedClosedDate)
}
</td>
</tr>
}
@@ -93,81 +102,90 @@
<li title="@jobSubType.Id">@jobSubType.Description</li>
}
</ul>
@if (!Model.Job.ClosedDate.HasValue)
@if (Authorization.Has(Claims.Job.Actions.UpdateSubTypes) && !Model.Job.ClosedDate.HasValue)
{
<a href="#" id="Job_Show_Job_SubTypes_Update">Update Sub Types</a>
}
</td>
</tr>
</table>
<div id="Job_Show_Job_SubTypes_Update_Dialog" title="Update Job Types">
<div>
<h2>
@Model.Job.JobType.Description</h2>
@using (Html.BeginForm(MVC.API.Job.UpdateSubTypes(Model.Job.Id, redirect: true), FormMethod.Post, new { id = "formUpdateJobTypes" }))
{
@CommonHelpers.CheckBoxList("SubTypes", Model.UpdatableJobSubTypes.ToSelectListItems(Model.Job.JobSubTypes.ToList()), 3)
<hr />
<div>
<input type="checkbox" value="true" id="UpdateJobTypesAddComponents" name="AddComponents"
checked="checked" /><label for="UpdateJobTypesAddComponents">Add Components for newly added Sub Types</label>
</div>
}
@if (Authorization.Has(Claims.Job.Actions.UpdateSubTypes))
{
<div id="Job_Show_Job_SubTypes_Update_Dialog" title="Update Job Types">
<div>
<h2>
@Model.Job.JobType.Description</h2>
@using (Html.BeginForm(MVC.API.Job.UpdateSubTypes(Model.Job.Id, redirect: true), FormMethod.Post, new { id = "formUpdateJobTypes" }))
{
@CommonHelpers.CheckBoxList("SubTypes", Model.UpdatableJobSubTypes.ToSelectListItems(Model.Job.JobSubTypes.ToList()), 3)
<hr />
<div>
<input type="checkbox" value="true" id="UpdateJobTypesAddComponents" name="AddComponents"
checked="checked" /><label for="UpdateJobTypesAddComponents">Add Components for newly added Sub Types</label>
</div>
}
</div>
</div>
</div>
<script>
$(function(){
var $Job_Show_Job_SubTypes_Update_Dialog = null;
<script>
$(function(){
var $Job_Show_Job_SubTypes_Update_Dialog = null;
$('#Job_Show_Job_SubTypes_Update').click(function () {
if (!$Job_Show_Job_SubTypes_Update_Dialog) {
$Job_Show_Job_SubTypes_Update_Dialog = $('#Job_Show_Job_SubTypes_Update_Dialog');
$Job_Show_Job_SubTypes_Update_Dialog.dialog({
resizable: false,
modal: true,
autoOpen: false,
width: 700,
buttons: {
"Save": function () {
$('#formUpdateJobTypes').submit();
$Job_Show_Job_SubTypes_Update_Dialog.dialog("disable");
},
Cancel: function () {
$(this).dialog("close");
$('#Job_Show_Job_SubTypes_Update').click(function () {
if (!$Job_Show_Job_SubTypes_Update_Dialog) {
$Job_Show_Job_SubTypes_Update_Dialog = $('#Job_Show_Job_SubTypes_Update_Dialog');
$Job_Show_Job_SubTypes_Update_Dialog.dialog({
resizable: false,
modal: true,
autoOpen: false,
width: 700,
buttons: {
"Save": function () {
$('#formUpdateJobTypes').submit();
$Job_Show_Job_SubTypes_Update_Dialog.dialog("disable");
},
Cancel: function () {
$(this).dialog("close");
}
}
}
});
}
});
}
$Job_Show_Job_SubTypes_Update_Dialog.dialog('open');
return false;
$Job_Show_Job_SubTypes_Update_Dialog.dialog('open');
return false;
});
});
});
</script>
</script>
}
</div>
<div id="Job_Show_GenerateDocument_Container" class="status">
@Html.DropDownList("Job_Show_GenerateDocument", Model.DocumentTemplatesSelectListItems)
<script type="text/javascript">
$(function () {
var generatePdfUrl = '@Url.Action(MVC.API.Job.GeneratePdf(Model.Job.Id.ToString(), null))?DocumentTemplateId=';
var $documentTemplates = $('#Job_Show_GenerateDocument');
$documentTemplates.change(function () {
var v = $documentTemplates.val();
if (v) {
window.location.href = generatePdfUrl + v;
$documentTemplates.val('').blur();
}
@if (Authorization.Has(Claims.Job.Actions.GenerateDocuments))
{
<div id="Job_Show_GenerateDocument_Container" class="status">
@Html.DropDownList("Job_Show_GenerateDocument", Model.DocumentTemplatesSelectListItems)
<script type="text/javascript">
$(function () {
var generatePdfUrl = '@Url.Action(MVC.API.Job.GeneratePdf(Model.Job.Id.ToString(), null))?DocumentTemplateId=';
var $documentTemplates = $('#Job_Show_GenerateDocument');
$documentTemplates.change(function () {
var v = $documentTemplates.val();
if (v) {
window.location.href = generatePdfUrl + v;
$documentTemplates.val('').blur();
}
});
});
});
</script>
</div>
</script>
</div>
}
</div>
</td>
@if (Model.Job.Device != null)
{
<td id="Job_Show_Device">
<div>
<h2 id="Job_Show_Device_SerialNumber" title="Serial Number">@Html.ActionLink(Model.Job.DeviceSerialNumber, MVC.Device.Show(Model.Job.DeviceSerialNumber))</h2>
<h2 id="Job_Show_Device_SerialNumber" title="Serial Number">@if (Authorization.Has(Claims.Device.Show))
{@Html.ActionLink(Model.Job.DeviceSerialNumber, MVC.Device.Show(Model.Job.DeviceSerialNumber))}
else
{@Model.Job.DeviceSerialNumber}</h2>
<div class="clearfix">
<div id="Job_Show_Device_Details">
<img id="Job_Show_Device_Model_Image" alt="Model Image" src="@Url.Action(MVC.API.DeviceModel.Image(Model.Job.Device.DeviceModelId, Model.Job.Device.DeviceModel.ImageHash()))" />
@@ -247,7 +265,22 @@
<table class="none">
<tr>
<td>Location:</td>
<td>@Html.TextBoxFor(m => m.Job.DeviceHeldLocation, new { @class = "small discreet" }) @AjaxHelpers.AjaxSave() @AjaxHelpers.AjaxLoader()</td>
<td>
<span id="Job_Show_Device_DeviceHeld_Location">
@if (Authorization.Has(Claims.Job.Properties.DeviceHeldLocation))
{
@Html.TextBoxFor(m => m.Job.DeviceHeldLocation, new { @class = "small discreet" }) @AjaxHelpers.AjaxSave() @AjaxHelpers.AjaxLoader()
}
else if (string.IsNullOrEmpty(Model.Job.DeviceHeldLocation))
{
<span class="smallMessage">&lt;None/Unknown&gt;</span>
}
else
{
@Model.Job.DeviceHeldLocation
}
</span>
</td>
</tr>
<tr>
<td>Held Since:</td>
@@ -268,47 +301,49 @@
</tr>
}
</table>
@if (Authorization.Has(Claims.Job.Properties.DeviceHeldLocation))
{
<script type="text/javascript">
$(function () {
var $deviceHeldLocation = $('#Job_DeviceHeldLocation');
var $ajaxSave = $deviceHeldLocation.next('.ajaxSave');
<script type="text/javascript">
$(function () {
var $deviceHeldLocation = $('#Job_DeviceHeldLocation');
var $ajaxSave = $deviceHeldLocation.next('.ajaxSave');
$deviceHeldLocation
.watermark('Unknown')
.focus(function () { $deviceHeldLocation.select() })
.keydown(function (e) {
$ajaxSave.show();
if (e.which == 13) {
$(this).blur();
}
}).blur(function () {
$ajaxSave.hide();
})
.change(function () {
$ajaxSave.hide();
$ajaxLoading = $ajaxSave.next('.ajaxLoading').show();
var data = { DeviceHeldLocation: $deviceHeldLocation.val() };
$.ajax({
url: '@Url.Action(MVC.API.Job.UpdateDeviceHeldLocation(Model.Job.Id, null))',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
} else {
$ajaxLoading.hide();
alert('Unable to update device held location: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update device held location: ' + textStatus);
$ajaxLoading.hide();
$deviceHeldLocation
.watermark('Unknown')
.focus(function () { $deviceHeldLocation.select() })
.keydown(function (e) {
$ajaxSave.show();
if (e.which == 13) {
$(this).blur();
}
}).blur(function () {
$ajaxSave.hide();
})
.change(function () {
$ajaxSave.hide();
$ajaxLoading = $ajaxSave.next('.ajaxLoading').show();
var data = { DeviceHeldLocation: $deviceHeldLocation.val() };
$.ajax({
url: '@Url.Action(MVC.API.Job.UpdateDeviceHeldLocation(Model.Job.Id, null))',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
} else {
$ajaxLoading.hide();
alert('Unable to update device held location: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update device held location: ' + textStatus);
$ajaxLoading.hide();
}
});
});
});
});
</script>
});
</script>
}
</div>
}
</div>
@@ -318,8 +353,12 @@
{
<td id="Job_Show_User">
<div>
<h2 id="Job_Show_User_DisplayName" title="Display Name">@Html.ActionLink(Model.Job.User.DisplayName, MVC.User.Show(Model.Job.UserId))</h2>
<div id="Job_Show_User_Id" title="Id">@Model.Job.UserId <span id="Job_Show_User_Type" title="Type">[@(Model.Job.User.Type)]</span></div>
<h2 id="Job_Show_User_DisplayName" title="Display Name">@if (Authorization.Has(Claims.User.Show))
{@Html.ActionLink(Model.Job.User.DisplayName, MVC.User.Show(Model.Job.UserId))}
else
{@Model.Job.User.DisplayName}
</h2>
<div id="Job_Show_User_Id" title="Id">@Model.Job.UserId</div>
@if (!string.IsNullOrWhiteSpace(Model.Job.User.PhoneNumber))
{<div id="Job_Show_User_PhoneNumber" title="Phone Number">Phone: @Model.Job.User.PhoneNumber</div>}
@if (!string.IsNullOrWhiteSpace(Model.Job.User.EmailAddress))
File diff suppressed because it is too large Load Diff
+4 -2
View File
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Views.Job
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
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/Job/List.cshtml")]
public partial class List : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ListModel>
public partial class List : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.ListModel>
{
public List()
{
+2
View File
@@ -1,5 +1,7 @@
@model Disco.Web.Models.Job.LogWarrantyModel
@{
Authorization.Require(Claims.Job.Actions.LogWarranty);
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Log Warranty");
}
@using (Html.BeginForm(MVC.Job.LogWarranty(), FormMethod.Post))
+42 -38
View File
@@ -28,12 +28,14 @@ namespace Disco.Web.Views.Job
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
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/Job/LogWarranty.cshtml")]
public partial class LogWarranty : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.LogWarrantyModel>
public partial class LogWarranty : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.LogWarrantyModel>
{
public LogWarranty()
{
@@ -43,6 +45,8 @@ namespace Disco.Web.Views.Job
#line 2 "..\..\Views\Job\LogWarranty.cshtml"
Authorization.Require(Claims.Job.Actions.LogWarranty);
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Log Warranty");
@@ -51,7 +55,7 @@ namespace Disco.Web.Views.Job
WriteLiteral("\r\n");
#line 5 "..\..\Views\Job\LogWarranty.cshtml"
#line 7 "..\..\Views\Job\LogWarranty.cshtml"
using (Html.BeginForm(MVC.Job.LogWarranty(), FormMethod.Post))
{
@@ -59,42 +63,42 @@ WriteLiteral("\r\n");
#line default
#line hidden
#line 7 "..\..\Views\Job\LogWarranty.cshtml"
#line 9 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.ValidationSummary(true));
#line default
#line hidden
#line 7 "..\..\Views\Job\LogWarranty.cshtml"
#line 9 "..\..\Views\Job\LogWarranty.cshtml"
#line default
#line hidden
#line 8 "..\..\Views\Job\LogWarranty.cshtml"
#line 10 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.HiddenFor(m => m.JobId));
#line default
#line hidden
#line 8 "..\..\Views\Job\LogWarranty.cshtml"
#line 10 "..\..\Views\Job\LogWarranty.cshtml"
#line default
#line hidden
#line 9 "..\..\Views\Job\LogWarranty.cshtml"
#line 11 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.ValidationMessageFor(m => m.JobId));
#line default
#line hidden
#line 9 "..\..\Views\Job\LogWarranty.cshtml"
#line 11 "..\..\Views\Job\LogWarranty.cshtml"
@@ -124,7 +128,7 @@ WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>In
WriteLiteral(" ");
#line 17 "..\..\Views\Job\LogWarranty.cshtml"
#line 19 "..\..\Views\Job\LogWarranty.cshtml"
Write(Model.JobId);
@@ -136,7 +140,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>
WriteLiteral(" ");
#line 24 "..\..\Views\Job\LogWarranty.cshtml"
#line 26 "..\..\Views\Job\LogWarranty.cshtml"
Write(Model.Job.Device.SerialNumber);
@@ -148,7 +152,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>
WriteLiteral(" ");
#line 31 "..\..\Views\Job\LogWarranty.cshtml"
#line 33 "..\..\Views\Job\LogWarranty.cshtml"
Write(Model.Job.Device.DeviceModel.Manufacturer);
@@ -157,7 +161,7 @@ WriteLiteral(" ");
WriteLiteral(" ");
#line 31 "..\..\Views\Job\LogWarranty.cshtml"
#line 33 "..\..\Views\Job\LogWarranty.cshtml"
Write(Model.Job.Device.DeviceModel.Model);
@@ -169,7 +173,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>
WriteLiteral(" ");
#line 38 "..\..\Views\Job\LogWarranty.cshtml"
#line 40 "..\..\Views\Job\LogWarranty.cshtml"
Write(Model.TechUser.DisplayName);
@@ -182,7 +186,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">\r\n Email Address: ");
#line 40 "..\..\Views\Job\LogWarranty.cshtml"
#line 42 "..\..\Views\Job\LogWarranty.cshtml"
Write(Model.TechUser.EmailAddress);
@@ -191,7 +195,7 @@ WriteLiteral(">\r\n Email Address: ");
WriteLiteral("<br />\r\n Phone Number: ");
#line 41 "..\..\Views\Job\LogWarranty.cshtml"
#line 43 "..\..\Views\Job\LogWarranty.cshtml"
Write(Model.TechUser.PhoneNumber);
@@ -207,7 +211,7 @@ WriteLiteral(">Repair Address:\r\n </th>\r\n <td>\
WriteLiteral(" ");
#line 49 "..\..\Views\Job\LogWarranty.cshtml"
#line 51 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.DropDownListFor(model => model.OrganisationAddressId, Model.OrganisationAddresses.ToSelectListItems(Model.OrganisationAddressId, (Model.OrganisationAddress == null))));
@@ -218,7 +222,7 @@ WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 50 "..\..\Views\Job\LogWarranty.cshtml"
#line 52 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.ValidationMessageFor(m => m.OrganisationAddressId));
@@ -232,14 +236,14 @@ WriteLiteral(" style=\"display: none\"");
WriteLiteral(">\r\n <img");
WriteAttribute("src", Tuple.Create(" src=\"", 2075), Tuple.Create("\"", 2134)
WriteAttribute("src", Tuple.Create(" src=\"", 2141), Tuple.Create("\"", 2200)
#line 52 "..\..\Views\Job\LogWarranty.cshtml"
, Tuple.Create(Tuple.Create("", 2081), Tuple.Create<System.Object, System.Int32>(Links.ClientSource.Style.Images.Status.loading_gif
#line 54 "..\..\Views\Job\LogWarranty.cshtml"
, Tuple.Create(Tuple.Create("", 2147), Tuple.Create<System.Object, System.Int32>(Links.ClientSource.Style.Images.Status.loading_gif
#line default
#line hidden
, 2081), false)
, 2147), false)
);
WriteLiteral(" alt=\"Loading\"");
@@ -255,13 +259,13 @@ WriteLiteral(" id=\"organisationAddressDetails\"");
WriteLiteral(">\r\n");
#line 56 "..\..\Views\Job\LogWarranty.cshtml"
#line 58 "..\..\Views\Job\LogWarranty.cshtml"
#line default
#line hidden
#line 56 "..\..\Views\Job\LogWarranty.cshtml"
#line 58 "..\..\Views\Job\LogWarranty.cshtml"
var oa = Model.OrganisationAddress;
if (oa != null)
@@ -273,7 +277,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" <span>");
#line 60 "..\..\Views\Job\LogWarranty.cshtml"
#line 62 "..\..\Views\Job\LogWarranty.cshtml"
Write(oa.Address);
@@ -286,7 +290,7 @@ WriteLiteral(" <br />\r\n");
WriteLiteral(" <span>");
#line 62 "..\..\Views\Job\LogWarranty.cshtml"
#line 64 "..\..\Views\Job\LogWarranty.cshtml"
Write(oa.Suburb);
@@ -295,7 +299,7 @@ WriteLiteral(" <span>");
WriteLiteral(", ");
#line 62 "..\..\Views\Job\LogWarranty.cshtml"
#line 64 "..\..\Views\Job\LogWarranty.cshtml"
Write(oa.Postcode);
@@ -308,7 +312,7 @@ WriteLiteral(" <br />\r\n");
WriteLiteral(" <span>");
#line 64 "..\..\Views\Job\LogWarranty.cshtml"
#line 66 "..\..\Views\Job\LogWarranty.cshtml"
Write(oa.State);
@@ -317,7 +321,7 @@ WriteLiteral(" <span>");
WriteLiteral(", ");
#line 64 "..\..\Views\Job\LogWarranty.cshtml"
#line 66 "..\..\Views\Job\LogWarranty.cshtml"
Write(oa.Country);
@@ -326,7 +330,7 @@ WriteLiteral(", ");
WriteLiteral("</span>\r\n");
#line 65 "..\..\Views\Job\LogWarranty.cshtml"
#line 67 "..\..\Views\Job\LogWarranty.cshtml"
}
@@ -339,7 +343,7 @@ WriteLiteral("\r\n </div>\r\n </td>\r\n
WriteLiteral(" ");
#line 74 "..\..\Views\Job\LogWarranty.cshtml"
#line 76 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.DropDownListFor(model => model.WarrantyProviderId, Model.WarrantyProviders.ToSelectListItems(Model.WarrantyProviderId, true)));
@@ -350,7 +354,7 @@ WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 75 "..\..\Views\Job\LogWarranty.cshtml"
#line 77 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.ValidationMessageFor(m => m.WarrantyProviderId));
@@ -372,7 +376,7 @@ WriteLiteral(">\r\n <h2>Fault Description</h2>\r\n <table>\r\n
WriteLiteral(" ");
#line 85 "..\..\Views\Job\LogWarranty.cshtml"
#line 87 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.EditorFor(model => model.FaultDescription));
@@ -383,7 +387,7 @@ WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 86 "..\..\Views\Job\LogWarranty.cshtml"
#line 88 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.ValidationMessageFor(m => m.FaultDescription));
@@ -392,7 +396,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n");
#line 91 "..\..\Views\Job\LogWarranty.cshtml"
#line 93 "..\..\Views\Job\LogWarranty.cshtml"
if (Model.WarrantyProvider != null && Model.WarrantyProviderSubmitJobViewType != null)
{
@@ -408,7 +412,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 94 "..\..\Views\Job\LogWarranty.cshtml"
#line 96 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.PartialCompiled(Model.WarrantyProviderSubmitJobViewType, Model.WarrantyProviderSubmitJobModel));
@@ -417,7 +421,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n </div>\r\n");
#line 96 "..\..\Views\Job\LogWarranty.cshtml"
#line 98 "..\..\Views\Job\LogWarranty.cshtml"
}
@@ -438,7 +442,7 @@ WriteLiteral(" value=\"Preview Warranty Claim\"");
WriteLiteral(" />\r\n </div>\r\n");
#line 100 "..\..\Views\Job\LogWarranty.cshtml"
#line 102 "..\..\Views\Job\LogWarranty.cshtml"
}
@@ -465,7 +469,7 @@ WriteLiteral(@">
window.location.href = '");
#line 115 "..\..\Views\Job\LogWarranty.cshtml"
#line 117 "..\..\Views\Job\LogWarranty.cshtml"
Write(Url.Action(MVC.Job.LogWarranty(Model.JobId, null, null)));
@@ -1,5 +1,7 @@
@model Disco.Web.Models.Job.LogWarrantyModel
@{
Authorization.Require(Claims.Job.Actions.LogWarranty);
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Log Warranty");
}
@using (Html.BeginForm(MVC.Job.LogWarranty(), FormMethod.Post))
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Views.Job
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
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/Job/LogWarrantyDisclose.cshtml")]
public partial class LogWarrantyDisclose : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.LogWarrantyModel>
public partial class LogWarrantyDisclose : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.LogWarrantyModel>
{
public LogWarrantyDisclose()
{
@@ -43,6 +45,8 @@ namespace Disco.Web.Views.Job
#line 2 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Authorization.Require(Claims.Job.Actions.LogWarranty);
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Log Warranty");
@@ -51,7 +55,7 @@ namespace Disco.Web.Views.Job
WriteLiteral("\r\n");
#line 5 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 7 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
using (Html.BeginForm(MVC.Job.LogWarranty(), FormMethod.Post))
{
@@ -59,84 +63,84 @@ WriteLiteral("\r\n");
#line default
#line hidden
#line 7 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 9 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Html.ValidationSummary(true));
#line default
#line hidden
#line 7 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 9 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line default
#line hidden
#line 8 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 10 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Html.HiddenFor(m => m.JobId));
#line default
#line hidden
#line 8 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 10 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line default
#line hidden
#line 9 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 11 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Html.HiddenFor(m => m.OrganisationAddressId));
#line default
#line hidden
#line 9 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 11 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line default
#line hidden
#line 10 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 12 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Html.HiddenFor(m => m.WarrantyProviderId));
#line default
#line hidden
#line 10 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 12 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line default
#line hidden
#line 11 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 13 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Html.HiddenFor(m => m.FaultDescription));
#line default
#line hidden
#line 11 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 13 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line default
#line hidden
#line 12 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 14 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Html.HiddenFor(m => m.WarrantyProviderPropertiesJson));
#line default
#line hidden
#line 12 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 14 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
@@ -166,7 +170,7 @@ WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>\r
WriteLiteral(" ");
#line 21 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 23 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.JobId);
@@ -179,7 +183,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>
WriteLiteral(" ");
#line 29 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 31 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.Job.Device.SerialNumber);
@@ -192,7 +196,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>
WriteLiteral(" ");
#line 37 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 39 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.Job.Device.DeviceModel.Manufacturer);
@@ -201,7 +205,7 @@ WriteLiteral(" ");
WriteLiteral(" ");
#line 37 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 39 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.Job.Device.DeviceModel.Model);
@@ -214,7 +218,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>
WriteLiteral(" ");
#line 45 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 47 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.TechUser.DisplayName);
@@ -227,7 +231,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">\r\n Email Address: ");
#line 47 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 49 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.TechUser.EmailAddress);
@@ -236,7 +240,7 @@ WriteLiteral(">\r\n Email Address: ");
WriteLiteral("<br />\r\n Phone Number: ");
#line 48 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 50 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.TechUser.PhoneNumber);
@@ -257,7 +261,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 58 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 60 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.OrganisationAddress.Name);
@@ -270,7 +274,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">\r\n <span>");
#line 60 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 62 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.OrganisationAddress.Address);
@@ -279,7 +283,7 @@ WriteLiteral(">\r\n <span>");
WriteLiteral("</span><br />\r\n <span>");
#line 61 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 63 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.OrganisationAddress.Suburb);
@@ -288,7 +292,7 @@ WriteLiteral("</span><br />\r\n <span>");
WriteLiteral(", ");
#line 61 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 63 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.OrganisationAddress.Postcode);
@@ -297,7 +301,7 @@ WriteLiteral(", ");
WriteLiteral("</span><br />\r\n <span>");
#line 62 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 64 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.OrganisationAddress.State);
@@ -306,7 +310,7 @@ WriteLiteral("</span><br />\r\n <span>");
WriteLiteral(", ");
#line 62 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 64 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.OrganisationAddress.Country);
@@ -319,7 +323,7 @@ WriteLiteral("</span>\r\n </div>\r\n <
WriteLiteral(" ");
#line 72 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 74 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.WarrantyProvider.Name);
@@ -328,7 +332,7 @@ WriteLiteral(" ");
WriteLiteral(" (");
#line 72 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 74 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.WarrantyProvider.Id);
@@ -337,7 +341,7 @@ WriteLiteral(" (");
WriteLiteral(") ");
#line 72 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 74 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.WarrantyProvider.PluginManifest.Version.ToString(3));
@@ -350,7 +354,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>
WriteLiteral(" ");
#line 80 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 82 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.FaultDescription.ToMultilineString());
@@ -365,13 +369,13 @@ WriteLiteral(" id=\"warrantyDisclosedInformation\"");
WriteLiteral(">\r\n <table>\r\n");
#line 90 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 92 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line default
#line hidden
#line 90 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 92 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
foreach (var dp in Model.DiscloseProperties)
{
@@ -381,7 +385,7 @@ WriteLiteral(">\r\n <table>\r\n");
WriteLiteral(" <tr>\r\n <th>");
#line 93 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 95 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(dp.Key);
@@ -391,7 +395,7 @@ WriteLiteral(":\r\n </th>\r\n
" <td>");
#line 95 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 97 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(dp.Value);
@@ -401,7 +405,7 @@ WriteLiteral("\r\n </td>\r\n
"> \r\n");
#line 98 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 100 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
}
@@ -425,7 +429,7 @@ WriteLiteral(" value=\"Submit Warranty Claim\"");
WriteLiteral(" />\r\n </div>\r\n");
#line 108 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line 110 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
}
#line default
@@ -1,5 +1,7 @@
@model Disco.Web.Models.Job.LogWarrantyModel
@{
Authorization.Require(Claims.Job.Actions.LogWarranty);
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Log Warranty Error");
}
<div class="form" style="width: 650px">
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Views.Job
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
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/Job/LogWarrantyError.cshtml")]
public partial class LogWarrantyError : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.LogWarrantyModel>
public partial class LogWarrantyError : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.LogWarrantyModel>
{
public LogWarrantyError()
{
@@ -43,6 +45,8 @@ namespace Disco.Web.Views.Job
#line 2 "..\..\Views\Job\LogWarrantyError.cshtml"
Authorization.Require(Claims.Job.Actions.LogWarranty);
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Log Warranty Error");
@@ -58,7 +62,7 @@ WriteLiteral(">\r\n <h2>\r\n Submission Error</h2>\r\n <table>\r\n
" <td>\r\n <div>\r\n <strong>");
#line 12 "..\..\Views\Job\LogWarrantyError.cshtml"
#line 14 "..\..\Views\Job\LogWarrantyError.cshtml"
Write(Model.Error.Message);
@@ -81,7 +85,7 @@ WriteLiteral(" style=\"display: none\"");
WriteLiteral(">\r\n <br />\r\n <strong>Error Type: </strong>");
#line 17 "..\..\Views\Job\LogWarrantyError.cshtml"
#line 19 "..\..\Views\Job\LogWarrantyError.cshtml"
Write(Model.Error.GetType().Name);
@@ -97,7 +101,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 21 "..\..\Views\Job\LogWarrantyError.cshtml"
#line 23 "..\..\Views\Job\LogWarrantyError.cshtml"
Write(Model.Error.StackTrace.ToMultilineString());
@@ -106,13 +110,13 @@ WriteLiteral(" ");
WriteLiteral("\r\n </div>\r\n");
#line 23 "..\..\Views\Job\LogWarrantyError.cshtml"
#line 25 "..\..\Views\Job\LogWarrantyError.cshtml"
#line default
#line hidden
#line 23 "..\..\Views\Job\LogWarrantyError.cshtml"
#line 25 "..\..\Views\Job\LogWarrantyError.cshtml"
if (Model.Error.InnerException != null)
{
@@ -125,7 +129,7 @@ WriteLiteral(" <div>\r\n <stro
"n:</strong> ");
#line 27 "..\..\Views\Job\LogWarrantyError.cshtml"
#line 29 "..\..\Views\Job\LogWarrantyError.cshtml"
Write(Model.Error.InnerException.Message);
@@ -134,7 +138,7 @@ WriteLiteral(" <div>\r\n <stro
WriteLiteral("<br />\r\n <strong>Error Type:</strong> ");
#line 28 "..\..\Views\Job\LogWarrantyError.cshtml"
#line 30 "..\..\Views\Job\LogWarrantyError.cshtml"
Write(Model.Error.GetType().Name);
@@ -150,7 +154,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 31 "..\..\Views\Job\LogWarrantyError.cshtml"
#line 33 "..\..\Views\Job\LogWarrantyError.cshtml"
Write(Model.Error.InnerException.StackTrace);
@@ -159,7 +163,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n </div>\r\n </div>\r\n");
#line 34 "..\..\Views\Job\LogWarrantyError.cshtml"
#line 36 "..\..\Views\Job\LogWarrantyError.cshtml"
}
@@ -196,7 +200,7 @@ WriteLiteral(">\r\n <h2>\r\n Warranty Submission Details</h2>\r\n <
WriteLiteral(" ");
#line 57 "..\..\Views\Job\LogWarrantyError.cshtml"
#line 59 "..\..\Views\Job\LogWarrantyError.cshtml"
Write(Model.JobId);
@@ -208,7 +212,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n
WriteLiteral(" ");
#line 65 "..\..\Views\Job\LogWarrantyError.cshtml"
#line 67 "..\..\Views\Job\LogWarrantyError.cshtml"
Write(Model.Job.Device.SerialNumber);
@@ -220,7 +224,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n
WriteLiteral(" ");
#line 73 "..\..\Views\Job\LogWarrantyError.cshtml"
#line 75 "..\..\Views\Job\LogWarrantyError.cshtml"
Write(Model.Job.Device.DeviceModel.Manufacturer);
@@ -229,7 +233,7 @@ WriteLiteral(" ");
WriteLiteral(" ");
#line 73 "..\..\Views\Job\LogWarrantyError.cshtml"
#line 75 "..\..\Views\Job\LogWarrantyError.cshtml"
Write(Model.Job.Device.DeviceModel.Model);
@@ -241,7 +245,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n
WriteLiteral(" ");
#line 81 "..\..\Views\Job\LogWarrantyError.cshtml"
#line 83 "..\..\Views\Job\LogWarrantyError.cshtml"
Write(Model.TechUser.DisplayName);
@@ -254,7 +258,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">\r\n Email Address: ");
#line 83 "..\..\Views\Job\LogWarrantyError.cshtml"
#line 85 "..\..\Views\Job\LogWarrantyError.cshtml"
Write(Model.TechUser.EmailAddress);
@@ -263,7 +267,7 @@ WriteLiteral(">\r\n Email Address: ");
WriteLiteral("<br />\r\n Phone Number: ");
#line 84 "..\..\Views\Job\LogWarrantyError.cshtml"
#line 86 "..\..\Views\Job\LogWarrantyError.cshtml"
Write(Model.TechUser.PhoneNumber);
@@ -284,7 +288,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 94 "..\..\Views\Job\LogWarrantyError.cshtml"
#line 96 "..\..\Views\Job\LogWarrantyError.cshtml"
Write(Model.OrganisationAddress.Name);
@@ -297,7 +301,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">\r\n <span>");
#line 96 "..\..\Views\Job\LogWarrantyError.cshtml"
#line 98 "..\..\Views\Job\LogWarrantyError.cshtml"
Write(Model.OrganisationAddress.Address);
@@ -306,7 +310,7 @@ WriteLiteral(">\r\n <span>");
WriteLiteral("</span><br />\r\n <span>");
#line 97 "..\..\Views\Job\LogWarrantyError.cshtml"
#line 99 "..\..\Views\Job\LogWarrantyError.cshtml"
Write(Model.OrganisationAddress.Suburb);
@@ -315,7 +319,7 @@ WriteLiteral("</span><br />\r\n <span>");
WriteLiteral(", ");
#line 97 "..\..\Views\Job\LogWarrantyError.cshtml"
#line 99 "..\..\Views\Job\LogWarrantyError.cshtml"
Write(Model.OrganisationAddress.Postcode);
@@ -324,7 +328,7 @@ WriteLiteral(", ");
WriteLiteral("</span><br />\r\n <span>");
#line 98 "..\..\Views\Job\LogWarrantyError.cshtml"
#line 100 "..\..\Views\Job\LogWarrantyError.cshtml"
Write(Model.OrganisationAddress.State);
@@ -333,7 +337,7 @@ WriteLiteral("</span><br />\r\n <span>");
WriteLiteral(", ");
#line 98 "..\..\Views\Job\LogWarrantyError.cshtml"
#line 100 "..\..\Views\Job\LogWarrantyError.cshtml"
Write(Model.OrganisationAddress.Country);
@@ -346,7 +350,7 @@ WriteLiteral("</span>\r\n </div>\r\n </div>\r\
WriteLiteral(" ");
#line 108 "..\..\Views\Job\LogWarrantyError.cshtml"
#line 110 "..\..\Views\Job\LogWarrantyError.cshtml"
Write(Model.WarrantyProvider.Name);
@@ -355,7 +359,7 @@ WriteLiteral(" ");
WriteLiteral(" (");
#line 108 "..\..\Views\Job\LogWarrantyError.cshtml"
#line 110 "..\..\Views\Job\LogWarrantyError.cshtml"
Write(Model.WarrantyProvider.Id);
@@ -364,7 +368,7 @@ WriteLiteral(" (");
WriteLiteral(") ");
#line 108 "..\..\Views\Job\LogWarrantyError.cshtml"
#line 110 "..\..\Views\Job\LogWarrantyError.cshtml"
Write(Model.WarrantyProvider.PluginManifest.Version.ToString(3));
@@ -376,7 +380,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n
WriteLiteral(" ");
#line 116 "..\..\Views\Job\LogWarrantyError.cshtml"
#line 118 "..\..\Views\Job\LogWarrantyError.cshtml"
Write(Model.FaultDescription.ToMultilineString());
@@ -391,7 +395,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 122 "..\..\Views\Job\LogWarrantyError.cshtml"
#line 124 "..\..\Views\Job\LogWarrantyError.cshtml"
Write(Html.ActionLinkButton("Try Again", MVC.Job.LogWarranty(Model.JobId, null, null)));
@@ -402,7 +406,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 123 "..\..\Views\Job\LogWarrantyError.cshtml"
#line 125 "..\..\Views\Job\LogWarrantyError.cshtml"
Write(Html.ActionLinkButton("Return to Job", MVC.Job.Show(Model.JobId)));
+53 -28
View File
@@ -1,8 +1,15 @@
@model Disco.Web.Models.Job.ShowModel
@{
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id.ToString()));
Html.BundleDeferred("~/ClientScripts/Modules/Silverlight");
if (Authorization.Has(Claims.Job.Actions.AddAttachments))
{
Html.BundleDeferred("~/ClientScripts/Modules/Silverlight");
}
Html.BundleDeferred("~/ClientScripts/Modules/jQueryUI-TimePicker");
Authorization.Require(Claims.Job.Show);
}
<div id="Job_Show">
<div id="Job_Show_Status">
@@ -18,39 +25,57 @@
<script type="text/javascript">
$(function () {
var $tabs = $('#jobDetailTabs');
$tabs.tabs({
activate: function (event, ui) {
window.setTimeout(function () {
var $window = $(window);
var tabHeight = $tabs.height();
var tabOffset = $tabs.offset();
var windowScrollTop = $window.scrollTop();
var windowHeight = $window.height();
if ($tabs.children().length > 1) {
$tabs.tabs({
activate: function (event, ui) {
window.setTimeout(function () {
var $window = $(window);
var tabHeight = $tabs.height();
var tabOffset = $tabs.offset();
var windowScrollTop = $window.scrollTop();
var windowHeight = $window.height();
var tabTopNotShown = windowScrollTop - tabOffset.top;
if (tabTopNotShown > 0) {
$('html').animate({ scrollTop: tabOffset.top }, 125);
} else {
var tabBottomNotShown = ((windowScrollTop + windowHeight) - (tabHeight + tabOffset.top)) * -1;
if (tabBottomNotShown > 0) {
if (tabHeight > windowHeight)
$('html').animate({ scrollTop: tabOffset.top }, 125);
else
$('html').animate({ scrollTop: windowScrollTop + tabBottomNotShown }, 125);
var tabTopNotShown = windowScrollTop - tabOffset.top;
if (tabTopNotShown > 0) {
$('html').animate({ scrollTop: tabOffset.top }, 125);
} else {
var tabBottomNotShown = ((windowScrollTop + windowHeight) - (tabHeight + tabOffset.top)) * -1;
if (tabBottomNotShown > 0) {
if (tabHeight > windowHeight)
$('html').animate({ scrollTop: tabOffset.top }, 125);
else
$('html').animate({ scrollTop: windowScrollTop + tabBottomNotShown }, 125);
}
}
}
}, 1);
}
});
}, 1);
}
});
} else {
$tabs.hide();
}
});
</script>
<div id="jobDetailTabs">
<ul id="jobDetailTabItems">
<li><a href="#jobDetailTab-Resources">Log and Attachments</a></li>
@if (Authorization.HasAll(Claims.Job.ShowLogs, Claims.Job.ShowAttachments))
{
<li><a href="#jobDetailTab-Resources">Log and Attachments</a></li>
}
else if (Authorization.Has(Claims.Job.ShowLogs))
{
<li><a href="#jobDetailTab-Resources">Log</a></li>
}
else if (Authorization.Has(Claims.Job.ShowLogs))
{
<li><a href="#jobDetailTab-Resources">Attachments</a></li>
}
</ul>
<div id="jobDetailTab-Resources" class="jobPart">
@Html.Partial(MVC.Job.Views.JobParts.Resources, Model)
</div>
@if (Authorization.HasAny(Claims.Job.ShowLogs, Claims.Job.ShowAttachments))
{
<div id="jobDetailTab-Resources" class="jobPart">
@Html.Partial(MVC.Job.Views.JobParts.Resources, Model)
</div>
}
@Html.Partial(MVC.Job.Views.JobParts.JobMetaAdditions, Model)
</div>
</div>
</div>
+128 -51
View File
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Views.Job
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
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/Job/Show.cshtml")]
public partial class Show : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
public partial class Show : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.ShowModel>
{
public Show()
{
@@ -44,9 +46,16 @@ namespace Disco.Web.Views.Job
#line 2 "..\..\Views\Job\Show.cshtml"
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id.ToString()));
Html.BundleDeferred("~/ClientScripts/Modules/Silverlight");
if (Authorization.Has(Claims.Job.Actions.AddAttachments))
{
Html.BundleDeferred("~/ClientScripts/Modules/Silverlight");
}
Html.BundleDeferred("~/ClientScripts/Modules/jQueryUI-TimePicker");
Authorization.Require(Claims.Job.Show);
#line default
#line hidden
@@ -61,35 +70,35 @@ WriteLiteral(" id=\"Job_Show_Status\"");
WriteLiteral(">\r\n");
#line 9 "..\..\Views\Job\Show.cshtml"
#line 16 "..\..\Views\Job\Show.cshtml"
#line default
#line hidden
#line 9 "..\..\Views\Job\Show.cshtml"
#line 16 "..\..\Views\Job\Show.cshtml"
var jobStatusInfo = Model.Job.Status();
#line default
#line hidden
WriteLiteral("\r\n <span");
WriteAttribute("class", Tuple.Create(" class=\"", 420), Tuple.Create("\"", 464)
, Tuple.Create(Tuple.Create("", 428), Tuple.Create("icon", 428), true)
, Tuple.Create(Tuple.Create(" ", 432), Tuple.Create("JobStatus", 433), true)
WriteAttribute("class", Tuple.Create(" class=\"", 552), Tuple.Create("\"", 596)
, Tuple.Create(Tuple.Create("", 560), Tuple.Create("icon", 560), true)
, Tuple.Create(Tuple.Create(" ", 564), Tuple.Create("JobStatus", 565), true)
#line 10 "..\..\Views\Job\Show.cshtml"
, Tuple.Create(Tuple.Create("", 442), Tuple.Create<System.Object, System.Int32>(jobStatusInfo.Item1
#line 17 "..\..\Views\Job\Show.cshtml"
, Tuple.Create(Tuple.Create("", 574), Tuple.Create<System.Object, System.Int32>(jobStatusInfo.Item1
#line default
#line hidden
, 442), false)
, 574), false)
);
WriteLiteral("></span>");
#line 10 "..\..\Views\Job\Show.cshtml"
#line 17 "..\..\Views\Job\Show.cshtml"
Write(jobStatusInfo.Item2);
@@ -105,7 +114,7 @@ WriteLiteral(">\r\n $(function () {\r\n $(\'#Job_Show_
WriteLiteral(" ");
#line 17 "..\..\Views\Job\Show.cshtml"
#line 24 "..\..\Views\Job\Show.cshtml"
Write(Html.Partial(MVC.Job.Views.JobParts._Subject, Model));
@@ -115,36 +124,26 @@ WriteLiteral("\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
var $tabs = $('#jobDetailTabs');
$tabs.tabs({
activate: function (event, ui) {
window.setTimeout(function () {
var $window = $(window);
var tabHeight = $tabs.height();
var tabOffset = $tabs.offset();
var windowScrollTop = $window.scrollTop();
var windowHeight = $window.height();
var tabTopNotShown = windowScrollTop - tabOffset.top;
if (tabTopNotShown > 0) {
$('html').animate({ scrollTop: tabOffset.top }, 125);
} else {
var tabBottomNotShown = ((windowScrollTop + windowHeight) - (tabHeight + tabOffset.top)) * -1;
if (tabBottomNotShown > 0) {
if (tabHeight > windowHeight)
$('html').animate({ scrollTop: tabOffset.top }, 125);
else
$('html').animate({ scrollTop: windowScrollTop + tabBottomNotShown }, 125);
}
}
}, 1);
}
});
});
</script>
<div");
WriteLiteral(">\r\n $(function () {\r\n var $tabs = $(\'#jobDetailTabs\');\r\n " +
" if ($tabs.children().length > 1) {\r\n $tabs.tabs({\r\n " +
" activate: function (event, ui) {\r\n window.setT" +
"imeout(function () {\r\n var $window = $(window);\r\n " +
" var tabHeight = $tabs.height();\r\n " +
" var tabOffset = $tabs.offset();\r\n var windowScro" +
"llTop = $window.scrollTop();\r\n var windowHeight = $wi" +
"ndow.height();\r\n\r\n var tabTopNotShown = windowScrollT" +
"op - tabOffset.top;\r\n if (tabTopNotShown > 0) {\r\n " +
" $(\'html\').animate({ scrollTop: tabOffset.top }, 125)" +
";\r\n } else {\r\n var tab" +
"BottomNotShown = ((windowScrollTop + windowHeight) - (tabHeight + tabOffset.top)" +
") * -1;\r\n if (tabBottomNotShown > 0) {\r\n " +
" if (tabHeight > windowHeight)\r\n " +
" $(\'html\').animate({ scrollTop: tabOffset.top }, 125);\r\n " +
" else\r\n $(\'ht" +
"ml\').animate({ scrollTop: windowScrollTop + tabBottomNotShown }, 125);\r\n " +
" }\r\n }\r\n " +
" }, 1);\r\n }\r\n });\r\n } else {\r\n " +
" $tabs.hide();\r\n }\r\n });\r\n </script>\r\n <div");
WriteLiteral(" id=\"jobDetailTabs\"");
@@ -152,11 +151,82 @@ WriteLiteral(">\r\n <ul");
WriteLiteral(" id=\"jobDetailTabItems\"");
WriteLiteral(">\r\n <li><a");
WriteLiteral(">\r\n");
#line 60 "..\..\Views\Job\Show.cshtml"
#line default
#line hidden
#line 60 "..\..\Views\Job\Show.cshtml"
if (Authorization.HasAll(Claims.Job.ShowLogs, Claims.Job.ShowAttachments))
{
#line default
#line hidden
WriteLiteral(" <li><a");
WriteLiteral(" href=\"#jobDetailTab-Resources\"");
WriteLiteral(">Log and Attachments</a></li>\r\n </ul>\r\n <div");
WriteLiteral(">Log and Attachments</a></li>\r\n");
#line 63 "..\..\Views\Job\Show.cshtml"
}
else if (Authorization.Has(Claims.Job.ShowLogs))
{
#line default
#line hidden
WriteLiteral(" <li><a");
WriteLiteral(" href=\"#jobDetailTab-Resources\"");
WriteLiteral(">Log</a></li>\r\n");
#line 67 "..\..\Views\Job\Show.cshtml"
}
else if (Authorization.Has(Claims.Job.ShowLogs))
{
#line default
#line hidden
WriteLiteral(" <li><a");
WriteLiteral(" href=\"#jobDetailTab-Resources\"");
WriteLiteral(">Attachments</a></li>\r\n");
#line 71 "..\..\Views\Job\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </ul>\r\n");
#line 73 "..\..\Views\Job\Show.cshtml"
#line default
#line hidden
#line 73 "..\..\Views\Job\Show.cshtml"
if (Authorization.HasAny(Claims.Job.ShowLogs, Claims.Job.ShowAttachments))
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" id=\"jobDetailTab-Resources\"");
@@ -164,27 +234,34 @@ WriteLiteral(" class=\"jobPart\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
WriteLiteral(" ");
#line 52 "..\..\Views\Job\Show.cshtml"
Write(Html.Partial(MVC.Job.Views.JobParts.Resources, Model));
#line 76 "..\..\Views\Job\Show.cshtml"
Write(Html.Partial(MVC.Job.Views.JobParts.Resources, Model));
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n");
WriteLiteral("\r\n </div>\r\n");
#line 78 "..\..\Views\Job\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 54 "..\..\Views\Job\Show.cshtml"
#line 79 "..\..\Views\Job\Show.cshtml"
Write(Html.Partial(MVC.Job.Views.JobParts.JobMetaAdditions, Model));
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n</div>");
WriteLiteral("\r\n </div>\r\n</div>\r\n");
}
}
@@ -1,6 +1,8 @@
@model Disco.Web.Models.Job.WarrantyProviderJobDetailsModel
@{ Layout = null;
Authorization.Require(Claims.Job.Properties.WarrantyProperties.ProviderDetails);
if (Model.JobDetailsException != null)
{
<h3>
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Views.Job
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
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/Job/WarrantyProviderJobDetails.cshtml")]
public partial class WarrantyProviderJobDetails : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.WarrantyProviderJobDetailsModel>
public partial class WarrantyProviderJobDetails : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.WarrantyProviderJobDetailsModel>
{
public WarrantyProviderJobDetails()
{
@@ -44,6 +46,8 @@ namespace Disco.Web.Views.Job
#line 2 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
Layout = null;
Authorization.Require(Claims.Job.Properties.WarrantyProperties.ProviderDetails);
if (Model.JobDetailsException != null)
{
@@ -55,7 +59,7 @@ WriteLiteral(" <h3>\r\n Error:</h3>\r\n");
WriteLiteral(" <div>\r\n <strong>");
#line 9 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
#line 11 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
Write(Model.JobDetailsException.Message);
@@ -82,7 +86,7 @@ WriteLiteral(" style=\"display: none\"");
WriteLiteral(">\r\n <br />\r\n <strong>Error Type: </strong>");
#line 14 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
#line 16 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
Write(Model.JobDetailsException.GetType().Name);
@@ -97,7 +101,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 18 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
#line 20 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
Write(Model.JobDetailsException.StackTrace.ToMultilineString());
@@ -106,13 +110,13 @@ WriteLiteral(" ");
WriteLiteral("\r\n </div>\r\n");
#line 20 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
#line 22 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
#line default
#line hidden
#line 20 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
#line 22 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
if (Model.JobDetailsException.InnerException != null)
{
@@ -124,7 +128,7 @@ WriteLiteral(" <hr />\r\n");
WriteLiteral(" <div>\r\n <strong>Inner Exception:</strong> ");
#line 24 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
#line 26 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
Write(Model.JobDetailsException.InnerException.Message);
@@ -133,7 +137,7 @@ WriteLiteral(" <div>\r\n <strong>Inner Exception:</str
WriteLiteral("<br />\r\n <strong>Error Type:</strong> ");
#line 25 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
#line 27 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
Write(Model.JobDetailsException.GetType().Name);
@@ -148,7 +152,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 28 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
#line 30 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
Write(Model.JobDetailsException.InnerException.StackTrace);
@@ -157,7 +161,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n </div>\r\n </div>\r\n");
#line 31 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
#line 33 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
}
@@ -179,7 +183,7 @@ WriteLiteral(@">
");
#line 41 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
#line 43 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
}
else
{
@@ -190,14 +194,14 @@ WriteLiteral(@">
#line default
#line hidden
#line 46 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
#line 48 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
Write(Html.PartialCompiled(Model.ViewType, Model.ViewModel));
#line default
#line hidden
#line 46 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
#line 48 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
}
else
@@ -213,7 +217,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">");
#line 50 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
#line 52 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
Write(Model.JobDetailsNotSupportedMessage);
@@ -222,7 +226,7 @@ WriteLiteral(">");
WriteLiteral("</span>\r\n");
#line 51 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
#line 53 "..\..\Views\Job\WarrantyProviderJobDetails.cshtml"
}
}
+5 -3
View File
@@ -1,4 +1,7 @@
@model Disco.Web.Models.Job.CreateModel
@{
Authorization.Require(Claims.Job.Actions.Create);
}
<table>
<tr>
<td>
@@ -19,7 +22,7 @@
{
<span><strong>Serial Number:</strong> @Model.Device.SerialNumber</span><br />
<span><strong>Name:</strong> @Model.Device.ComputerName</span><br />
<span><strong>Model:</strong> @Model.Device.DeviceModel.ToString()</span><br />
<span><strong>Model:</strong> @Model.Device.DeviceModel.ToString()</span>
}
</td>
<td>
@@ -33,8 +36,7 @@
else
{
<span><strong>Id:</strong> @Model.User.Id</span><br />
<span><strong>Name:</strong> @Model.User.DisplayName</span><br />
<span><strong>Type:</strong> @Model.User.Type</span>
<span><strong>Name:</strong> @Model.User.DisplayName</span>
}
</td>
</tr>
+34 -39
View File
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,28 +28,38 @@ namespace Disco.Web.Views.Job
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
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/Job/_CreateSubject.cshtml")]
public partial class CreateSubject : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.CreateModel>
public partial class CreateSubject : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.CreateModel>
{
public CreateSubject()
{
}
public override void Execute()
{
WriteLiteral("<table>\r\n <tr>\r\n <td>\r\n <h2>Device</h2>\r\n </td>\r\n");
#line 2 "..\..\Views\Job\_CreateSubject.cshtml"
Authorization.Require(Claims.Job.Actions.Create);
#line 7 "..\..\Views\Job\_CreateSubject.cshtml"
#line default
#line hidden
WriteLiteral("\r\n<table>\r\n <tr>\r\n <td>\r\n <h2>Device</h2>\r\n </td>\r\n");
#line 10 "..\..\Views\Job\_CreateSubject.cshtml"
#line default
#line hidden
#line 7 "..\..\Views\Job\_CreateSubject.cshtml"
#line 10 "..\..\Views\Job\_CreateSubject.cshtml"
if (Model.Device != null)
{
@@ -66,20 +76,20 @@ WriteLiteral(" class=\"modelImage\"");
WriteLiteral(" alt=\"Model Image\"");
WriteAttribute("src", Tuple.Create(" src=\"", 260), Tuple.Create("\"", 370)
WriteAttribute("src", Tuple.Create(" src=\"", 322), Tuple.Create("\"", 432)
#line 10 "..\..\Views\Job\_CreateSubject.cshtml"
, Tuple.Create(Tuple.Create("", 266), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceModel.Image(Model.Device.DeviceModelId, Model.Device.DeviceModel.ImageHash()))
#line 13 "..\..\Views\Job\_CreateSubject.cshtml"
, Tuple.Create(Tuple.Create("", 328), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceModel.Image(Model.Device.DeviceModelId, Model.Device.DeviceModel.ImageHash()))
#line default
#line hidden
, 266), false)
, 328), false)
);
WriteLiteral(" />\r\n </td>\r\n");
#line 12 "..\..\Views\Job\_CreateSubject.cshtml"
#line 15 "..\..\Views\Job\_CreateSubject.cshtml"
}
@@ -92,13 +102,13 @@ WriteLiteral(" style=\"width: 50%\"");
WriteLiteral(">\r\n");
#line 14 "..\..\Views\Job\_CreateSubject.cshtml"
#line 17 "..\..\Views\Job\_CreateSubject.cshtml"
#line default
#line hidden
#line 14 "..\..\Views\Job\_CreateSubject.cshtml"
#line 17 "..\..\Views\Job\_CreateSubject.cshtml"
if (Model.Device == null)
{
@@ -112,7 +122,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">No Device referenced to this Job</span>\r\n");
#line 17 "..\..\Views\Job\_CreateSubject.cshtml"
#line 20 "..\..\Views\Job\_CreateSubject.cshtml"
}
else
{
@@ -123,7 +133,7 @@ WriteLiteral(">No Device referenced to this Job</span>\r\n");
WriteLiteral(" <span><strong>Serial Number:</strong> ");
#line 20 "..\..\Views\Job\_CreateSubject.cshtml"
#line 23 "..\..\Views\Job\_CreateSubject.cshtml"
Write(Model.Device.SerialNumber);
@@ -136,7 +146,7 @@ WriteLiteral("<br />\r\n");
WriteLiteral(" <span><strong>Name:</strong> ");
#line 21 "..\..\Views\Job\_CreateSubject.cshtml"
#line 24 "..\..\Views\Job\_CreateSubject.cshtml"
Write(Model.Device.ComputerName);
@@ -149,18 +159,16 @@ WriteLiteral("<br />\r\n");
WriteLiteral(" <span><strong>Model:</strong> ");
#line 22 "..\..\Views\Job\_CreateSubject.cshtml"
#line 25 "..\..\Views\Job\_CreateSubject.cshtml"
Write(Model.Device.DeviceModel.ToString());
#line default
#line hidden
WriteLiteral("</span>");
WriteLiteral("<br />\r\n");
WriteLiteral("</span>\r\n");
#line 23 "..\..\Views\Job\_CreateSubject.cshtml"
#line 26 "..\..\Views\Job\_CreateSubject.cshtml"
}
@@ -174,13 +182,13 @@ WriteLiteral(" style=\"width: 50%\"");
WriteLiteral(">\r\n");
#line 29 "..\..\Views\Job\_CreateSubject.cshtml"
#line 32 "..\..\Views\Job\_CreateSubject.cshtml"
#line default
#line hidden
#line 29 "..\..\Views\Job\_CreateSubject.cshtml"
#line 32 "..\..\Views\Job\_CreateSubject.cshtml"
if (Model.User == null)
{
@@ -194,7 +202,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">No User referenced to this Job</span>\r\n");
#line 32 "..\..\Views\Job\_CreateSubject.cshtml"
#line 35 "..\..\Views\Job\_CreateSubject.cshtml"
}
else
{
@@ -205,7 +213,7 @@ WriteLiteral(">No User referenced to this Job</span>\r\n");
WriteLiteral(" <span><strong>Id:</strong> ");
#line 35 "..\..\Views\Job\_CreateSubject.cshtml"
#line 38 "..\..\Views\Job\_CreateSubject.cshtml"
Write(Model.User.Id);
@@ -218,29 +226,16 @@ WriteLiteral("<br />\r\n");
WriteLiteral(" <span><strong>Name:</strong> ");
#line 36 "..\..\Views\Job\_CreateSubject.cshtml"
#line 39 "..\..\Views\Job\_CreateSubject.cshtml"
Write(Model.User.DisplayName);
#line default
#line hidden
WriteLiteral("</span>");
WriteLiteral("<br />\r\n");
WriteLiteral(" <span><strong>Type:</strong> ");
#line 37 "..\..\Views\Job\_CreateSubject.cshtml"
Write(Model.User.Type);
#line default
#line hidden
WriteLiteral("</span>\r\n");
#line 38 "..\..\Views\Job\_CreateSubject.cshtml"
#line 40 "..\..\Views\Job\_CreateSubject.cshtml"
}
+3 -1
View File
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,6 +28,8 @@ namespace Disco.Web.Views.Job
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;