initial source commit

This commit is contained in:
Gary Sharp
2013-02-01 12:35:28 +11:00
parent 543a005d31
commit 0a93429800
1103 changed files with 285609 additions and 0 deletions
@@ -0,0 +1,184 @@
@model Disco.Web.Models.Job.ShowModel
@{
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-NumberFormatter");
}
<table id="jobComponents">
<tr>
<th>
Description
</th>
<th>
Cost
</th>
<th class="actions">
&nbsp;
</th>
</tr>
@foreach (var jc in Model.Job.JobComponents)
{
<tr data-jobcomponentid="@jc.Id">
<td>
<input type="text" class="description" value="@jc.Description" />
</td>
<td>
<input type="text" class="cost" value="@jc.Cost.ToString("C")" />
</td>
<td>
<span class="remove"></span>
</td>
</tr>
}
<tr>
<td>
<a href="#" id="jobComponentsAdd">Add Component</a>
</td>
<td colspan="2" class="totalCost">
Total: <span id="jobComponentsTotalCost"></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');
$jobComponents.find('input').live('change', updateComponent).focus(function () { $(this).select() }).filter('.cost');
$jobComponents.find('span.remove').live('click', 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;
});
$('#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 };
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");
}
});
},
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');
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>
@@ -0,0 +1,294 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Views.Job.JobParts
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
using System.Web.Helpers;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Mvc.Html;
using System.Web.Routing;
using System.Web.Security;
using System.Web.UI;
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Job/JobParts/Components.cshtml")]
public class Components : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
{
public Components()
{
}
public override void Execute()
{
#line 2 "..\..\Views\Job\JobParts\Components.cshtml"
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-NumberFormatter");
#line default
#line hidden
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(" class=\"actions\"");
WriteLiteral(">\r\n &nbsp;\r\n </th>\r\n </tr>\r\n");
#line 17 "..\..\Views\Job\JobParts\Components.cshtml"
#line default
#line hidden
#line 17 "..\..\Views\Job\JobParts\Components.cshtml"
foreach (var jc in Model.Job.JobComponents)
{
#line default
#line hidden
WriteLiteral(" <tr");
WriteLiteral(" data-jobcomponentid=\"");
#line 19 "..\..\Views\Job\JobParts\Components.cshtml"
Write(jc.Id);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n <td>\r\n <input");
WriteLiteral(" type=\"text\"");
WriteLiteral(" class=\"description\"");
WriteAttribute("value", Tuple.Create(" value=\"", 513), Tuple.Create("\"", 536)
#line 21 "..\..\Views\Job\JobParts\Components.cshtml"
, Tuple.Create(Tuple.Create("", 521), Tuple.Create<System.Object, System.Int32>(jc.Description
#line default
#line hidden
, 521), false)
);
WriteLiteral(" />\r\n </td>\r\n <td>\r\n <input");
WriteLiteral(" type=\"text\"");
WriteLiteral(" class=\"cost\"");
WriteAttribute("value", Tuple.Create(" value=\"", 626), Tuple.Create("\"", 656)
#line 24 "..\..\Views\Job\JobParts\Components.cshtml"
, Tuple.Create(Tuple.Create("", 634), Tuple.Create<System.Object, System.Int32>(jc.Cost.ToString("C")
#line default
#line hidden
, 634), false)
);
WriteLiteral(" />\r\n </td>\r\n <td>\r\n <span");
WriteLiteral(" class=\"remove\"");
WriteLiteral("></span>\r\n </td>\r\n </tr>\r\n");
#line 30 "..\..\Views\Job\JobParts\Components.cshtml"
}
#line default
#line hidden
WriteLiteral(" <tr>\r\n <td>\r\n <a");
WriteLiteral(" href=\"#\"");
WriteLiteral(" id=\"jobComponentsAdd\"");
WriteLiteral(">Add Component</a>\r\n </td>\r\n <td");
WriteLiteral(" colspan=\"2\"");
WriteLiteral(" class=\"totalCost\"");
WriteLiteral(">\r\n Total: <span");
WriteLiteral(" id=\"jobComponentsTotalCost\"");
WriteLiteral("></span>\r\n </td>\r\n </tr>\r\n</table>\r\n<div");
WriteLiteral(" id=\"dialogRemoveComponent\"");
WriteLiteral(" title=\"Remove this Component?\"");
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(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n var $jobComponents = $(\'#jobComponents\');\r\n\r\n " +
" $jobComponents.find(\'input\').live(\'change\', updateComponent).focus(function " +
"() { $(this).select() }).filter(\'.cost\');\r\n $jobComponents.find(\'span.rem" +
"ove\').live(\'click\', removeComponent);\r\n\r\n $(\'#jobComponentsAdd\').click(fu" +
"nction () {\r\n var jc = $(\'<tr><td><input type=\"text\" class=\"descripti" +
"on\" /></td><td><input type=\"text\" class=\"cost\" /></td><td><span class=\"remove\"><" +
"/span></td></tr>\');\r\n jc.find(\'input\').focus(function () { $(this).se" +
"lect() })\r\n jc.insertBefore($jobComponents.find(\'tr\').last());\r\n " +
" jc.find(\'input.description\').focus();\r\n return false;\r\n " +
" });\r\n\r\n $(\'#dialogRemoveComponent\').dialog({\r\n resizable: fal" +
"se,\r\n height: 140,\r\n modal: true,\r\n autoOpen: f" +
"alse\r\n });\r\n\r\n function removeComponent() {\r\n var compo" +
"nentRow = $(this).closest(\'tr\');\r\n var id = componentRow.attr(\'data-j" +
"obcomponentid\');\r\n if (id) {\r\n var data = { id: id };\r" +
"\n\r\n var $dialogRemoveComponent = $(\'#dialogRemoveComponent\');\r\n " +
" $dialogRemoveComponent.dialog(\"enable\");\r\n $dialogR" +
"emoveComponent.dialog(\'option\', \'buttons\', {\r\n \"Remove\": func" +
"tion () {\r\n $dialogRemoveComponent.dialog(\"disable\");\r\n " +
" $dialogRemoveComponent.dialog(\"option\", \"buttons\", null);\r" +
"\n $.ajax({\r\n url: \'");
#line 80 "..\..\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: \'");
#line 137 "..\..\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);
}
},
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: '");
#line 161 "..\..\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);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to add component: ' + textStatus);
}
});
}
updateTotalCost();
}
updateTotalCost();
});
</script>
");
}
}
}
#pragma warning restore 1591
+90
View File
@@ -0,0 +1,90 @@
@model Disco.Web.Models.Job.ShowModel
@{
var validFlags = Model.Job.ValidFlagsGrouped();
}
<div id="jobDetailTab-Flags" class="jobPart">
<table id="jobFlags">
@foreach (var flagGroup in validFlags)
{
<tr>
<th>
<span class="flagGroupName">@flagGroup.Key</span><br />
@AjaxHelpers.AjaxLoader()
</th>
<td>
@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>
}
</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;
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 (result != 'success' || response != 'OK') {
alert('Unable to change Flag:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
})
}
};
$dialogFlagsAction.dialog({
resizable: false,
height: 240,
modal: true,
autoOpen: false,
buttons: {
"Add": function () {
var $this = $(this);
$this.dialog("disable");
$this.dialog("option", "buttons", null);
$this.find('form').first().submit();
},
Cancel: function () {
$(this).dialog("close");
}
},
close: function () {
$flagCheckbox.attr('checked', false);
}
});
$flagCheckboxes.click(updateFlags);
});
</script>
</div>
@@ -0,0 +1,327 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Views.Job.JobParts
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
using System.Web.Helpers;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Mvc.Html;
using System.Web.Routing;
using System.Web.Security;
using System.Web.UI;
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Job/JobParts/Flags.cshtml")]
public class Flags : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
{
public Flags()
{
}
public override void Execute()
{
#line 2 "..\..\Views\Job\JobParts\Flags.cshtml"
var validFlags = Model.Job.ValidFlagsGrouped();
#line default
#line hidden
WriteLiteral("\r\n<div");
WriteLiteral(" id=\"jobDetailTab-Flags\"");
WriteLiteral(" class=\"jobPart\"");
WriteLiteral(">\r\n <table");
WriteLiteral(" id=\"jobFlags\"");
WriteLiteral(">\r\n");
#line 7 "..\..\Views\Job\JobParts\Flags.cshtml"
#line default
#line hidden
#line 7 "..\..\Views\Job\JobParts\Flags.cshtml"
foreach (var flagGroup in validFlags)
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <th>\r\n <span");
WriteLiteral(" class=\"flagGroupName\"");
WriteLiteral(">");
#line 11 "..\..\Views\Job\JobParts\Flags.cshtml"
Write(flagGroup.Key);
#line default
#line hidden
WriteLiteral("</span><br />\r\n");
WriteLiteral(" ");
#line 12 "..\..\Views\Job\JobParts\Flags.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n </th>\r\n <td>\r\n");
#line 15 "..\..\Views\Job\JobParts\Flags.cshtml"
#line default
#line hidden
#line 15 "..\..\Views\Job\JobParts\Flags.cshtml"
foreach (var flagItem in flagGroup.Value)
{
#line default
#line hidden
WriteLiteral(" <div>\r\n <input");
WriteLiteral(" type=\"checkbox\"");
WriteAttribute("value", Tuple.Create(" value=\"", 609), Tuple.Create("\"", 632)
#line 18 "..\..\Views\Job\JobParts\Flags.cshtml"
, Tuple.Create(Tuple.Create("", 617), Tuple.Create<System.Object, System.Int32>(flagItem.Item1
#line default
#line hidden
, 617), false)
);
WriteAttribute("id", Tuple.Create(" id=\"", 633), Tuple.Create("\"", 663)
, Tuple.Create(Tuple.Create("", 638), Tuple.Create("jobFlag_", 638), true)
#line 18 "..\..\Views\Job\JobParts\Flags.cshtml"
, Tuple.Create(Tuple.Create("", 646), Tuple.Create<System.Object, System.Int32>(flagItem.Item1
#line default
#line hidden
, 646), false)
);
WriteLiteral(" ");
#line 18 "..\..\Views\Job\JobParts\Flags.cshtml"
Write(flagItem.Item3 ? new HtmlString("checked=\"checked\"") : new HtmlString(string.Empty));
#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)
#line 18 "..\..\Views\Job\JobParts\Flags.cshtml"
, Tuple.Create(Tuple.Create("", 780), Tuple.Create<System.Object, System.Int32>(flagItem.Item1
#line default
#line hidden
, 780), false)
);
WriteAttribute("for", Tuple.Create(" for=\"", 798), Tuple.Create("\"", 829)
, Tuple.Create(Tuple.Create("", 804), Tuple.Create("jobFlag_", 804), true)
#line 18 "..\..\Views\Job\JobParts\Flags.cshtml"
, Tuple.Create(Tuple.Create("", 812), Tuple.Create<System.Object, System.Int32>(flagItem.Item1
#line default
#line hidden
, 812), false)
);
WriteLiteral(">");
#line 18 "..\..\Views\Job\JobParts\Flags.cshtml"
Write(flagItem.Item2);
#line default
#line hidden
WriteLiteral("</label></div>\r\n");
#line 19 "..\..\Views\Job\JobParts\Flags.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n");
#line 22 "..\..\Views\Job\JobParts\Flags.cshtml"
}
#line default
#line hidden
WriteLiteral(" </table>\r\n <div");
WriteLiteral(" id=\"dialogFlagsAction\"");
WriteLiteral(" title=\"Add Flag\"");
WriteLiteral(">\r\n");
#line 25 "..\..\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 default
#line hidden
WriteLiteral(" <input");
WriteLiteral(" id=\"dialogFlagsActionFlag\"");
WriteLiteral(" type=\"hidden\"");
WriteLiteral(" name=\"Flag\"");
WriteLiteral(" value=\"0\"");
WriteLiteral(" />\r\n");
WriteLiteral(" <h3>\r\n Reason:</h3>\r\n");
WriteLiteral(" <p>\r\n <textarea");
WriteLiteral(" name=\"Reason\"");
WriteLiteral(" class=\"block\"");
WriteLiteral("></textarea>\r\n </p>\r\n");
#line 33 "..\..\Views\Job\JobParts\Flags.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n <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;
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('");
#line 56 "..\..\Views\Job\JobParts\Flags.cshtml"
Write(Url.Action(MVC.API.Job.UpdateFlag(Model.Job.Id, null, null, false)));
#line default
#line hidden
WriteLiteral(@"', { Flag: '-' + flagValue }, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Flag:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
})
}
};
$dialogFlagsAction.dialog({
resizable: false,
height: 240,
modal: true,
autoOpen: false,
buttons: {
""Add"": function () {
var $this = $(this);
$this.dialog(""disable"");
$this.dialog(""option"", ""buttons"", null);
$this.find('form').first().submit();
},
Cancel: function () {
$(this).dialog(""close"");
}
},
close: function () {
$flagCheckbox.attr('checked', false);
}
});
$flagCheckboxes.click(updateFlags);
});
</script>
</div>
");
}
}
}
#pragma warning restore 1591
@@ -0,0 +1,380 @@
@model Disco.Web.Models.Job.ShowModel
<table id="jobNonWarrantyInsurance">
@if (Model.Job.JobMetaNonWarranty.IsInsuranceClaim)
{
<tr>
<th style="width: 230px;">
Date of Loss or Damage
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaInsurance.LossOrDamageDate)
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var dateField = $('#Job_JobMetaInsurance_LossOrDamageDate');
document.DiscoFunctions.DateChangeHelper(
dateField,
'Unknown',
'@(Url.Action(MVC.API.Job.UpdateInsuranceLossOrDamageDate(Model.Job.Id, null)))',
'LossOrDamageDate',
null
);
});
</script>
</td>
</tr>
<tr>
<th>
Event Location
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaInsurance.EventLocation)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#Job_JobMetaInsurance_EventLocation'),
'Unknown',
'@Url.Action(MVC.API.Job.UpdateInsuranceEventLocation(Model.Job.Id, null))',
'EventLocation'
);
});
</script>
</td>
</tr>
<tr>
<th>
Description
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaInsurance.Description)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#Job_JobMetaInsurance_Description'),
'None',
'@Url.Action(MVC.API.Job.UpdateInsuranceDescription(Model.Job.Id, null))',
'Description'
);
});
</script>
</td>
</tr>
<tr>
<th style="width: 200px;">
&nbsp;
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaInsurance.ThirdPartyCaused)@Html.LabelFor(m => m.Job.JobMetaInsurance.ThirdPartyCaused)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<div id="Job_JobMetaInsurance_ThirdPartyCaused_Details" style="padding-left: 25px;">
<div>
<h5>
Third Party Name</h5>
@Html.EditorFor(m => m.Job.JobMetaInsurance.ThirdPartyCausedName)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
</div>
<div>
<h5>
Why Third Parties Fault</h5>
@Html.EditorFor(m => m.Job.JobMetaInsurance.ThirdPartyCausedWhy)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
</div>
</div>
<script type="text/javascript">
$(function () {
var thirdPartyField = $('#Job_JobMetaInsurance_ThirdPartyCaused');
var thirdPartyDetails = $('#Job_JobMetaInsurance_ThirdPartyCaused_Details');
var thirdPartyDetails_Changed = function (e, dontAnimate) {
if (thirdPartyField.is(':checked')) {
if (dontAnimate) {
thirdPartyDetails.show();
} else {
thirdPartyDetails.slideDown();
}
} else {
if (dontAnimate) {
thirdPartyDetails.hide();
} else {
thirdPartyDetails.slideUp();
}
}
};
thirdPartyDetails_Changed(null, true);
thirdPartyField.change(thirdPartyDetails_Changed);
document.DiscoFunctions.PropertyChangeHelper(
thirdPartyField,
null,
'@Url.Action(MVC.API.Job.UpdateInsuranceThirdPartyCaused(Model.Job.Id, null))',
'ThirdPartyCaused'
);
document.DiscoFunctions.PropertyChangeHelper(
$('#Job_JobMetaInsurance_ThirdPartyCausedName'),
'None',
'@Url.Action(MVC.API.Job.UpdateInsuranceThirdPartyCausedName(Model.Job.Id, null))',
'ThirdPartyCausedName'
);
document.DiscoFunctions.PropertyChangeHelper(
$('#Job_JobMetaInsurance_ThirdPartyCausedWhy'),
'Unknown',
'@Url.Action(MVC.API.Job.UpdateInsuranceThirdPartyCausedWhy(Model.Job.Id, null))',
'ThirdPartyCausedWhy'
);
});
</script>
</td>
</tr>
<tr>
<th>
Witnessed by (Name/Address)
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaInsurance.WitnessesNamesAddresses)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#Job_JobMetaInsurance_WitnessesNamesAddresses'),
'None',
'@Url.Action(MVC.API.Job.UpdateInsuranceWitnessesNamesAddresses(Model.Job.Id, null))',
'WitnessesNamesAddresses'
);
});
</script>
</td>
</tr>
<tr>
<th>
Burglary/Theft - Method of Entry
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaInsurance.BurglaryTheftMethodOfEntry)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#Job_JobMetaInsurance_BurglaryTheftMethodOfEntry'),
'None',
'@Url.Action(MVC.API.Job.UpdateInsuranceBurglaryTheftMethodOfEntry(Model.Job.Id, null))',
'BurglaryTheftMethodOfEntry'
);
});
</script>
</td>
</tr>
<tr>
<th style="width: 200px;">
Property Last Seen
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaInsurance.PropertyLastSeenDate)
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var dateField = $('#Job_JobMetaInsurance_PropertyLastSeenDate');
document.DiscoFunctions.DateChangeHelper(
dateField,
'Unknown/NA',
'@(Url.Action(MVC.API.Job.UpdateInsurancePropertyLastSeenDate(Model.Job.Id, null)))',
'PropertyLastSeenDate',
null
);
});
</script>
</td>
</tr>
<tr>
<th style="width: 200px;">
&nbsp;
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaInsurance.PoliceNotified)@Html.LabelFor(m => m.Job.JobMetaInsurance.PoliceNotified)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<div id="Job_JobMetaInsurance_PoliceNotified_Details" style="padding-left: 25px;">
<div>
<h5>
Station</h5>
@Html.EditorFor(m => m.Job.JobMetaInsurance.PoliceNotifiedStation)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
</div>
<div>
<h5>
Date</h5>
@Html.EditorFor(m => m.Job.JobMetaInsurance.PoliceNotifiedDate)
@AjaxHelpers.AjaxLoader()
</div>
<div>
<h5>
Crime Report #</h5>
@Html.EditorFor(m => m.Job.JobMetaInsurance.PoliceNotifiedCrimeReportNo)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
</div>
</div>
<script type="text/javascript">
$(function () {
var policeNotifiedField = $('#Job_JobMetaInsurance_PoliceNotified');
var policeNotifiedDetails = $('#Job_JobMetaInsurance_PoliceNotified_Details');
var policeNotifiedDetails_Changed = function (e, dontAnimate) {
if (policeNotifiedField.is(':checked')) {
if (dontAnimate) {
policeNotifiedDetails.show();
} else {
policeNotifiedDetails.slideDown();
}
} else {
if (dontAnimate) {
policeNotifiedDetails.hide();
} else {
policeNotifiedDetails.slideUp();
}
}
};
policeNotifiedDetails_Changed(null, true);
policeNotifiedField.change(policeNotifiedDetails_Changed);
document.DiscoFunctions.PropertyChangeHelper(
policeNotifiedField,
null,
'@Url.Action(MVC.API.Job.UpdateInsurancePoliceNotified(Model.Job.Id, null))',
'PoliceNotified'
);
document.DiscoFunctions.PropertyChangeHelper(
$('#Job_JobMetaInsurance_PoliceNotifiedStation'),
'Unknown',
'@Url.Action(MVC.API.Job.UpdateInsurancePoliceNotifiedStation(Model.Job.Id, null))',
'PoliceNotifiedStation'
);
var dateField = $('#Job_JobMetaInsurance_PoliceNotifiedDate');
document.DiscoFunctions.DateChangeHelper(
dateField,
'Unknown',
'@(Url.Action(MVC.API.Job.UpdateInsurancePoliceNotifiedDate(Model.Job.Id, null)))',
'PoliceNotifiedDate',
null,
true
);
document.DiscoFunctions.PropertyChangeHelper(
$('#Job_JobMetaInsurance_PoliceNotifiedCrimeReportNo'),
'Unknown',
'@Url.Action(MVC.API.Job.UpdateInsurancePoliceNotifiedCrimeReportNo(Model.Job.Id, null))',
'PoliceNotifiedCrimeReportNo'
);
});
</script>
</td>
</tr>
<tr>
<th>
Action to Recover/Reduce Loss
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaInsurance.RecoverReduceAction)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#Job_JobMetaInsurance_RecoverReduceAction'),
'None',
'@Url.Action(MVC.API.Job.UpdateInsuranceRecoverReduceAction(Model.Job.Id, null))',
'RecoverReduceAction'
);
});
</script>
</td>
</tr>
<tr>
<th>
Other Interested Parties
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaInsurance.OtherInterestedParties)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#Job_JobMetaInsurance_OtherInterestedParties'),
'None',
'@Url.Action(MVC.API.Job.UpdateInsuranceOtherInterestedParties(Model.Job.Id, null))',
'OtherInterestedParties'
);
});
</script>
</td>
</tr>
<tr>
<th style="width: 200px;">
Date of Purchase
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaInsurance.DateOfPurchase)
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var dateField = $('#Job_JobMetaInsurance_DateOfPurchase');
document.DiscoFunctions.DateChangeHelper(
dateField,
'Unknown',
'@(Url.Action(MVC.API.Job.UpdateInsuranceDateOfPurchase(Model.Job.Id, null)))',
'DateOfPurchase',
null,
true
);
});
</script>
</td>
</tr>
<tr>
<th>
Claim Form Sent Date
</th>
<td>
@Html.EditorFor(m => m.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>
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.DateChangeUserHelper(
$('#Job_JobMetaInsurance_ClaimFormSentDate'),
$('#Job_JobMetaInsurance_ClaimFormSentUserId'),
'Unknown',
'@(Url.Action(MVC.API.Job.UpdateInsuranceClaimFormSentDate(Model.Job.Id, null)))',
'ClaimFormSentDate',
@(Model.Job.OpenedDate.ToJavascriptDate())
);
});
</script>
</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>
</table>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,19 @@
@model Disco.Web.Models.Job.ShowModel
@using Disco.Models.Repository;
@{
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
}
@switch (Model.Job.JobTypeId)
{
case JobType.JobTypeIds.HWar:
@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);
break;
default:
break;
}
@@ -0,0 +1,119 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Views.Job.JobParts
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
using System.Web.Helpers;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Mvc.Html;
using System.Web.Routing;
using System.Web.Security;
using System.Web.UI;
using System.Web.WebPages;
using Disco.BI.Extensions;
#line 2 "..\..\Views\Job\JobParts\JobMetaAdditions.cshtml"
using Disco.Models.Repository;
#line default
#line hidden
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Job/JobParts/JobMetaAdditions.cshtml")]
public class JobMetaAdditions : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
{
public JobMetaAdditions()
{
}
public override void Execute()
{
#line 3 "..\..\Views\Job\JobParts\JobMetaAdditions.cshtml"
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
#line default
#line hidden
WriteLiteral("\r\n");
#line 6 "..\..\Views\Job\JobParts\JobMetaAdditions.cshtml"
switch (Model.Job.JobTypeId)
{
case JobType.JobTypeIds.HWar:
#line default
#line hidden
#line 9 "..\..\Views\Job\JobParts\JobMetaAdditions.cshtml"
Write(Html.Partial(MVC.Job.Views.JobParts.Warranty));
#line default
#line hidden
#line 9 "..\..\Views\Job\JobParts\JobMetaAdditions.cshtml"
;
break;
case JobType.JobTypeIds.HNWar:
#line default
#line hidden
#line 12 "..\..\Views\Job\JobParts\JobMetaAdditions.cshtml"
Write(Html.Partial(MVC.Job.Views.JobParts.NonWarranty));
#line default
#line hidden
#line 12 "..\..\Views\Job\JobParts\JobMetaAdditions.cshtml"
;
break;
case JobType.JobTypeIds.UMgmt:
#line default
#line hidden
#line 15 "..\..\Views\Job\JobParts\JobMetaAdditions.cshtml"
Write(Html.Partial(MVC.Job.Views.JobParts.Flags));
#line default
#line hidden
#line 15 "..\..\Views\Job\JobParts\JobMetaAdditions.cshtml"
;
break;
default:
break;
}
#line default
#line hidden
}
}
}
#pragma warning restore 1591
@@ -0,0 +1,16 @@
@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>
@@ -0,0 +1,123 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Views.Job.JobParts
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
using System.Web.Helpers;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Mvc.Html;
using System.Web.Routing;
using System.Web.Security;
using System.Web.UI;
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Job/JobParts/NonWarranty.cshtml")]
public class NonWarranty : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
{
public NonWarranty()
{
}
public override void Execute()
{
WriteLiteral("<div");
WriteLiteral(" id=\"jobDetailTab-Components\"");
WriteLiteral(" class=\"jobPart\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 3 "..\..\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(" id=\"jobDetailTab-NonWarrantyFinance\"");
WriteLiteral(" class=\"jobPart\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 6 "..\..\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(" id=\"jobDetailTab-NonWarrantyRepairs\"");
WriteLiteral(" class=\"jobPart\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 9 "..\..\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(" id=\"jobDetailTab-NonWarrantyInsurance\"");
WriteLiteral(" class=\"jobPart\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 12 "..\..\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(" 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>
");
}
}
}
#pragma warning restore 1591
@@ -0,0 +1,184 @@
@model Disco.Web.Models.Job.ShowModel
<table id="jobNonWarrantyFinance">
<tr>
<th style="width: 200px;">
Accounting Charge Required
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaNonWarranty.AccountingChargeRequiredDate)
<span id="Job_JobMetaNonWarranty_AccountingChargeRequiredUser">@(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargeRequiredUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargeRequiredUser.ToString()))</span>
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.DateChangeUserHelper(
$('#Job_JobMetaNonWarranty_AccountingChargeRequiredDate'),
$('#Job_JobMetaNonWarranty_AccountingChargeRequiredUser'),
'Not Required',
'@(Url.Action(MVC.API.Job.UpdateNonWarrantyAccountingChargeRequired(Model.Job.Id, null)))',
'AccountingChargeRequiredDate',
@(Model.Job.OpenedDate.ToJavascriptDate())
);
});
</script>
</td>
</tr>
<tr>
<th style="width: 200px;">
Accounting Charge Added
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaNonWarranty.AccountingChargeAddedDate)
<span id="Job_JobMetaNonWarranty_AccountingChargeAddedUser">@(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargeAddedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargeAddedUser.ToString()))</span>
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.DateChangeUserHelper(
$('#Job_JobMetaNonWarranty_AccountingChargeAddedDate'),
$('#Job_JobMetaNonWarranty_AccountingChargeAddedUser'),
'Not Added',
'@(Url.Action(MVC.API.Job.UpdateNonWarrantyAccountingChargeAdded(Model.Job.Id, null)))',
'AccountingChargeAddedDate',
@(Model.Job.OpenedDate.ToJavascriptDate())
);
});
</script>
</td>
</tr>
<tr>
<th style="width: 200px;">
Accounting Charge Paid
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaNonWarranty.AccountingChargePaidDate)
<span id="Job_JobMetaNonWarranty_AccountingChargePaidUser">@(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargePaidUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargePaidUser.ToString()))</span>
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.DateChangeUserHelper(
$('#Job_JobMetaNonWarranty_AccountingChargePaidDate'),
$('#Job_JobMetaNonWarranty_AccountingChargePaidUser'),
'Not Paid',
'@(Url.Action(MVC.API.Job.UpdateNonWarrantyAccountingChargePaid(Model.Job.Id, null)))',
'AccountingChargePaidDate',
@(Model.Job.OpenedDate.ToJavascriptDate())
);
});
</script>
</td>
</tr>
<tr>
<th style="width: 200px;">
Purchase Order Raised
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaNonWarranty.PurchaseOrderRaisedDate)
<span id="Job_JobMetaNonWarranty_PurchaseOrderRaisedUser">@(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.PurchaseOrderRaisedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.PurchaseOrderRaisedUser.ToString()))</span>
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.DateChangeUserHelper(
$('#Job_JobMetaNonWarranty_PurchaseOrderRaisedDate'),
$('#Job_JobMetaNonWarranty_PurchaseOrderRaisedUser'),
'Not Raised',
'@(Url.Action(MVC.API.Job.UpdateNonWarrantyPurchaseOrderRaised(Model.Job.Id, null)))',
'PurchaseOrderRaisedDate',
@(Model.Job.OpenedDate.ToJavascriptDate())
);
});
</script>
</td>
</tr>
<tr>
<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();
}
});
});
});
</script>
</td>
</tr>
<tr>
<th style="width: 200px;">
Purchase Order Sent
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaNonWarranty.PurchaseOrderSentDate)
<span id="Job_JobMetaNonWarranty_PurchaseOrderSentUser">@(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.PurchaseOrderSentUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.PurchaseOrderSentUser.ToString()))</span>
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.DateChangeUserHelper(
$('#Job_JobMetaNonWarranty_PurchaseOrderSentDate'),
$('#Job_JobMetaNonWarranty_PurchaseOrderSentUser'),
'Not Sent',
'@(Url.Action(MVC.API.Job.UpdateNonWarrantyPurchaseOrderSent(Model.Job.Id, null)))',
'PurchaseOrderSentDate',
@(Model.Job.OpenedDate.ToJavascriptDate())
);
});
</script>
</td>
</tr>
<tr>
<th style="width: 200px;">
Invoice Received
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaNonWarranty.InvoiceReceivedDate)
<span id="Job_JobMetaNonWarranty_InvoiceReceivedUser">@(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.InvoiceReceivedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.InvoiceReceivedUser.ToString()))</span>
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.DateChangeUserHelper(
$('#Job_JobMetaNonWarranty_InvoiceReceivedDate'),
$('#Job_JobMetaNonWarranty_InvoiceReceivedUser'),
'Not Received',
'@(Url.Action(MVC.API.Job.UpdateNonWarrantyInvoiceReceived(Model.Job.Id, null)))',
'InvoiceReceivedDate',
@(Model.Job.OpenedDate.ToJavascriptDate())
);
});
</script>
</td>
</tr>
</table>
@@ -0,0 +1,561 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Views.Job.JobParts
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
using System.Web.Helpers;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Mvc.Html;
using System.Web.Routing;
using System.Web.Security;
using System.Web.UI;
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Job/JobParts/NonWarrantyFinance.cshtml")]
public class NonWarrantyFinance : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
{
public NonWarrantyFinance()
{
}
public override void Execute()
{
WriteLiteral("<table");
WriteLiteral(" id=\"jobNonWarrantyFinance\"");
WriteLiteral(">\r\n <tr>\r\n <th");
WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">\r\n Accounting Charge Required\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 8 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.AccountingChargeRequiredDate));
#line default
#line hidden
WriteLiteral("\r\n <span");
WriteLiteral(" id=\"Job_JobMetaNonWarranty_AccountingChargeRequiredUser\"");
WriteLiteral(">");
#line 9 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargeRequiredUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargeRequiredUser.ToString()));
#line default
#line hidden
WriteLiteral("</span>\r\n");
WriteLiteral(" ");
#line 10 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
document.DiscoFunctions.DateChangeUserHelper(
$('#Job_JobMetaNonWarranty_AccountingChargeRequiredDate'),
$('#Job_JobMetaNonWarranty_AccountingChargeRequiredUser'),
'Not Required',
'");
#line 17 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyAccountingChargeRequired(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral("\',\r\n \'AccountingChargeRequiredDate\',\r\n");
WriteLiteral(" ");
#line 19 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Model.Job.OpenedDate.ToJavascriptDate());
#line default
#line hidden
WriteLiteral("\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 Accounting Charge Added\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 30 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.AccountingChargeAddedDate));
#line default
#line hidden
WriteLiteral("\r\n <span");
WriteLiteral(" id=\"Job_JobMetaNonWarranty_AccountingChargeAddedUser\"");
WriteLiteral(">");
#line 31 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargeAddedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargeAddedUser.ToString()));
#line default
#line hidden
WriteLiteral("</span>\r\n");
WriteLiteral(" ");
#line 32 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
document.DiscoFunctions.DateChangeUserHelper(
$('#Job_JobMetaNonWarranty_AccountingChargeAddedDate'),
$('#Job_JobMetaNonWarranty_AccountingChargeAddedUser'),
'Not Added',
'");
#line 39 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyAccountingChargeAdded(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral("\',\r\n \'AccountingChargeAddedDate\',\r\n");
WriteLiteral(" ");
#line 41 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Model.Job.OpenedDate.ToJavascriptDate());
#line default
#line hidden
WriteLiteral("\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 Accounting Charge Paid\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 52 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.AccountingChargePaidDate));
#line default
#line hidden
WriteLiteral("\r\n <span");
WriteLiteral(" id=\"Job_JobMetaNonWarranty_AccountingChargePaidUser\"");
WriteLiteral(">");
#line 53 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargePaidUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargePaidUser.ToString()));
#line default
#line hidden
WriteLiteral("</span>\r\n");
WriteLiteral(" ");
#line 54 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
document.DiscoFunctions.DateChangeUserHelper(
$('#Job_JobMetaNonWarranty_AccountingChargePaidDate'),
$('#Job_JobMetaNonWarranty_AccountingChargePaidUser'),
'Not Paid',
'");
#line 61 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyAccountingChargePaid(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral("\',\r\n \'AccountingChargePaidDate\',\r\n");
WriteLiteral(" ");
#line 63 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Model.Job.OpenedDate.ToJavascriptDate());
#line default
#line hidden
WriteLiteral("\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 Purchase Order Raised\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 74 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.PurchaseOrderRaisedDate));
#line default
#line hidden
WriteLiteral("\r\n <span");
WriteLiteral(" id=\"Job_JobMetaNonWarranty_PurchaseOrderRaisedUser\"");
WriteLiteral(">");
#line 75 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.PurchaseOrderRaisedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.PurchaseOrderRaisedUser.ToString()));
#line default
#line hidden
WriteLiteral("</span>\r\n");
WriteLiteral(" ");
#line 76 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
document.DiscoFunctions.DateChangeUserHelper(
$('#Job_JobMetaNonWarranty_PurchaseOrderRaisedDate'),
$('#Job_JobMetaNonWarranty_PurchaseOrderRaisedUser'),
'Not Raised',
'");
#line 83 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyPurchaseOrderRaised(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral("\',\r\n \'PurchaseOrderRaisedDate\',\r\n");
WriteLiteral(" ");
#line 85 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Model.Job.OpenedDate.ToJavascriptDate());
#line default
#line hidden
WriteLiteral("\r\n );\r\n });\r\n </script>\r\n " +
" </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n Purchase Order Reference\r" +
"\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 96 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Html.TextBoxFor(m => m.Job.JobMetaNonWarranty.PurchaseOrderReference));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 97 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxSave());
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 98 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n <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: '");
#line 119 "..\..\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 {
$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");
WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">\r\n Purchase Order Sent\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 145 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.PurchaseOrderSentDate));
#line default
#line hidden
WriteLiteral("\r\n <span");
WriteLiteral(" id=\"Job_JobMetaNonWarranty_PurchaseOrderSentUser\"");
WriteLiteral(">");
#line 146 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.PurchaseOrderSentUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.PurchaseOrderSentUser.ToString()));
#line default
#line hidden
WriteLiteral("</span>\r\n");
WriteLiteral(" ");
#line 147 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
document.DiscoFunctions.DateChangeUserHelper(
$('#Job_JobMetaNonWarranty_PurchaseOrderSentDate'),
$('#Job_JobMetaNonWarranty_PurchaseOrderSentUser'),
'Not Sent',
'");
#line 154 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyPurchaseOrderSent(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral("\',\r\n \'PurchaseOrderSentDate\',\r\n");
WriteLiteral(" ");
#line 156 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Model.Job.OpenedDate.ToJavascriptDate());
#line default
#line hidden
WriteLiteral("\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 Invoice Received\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 167 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.InvoiceReceivedDate));
#line default
#line hidden
WriteLiteral("\r\n <span");
WriteLiteral(" id=\"Job_JobMetaNonWarranty_InvoiceReceivedUser\"");
WriteLiteral(">");
#line 168 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.InvoiceReceivedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.InvoiceReceivedUser.ToString()));
#line default
#line hidden
WriteLiteral("</span>\r\n");
WriteLiteral(" ");
#line 169 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
document.DiscoFunctions.DateChangeUserHelper(
$('#Job_JobMetaNonWarranty_InvoiceReceivedDate'),
$('#Job_JobMetaNonWarranty_InvoiceReceivedUser'),
'Not Received',
'");
#line 176 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyInvoiceReceived(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral("\',\r\n \'InvoiceReceivedDate\',\r\n");
WriteLiteral(" ");
#line 178 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Model.Job.OpenedDate.ToJavascriptDate());
#line default
#line hidden
WriteLiteral("\r\n );\r\n });\r\n </script>\r\n " +
" </td>\r\n </tr>\r\n</table>\r\n");
}
}
}
#pragma warning restore 1591
@@ -0,0 +1,85 @@
@model Disco.Web.Models.Job.ShowModel
<table id="jobNonWarrantyRepairs">
<tr>
<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))',
'RepairerName'
);
});
</script>
</td>
</tr>
<tr>
<th style="width: 200px;">
Repair Logged
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaNonWarranty.RepairerLoggedDate)
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var dateField = $('#Job_JobMetaNonWarranty_RepairerLoggedDate');
document.DiscoFunctions.DateChangeHelper(
dateField,
'Unknown',
'@(Url.Action(MVC.API.Job.UpdateNonWarrantyRepairerLoggedDate(Model.Job.Id, null)))',
'RepairerLoggedDate',
null
);
});
</script>
</td>
</tr>
<tr>
<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))',
'RepairerReference'
);
});
</script>
</td>
</tr>
<tr>
<th style="width: 200px;">
Repair Completed
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaNonWarranty.RepairerCompletedDate)
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var dateField = $('#Job_JobMetaNonWarranty_RepairerCompletedDate');
document.DiscoFunctions.DateChangeHelper(
dateField,
'Unknown',
'@(Url.Action(MVC.API.Job.UpdateNonWarrantyRepairerCompletedDate(Model.Job.Id, null)))',
'RepairerCompletedDate',
null
);
});
</script>
</td>
</tr>
</table>
@@ -0,0 +1,256 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Views.Job.JobParts
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
using System.Web.Helpers;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Mvc.Html;
using System.Web.Routing;
using System.Web.Security;
using System.Web.UI;
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Job/JobParts/Repairs.cshtml")]
public class Repairs : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
{
public Repairs()
{
}
public override void Execute()
{
WriteLiteral("<table");
WriteLiteral(" id=\"jobNonWarrantyRepairs\"");
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 8 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.RepairerName));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 9 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(AjaxHelpers.AjaxSave());
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 10 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n <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 " +
" \'");
#line 16 "..\..\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");
WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">\r\n Repair Logged\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 28 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.RepairerLoggedDate));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 29 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
var dateField = $('#Job_JobMetaNonWarranty_RepairerLoggedDate');
document.DiscoFunctions.DateChangeHelper(
dateField,
'Unknown',
'");
#line 36 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyRepairerLoggedDate(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral("\',\r\n \'RepairerLoggedDate\',\r\n null\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 Repair Reference\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 49 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.RepairerReference));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 50 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(AjaxHelpers.AjaxSave());
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 51 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n <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 " +
" \'");
#line 57 "..\..\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");
WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">\r\n Repair Completed\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 69 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.RepairerCompletedDate));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 70 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
var dateField = $('#Job_JobMetaNonWarranty_RepairerCompletedDate');
document.DiscoFunctions.DateChangeHelper(
dateField,
'Unknown',
'");
#line 77 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyRepairerCompletedDate(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral("\',\r\n \'RepairerCompletedDate\',\r\n nul" +
"l\r\n );\r\n });\r\n </script>\r\n " +
" </td>\r\n </tr>\r\n</table>\r\n");
}
}
}
#pragma warning restore 1591
@@ -0,0 +1,332 @@
@model Disco.Web.Models.Job.ShowModel
@{
Html.BundleDeferred("~/Style/Shadowbox");
Html.BundleDeferred("~/ClientScripts/Modules/Shadowbox");
}
<table id="jobShowResources">
<tr>
<td id="Comments">
<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><span class="remove"></span><span class="timestamp" title="@jl.Timestamp.ToFullDateTime()">@jl.Timestamp.ToFuzzy()</span>
<span class="comment">@jl.Comments.ToMultilineJobRefString()</span>
</div>
}
</div>
<div class="commentInput clearfix">
<textarea class="commentInput" accesskey="l"></textarea>
<span class="action post commentInputPost"></span>
</div>
<script type="text/javascript">
$(function () {
$Comments = $('#Comments');
$CommentOutput = $Comments.find('.commentOutput');
$CommentOutputContainer = $Comments.find('.commentOutputContainer');
$CommentInput = $Comments.find('textarea.commentInput');
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);
$dialogRemoveLog = $('#dialogRemoveLog');
$dialogRemoveLog.dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: 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') {
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') };
$dialogRemoveLog.dialog("enable");
$dialogRemoveLog.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') {
$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");
}
});
$dialogRemoveLog.dialog('open');
return false;
}
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)
}
}
});
</script>
</td>
<td id="Attachments">
<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><span class="remove"></span><span class="timestamp" title="@ja.Timestamp.ToFullDateTime()">@ja.Timestamp.ToFuzzy()</span>
</a>
}
</div>
<div class="attachmentInput clearfix">
<span class="action upload"></span><span class="action photo"></span>
</div>
<script type="text/javascript">
Shadowbox.init({
skipSetup: true,
modal: true
});
$(function () {
if (!document.DiscoFunctions) {
document.DiscoFunctions = {};
}
document.DiscoFunctions.addAttachment = addAttachment;
$Attachments = $('#Attachments');
$attachmentOutput = $Attachments.find('.attachmentOutput');
$attachmentOutput.find('span.remove').click(removeAttachment);
$('#dialogUpload').dialog({
autoOpen: false,
draggable: false,
modal: true,
resizable: false,
width: 860,
height: 550,
close: function () {
silverlightUploadAttachment.content.Navigator.Navigate('/Hidden');
}
});
$('#dialogRemoveAttachment').dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: false
});
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' },
{
onLoad: function () {
if (onLoadNavigation) {
silverlightUploadAttachment.content.Navigator.Navigate(onLoadNavigation);
isLoaded = true;
}
}
},
'UploadUrl=@(Url.Action(MVC.API.Job.AttachmentUpload(Model.Job.Id, null)))'
);
$attachmentInput = $Attachments.find('.attachmentInput');
$attachmentInput.find('.photo').click(function () {
showDialog('/WebCam');
});
$attachmentInput.find('.upload').click(function () {
showDialog('/File');
});
silverlightUploadAttachment = $('#silverlightUploadAttachment').get(0);
function showDialog(navigationPath) {
$('#dialogUpload').dialog('open');
if (isLoaded) {
silverlightUploadAttachment.content.Navigator.Navigate(navigationPath);
} else {
onLoadNavigation = navigationPath;
}
};
function addAttachment(id, quick) {
var data = { id: id };
$.ajax({
url: '@Url.Action(MVC.API.Job.Attachment())',
dataType: 'json',
data: data,
success: function (d) {
if (d.Result == 'OK') {
var a = d.Attachment;
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(removeAttachment);
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);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to add attachment: ' + textStatus);
}
});
}
function removeAttachment() {
$this = $(this).closest('a');
var data = { id: $this.attr('data-attachmentid') };
var $dialogRemoveAttachment = $('#dialogRemoveAttachment');
$dialogRemoveAttachment.dialog("enable");
$dialogRemoveAttachment.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') {
$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");
}
});
$dialogRemoveAttachment.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() });
});
});
</script>
</td>
</tr>
</table>
<div id="dialogUpload" title="Upload Attachment">
<div id="silverlightHostUploadAttachment">
</div>
</div>
<div id="dialogRemoveLog" 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" 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>
@@ -0,0 +1,718 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Views.Job.JobParts
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
using System.Web.Helpers;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Mvc.Html;
using System.Web.Routing;
using System.Web.Security;
using System.Web.UI;
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Job/JobParts/Resources.cshtml")]
public class Resources : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
{
public Resources()
{
}
public override void Execute()
{
#line 2 "..\..\Views\Job\JobParts\Resources.cshtml"
Html.BundleDeferred("~/Style/Shadowbox");
Html.BundleDeferred("~/ClientScripts/Modules/Shadowbox");
#line default
#line hidden
WriteLiteral("\r\n<table");
WriteLiteral(" id=\"jobShowResources\"");
WriteLiteral(">\r\n <tr>\r\n <td");
WriteLiteral(" id=\"Comments\"");
WriteLiteral(">\r\n <div");
WriteLiteral(" class=\"commentOutput\"");
WriteLiteral(">\r\n");
#line 10 "..\..\Views\Job\JobParts\Resources.cshtml"
#line default
#line hidden
#line 10 "..\..\Views\Job\JobParts\Resources.cshtml"
foreach (var jl in Model.Job.JobLogs.OrderBy(m => m.Timestamp))
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" data-logid=\"");
#line 12 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(jl.Id);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n <span");
WriteLiteral(" class=\"author\"");
WriteLiteral(">");
#line 13 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(jl.TechUser.ToString());
#line default
#line hidden
WriteLiteral("</span><span");
WriteLiteral(" class=\"remove\"");
WriteLiteral("></span><span");
WriteLiteral(" class=\"timestamp\"");
WriteAttribute("title", Tuple.Create(" title=\"", 540), Tuple.Create("\"", 578)
#line 13 "..\..\Views\Job\JobParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 548), Tuple.Create<System.Object, System.Int32>(jl.Timestamp.ToFullDateTime()
#line default
#line hidden
, 548), false)
);
WriteLiteral(">");
#line 13 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(jl.Timestamp.ToFuzzy());
#line default
#line hidden
WriteLiteral("</span>\r\n <span");
WriteLiteral(" class=\"comment\"");
WriteLiteral(">");
#line 14 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(jl.Comments.ToMultilineJobRefString());
#line default
#line hidden
WriteLiteral("</span>\r\n </div>\r\n");
#line 16 "..\..\Views\Job\JobParts\Resources.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n <div");
WriteLiteral(" class=\"commentInput clearfix\"");
WriteLiteral(">\r\n <textarea");
WriteLiteral(" class=\"commentInput\"");
WriteLiteral(" accesskey=\"l\"");
WriteLiteral("></textarea>\r\n <span");
WriteLiteral(" class=\"action post commentInputPost\"");
WriteLiteral("></span>\r\n </div>\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n $Comments = $(\'#Comments\'" +
");\r\n $CommentOutput = $Comments.find(\'.commentOutput\');\r\n " +
" $CommentOutputContainer = $Comments.find(\'.commentOutputContaine" +
"r\');\r\n $CommentInput = $Comments.find(\'textarea.commentInput\'" +
");\r\n\r\n window.setTimeout(function () {\r\n " +
" $CommentOutput[0].scrollTop = $CommentOutput[0].scrollHeight; // Scroll to Bo" +
"ttom\r\n }, 0);\r\n $(\'#jobDetailTabs\').on(\'ta" +
"bsactivate\', function (event, ui) {\r\n if (ui.newPanel && " +
"ui.newPanel.is(\'#jobDetailTab-Resources\')) {\r\n $Comme" +
"ntOutput[0].scrollTop = $CommentOutput[0].scrollHeight; // Scroll to Bottom\r\n " +
" }\r\n });\r\n\r\n $Comments" +
".find(\'.commentInputPost\').click(postComment);\r\n $CommentInpu" +
"t.keypress(function (e) {\r\n if (e.which == 13 && !e.shift" +
"Key) {\r\n postComment();\r\n " +
"return false;\r\n }\r\n });\r\n " +
" $CommentOutput.find(\'span.remove\').click(removePost);\r\n\r\n " +
" $dialogRemoveLog = $(\'#dialogRemoveLog\');\r\n $dialogRemove" +
"Log.dialog({\r\n resizable: false,\r\n " +
" height: 140,\r\n modal: true,\r\n aut" +
"oOpen: false\r\n });\r\n\r\n function postCommen" +
"t() {\r\n var comment = $CommentInput.val();\r\n " +
" if (comment != \'\') {\r\n var data = { commen" +
"t: comment }\r\n $.ajax({\r\n " +
" url: \'");
#line 60 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.CommentPost(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral("\',\r\n dataType: \'json\',\r\n " +
" data: data,\r\n success: function (d) {\r\n " +
" if (d.Result == \'OK\') {\r\n " +
" addComment(d.Comment, false);\r\n " +
" $CommentInput.val(\'\').attr(\'disabled\', false).focus();\r\n " +
" } else {\r\n alert(\'Una" +
"ble to post comment: \' + d.Result);\r\n $Co" +
"mmentInput.attr(\'disabled\', false);\r\n }\r\n " +
" },\r\n error: function " +
"(jqXHR, textStatus, errorThrown) {\r\n alert(\'U" +
"nable to post comment: \' + textStatus);\r\n $Co" +
"mmentInput.attr(\'disabled\', false);\r\n }\r\n " +
" });\r\n }\r\n }\r\n " +
" function removePost() {\r\n $this = $(this);" +
"\r\n var data = { id: $this.closest(\'div\').attr(\'data-logid" +
"\') };\r\n\r\n $dialogRemoveLog.dialog(\"enable\");\r\n " +
" $dialogRemoveLog.dialog(\'option\', \'buttons\', {\r\n " +
" \"Remove\": function () {\r\n $dialogRemoveL" +
"og.dialog(\"disable\");\r\n $dialogRemoveLog.dialog(\"" +
"option\", \"buttons\", null);\r\n $.ajax({\r\n " +
" url: \'");
#line 89 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.CommentRemove()));
#line default
#line hidden
WriteLiteral("\',\r\n dataType: \'json\',\r\n " +
" data: data,\r\n success: function" +
" (d) {\r\n if (d == \'OK\') {\r\n " +
" $this.closest(\'div\').slideUp(300).delay(300).queue" +
"(function () {\r\n $(this).remove()" +
";\r\n });\r\n " +
" } else {\r\n alert(\'Unable " +
"to remove comment: \' + d);\r\n }\r\n " +
" $dialogRemoveLog.dialog(\"close\");\r\n " +
" },\r\n error: function (j" +
"qXHR, textStatus, errorThrown) {\r\n alert(" +
"\'Unable to remove comment: \' + textStatus);\r\n " +
" $dialogRemoveLog.dialog(\"close\");\r\n }\r\n " +
" });\r\n },\r\n " +
" \"Cancel\": function () {\r\n $dialog" +
"RemoveLog.dialog(\"close\");\r\n }\r\n " +
" });\r\n\r\n $dialogRemoveLog.dialog(\'open\');\r\n\r\n " +
" return false;\r\n }\r\n function" +
" addComment(c, quick) {\r\n var e = $(\'<div><span class=\"au" +
"thor\" /><span class=\"remove\" /><span class=\"timestamp\" /><span class=\"comment\" /" +
"></div>\');\r\n e.attr(\'data-logid\', c.Id);\r\n " +
" e.find(\'.author\').text(c.Author);\r\n e.find(\'.tim" +
"estamp\').text(c.TimestampFuzzy).attr(\'title\', c.TimestampFull);\r\n " +
" e.find(\'.remove\').click(removePost);\r\n var eComm" +
"ent = e.find(\'.comment\').text(c.Comments);\r\n var commentH" +
"tml = eComment.text().replace(/\\r\\n|\\r|\\n/g, \'<br />\');\r\n " +
" commentHtml = commentHtml.replace(/\\#(\\d+)/g, \'<a href=\"");
#line 125 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.Job.Show(null)));
#line default
#line hidden
WriteLiteral(@"?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)
}
}
});
</script>
</td>
<td");
WriteLiteral(" id=\"Attachments\"");
WriteLiteral(">\r\n <div");
WriteLiteral(" class=\"attachmentOutput\"");
WriteLiteral(">\r\n");
#line 142 "..\..\Views\Job\JobParts\Resources.cshtml"
#line default
#line hidden
#line 142 "..\..\Views\Job\JobParts\Resources.cshtml"
foreach (var ja in Model.Job.JobAttachments)
{
#line default
#line hidden
WriteLiteral(" <a");
WriteAttribute("href", Tuple.Create(" href=\"", 7537), Tuple.Create("\"", 7594)
#line 144 "..\..\Views\Job\JobParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 7544), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentDownload(ja.Id))
#line default
#line hidden
, 7544), false)
);
WriteLiteral(" data-attachmentid=\"");
#line 144 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(ja.Id);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(" data-mimetype=\"");
#line 144 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(ja.MimeType);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n <span");
WriteLiteral(" class=\"icon\"");
WriteAttribute("title", Tuple.Create(" title=\"", 7696), Tuple.Create("\"", 7716)
#line 145 "..\..\Views\Job\JobParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 7704), Tuple.Create<System.Object, System.Int32>(ja.Filename
#line default
#line hidden
, 7704), false)
);
WriteLiteral(">\r\n <img");
WriteLiteral(" alt=\"Attachment Thumbnail\"");
WriteAttribute("src", Tuple.Create(" src=\"", 7779), Tuple.Create("\"", 7838)
#line 146 "..\..\Views\Job\JobParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 7785), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id))
#line default
#line hidden
, 7785), false)
);
WriteLiteral(" /></span>\r\n <span");
WriteLiteral(" class=\"comments\"");
WriteAttribute("title", Tuple.Create(" title=\"", 7897), Tuple.Create("\"", 7917)
#line 147 "..\..\Views\Job\JobParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 7905), Tuple.Create<System.Object, System.Int32>(ja.Comments
#line default
#line hidden
, 7905), false)
);
WriteLiteral(">\r\n");
#line 148 "..\..\Views\Job\JobParts\Resources.cshtml"
#line default
#line hidden
#line 148 "..\..\Views\Job\JobParts\Resources.cshtml"
if (!string.IsNullOrEmpty(ja.DocumentTemplateId))
{
#line default
#line hidden
#line 149 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(ja.DocumentTemplate.Description);
#line default
#line hidden
#line 149 "..\..\Views\Job\JobParts\Resources.cshtml"
}
else
{
#line default
#line hidden
#line 151 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(ja.Comments);
#line default
#line hidden
#line 151 "..\..\Views\Job\JobParts\Resources.cshtml"
}
#line default
#line hidden
WriteLiteral("\r\n </span><span");
WriteLiteral(" class=\"author\"");
WriteLiteral(">");
#line 152 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(ja.TechUser.ToString());
#line default
#line hidden
WriteLiteral("</span><span");
WriteLiteral(" class=\"remove\"");
WriteLiteral("></span><span");
WriteLiteral(" class=\"timestamp\"");
WriteAttribute("title", Tuple.Create(" title=\"", 8287), Tuple.Create("\"", 8325)
#line 152 "..\..\Views\Job\JobParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 8295), Tuple.Create<System.Object, System.Int32>(ja.Timestamp.ToFullDateTime()
#line default
#line hidden
, 8295), false)
);
WriteLiteral(">");
#line 152 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(ja.Timestamp.ToFuzzy());
#line default
#line hidden
WriteLiteral("</span>\r\n </a> \r\n");
#line 154 "..\..\Views\Job\JobParts\Resources.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n <div");
WriteLiteral(" class=\"attachmentInput clearfix\"");
WriteLiteral(">\r\n <span");
WriteLiteral(" class=\"action upload\"");
WriteLiteral("></span><span");
WriteLiteral(" class=\"action photo\"");
WriteLiteral("></span>\r\n </div>\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
Shadowbox.init({
skipSetup: true,
modal: true
});
$(function () {
if (!document.DiscoFunctions) {
document.DiscoFunctions = {};
}
document.DiscoFunctions.addAttachment = addAttachment;
$Attachments = $('#Attachments');
$attachmentOutput = $Attachments.find('.attachmentOutput');
$attachmentOutput.find('span.remove').click(removeAttachment);
$('#dialogUpload').dialog({
autoOpen: false,
draggable: false,
modal: true,
resizable: false,
width: 860,
height: 550,
close: function () {
silverlightUploadAttachment.content.Navigator.Navigate('/Hidden');
}
});
$('#dialogRemoveAttachment').dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: false
});
var onLoadNavigation = null;
var isLoaded = null;
Silverlight.createObject(
'");
#line 197 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Links.ClientBin.Disco_Silverlight_AttachmentUpload_xap);
#line default
#line hidden
WriteLiteral(@"',
$('#silverlightHostUploadAttachment').get(0),
'silverlightUploadAttachment',
{ width: '840px', height: '500px', background: 'white', version: '4.0.60310.0' },
{
onLoad: function () {
if (onLoadNavigation) {
silverlightUploadAttachment.content.Navigator.Navigate(onLoadNavigation);
isLoaded = true;
}
}
},
'UploadUrl=");
#line 209 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.AttachmentUpload(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral(@"'
);
$attachmentInput = $Attachments.find('.attachmentInput');
$attachmentInput.find('.photo').click(function () {
showDialog('/WebCam');
});
$attachmentInput.find('.upload').click(function () {
showDialog('/File');
});
silverlightUploadAttachment = $('#silverlightUploadAttachment').get(0);
function showDialog(navigationPath) {
$('#dialogUpload').dialog('open');
if (isLoaded) {
silverlightUploadAttachment.content.Navigator.Navigate(navigationPath);
} else {
onLoadNavigation = navigationPath;
}
};
function addAttachment(id, quick) {
var data = { id: id };
$.ajax({
url: '");
#line 232 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.Attachment()));
#line default
#line hidden
WriteLiteral(@"',
dataType: 'json',
data: data,
success: function (d) {
if (d.Result == 'OK') {
var a = d.Attachment;
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', '");
#line 241 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.AttachmentDownload()));
#line default
#line hidden
WriteLiteral("/\' + a.Id);\r\n e.find(\'.icon img\').attr(\'src\', " +
"\'");
#line 242 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.AttachmentThumbnail()));
#line default
#line hidden
WriteLiteral("/\' + a.Id);\r\n e.find(\'.comments\').text(a.Comme" +
"nts);\r\n e.find(\'.author\').text(a.Author);\r\n " +
" e.find(\'.timestamp\').text(a.TimestampFuzzy).at" +
"tr(\'title\', a.TimestampFull);\r\n e.find(\'.remo" +
"ve\').click(removeAttachment);\r\n if (!quick)\r\n" +
" e.hide();\r\n " +
" $attachmentOutput.append(e);\r\n if (!qu" +
"ick)\r\n e.show(\'slow\');\r\n " +
" if (a.MimeType.toLowerCase().indexOf(\'image/\') == 0)\r\n " +
" e.shadowbox({ gallery: \'attachments\', player: \'" +
"img\', title: a.Comments });\r\n } else {\r\n " +
" alert(\'Unable to add attachment: \' + d.Result);\r\n " +
" }\r\n },\r\n " +
" error: function (jqXHR, textStatus, errorThrown) {\r\n " +
" alert(\'Unable to add attachment: \' + textStatus);\r\n " +
" }\r\n });\r\n }\r\n " +
" function removeAttachment() {\r\n $this = $(this)." +
"closest(\'a\');\r\n\r\n var data = { id: $this.attr(\'data-attac" +
"hmentid\') };\r\n\r\n var $dialogRemoveAttachment = $(\'#dialog" +
"RemoveAttachment\');\r\n $dialogRemoveAttachment.dialog(\"ena" +
"ble\");\r\n $dialogRemoveAttachment.dialog(\'option\', \'button" +
"s\', {\r\n \"Remove\": function () {\r\n " +
" $dialogRemoveAttachment.dialog(\"disable\");\r\n " +
" $dialogRemoveAttachment.dialog(\"option\", \"buttons\", null);\r\n " +
" $.ajax({\r\n url: \'");
#line 275 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.AttachmentRemove()));
#line default
#line hidden
WriteLiteral("\',\r\n dataType: \'json\',\r\n " +
" data: data,\r\n success: function" +
" (d) {\r\n if (d == \'OK\') {\r\n " +
" $this.hide(300).delay(300).queue(function () {\r\n " +
" var $this = $(this);\r\n " +
" if ($this.attr(\'data-mimetype\').toLowerCase(" +
").indexOf(\'image/\') == 0)\r\n S" +
"hadowbox.removeCache(this);\r\n $th" +
"is.remove();\r\n });\r\n " +
" } else {\r\n ale" +
"rt(\'Unable to remove attachment: \' + d);\r\n " +
" }\r\n $dialogRemoveAttachment.dialog(\"clo" +
"se\");\r\n },\r\n " +
" error: function (jqXHR, textStatus, errorThrown) {\r\n " +
" alert(\'Unable to remove attachment: \' + textStatus);\r\n " +
" $dialogRemoveAttachment.dialog(\"close\");\r\n " +
" }\r\n });\r\n " +
" },\r\n \"Cancel\": function () {\r\n " +
" $dialogRemoveAttachment.dialog(\"close\");\r\n " +
" }\r\n });\r\n\r\n $dialogR" +
"emoveAttachment.dialog(\'open\');\r\n\r\n return false;\r\n " +
" }\r\n\r\n $attachmentOutput.children(\'a\').each(func" +
"tion () {\r\n $this = $(this);\r\n if " +
"($this.attr(\'data-mimetype\').toLowerCase().indexOf(\'image/\') == 0)\r\n " +
" $this.shadowbox({ gallery: \'attachments\', player: \'img\', title: " +
"$this.find(\'.comments\').text() });\r\n });\r\n });" +
"\r\n </script>\r\n </td>\r\n </tr>\r\n</table>\r\n<div");
WriteLiteral(" id=\"dialogUpload\"");
WriteLiteral(" title=\"Upload Attachment\"");
WriteLiteral(">\r\n <div");
WriteLiteral(" id=\"silverlightHostUploadAttachment\"");
WriteLiteral(">\r\n </div>\r\n</div>\r\n<div");
WriteLiteral(" id=\"dialogRemoveLog\"");
WriteLiteral(" title=\"Remove this Comment?\"");
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?\r\n </p>\r\n</div>\r\n<div");
WriteLiteral(" id=\"dialogRemoveAttachment\"");
WriteLiteral(" title=\"Remove this Attachment?\"");
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?\r\n </p>\r\n</div>\r\n");
}
}
}
#pragma warning restore 1591
@@ -0,0 +1,127 @@
@model Disco.Web.Models.Job.ShowModel
<div id="jobDetailTab-Warranty" class="jobPart">
<table id="jobNonWarrantyFinance">
<tr>
<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))',
'ExternalName'
);
});
</script>
</td>
</tr>
<tr>
<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)))',
'ExternalLoggedDate',
null
);
});
</script>
</td>
</tr>
<tr>
<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))',
'ExternalReference'
);
});
</script>
</td>
</tr>
<tr>
<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)))',
'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>
</td>
</tr>
</table>
</div>
<script type="text/javascript">
$('#jobDetailTabItems').append('<li><a href="#jobDetailTab-Warranty">Warranty</a></li>');
$(function () {
var warrantyProviderDetailLoaded = false;
$('#jobDetailTabs').bind('tabsshow', function (e, ui) {
if ($(ui.panel).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();
}
);
warrantyProviderDetailLoaded = true;
}
}
}
});
});
</script>
@@ -0,0 +1,341 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Views.Job.JobParts
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
using System.Web.Helpers;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Mvc.Html;
using System.Web.Routing;
using System.Web.Security;
using System.Web.UI;
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Job/JobParts/Warranty.cshtml")]
public class Warranty : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
{
public Warranty()
{
}
public override void Execute()
{
WriteLiteral("<div");
WriteLiteral(" id=\"jobDetailTab-Warranty\"");
WriteLiteral(" class=\"jobPart\"");
WriteLiteral(">\r\n <table");
WriteLiteral(" id=\"jobNonWarrantyFinance\"");
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(" ");
#line 11 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n <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 " +
" \'");
#line 17 "..\..\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(" ");
#line 29 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaWarranty.ExternalLoggedDate));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 30 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(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 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");
WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">\r\n Warranty Reference\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 50 "..\..\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 default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 52 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n <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 " +
" \'");
#line 58 "..\..\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");
WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">\r\n Warranty Completed\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 70 "..\..\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 default
#line hidden
WriteLiteral("\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(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 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");
WriteLiteral(" id=\"jobWarrantyProviderDetailContainer\"");
WriteLiteral(" style=\"display: none\"");
WriteLiteral(">\r\n <th");
WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">\r\n Provider Details\r\n </th>\r\n <td>\r\n " +
" <div");
WriteLiteral(" id=\"jobWarrantyProviderDetailLoading\"");
WriteLiteral(">\r\n <span");
WriteLiteral(" class=\"ajaxHelperIcon ajaxLoading\"");
WriteLiteral(" title=\"Loading...\"");
WriteLiteral("></span> Loading...\r\n </div>\r\n <div");
WriteLiteral(" id=\"jobWarrantyProviderDetailHost\"");
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(" type=\"text/javascript\"");
WriteLiteral(@">
$('#jobDetailTabItems').append('<li><a href=""#jobDetailTab-Warranty"">Warranty</a></li>');
$(function () {
var warrantyProviderDetailLoaded = false;
$('#jobDetailTabs').bind('tabsshow', function (e, ui) {
if ($(ui.panel).is('#jobDetailTab-Warranty')) {
if (!warrantyProviderDetailLoaded) {
var warrantyExternalName = $('#Job_JobMetaWarranty_ExternalName').val();
if (warrantyExternalName) {
$('#jobWarrantyProviderDetailContainer').show();
$('#jobWarrantyProviderDetailLoading span').show();
$('#jobWarrantyProviderDetailHost').load(
'");
#line 113 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(Url.Action(MVC.Job.WarrantyProviderJobDetails()));
#line default
#line hidden
WriteLiteral("\',\r\n { id: \'");
#line 114 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(Model.Job.Id);
#line default
#line hidden
WriteLiteral(@"' },
function () {
$('#jobWarrantyProviderDetailLoading').hide();
$(this).slideDown();
}
);
warrantyProviderDetailLoaded = true;
}
}
}
});
});
</script>
");
}
}
}
#pragma warning restore 1591
@@ -0,0 +1,715 @@
@model Disco.Web.Models.Job.ShowModel
<table id="Job_Show_Subjects">
<tr>
<td id="Job_Show_Job">
<div>
<div id="Job_Show_Job_Dates">
<table class="none">
<tr>
<td>Opened:
</td>
<td><span id="Job_Show_Job_Dates_Opened">@CommonHelpers.FriendlyDateAndTitleUser(Model.Job.OpenedDate, Model.Job.OpenedTechUser)</span></td>
</tr>
@if (!Model.Job.ClosedDate.HasValue || Model.Job.ExpectedClosedDate.HasValue)
{
<tr>
<td>
<span title="Expected to Close">Expected:</span>
</td>
<td>@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');
var dateFieldChangeToken = null;
var dateFieldValue = $('#Job_ExpectedClosedDate').val();
$('#Job_ExpectedClosedDate')
.watermark('Unknown')
.datetimepicker({
ampm: true,
stepMinute: 1,
hour: 9,
minDate: @(Model.Job.OpenedDate.ToJavascriptDate()),
changeYear: true,
changeMonth: true,
dateFormat: 'yy/mm/dd'
}).change(function () {
var $this = $(this);
var dateText = $this.val();
if (dateFieldValue.toLowerCase() != dateText.toLowerCase()) {
dateFieldValue = dateText;
if (dateFieldChangeToken)
window.clearTimeout(dateFieldChangeToken);
dateFieldChangeToken = window.setTimeout(function () {
$ajaxSave.hide();
var $ajaxLoading = $ajaxSave.next('.ajaxLoading').show();
var data = { ExpectedClosedDate: dateText };
$.getJSON('@(Url.Action(MVC.API.Job.UpdateExpectedClosedDate(Model.Job.Id, null)))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Expected Closed Date:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
})
dateFieldChangeToken = null;
}, 750);
}
});
});
</script>
</td>
</tr>
}
@if (Model.Job.ClosedDate.HasValue)
{
<tr>
<td>Closed:
</td>
<td><span id="Job_Show_Job_Dates_Closed">@CommonHelpers.FriendlyDateAndTitleUser(Model.Job.ClosedDate, Model.Job.ClosedTechUser)</span></td>
</tr>
}
</table>
</div>
<div id="Job_Show_Job_Type" class="status">
<h2 title="@Model.Job.JobType.Id">@Model.Job.JobType.Description</h2>
<table class="none">
<tr>
@{
var jobSubTypeFirst = (int)Math.Ceiling((double)(Model.Job.JobSubTypes.Count + 1) / 2);
}
<td>
<ul id="Job_Show_Job_SubTypes_1">
@foreach (var jobSubType in Model.Job.JobSubTypes.Take(jobSubTypeFirst))
{
<li title="@jobSubType.Id">@jobSubType.Description</li>
}
</ul>
</td>
<td>
<ul id="Job_Show_Job_SubTypes_2">
@foreach (var jobSubType in Model.Job.JobSubTypes.Skip(jobSubTypeFirst))
{
<li title="@jobSubType.Id">@jobSubType.Description</li>
}
</ul>
@if (!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>
}
</div>
</div>
<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_Dialog.dialog('open');
return false;
});
});
</script>
</div>
<div id="Job_Show_GenerateDocument_Container" class="status">
@Html.DropDownList("Job_Show_GenerateDocument", Model.DocumentTemplatesSelectListItems) <span id="Job_Show_GenerateDocument_Status">@AjaxHelpers.AjaxLoader()&nbsp;Generating...</span>
<script type="text/javascript">
$(function () {
var generatePdfUrl = '@Url.Action(MVC.API.Job.GeneratePdf(Model.Job.Id.ToString(), null))?DocumentTemplateId=';
var $documentTemplates = $('#Job_Show_GenerateDocument');
var $Job_Show_GenerateDocument_Status = $('#Job_Show_GenerateDocument_Status');
$Job_Show_GenerateDocument_Status.find('.ajaxLoading').css('display', 'inline-block');
$documentTemplates.change(function () {
var v = $documentTemplates.val();
if (v) {
if ($.browser.msie || $.browser.mozilla){
// Popup & Status for MSIE & Firefox
var w = window.open(generatePdfUrl + v, null, 'height=100,width=150,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no');
var statusShown = false;
var c = function(timeout){window.setTimeout(function(){
if (w.closed === undefined || w.closed === true){
if (statusShown)
$Job_Show_GenerateDocument_Status.fadeOut(750);
}else{
if (!statusShown)
{
$Job_Show_GenerateDocument_Status.show()
statusShown = true;
}
c(500);
}
}, timeout)}
c(200);
}else{
// Redirect other Browsers with different download mechanisms
window.location.href = generatePdfUrl + v;
}
$documentTemplates.val('').blur();
}
});
});
</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>
<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()))" />
<div id="Job_Show_Device_ComputerName" title="Computer Name">@Model.Job.Device.ComputerName</div>
<div id="Job_Show_Device_Model" title="Model">@Html.ActionLink(Model.Job.Device.DeviceModel.ToString(), MVC.Config.DeviceModel.Index(Model.Job.Device.DeviceModelId))</div>
@if (Model.Job.Device.DeviceBatch != null)
{
<div id="Job_Show_Device_Batch" title="Batch">@Html.ActionLink(Model.Job.Device.DeviceBatch.Name, MVC.Config.DeviceBatch.Index(Model.Job.Device.DeviceBatchId))</div>
}
</div>
@if (Model.Job.JobTypeId == JobType.JobTypeIds.HWar)
{
<div id="Job_Show_Device_Details_HWar">
<div>DEVICE WARRANTY</div>
<div>Until: <span id="Job_Show_Device_Details_HWar_ValidUntil">@Model.Job.Device.DeviceBatch.WarrantyValidUntil.ToFuzzy("Unknown")</span></div>
@if (!string.IsNullOrWhiteSpace(Model.Job.Device.DeviceBatch.WarrantyDetails))
{
<a id="Job_Show_Device_Details_HWar_Details_Button" href="#">Show Details</a>
<div id="Job_Show_Device_Details_HWar_Details_Dialog" class="dialog" title="Warranty Details for @(Model.Job.Device.DeviceBatch.Name)">
<div>@(new HtmlString(Model.Job.Device.DeviceBatch.WarrantyDetails))</div>
</div>
<script type="text/javascript">
$(function () {
var d;
$('#Job_Show_Device_Details_HWar_Details_Button').click(function () {
if (!d)
d = $('#Job_Show_Device_Details_HWar_Details_Dialog').dialog({
width: 570,
modal: true
});
else
d.dialog('open');
return false;
});
});
</script>
}
</div>
}
@if (Model.Job.JobTypeId == JobType.JobTypeIds.HNWar)
{
<div id="Job_Show_Device_Details_HNWar">
<div>INSURANCE</div>
<div id="Job_Show_Device_Details_HNWar_InsuranceSupplier">@Model.Job.Device.DeviceBatch.InsuranceSupplier</div>
<div>Until: <span id="Job_Show_Device_Details_HNWar_ValidUntil">@Model.Job.Device.DeviceBatch.InsuredUntil.ToFuzzy("Unknown")</span></div>
@if (!string.IsNullOrWhiteSpace(Model.Job.Device.DeviceBatch.InsuranceDetails))
{
<a id="Job_Show_Device_Details_HNWar_Details_Button" href="#">Show Details</a>
<div id="Job_Show_Device_Details_HNWar_Details_Dialog" class="dialog" title="Insurance Details for @(Model.Job.Device.DeviceBatch.Name)">
<div>@(new HtmlString(Model.Job.Device.DeviceBatch.InsuranceDetails))</div>
</div>
<script type="text/javascript">
$(function () {
var d;
$('#Job_Show_Device_Details_HNWar_Details_Button').click(function () {
if (!d)
d = $('#Job_Show_Device_Details_HNWar_Details_Dialog').dialog({
width: 570,
modal: true
});
else
d.dialog('open');
return false;
});
});
</script>
}
</div>
}
</div>
@if (Model.Job.DeviceHeld.HasValue)
{
<div id="Job_Show_Device_DeviceHeld" class="status">
<table class="none">
<tr>
<td>Location:</td>
<td>@Html.TextBoxFor(m => m.Job.DeviceHeldLocation, new { @class = "small discreet" }) @AjaxHelpers.AjaxSave() @AjaxHelpers.AjaxLoader()</td>
</tr>
<tr>
<td>Held Since:</td>
<td><span id="Job_Show_Device_DeviceHeld_DeviceHeld">@CommonHelpers.FriendlyDateAndTitleUser(Model.Job.DeviceHeld, Model.Job.DeviceHeldTechUser)</span></td>
</tr>
@if (Model.Job.DeviceReadyForReturn.HasValue)
{
<tr>
<td>Ready:</td>
<td><span id="Job_Show_Device_DeviceHeld_DeviceReadyForReturn">@CommonHelpers.FriendlyDateAndTitleUser(Model.Job.DeviceReadyForReturn, Model.Job.DeviceReadyForReturnTechUser)</span></td>
</tr>
}
@if (Model.Job.DeviceReturnedDate.HasValue)
{
<tr>
<td>Returned:</td>
<td><span id="Job_Show_Device_DeviceHeld_DeviceReturnedDate">@CommonHelpers.FriendlyDateAndTitleUser(Model.Job.DeviceReturnedDate, Model.Job.DeviceReturnedTechUser)</span></td>
</tr>
}
</table>
<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();
}
});
});
});
</script>
</div>
}
</div>
</td>
}
@if (Model.Job.User != null)
{
<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>
@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))
{<div id="Job_Show_User_EmailAddress" title="Email Address">Email: <a href="mailto:@(Model.Job.User.EmailAddress)">@Model.Job.User.EmailAddress</a></div>}
@if (Model.Job.WaitingForUserAction.HasValue)
{
<div id="Job_Show_User_WaitingForUserAction" class="status">
<h4>Awaiting Action</h4>
Since: @Model.Job.WaitingForUserAction.ToFuzzy()
</div>
}
</div>
</td>
}
</tr>
<tr id="Job_Show_Subjects_Actions">
<td id="Job_Show_Job_Actions">
@if (Model.Job.CanClose())
{
@Html.ActionLinkSmallButton("Close Job", MVC.API.Job.Close(Model.Job.Id, true), "Job_Show_Job_Actions_Close_Button")
<div id="Job_Show_Job_Actions_Close_Dialog" class="dialog" title="Close this Job?">
<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 button = $('#Job_Show_Job_Actions_Close_Button');
var buttonDialog = null;
var buttonLink = button.attr('href');
button.attr('href', '#').click(function () {
if (!buttonDialog){
buttonDialog = $('#Job_Show_Job_Actions_Close_Dialog');
buttonDialog.dialog({
resizable: false,
modal: true,
autoOpen: false,
buttons: {
"Close Job": function () {
var $this = $(this);
$this.dialog("disable");
$this.dialog("option", "buttons", null);
window.location.href = buttonLink;
},
Cancel: function () {
$(this).dialog("close");
}
}
});
}
buttonDialog.dialog('open');
return false;
});
});
</script>
}
@if (Model.Job.CanReopen())
{
@Html.ActionLinkSmallButton("Reopen Job", MVC.API.Job.Reopen(Model.Job.Id, true), "Job_Show_Job_Actions_Reopen_Button")
<div id="Job_Show_Job_Actions_Reopen_Dialog" class="dialog" title="Reopen this Job?">
<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 button = $('#Job_Show_Job_Actions_Reopen_Button');
var buttonDialog = null;
var buttonLink = button.attr('href');
button.attr('href', '#');
button.click(function () {
if (!buttonDialog){
buttonDialog = $('#Job_Show_Job_Actions_Reopen_Dialog');
buttonDialog.dialog({
resizable: false,
modal: true,
autoOpen: false,
buttons: {
"Reopen": function () {
var $this = $(this);
$this.dialog("disable");
$this.dialog("option", "buttons", null);
window.location.href = buttonLink;
},
Cancel: function () {
$(this).dialog("close");
}
}
});
}
buttonDialog.dialog('open');
return false;
});
});
</script>
}
@if (Model.Job.CanDelete())
{
@Html.ActionLinkSmallButton("Delete Job", MVC.API.Job.Delete(Model.Job.Id, true), "Job_Show_Job_Actions_Delete_Button")
<div id="Job_Show_Job_Actions_Delete_Dialog" class="dialog" title="Delete this Job?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
This item will be permanently deleted and cannot be recovered. Are you sure?
</p>
</div>
<script type="text/javascript">
$(function () {
var button = $('#Job_Show_Job_Actions_Delete_Button');
var buttonDialog = null;
var buttonLink = button.attr('href');
button.attr('href', '#');
button.click(function () {
if (!buttonDialog){
buttonDialog = $('#Job_Show_Job_Actions_Delete_Dialog');
buttonDialog.dialog({
resizable: false,
modal: true,
autoOpen: false,
buttons: {
"Delete": function () {
var $this = $(this);
$this.dialog("disable");
$this.dialog("option", "buttons", null);
window.location.href = buttonLink;
},
Cancel: function () {
$(this).dialog("close");
}
}
});
}
buttonDialog.dialog('open');
return false;
});
});
</script>
}
@if (Model.Job.CanLogWarranty())
{
@Html.ActionLinkSmallButton("Log Warranty", MVC.Job.LogWarranty(Model.Job.Id, null, null), "Job_Show_Job_Actions_LogWarranty_Button")
}
@if (Model.Job.CanWarrantyCompleted())
{
@Html.ActionLinkSmallButton("Warranty Complete", MVC.API.Job.UpdateWarrantyExternalCompletedDate(Model.Job.Id, "Now", true), "Job_Show_Job_Actions_WarrantyComplete_Button", "alert")
}
@if (Model.Job.CanInsuranceClaimFormSent())
{
@Html.ActionLinkSmallButton("Insurance Claim Form Sent", MVC.API.Job.UpdateInsuranceClaimFormSentDate(Model.Job.Id, "Now", true), "Job_Show_Job_Actions_InsuranceClaimFormSent_Button", "alert")
}
@if (Model.Job.CanLogRepair())
{
@Html.ActionLinkSmallButton("Repairs Logged", MVC.API.Job.LogRepair(Model.Job.Id, null, null, true), "Job_Show_Job_Actions_LogRepair_Button")
<div id="Job_Show_Job_Actions_LogRepair_Dialog" class="dialog" title="Repairs Logged">
@using (Html.BeginForm(MVC.API.Job.LogRepair(Model.Job.Id, null, null, true)))
{
<h3>Repairer Name:</h3>
<p>
<input type="text" id="Job_Show_Job_Actions_LogRepair_Dialog_RepairerName" name="RepairerName" />
</p>
<h3>Repairer Reference:</h3>
<p>
<input type="text" id="Job_Show_Job_Actions_LogRepair_Dialog_RepairerReference" name="RepairerReference" />
</p>
}
</div>
<script type="text/javascript">
$(function () {
var button = $('#Job_Show_Job_Actions_LogRepair_Button');
var buttonDialog = null;
button.attr('href', '#');
button.click(function () {
if (!buttonDialog){
buttonDialog = $('#Job_Show_Job_Actions_LogRepair_Dialog');
buttonDialog.dialog({
resizable: false,
height: 240,
modal: true,
autoOpen: false,
buttons: {
"Log Repairs": function () {
var $this = $(this);
$this.dialog("disable");
$this.dialog("option", "buttons", null);
$this.find('form').submit();
},
Cancel: function () {
$(this).dialog("close");
}
}
});
}
buttonDialog.dialog('open');
$('#Job_Show_Job_Actions_LogRepair_Dialog_RepairerName').val($('#Job_JobMetaNonWarranty_RepairerName').val()).focus();
$('#Job_Show_Job_Actions_LogRepair_Dialog_RepairerReference').val($('#Job_JobMetaNonWarranty_RepairerReference').val());
return false;
});
});
</script>
}
@if (Model.Job.CanRepairComplete())
{
@Html.ActionLinkSmallButton("Repairs Complete", MVC.API.Job.UpdateNonWarrantyRepairerCompletedDate(Model.Job.Id, "Now", true), "Job_Show_Job_Actions_RepairComplete_Button", "alert")
}
@if (Model.Job.CanConvertHWarToHNWar())
{
@Html.ActionLinkSmallButton("Convert to Non-Warranty", MVC.API.Job.ConvertHWarToHNWar(Model.Job.Id, true), "Job_Show_Job_Actions_ConvertToHNWar_Button")
<div id="Job_Show_Job_Actions_ConvertToHNWar_Dialog" class="dialog" title="Convert this Job?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
This process is not reversible.<br />
Are you sure?
</p>
</div>
<script type="text/javascript">
$(function () {
var button = $('#Job_Show_Job_Actions_ConvertToHNWar_Button');
var buttonDialog = null;
var buttonLink = button.attr('href');
button.attr('href', '#');
button.click(function () {
if (!buttonDialog){
buttonDialog = $('#Job_Show_Job_Actions_ConvertToHNWar_Dialog');
buttonDialog.dialog({
resizable: false,
modal: true,
autoOpen: false,
buttons: {
"Convert": function () {
var $this = $(this);
$this.dialog("disable");
$this.dialog("option", "buttons", null);
window.location.href = buttonLink;
},
Cancel: function () {
$(this).dialog("close");
}
}
});
}
buttonDialog.dialog('open');
return false;
});
});
</script>
}
</td>
@if (Model.Job.Device != null)
{
<td id="Job_Show_Device_Actions">
@if (Model.Job.CanDeviceHeld())
{
@Html.ActionLinkSmallButton("Held", MVC.API.Job.DeviceHeld(Model.Job.Id, true), "Job_Show_Device_Actions_Held_Button")
}
@if (Model.Job.CanDeviceReadyForReturn())
{
@Html.ActionLinkSmallButton("Ready For Return", MVC.API.Job.DeviceReadyForReturn(Model.Job.Id, true), "Job_Show_Device_Actions_DeviceReadyForReturn_Button", "alert")
}
@if (Model.Job.CanDeviceReturned())
{
@Html.ActionLinkSmallButton("Returned", MVC.API.Job.DeviceReturned(Model.Job.Id, true), "Job_Show_Device_Actions_DeviceReturned_Button", Model.Job.CanDeviceReadyForReturn() ? null : "alert")
}
</td>
}
@if (Model.Job.User != null)
{
<td id="Job_Show_User_Actions">
@if (Model.Job.CanWaitingForUserAction())
{
<a id="Job_Show_User_Actions_WaitingForUserAction_Button" href="#" class="button small">Awaiting Action</a>
<div id="Job_Show_User_Actions_WaitingForUserAction_Dialog" class="dialog" title="Waiting for User Action">
@using (Html.BeginForm(MVC.API.Job.WaitingForUserAction(Model.Job.Id, null, true)))
{
<h3>Reason:</h3>
<p>
<textarea name="Reason" class="block"></textarea>
</p>
}
</div>
<script type="text/javascript">
$(function () {
var button = $('#Job_Show_User_Actions_WaitingForUserAction_Button');
var buttonDialog = null;
button.click(function () {
if (!buttonDialog) {
buttonDialog = $('#Job_Show_User_Actions_WaitingForUserAction_Dialog');
buttonDialog.dialog({
resizable: false,
modal: true,
autoOpen: false,
buttons: {
"Waiting for User Action": function () {
var $this = $(this);
$this.dialog("disable");
$this.dialog("option", "buttons", null);
$this.find('form').submit();
},
Cancel: function () {
$(this).dialog("close");
}
}
});
}
buttonDialog.dialog('open');
return false;
});
});
</script>
}
@if (Model.Job.CanNotWaitingForUserAction())
{
<a id="Job_Show_User_Actions_NotWaitingForUserAction_Button" href="#" class="button alert small">Action Resolved</a>
<div id="Job_Show_User_Actions_NotWaitingForUserAction_Dialog" class="dialog" title="Not Waiting for User Action">
@using (Html.BeginForm(MVC.API.Job.NotWaitingForUserAction(Model.Job.Id, null, true)))
{
<h3>Resolution:</h3>
<p>
<textarea name="Resolution" class="block"></textarea>
</p>
}
</div>
<script type="text/javascript">
$(function () {
var button = $('#Job_Show_User_Actions_NotWaitingForUserAction_Button');
var buttonDialog = null;
button.click(function () {
if (!buttonDialog) {
buttonDialog = $('#Job_Show_User_Actions_NotWaitingForUserAction_Dialog');
buttonDialog.dialog({
resizable: false,
height: 240,
modal: true,
autoOpen: false,
buttons: {
"Not Waiting for User Action": function () {
var $this = $(this);
$this.dialog("disable");
$this.dialog("option", "buttons", null);
$this.find('form').submit();
},
Cancel: function () {
$(this).dialog("close");
}
}
});
}
buttonDialog.dialog('open');
return false;
});
});
</script>
}
</td>
}
</tr>
</table>
File diff suppressed because it is too large Load Diff