Update: Support Ajax and Form Post for All HNWAR

This commit is contained in:
Gary Sharp
2013-04-02 14:03:23 +11:00
parent 8657d4ec32
commit e7ff62afc7
19 changed files with 879 additions and 879 deletions
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0328.1100")]
[assembly: AssemblyFileVersion("1.2.0328.1100")]
[assembly: AssemblyVersion("1.2.0401.1659")]
[assembly: AssemblyFileVersion("1.2.0401.1659")]
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0328.1059")]
[assembly: AssemblyFileVersion("1.2.0328.1059")]
[assembly: AssemblyVersion("1.2.0401.1659")]
[assembly: AssemblyFileVersion("1.2.0401.1659")]
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0328.1059")]
[assembly: AssemblyFileVersion("1.2.0328.1059")]
[assembly: AssemblyVersion("1.2.0401.1659")]
[assembly: AssemblyFileVersion("1.2.0401.1659")]
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0328.1100")]
[assembly: AssemblyFileVersion("1.2.0328.1100")]
[assembly: AssemblyVersion("1.2.0401.1659")]
[assembly: AssemblyFileVersion("1.2.0401.1659")]
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0328.1100")]
[assembly: AssemblyFileVersion("1.2.0328.1100")]
[assembly: AssemblyVersion("1.2.0401.1659")]
[assembly: AssemblyFileVersion("1.2.0401.1659")]
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0328.1100")]
[assembly: AssemblyFileVersion("1.2.0328.1100")]
[assembly: AssemblyVersion("1.2.0401.1659")]
[assembly: AssemblyFileVersion("1.2.0401.1659")]
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0328.1100")]
[assembly: AssemblyFileVersion("1.2.0328.1100")]
[assembly: AssemblyVersion("1.2.0401.1659")]
[assembly: AssemblyFileVersion("1.2.0401.1659")]
@@ -1,10 +1,10 @@
///#source 1 1 /ClientSource/Scripts/Modules/Disco-PropertyChangeHelpers/disco.propertychangehelpers.js
if (!document.DiscoFunctions) {
document.DiscoFunctions = {};
}
if (!document.DiscoFunctions.PropertyChangeHelper){
document.DiscoFunctions.PropertyValue = function(PropertyField){
if (PropertyField[0].nodeName.toLowerCase()=='input' && PropertyField.attr('type')=='checkbox'){
}
if (!document.DiscoFunctions.PropertyChangeHelper) {
document.DiscoFunctions.PropertyValue = function (PropertyField) {
if (PropertyField[0].nodeName.toLowerCase() == 'input' && PropertyField.attr('type') == 'checkbox') {
return PropertyField.is(':checked');
}
return PropertyField.val();
@@ -14,14 +14,14 @@ if (!document.DiscoFunctions) {
var fieldChangeToken = null;
var $ajaxSave = PropertyField.nextAll('.ajaxSave').first();
var $ajaxLoading = PropertyField.nextAll('.ajaxLoading').first();
var fieldChangeFunction = function(){
var fieldChangeFunction = function () {
$ajaxSave.hide();
var changedValue = document.DiscoFunctions.PropertyValue(PropertyField);
if (fieldValue != changedValue){
if (fieldValue != changedValue) {
fieldValue = changedValue;
if (fieldChangeToken)
window.clearTimeout(fieldChangeToken);
fieldChangeToken = window.setTimeout(function(){
fieldChangeToken = window.setTimeout(function () {
$ajaxLoading.show();
var data = {};
data[UpdatePropertyName] = fieldValue;
@@ -37,14 +37,14 @@ if (!document.DiscoFunctions) {
}, 500);
};
}
if (PropertyField[0].nodeName.toLowerCase()=='input' && PropertyField.attr('type')=='checkbox'){
if (PropertyField[0].nodeName.toLowerCase() == 'input' && PropertyField.attr('type') == 'checkbox') {
PropertyField.click(fieldChangeFunction);
}else{
} else {
PropertyField.change(fieldChangeFunction);
}
// For Input Text Boxes
if (PropertyField[0].nodeName.toLowerCase()=='input' && PropertyField.attr('type')=='text'){
PropertyField.keydown(function(e){
if (PropertyField[0].nodeName.toLowerCase() == 'input' && PropertyField.attr('type') == 'text') {
PropertyField.keydown(function (e) {
$ajaxSave.show();
if (e.which == 13) {
$(this).blur();
@@ -53,32 +53,32 @@ if (!document.DiscoFunctions) {
.watermark(FieldWatermark)
.blur(function () {
$ajaxSave.hide();
}).focus(function(){
}).focus(function () {
$(this).select();
});
}
// For TextAreas
if (PropertyField[0].nodeName.toLowerCase()=='textarea'){
PropertyField.keydown(function(){
if (PropertyField[0].nodeName.toLowerCase() == 'textarea') {
PropertyField.keydown(function () {
$ajaxSave.show();
})
}
}
};
if (!document.DiscoFunctions.DateChangeUserHelper){
};
if (!document.DiscoFunctions.DateChangeUserHelper) {
document.DiscoFunctions.DateChangeUserHelper = function (DateField, UserField, DateFieldWatermark, UpdateUrl, UpdatePropertyName, minDate, dateOnly) {
var dateFieldValue = DateField.val();
var dateFieldChangeToken = null;
var $ajaxLoading = UserField.next('.ajaxLoading');
DateField
.watermark(DateFieldWatermark)
.change(function(){
.change(function () {
var dateText = DateField.val();
if (dateFieldValue.toLowerCase() != dateText.toLowerCase()){
if (dateFieldValue.toLowerCase() != dateText.toLowerCase()) {
dateFieldValue = dateText;
if (dateFieldChangeToken)
window.clearTimeout(dateFieldChangeToken);
dateFieldChangeToken = window.setTimeout(function(){
dateFieldChangeToken = window.setTimeout(function () {
$ajaxLoading.show();
var data = {};
data[UpdatePropertyName] = dateFieldValue;
@@ -94,25 +94,25 @@ if (!document.DiscoFunctions) {
dateFieldChangeToken = null;
}, 500);
}
}).focus(function(){
}).focus(function () {
$(this).select();
});
if (dateOnly){
if (dateOnly) {
DateField.datepicker({
defaultDate: new Date(),
minDate: minDate,
changeYear: true,
changeMonth: true,
dateFormat: 'yy/mm/dd',
beforeShow: function(input, inst){
beforeShow: function (input, inst) {
$input = $(input);
if (!$input.val()){
if (!$input.val()) {
$input.datepicker('setDate', new Date());
}
}
});
}else{
} else {
DateField.datetimepicker({
defaultDate: new Date(),
ampm: true,
@@ -120,9 +120,9 @@ if (!document.DiscoFunctions) {
changeYear: true,
changeMonth: true,
dateFormat: 'yy/mm/dd',
beforeShow: function(input, inst){
beforeShow: function (input, inst) {
$input = $(input);
if (!$input.val()){
if (!$input.val()) {
$input.datetimepicker('setDate', new Date());
}
}
@@ -130,21 +130,21 @@ if (!document.DiscoFunctions) {
}
}
};
if (!document.DiscoFunctions.DateChangeHelper){
};
if (!document.DiscoFunctions.DateChangeHelper) {
document.DiscoFunctions.DateChangeHelper = function (DateField, DateFieldWatermark, UpdateUrl, UpdatePropertyName, minDate, dateOnly) {
var dateFieldValue = DateField.val();
var dateFieldChangeToken = null;
var $ajaxLoading = DateField.next('.ajaxLoading');
DateField
.watermark(DateFieldWatermark)
.change(function(){
.change(function () {
var dateText = DateField.val();
if (dateFieldValue.toLowerCase() != dateText.toLowerCase()){
if (dateFieldValue.toLowerCase() != dateText.toLowerCase()) {
dateFieldValue = dateText;
if (dateFieldChangeToken)
window.clearTimeout(dateFieldChangeToken);
dateFieldChangeToken = window.setTimeout(function(){
dateFieldChangeToken = window.setTimeout(function () {
$ajaxLoading.show();
var data = {};
data[UpdatePropertyName] = dateFieldValue;
@@ -159,25 +159,25 @@ if (!document.DiscoFunctions) {
dateFieldChangeToken = null;
}, 500);
}
}).focus(function(){
}).focus(function () {
$(this).select();
});
if (dateOnly){
if (dateOnly) {
DateField.datepicker({
defaultDate: new Date(),
minDate: minDate,
changeYear: true,
changeMonth: true,
dateFormat: 'yy/mm/dd',
beforeShow: function(input, inst){
beforeShow: function (input, inst) {
$input = $(input);
if (!$input.val()){
if (!$input.val()) {
$input.datepicker('setDate', new Date());
}
}
});
}else{
} else {
DateField.datetimepicker({
defaultDate: new Date(),
ampm: true,
@@ -185,9 +185,9 @@ if (!document.DiscoFunctions) {
changeYear: true,
changeMonth: true,
dateFormat: 'yy/mm/dd',
beforeShow: function(input, inst){
beforeShow: function (input, inst) {
$input = $(input);
if (!$input.val()){
if (!$input.val()) {
$input.datetimepicker('setDate', new Date());
}
}
@@ -195,4 +195,133 @@ if (!document.DiscoFunctions) {
}
};
}
if (!document.DiscoFunctions.DateDialogCreateUpdater)
{
var dialog, dialogForm, dialogHeader, dialogDateBox, dialogDatePropertyNameBox;
var updateUrl, friendlyName, dateField, userField, updatePropertyName, notSetDisplay, minDate, useAjax;
function dateDialogGet() {
if (!dialog) {
dialog = $('<div>').attr({ 'class': 'dialog' })
dialogForm = $('<form>').attr({ 'action': '/', 'method': 'post' }).appendTo(dialog);
var dialogBody = $('<p>').appendTo(dialogForm);
dialogHeader = $('<h3>').attr('autofocus', 'autofocus').appendTo(dialogBody);
dialogDatePropertyNameBox = $('<input>').attr({ 'type': 'hidden', 'name': 'key' }).appendTo(dialogBody);
dialogDateBox = $('<input>').attr({ 'type': 'datetime', 'name': 'value' }).css({ 'display': 'block', 'margin-top': 15, 'margin-left': 'auto', 'margin-right': 'auto' }).appendTo(dialogBody);
$('<input>').attr({ 'type': 'hidden', 'name': 'redirect' }).val('true').appendTo(dialogBody);
dialog.dialog({
resizable: false,
modal: true,
autoOpen: false,
buttons: {
"Update": dateDialogUpdate,
Cancel: function () {
$(this).dialog("close");
}
},
open: function () {
dialog.dialog('widget').find('.ui-dialog-buttonpane :tabbable:first').focus();
}
});
dialogDateBox.datetimepicker({
defaultDate: new Date(),
ampm: true,
changeYear: true,
changeMonth: true,
dateFormat: 'yy/mm/dd',
});
}
return dialog;
}
function dateDialogUpdate() {
var dateValue = dialogDateBox.val();
if (useAjax) {
// Use Ajax
var $dateField, $userField;
$dateField = $('#' + dateField);
if (userField)
$userField = $('#' + userField);
dialog.dialog("close");
var $ajaxLoading = ($userField ? $userField.next('.ajaxLoading') : $dateField.next('.ajaxLoading')).show();
var data = {
key: updatePropertyName,
value: dateValue
};
$.getJSON(updateUrl, data, function (response, result) {
if (result != 'success' || response.Result != 'OK') {
alert('Unable to change ' + friendlyName + ' Date:\n' + response);
$ajaxLoading.hide();
} else {
if (response.DateTimeFull) {
$dateField.attr('data-datetimeformatted', response.DateTimeJavascript)
.attr('data-discodatetime', response.DateTimeSortable)
.attr('title', response.DateTimeFull)
.text(response.DateTimeFriendly);
} else {
$dateField.attr('data-datetimeformatted', '')
.attr('data-discodatetime', '-1')
.attr('title', notSetDisplay)
.text(notSetDisplay);
}
if ($userField)
$userField.text('by ' + response.UserDescription);
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
})
} else {
// Post Form & Redirect
dialog.dialog("disable");
dialog.dialog("option", "buttons", null);
dialogDatePropertyNameBox.val(updatePropertyName);
dialogForm.attr('action', updateUrl);
dialogForm.submit();
}
}
function dateDialogOpen(UpdateUrl, FriendlyName, DateField, UserField, UpdatePropertyName, NotSetDisplay, MinDate, UseAjax) {
updateUrl = UpdateUrl;
friendlyName = FriendlyName;
dateField = DateField;
userField = UserField;
updatePropertyName = UpdatePropertyName;
notSetDisplay = NotSetDisplay;
minDate = MinDate;
useAjax = UseAjax;
var d = dateDialogGet();
d.dialog('option', 'title', friendlyName);
dialogHeader.text(friendlyName + ' Date');
var dfVal = $('#' + DateField).attr('data-datetimeformatted');
if (dfVal)
dialogDateBox.datetimepicker('setDate', new Date(dfVal));
else
dialogDateBox.datetimepicker('setDate', new Date());
if (MinDate)
dialogDateBox.datetimepicker('option', 'minDate', MinDate);
else
dialogDateBox.datetimepicker('option', 'minDate', null);
d.dialog('open');
}
function dateDialogCreateUpdater(UpdateUrl, FriendlyName, DateField, UserField, UpdatePropertyName, NotSetDisplay, MinDate, UseAjax) {
$('<a>').attr({ href: '#', 'class': 'button small', style: 'margin-right: 5px;' }).text('Update').click(function (event) {
event.preventDefault();
dateDialogOpen(UpdateUrl, FriendlyName, DateField, UserField, UpdatePropertyName, NotSetDisplay, MinDate, UseAjax);
}).insertBefore('#' + DateField);
}
document.DiscoFunctions.DateDialogCreateUpdater = dateDialogCreateUpdater;
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,9 +1,9 @@
if (!document.DiscoFunctions) {
document.DiscoFunctions = {};
}
if (!document.DiscoFunctions.PropertyChangeHelper){
document.DiscoFunctions.PropertyValue = function(PropertyField){
if (PropertyField[0].nodeName.toLowerCase()=='input' && PropertyField.attr('type')=='checkbox'){
}
if (!document.DiscoFunctions.PropertyChangeHelper) {
document.DiscoFunctions.PropertyValue = function (PropertyField) {
if (PropertyField[0].nodeName.toLowerCase() == 'input' && PropertyField.attr('type') == 'checkbox') {
return PropertyField.is(':checked');
}
return PropertyField.val();
@@ -13,14 +13,14 @@
var fieldChangeToken = null;
var $ajaxSave = PropertyField.nextAll('.ajaxSave').first();
var $ajaxLoading = PropertyField.nextAll('.ajaxLoading').first();
var fieldChangeFunction = function(){
var fieldChangeFunction = function () {
$ajaxSave.hide();
var changedValue = document.DiscoFunctions.PropertyValue(PropertyField);
if (fieldValue != changedValue){
if (fieldValue != changedValue) {
fieldValue = changedValue;
if (fieldChangeToken)
window.clearTimeout(fieldChangeToken);
fieldChangeToken = window.setTimeout(function(){
fieldChangeToken = window.setTimeout(function () {
$ajaxLoading.show();
var data = {};
data[UpdatePropertyName] = fieldValue;
@@ -36,14 +36,14 @@
}, 500);
};
}
if (PropertyField[0].nodeName.toLowerCase()=='input' && PropertyField.attr('type')=='checkbox'){
if (PropertyField[0].nodeName.toLowerCase() == 'input' && PropertyField.attr('type') == 'checkbox') {
PropertyField.click(fieldChangeFunction);
}else{
} else {
PropertyField.change(fieldChangeFunction);
}
// For Input Text Boxes
if (PropertyField[0].nodeName.toLowerCase()=='input' && PropertyField.attr('type')=='text'){
PropertyField.keydown(function(e){
if (PropertyField[0].nodeName.toLowerCase() == 'input' && PropertyField.attr('type') == 'text') {
PropertyField.keydown(function (e) {
$ajaxSave.show();
if (e.which == 13) {
$(this).blur();
@@ -52,32 +52,32 @@
.watermark(FieldWatermark)
.blur(function () {
$ajaxSave.hide();
}).focus(function(){
}).focus(function () {
$(this).select();
});
}
// For TextAreas
if (PropertyField[0].nodeName.toLowerCase()=='textarea'){
PropertyField.keydown(function(){
if (PropertyField[0].nodeName.toLowerCase() == 'textarea') {
PropertyField.keydown(function () {
$ajaxSave.show();
})
}
}
};
if (!document.DiscoFunctions.DateChangeUserHelper){
};
if (!document.DiscoFunctions.DateChangeUserHelper) {
document.DiscoFunctions.DateChangeUserHelper = function (DateField, UserField, DateFieldWatermark, UpdateUrl, UpdatePropertyName, minDate, dateOnly) {
var dateFieldValue = DateField.val();
var dateFieldChangeToken = null;
var $ajaxLoading = UserField.next('.ajaxLoading');
DateField
.watermark(DateFieldWatermark)
.change(function(){
.change(function () {
var dateText = DateField.val();
if (dateFieldValue.toLowerCase() != dateText.toLowerCase()){
if (dateFieldValue.toLowerCase() != dateText.toLowerCase()) {
dateFieldValue = dateText;
if (dateFieldChangeToken)
window.clearTimeout(dateFieldChangeToken);
dateFieldChangeToken = window.setTimeout(function(){
dateFieldChangeToken = window.setTimeout(function () {
$ajaxLoading.show();
var data = {};
data[UpdatePropertyName] = dateFieldValue;
@@ -93,25 +93,25 @@
dateFieldChangeToken = null;
}, 500);
}
}).focus(function(){
}).focus(function () {
$(this).select();
});
if (dateOnly){
if (dateOnly) {
DateField.datepicker({
defaultDate: new Date(),
minDate: minDate,
changeYear: true,
changeMonth: true,
dateFormat: 'yy/mm/dd',
beforeShow: function(input, inst){
beforeShow: function (input, inst) {
$input = $(input);
if (!$input.val()){
if (!$input.val()) {
$input.datepicker('setDate', new Date());
}
}
});
}else{
} else {
DateField.datetimepicker({
defaultDate: new Date(),
ampm: true,
@@ -119,9 +119,9 @@
changeYear: true,
changeMonth: true,
dateFormat: 'yy/mm/dd',
beforeShow: function(input, inst){
beforeShow: function (input, inst) {
$input = $(input);
if (!$input.val()){
if (!$input.val()) {
$input.datetimepicker('setDate', new Date());
}
}
@@ -129,21 +129,21 @@
}
}
};
if (!document.DiscoFunctions.DateChangeHelper){
};
if (!document.DiscoFunctions.DateChangeHelper) {
document.DiscoFunctions.DateChangeHelper = function (DateField, DateFieldWatermark, UpdateUrl, UpdatePropertyName, minDate, dateOnly) {
var dateFieldValue = DateField.val();
var dateFieldChangeToken = null;
var $ajaxLoading = DateField.next('.ajaxLoading');
DateField
.watermark(DateFieldWatermark)
.change(function(){
.change(function () {
var dateText = DateField.val();
if (dateFieldValue.toLowerCase() != dateText.toLowerCase()){
if (dateFieldValue.toLowerCase() != dateText.toLowerCase()) {
dateFieldValue = dateText;
if (dateFieldChangeToken)
window.clearTimeout(dateFieldChangeToken);
dateFieldChangeToken = window.setTimeout(function(){
dateFieldChangeToken = window.setTimeout(function () {
$ajaxLoading.show();
var data = {};
data[UpdatePropertyName] = dateFieldValue;
@@ -158,25 +158,25 @@
dateFieldChangeToken = null;
}, 500);
}
}).focus(function(){
}).focus(function () {
$(this).select();
});
if (dateOnly){
if (dateOnly) {
DateField.datepicker({
defaultDate: new Date(),
minDate: minDate,
changeYear: true,
changeMonth: true,
dateFormat: 'yy/mm/dd',
beforeShow: function(input, inst){
beforeShow: function (input, inst) {
$input = $(input);
if (!$input.val()){
if (!$input.val()) {
$input.datepicker('setDate', new Date());
}
}
});
}else{
} else {
DateField.datetimepicker({
defaultDate: new Date(),
ampm: true,
@@ -184,9 +184,9 @@
changeYear: true,
changeMonth: true,
dateFormat: 'yy/mm/dd',
beforeShow: function(input, inst){
beforeShow: function (input, inst) {
$input = $(input);
if (!$input.val()){
if (!$input.val()) {
$input.datetimepicker('setDate', new Date());
}
}
@@ -194,4 +194,133 @@
}
};
}
if (!document.DiscoFunctions.DateDialogCreateUpdater)
{
var dialog, dialogForm, dialogHeader, dialogDateBox, dialogDatePropertyNameBox;
var updateUrl, friendlyName, dateField, userField, updatePropertyName, notSetDisplay, minDate, useAjax;
function dateDialogGet() {
if (!dialog) {
dialog = $('<div>').attr({ 'class': 'dialog' })
dialogForm = $('<form>').attr({ 'action': '/', 'method': 'post' }).appendTo(dialog);
var dialogBody = $('<p>').appendTo(dialogForm);
dialogHeader = $('<h3>').attr('autofocus', 'autofocus').appendTo(dialogBody);
dialogDatePropertyNameBox = $('<input>').attr({ 'type': 'hidden', 'name': 'key' }).appendTo(dialogBody);
dialogDateBox = $('<input>').attr({ 'type': 'datetime', 'name': 'value' }).css({ 'display': 'block', 'margin-top': 15, 'margin-left': 'auto', 'margin-right': 'auto' }).appendTo(dialogBody);
$('<input>').attr({ 'type': 'hidden', 'name': 'redirect' }).val('true').appendTo(dialogBody);
dialog.dialog({
resizable: false,
modal: true,
autoOpen: false,
buttons: {
"Update": dateDialogUpdate,
Cancel: function () {
$(this).dialog("close");
}
},
open: function () {
dialog.dialog('widget').find('.ui-dialog-buttonpane :tabbable:first').focus();
}
});
dialogDateBox.datetimepicker({
defaultDate: new Date(),
ampm: true,
changeYear: true,
changeMonth: true,
dateFormat: 'yy/mm/dd',
});
}
return dialog;
}
function dateDialogUpdate() {
var dateValue = dialogDateBox.val();
if (useAjax) {
// Use Ajax
var $dateField, $userField;
$dateField = $('#' + dateField);
if (userField)
$userField = $('#' + userField);
dialog.dialog("close");
var $ajaxLoading = ($userField ? $userField.next('.ajaxLoading') : $dateField.next('.ajaxLoading')).show();
var data = {
key: updatePropertyName,
value: dateValue
};
$.getJSON(updateUrl, data, function (response, result) {
if (result != 'success' || response.Result != 'OK') {
alert('Unable to change ' + friendlyName + ' Date:\n' + response);
$ajaxLoading.hide();
} else {
if (response.DateTimeFull) {
$dateField.attr('data-datetimeformatted', response.DateTimeJavascript)
.attr('data-discodatetime', response.DateTimeSortable)
.attr('title', response.DateTimeFull)
.text(response.DateTimeFriendly);
} else {
$dateField.attr('data-datetimeformatted', '')
.attr('data-discodatetime', '-1')
.attr('title', notSetDisplay)
.text(notSetDisplay);
}
if ($userField)
$userField.text('by ' + response.UserDescription);
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
})
} else {
// Post Form & Redirect
dialog.dialog("disable");
dialog.dialog("option", "buttons", null);
dialogDatePropertyNameBox.val(updatePropertyName);
dialogForm.attr('action', updateUrl);
dialogForm.submit();
}
}
function dateDialogOpen(UpdateUrl, FriendlyName, DateField, UserField, UpdatePropertyName, NotSetDisplay, MinDate, UseAjax) {
updateUrl = UpdateUrl;
friendlyName = FriendlyName;
dateField = DateField;
userField = UserField;
updatePropertyName = UpdatePropertyName;
notSetDisplay = NotSetDisplay;
minDate = MinDate;
useAjax = UseAjax;
var d = dateDialogGet();
d.dialog('option', 'title', friendlyName);
dialogHeader.text(friendlyName + ' Date');
var dfVal = $('#' + DateField).attr('data-datetimeformatted');
if (dfVal)
dialogDateBox.datetimepicker('setDate', new Date(dfVal));
else
dialogDateBox.datetimepicker('setDate', new Date());
if (MinDate)
dialogDateBox.datetimepicker('option', 'minDate', MinDate);
else
dialogDateBox.datetimepicker('option', 'minDate', null);
d.dialog('open');
}
function dateDialogCreateUpdater(UpdateUrl, FriendlyName, DateField, UserField, UpdatePropertyName, NotSetDisplay, MinDate, UseAjax) {
$('<a>').attr({ href: '#', 'class': 'button small', style: 'margin-right: 5px;' }).text('Update').click(function (event) {
event.preventDefault();
dateDialogOpen(UpdateUrl, FriendlyName, DateField, UserField, UpdatePropertyName, NotSetDisplay, MinDate, UseAjax);
}).insertBefore('#' + DateField);
}
document.DiscoFunctions.DateDialogCreateUpdater = dateDialogCreateUpdater;
}
+2 -2
View File
@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.2.0328.1100")]
[assembly: AssemblyFileVersion("1.2.0328.1100")]
[assembly: AssemblyVersion("1.2.0401.1659")]
[assembly: AssemblyFileVersion("1.2.0401.1659")]
+7 -11
View File
@@ -2,6 +2,7 @@
<table id="jobNonWarrantyInsurance">
@if (Model.Job.JobMetaNonWarranty.IsInsuranceClaim)
{
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
<tr>
<th style="width: 230px;">
Date of Loss or Damage
@@ -342,19 +343,14 @@
Claim Form Sent Date
</th>
<td>
@Html.EditorFor(m => m.Job.JobMetaInsurance.ClaimFormSentDate)
@CommonHelpers.FriendlyDate(Model.Job.JobMetaInsurance.ClaimFormSentDate, "Not Sent", "Job_JobMetaInsurance_ClaimFormSentDate")
<span id="Job_JobMetaInsurance_ClaimFormSentUserId">@(string.IsNullOrEmpty(Model.Job.JobMetaInsurance.ClaimFormSentUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaInsurance.ClaimFormSentUser.ToString()))</span>
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
<script>
$(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())
);
var updateUrl = '@(Url.Action(MVC.API.Job.Update(Model.Job.Id, null)))';
var jobOpenDate = '@(Model.Job.OpenedDate.ToJavascriptDateTime())';
document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Claim Form Sent Date', 'Job_JobMetaInsurance_ClaimFormSentDate', 'Job_JobMetaInsurance_ClaimFormSentUserId', 'InsuranceClaimFormSentDate', 'Not Sent', jobOpenDate, false);
});
</script>
</td>
@@ -31,9 +31,9 @@ namespace Disco.Web.Views.Job.JobParts
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.4.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Job/JobParts/Insurance.cshtml")]
public class Insurance : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
public partial class Insurance : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
{
public Insurance()
{
@@ -56,6 +56,7 @@ WriteLiteral(">\r\n");
#line 3 "..\..\Views\Job\JobParts\Insurance.cshtml"
if (Model.Job.JobMetaNonWarranty.IsInsuranceClaim)
{
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
#line default
@@ -69,7 +70,7 @@ WriteLiteral(">\r\n Date of Loss or Damage\r\n </th>\r
WriteLiteral(" ");
#line 10 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 11 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaInsurance.LossOrDamageDate));
@@ -80,7 +81,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 11 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 12 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -99,7 +100,7 @@ WriteLiteral(@">
'");
#line 18 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 19 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateInsuranceLossOrDamageDate(Model.Job.Id, null)));
@@ -115,7 +116,7 @@ WriteLiteral(" <tr>\r\n <th>\r\n Event Location
WriteLiteral(" ");
#line 31 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 32 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaInsurance.EventLocation));
@@ -126,7 +127,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 32 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 33 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxSave());
@@ -137,7 +138,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 33 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 34 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -153,7 +154,7 @@ WriteLiteral(">\r\n $(function () {\r\n
" \'");
#line 39 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 40 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateInsuranceEventLocation(Model.Job.Id, null)));
@@ -169,7 +170,7 @@ WriteLiteral(" <tr>\r\n <th>\r\n Description\r\
WriteLiteral(" ");
#line 51 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 52 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaInsurance.Description));
@@ -180,7 +181,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 52 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 53 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxSave());
@@ -191,7 +192,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 53 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 54 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -207,7 +208,7 @@ WriteLiteral(">\r\n $(function () {\r\n
" \'");
#line 59 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 60 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateInsuranceDescription(Model.Job.Id, null)));
@@ -226,14 +227,14 @@ WriteLiteral(">\r\n &nbsp;\r\n </th>\r\n <t
WriteLiteral(" ");
#line 71 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 72 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaInsurance.ThirdPartyCaused));
#line default
#line hidden
#line 71 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 72 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Html.LabelFor(m => m.Job.JobMetaInsurance.ThirdPartyCaused));
@@ -244,7 +245,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 72 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 73 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxSave());
@@ -255,7 +256,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 73 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 74 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -273,7 +274,7 @@ WriteLiteral(">\r\n <div>\r\n <h5>\r\n
WriteLiteral(" ");
#line 78 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 79 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaInsurance.ThirdPartyCausedName));
@@ -284,7 +285,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 79 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 80 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxSave());
@@ -295,7 +296,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 80 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 81 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -307,7 +308,7 @@ WriteLiteral("\r\n </div>\r\n <div>\r\n
WriteLiteral(" ");
#line 85 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 86 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaInsurance.ThirdPartyCausedWhy));
@@ -318,7 +319,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 86 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 87 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxSave());
@@ -329,7 +330,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 87 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 88 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -367,7 +368,7 @@ WriteLiteral(@">
'");
#line 115 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 116 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateInsuranceThirdPartyCaused(Model.Job.Id, null)));
@@ -382,7 +383,7 @@ WriteLiteral(@"',
'");
#line 121 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 122 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateInsuranceThirdPartyCausedName(Model.Job.Id, null)));
@@ -397,7 +398,7 @@ WriteLiteral(@"',
'");
#line 127 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 128 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateInsuranceThirdPartyCausedWhy(Model.Job.Id, null)));
@@ -413,7 +414,7 @@ WriteLiteral(" <tr>\r\n <th>\r\n Witnessed by (
WriteLiteral(" ");
#line 139 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 140 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaInsurance.WitnessesNamesAddresses));
@@ -424,7 +425,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 140 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 141 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxSave());
@@ -435,7 +436,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 141 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 142 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -453,7 +454,7 @@ WriteLiteral(@">
'");
#line 147 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 148 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateInsuranceWitnessesNamesAddresses(Model.Job.Id, null)));
@@ -469,7 +470,7 @@ WriteLiteral(" <tr>\r\n <th>\r\n Burglary/Theft
WriteLiteral(" ");
#line 159 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 160 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaInsurance.BurglaryTheftMethodOfEntry));
@@ -480,7 +481,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 160 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 161 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxSave());
@@ -491,7 +492,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 161 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 162 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -509,7 +510,7 @@ WriteLiteral(@">
'");
#line 167 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 168 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateInsuranceBurglaryTheftMethodOfEntry(Model.Job.Id, null)));
@@ -528,7 +529,7 @@ WriteLiteral(">\r\n Property Last Seen\r\n </th>\r\n
WriteLiteral(" ");
#line 179 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 180 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaInsurance.PropertyLastSeenDate));
@@ -539,7 +540,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 180 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 181 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -558,7 +559,7 @@ WriteLiteral(@">
'");
#line 187 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 188 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateInsurancePropertyLastSeenDate(Model.Job.Id, null)));
@@ -577,14 +578,14 @@ WriteLiteral(">\r\n &nbsp;\r\n </th>\r\n <t
WriteLiteral(" ");
#line 200 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 201 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaInsurance.PoliceNotified));
#line default
#line hidden
#line 200 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 201 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Html.LabelFor(m => m.Job.JobMetaInsurance.PoliceNotified));
@@ -595,7 +596,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 201 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 202 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxSave());
@@ -606,7 +607,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 202 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 203 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -624,7 +625,7 @@ WriteLiteral(">\r\n <div>\r\n <h5>\r\n
WriteLiteral(" ");
#line 207 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 208 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaInsurance.PoliceNotifiedStation));
@@ -635,7 +636,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 208 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 209 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxSave());
@@ -646,7 +647,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 209 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 210 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -658,7 +659,7 @@ WriteLiteral("\r\n </div>\r\n <div>\r\n
WriteLiteral(" ");
#line 214 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 215 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaInsurance.PoliceNotifiedDate));
@@ -669,7 +670,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 215 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 216 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -681,7 +682,7 @@ WriteLiteral("\r\n </div>\r\n <div>\r\n
WriteLiteral(" ");
#line 220 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 221 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaInsurance.PoliceNotifiedCrimeReportNo));
@@ -692,7 +693,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 221 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 222 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxSave());
@@ -703,7 +704,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 222 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 223 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -741,7 +742,7 @@ WriteLiteral(@">
'");
#line 250 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 251 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateInsurancePoliceNotified(Model.Job.Id, null)));
@@ -756,7 +757,7 @@ WriteLiteral(@"',
'");
#line 256 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 257 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateInsurancePoliceNotifiedStation(Model.Job.Id, null)));
@@ -772,7 +773,7 @@ WriteLiteral(@"',
'");
#line 263 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 264 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateInsurancePoliceNotifiedDate(Model.Job.Id, null)));
@@ -789,7 +790,7 @@ WriteLiteral(@"',
'");
#line 271 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 272 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateInsurancePoliceNotifiedCrimeReportNo(Model.Job.Id, null)));
@@ -805,7 +806,7 @@ WriteLiteral(" <tr>\r\n <th>\r\n Action to Reco
WriteLiteral(" ");
#line 283 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 284 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaInsurance.RecoverReduceAction));
@@ -816,7 +817,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 284 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 285 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxSave());
@@ -827,7 +828,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 285 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 286 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -843,7 +844,7 @@ WriteLiteral(">\r\n $(function () {\r\n
" \'");
#line 291 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 292 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateInsuranceRecoverReduceAction(Model.Job.Id, null)));
@@ -859,7 +860,7 @@ WriteLiteral(" <tr>\r\n <th>\r\n Other Interest
WriteLiteral(" ");
#line 303 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 304 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaInsurance.OtherInterestedParties));
@@ -870,7 +871,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 304 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 305 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxSave());
@@ -881,7 +882,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 305 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 306 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -899,7 +900,7 @@ WriteLiteral(@">
'");
#line 311 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 312 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateInsuranceOtherInterestedParties(Model.Job.Id, null)));
@@ -918,7 +919,7 @@ WriteLiteral(">\r\n Date of Purchase\r\n </th>\r\n
WriteLiteral(" ");
#line 323 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 324 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaInsurance.DateOfPurchase));
@@ -929,7 +930,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 324 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 325 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -948,7 +949,7 @@ WriteLiteral(@">
'");
#line 331 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 332 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateInsuranceDateOfPurchase(Model.Job.Id, null)));
@@ -964,8 +965,8 @@ WriteLiteral(" <tr>\r\n <th>\r\n Claim Form Sen
WriteLiteral(" ");
#line 345 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaInsurance.ClaimFormSentDate));
#line 346 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaInsurance.ClaimFormSentDate, "Not Sent", "Job_JobMetaInsurance_ClaimFormSentDate"));
#line default
@@ -977,58 +978,42 @@ WriteLiteral(" id=\"Job_JobMetaInsurance_ClaimFormSentUserId\"");
WriteLiteral(">");
#line 346 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 347 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(string.IsNullOrEmpty(Model.Job.JobMetaInsurance.ClaimFormSentUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaInsurance.ClaimFormSentUser.ToString()));
#line default
#line hidden
WriteLiteral("</span>\r\n");
WriteLiteral(" ");
WriteLiteral("</span>\r\n <script>\r\n $(function () {\r\n " +
" var updateUrl = \'");
#line 347 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line 350 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Url.Action(MVC.API.Job.Update(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral("\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
document.DiscoFunctions.DateChangeUserHelper(
$('#Job_JobMetaInsurance_ClaimFormSentDate'),
$('#Job_JobMetaInsurance_ClaimFormSentUserId'),
'Unknown',
'");
WriteLiteral("\';\r\n var jobOpenDate = \'");
#line 354 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateInsuranceClaimFormSentDate(Model.Job.Id, null)));
#line 351 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Model.Job.OpenedDate.ToJavascriptDateTime());
#line default
#line hidden
WriteLiteral("\',\r\n \'ClaimFormSentDate\',\r\n");
WriteLiteral(@"';
WriteLiteral(" ");
document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Claim Form Sent Date', 'Job_JobMetaInsurance_ClaimFormSentDate', 'Job_JobMetaInsurance_ClaimFormSentUserId', 'InsuranceClaimFormSentDate', 'Not Sent', jobOpenDate, false);
});
</script>
</td>
</tr>
");
#line 356 "..\..\Views\Job\JobParts\Insurance.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");
#line 362 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 358 "..\..\Views\Job\JobParts\Insurance.cshtml"
}
@@ -1042,13 +1027,13 @@ WriteLiteral(" style=\"padding: 8px; text-align: center\"");
WriteLiteral(">\r\n");
#line 369 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 365 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line default
#line hidden
#line 369 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 365 "..\..\Views\Job\JobParts\Insurance.cshtml"
if (Model.Job.JobMetaNonWarranty.IsInsuranceClaim)
{
@@ -1056,14 +1041,14 @@ WriteLiteral(">\r\n");
#line default
#line hidden
#line 371 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 367 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Html.ActionLinkButton("Remove Insurance Claim", MVC.API.Job.UpdateNonWarrantyIsInsuranceClaim(Model.Job.Id, false, true)));
#line default
#line hidden
#line 371 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 367 "..\..\Views\Job\JobParts\Insurance.cshtml"
}
else
@@ -1073,14 +1058,14 @@ WriteLiteral(">\r\n");
#line default
#line hidden
#line 375 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 371 "..\..\Views\Job\JobParts\Insurance.cshtml"
Write(Html.ActionLinkButton("Add Insurance Claim", MVC.API.Job.UpdateNonWarrantyIsInsuranceClaim(Model.Job.Id, true, true)));
#line default
#line hidden
#line 375 "..\..\Views\Job\JobParts\Insurance.cshtml"
#line 371 "..\..\Views\Job\JobParts\Insurance.cshtml"
}
@@ -1,4 +1,7 @@
@model Disco.Web.Models.Job.ShowModel
@{
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
}
<table id="jobNonWarrantyFinance">
<tr>
<th style="width: 200px;">Accounting Charge Required
@@ -104,146 +107,15 @@
</tr>
</table>
<script>
(function(){
var baseUpdateUrl = '@(Url.Action(MVC.API.Job.Update(Model.Job.Id, null)))';
var dialog, dialogForm, dialogHeader, dialogDateBox, dialogDatePropertyNameBox;
var friendlyName, dateField, userField, updatePropertyName, notSetDisplay, minDate, useAjax;
function dateDialogGet(){
if (!dialog){
dialog = $('<div>').attr({'class': 'dialog'})
dialogForm = $('<form>').attr({'action': baseUpdateUrl, 'method': 'post'}).appendTo(dialog);
var dialogBody = $('<p>').appendTo(dialogForm);
dialogHeader = $('<h3>').attr('autofocus', 'autofocus').appendTo(dialogBody);
dialogDatePropertyNameBox = $('<input>').attr({'type': 'hidden', 'name': 'key'}).appendTo(dialogBody);
dialogDateBox = $('<input>').attr({'type': 'datetime', 'name': 'value'}).css({'display': 'block', 'margin-top': 15, 'margin-left': 'auto', 'margin-right': 'auto' }).appendTo(dialogBody);
$('<input>').attr({'type': 'hidden', 'name': 'redirect'}).val('true').appendTo(dialogBody);
dialog.dialog({
resizable: false,
modal: true,
autoOpen: false,
buttons: {
"Update": dateDialogUpdate,
Cancel: function () {
$(this).dialog("close");
}
},
open: function(){
dialog.dialog('widget').find('.ui-dialog-buttonpane :tabbable:first').focus();
}
});
dialogDateBox.datetimepicker({
defaultDate: new Date(),
ampm: true,
changeYear: true,
changeMonth: true,
dateFormat: 'yy/mm/dd',
});
}
return dialog;
}
function dateDialogUpdate(){
var dateValue = dialogDateBox.val();
if (useAjax){
// Use Ajax
var $dateField, $userField;
$dateField = $('#' + dateField);
if (userField)
$userField = $('#' + userField);
dialog.dialog("close");
var $ajaxLoading = ($userField ? $userField.next('.ajaxLoading') : $dateField.next('.ajaxLoading')).show();
var data = {
key: updatePropertyName,
value: dateValue
};
$.getJSON(baseUpdateUrl, data, function (response, result) {
if (result != 'success' || response.Result != 'OK') {
alert('Unable to change ' + friendlyName + ' Date:\n' + response);
$ajaxLoading.hide();
} else {
if (response.DateTimeFull){
$dateField.attr('data-datetimeformatted', response.DateTimeJavascript)
.attr('data-discodatetime', response.DateTimeSortable)
.attr('title', response.DateTimeFull)
.text(response.DateTimeFriendly);
}else{
$dateField.attr('data-datetimeformatted', '')
.attr('data-discodatetime', '-1')
.attr('title', notSetDisplay)
.text(notSetDisplay);
}
if ($userField)
$userField.text('by ' + response.UserDescription);
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
})
}else{
// Post Form & Redirect
dialog.dialog("disable");
dialog.dialog("option", "buttons", null);
dialogDatePropertyNameBox.val(updatePropertyName);
dialogForm.submit();
}
}
function dateDialogOpen(FriendlyName, DateField, UserField, UpdatePropertyName, NotSetDisplay, MinDate, UseAjax){
friendlyName = FriendlyName;
dateField = DateField;
userField = UserField;
updatePropertyName = UpdatePropertyName;
notSetDisplay = NotSetDisplay;
minDate = MinDate;
useAjax = UseAjax;
var d = dateDialogGet();
d.dialog('option', 'title', friendlyName);
dialogHeader.text(friendlyName + ' Date');
var dfVal = $('#' + DateField).attr('data-datetimeformatted');
if (dfVal)
dialogDateBox.datetimepicker('setDate', new Date(dfVal));
else
dialogDateBox.datetimepicker('setDate', new Date());
if (MinDate)
dialogDateBox.datetimepicker('option', 'minDate', MinDate);
else
dialogDateBox.datetimepicker('option', 'minDate', null);
d.dialog('open');
}
function dateDialogCreateUpdater(FriendlyName, DateField, UserField, UpdatePropertyName, NotSetDisplay, MinDate, UseAjax){
$('<a>').attr({href: '#', 'class': 'button small', style: 'margin-right: 5px;'}).text('Update').click(function(event){
event.preventDefault();
dateDialogOpen(FriendlyName, DateField, UserField, UpdatePropertyName, NotSetDisplay, MinDate, UseAjax);
}).insertBefore('#' + DateField);
}
if (!document.DiscoFunctions)
document.DiscoFunctions = {};
if (!document.DiscoFunctions.DateDialogCreateUpdater)
document.DiscoFunctions.DateDialogCreateUpdater = dateDialogCreateUpdater;
})();
$(function(){
var updateUrl = '@(Url.Action(MVC.API.Job.Update(Model.Job.Id, null)))';
var jobOpenDate = '@(Model.Job.OpenedDate.ToJavascriptDateTime())';
document.DiscoFunctions.DateDialogCreateUpdater('Accounting Charge Required', 'Job_JobMetaNonWarranty_AccountingChargeRequiredDate', 'Job_JobMetaNonWarranty_AccountingChargeRequiredUser', 'NonWarrantyAccountingChargeRequired', 'Not Required', jobOpenDate, false);
document.DiscoFunctions.DateDialogCreateUpdater('Accounting Charge Added', 'Job_JobMetaNonWarranty_AccountingChargeAddedDate', 'Job_JobMetaNonWarranty_AccountingChargeAddedUser', 'NonWarrantyAccountingChargeAdded', 'Not Added', jobOpenDate, false);
document.DiscoFunctions.DateDialogCreateUpdater('Accounting Charge Paid', 'Job_JobMetaNonWarranty_AccountingChargePaidDate', 'Job_JobMetaNonWarranty_AccountingChargePaidUser', 'NonWarrantyAccountingChargePaid', 'Not Paid', jobOpenDate, false);
document.DiscoFunctions.DateDialogCreateUpdater('Purchase Order Raised', 'Job_JobMetaNonWarranty_PurchaseOrderRaisedDate', 'Job_JobMetaNonWarranty_PurchaseOrderRaisedUser', 'NonWarrantyPurchaseOrderRaised', 'Not Raised', jobOpenDate, true);
document.DiscoFunctions.DateDialogCreateUpdater('Purchase Order Sent', 'Job_JobMetaNonWarranty_PurchaseOrderSentDate', 'Job_JobMetaNonWarranty_PurchaseOrderSentUser', 'NonWarrantyPurchaseOrderSent', 'Not Sent', jobOpenDate, true);
document.DiscoFunctions.DateDialogCreateUpdater('Invoice Received', 'Job_JobMetaNonWarranty_InvoiceReceivedDate', 'Job_JobMetaNonWarranty_InvoiceReceivedUser', 'NonWarrantyInvoiceReceived', 'Not Received', jobOpenDate, true);
document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Accounting Charge Required', 'Job_JobMetaNonWarranty_AccountingChargeRequiredDate', 'Job_JobMetaNonWarranty_AccountingChargeRequiredUser', 'NonWarrantyAccountingChargeRequired', 'Not Required', jobOpenDate, false);
document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Accounting Charge Added', 'Job_JobMetaNonWarranty_AccountingChargeAddedDate', 'Job_JobMetaNonWarranty_AccountingChargeAddedUser', 'NonWarrantyAccountingChargeAdded', 'Not Added', jobOpenDate, false);
document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Accounting Charge Paid', 'Job_JobMetaNonWarranty_AccountingChargePaidDate', 'Job_JobMetaNonWarranty_AccountingChargePaidUser', 'NonWarrantyAccountingChargePaid', 'Not Paid', jobOpenDate, false);
document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Purchase Order Raised', 'Job_JobMetaNonWarranty_PurchaseOrderRaisedDate', 'Job_JobMetaNonWarranty_PurchaseOrderRaisedUser', 'NonWarrantyPurchaseOrderRaised', 'Not Raised', jobOpenDate, true);
document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Purchase Order Sent', 'Job_JobMetaNonWarranty_PurchaseOrderSentDate', 'Job_JobMetaNonWarranty_PurchaseOrderSentUser', 'NonWarrantyPurchaseOrderSent', 'Not Sent', jobOpenDate, true);
document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Invoice Received', 'Job_JobMetaNonWarranty_InvoiceReceivedDate', 'Job_JobMetaNonWarranty_InvoiceReceivedUser', 'NonWarrantyInvoiceReceived', 'Not Received', jobOpenDate, true);
});
</script>
@@ -40,7 +40,15 @@ namespace Disco.Web.Views.Job.JobParts
}
public override void Execute()
{
WriteLiteral("<table");
#line 2 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
#line default
#line hidden
WriteLiteral("\r\n<table");
WriteLiteral(" id=\"jobNonWarrantyFinance\"");
@@ -53,7 +61,7 @@ WriteLiteral(">Accounting Charge Required\r\n </th>\r\n <td>\r\n")
WriteLiteral(" ");
#line 7 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 10 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.AccountingChargeRequiredDate, "Not Required", "Job_JobMetaNonWarranty_AccountingChargeRequiredDate"));
@@ -66,7 +74,7 @@ WriteLiteral(" id=\"Job_JobMetaNonWarranty_AccountingChargeRequiredUser\"");
WriteLiteral(">");
#line 8 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 11 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargeRequiredUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargeRequiredUser.ToString()));
@@ -77,7 +85,7 @@ WriteLiteral("</span>\r\n");
WriteLiteral(" ");
#line 9 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 12 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -92,7 +100,7 @@ WriteLiteral(">Accounting Charge Added\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 16 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 19 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.AccountingChargeAddedDate, "Not Added", "Job_JobMetaNonWarranty_AccountingChargeAddedDate"));
@@ -105,7 +113,7 @@ WriteLiteral(" id=\"Job_JobMetaNonWarranty_AccountingChargeAddedUser\"");
WriteLiteral(">");
#line 17 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 20 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargeAddedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargeAddedUser.ToString()));
@@ -116,7 +124,7 @@ WriteLiteral("</span>\r\n");
WriteLiteral(" ");
#line 18 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 21 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -131,7 +139,7 @@ WriteLiteral(">Accounting Charge Paid\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 25 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 28 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.AccountingChargePaidDate, "Not Paid", "Job_JobMetaNonWarranty_AccountingChargePaidDate"));
@@ -144,7 +152,7 @@ WriteLiteral(" id=\"Job_JobMetaNonWarranty_AccountingChargePaidUser\"");
WriteLiteral(">");
#line 26 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 29 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargePaidUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargePaidUser.ToString()));
@@ -155,7 +163,7 @@ WriteLiteral("</span>\r\n");
WriteLiteral(" ");
#line 27 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 30 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -170,7 +178,7 @@ WriteLiteral(">Purchase Order Raised\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 34 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 37 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.PurchaseOrderRaisedDate, "Not Raised", "Job_JobMetaNonWarranty_PurchaseOrderRaisedDate"));
@@ -183,7 +191,7 @@ WriteLiteral(" id=\"Job_JobMetaNonWarranty_PurchaseOrderRaisedUser\"");
WriteLiteral(">");
#line 35 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 38 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.PurchaseOrderRaisedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.PurchaseOrderRaisedUser.ToString()));
@@ -194,7 +202,7 @@ WriteLiteral("</span>\r\n");
WriteLiteral(" ");
#line 36 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 39 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -206,7 +214,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>Purchase
WriteLiteral(" ");
#line 43 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 46 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Html.TextBoxFor(m => m.Job.JobMetaNonWarranty.PurchaseOrderReference));
@@ -217,7 +225,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 44 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 47 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxSave());
@@ -228,7 +236,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 45 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 48 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -261,7 +269,7 @@ WriteLiteral(@">
url: '");
#line 66 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 69 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyPurchaseOrderReference(Model.Job.Id, null)));
@@ -298,7 +306,7 @@ WriteLiteral(">Purchase Order Sent\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 91 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 94 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.PurchaseOrderSentDate, "Not Sent", "Job_JobMetaNonWarranty_PurchaseOrderSentDate"));
@@ -311,7 +319,7 @@ WriteLiteral(" id=\"Job_JobMetaNonWarranty_PurchaseOrderSentUser\"");
WriteLiteral(">");
#line 92 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 95 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.PurchaseOrderSentUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.PurchaseOrderSentUser.ToString()));
@@ -322,7 +330,7 @@ WriteLiteral("</span>\r\n");
WriteLiteral(" ");
#line 93 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 96 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -337,7 +345,7 @@ WriteLiteral(">Invoice Received\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 100 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 103 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.InvoiceReceivedDate, "Not Received", "Job_JobMetaNonWarranty_InvoiceReceivedDate"));
@@ -350,7 +358,7 @@ WriteLiteral(" id=\"Job_JobMetaNonWarranty_InvoiceReceivedUser\"");
WriteLiteral(">");
#line 101 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 104 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.InvoiceReceivedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.InvoiceReceivedUser.ToString()));
@@ -361,125 +369,52 @@ WriteLiteral("</span>\r\n");
WriteLiteral(" ");
#line 102 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 105 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n</table>\r\n<script>\r\n (function(){\r\n var bas" +
"eUpdateUrl = \'");
WriteLiteral("\r\n </td>\r\n </tr>\r\n</table>\r\n<script>\r\n $(function(){\r\n var up" +
"dateUrl = \'");
#line 108 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 111 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Url.Action(MVC.API.Job.Update(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral("\';\r\n\r\n var dialog, dialogForm, dialogHeader, dialogDateBox, dialogDateProp" +
"ertyNameBox;\r\n var friendlyName, dateField, userField, updatePropertyName" +
", notSetDisplay, minDate, useAjax;\r\n\r\n function dateDialogGet(){\r\n " +
" if (!dialog){\r\n dialog = $(\'<div>\').attr({\'class\': \'dialog\'}" +
")\r\n dialogForm = $(\'<form>\').attr({\'action\': baseUpdateUrl, \'meth" +
"od\': \'post\'}).appendTo(dialog);\r\n var dialogBody = $(\'<p>\').appen" +
"dTo(dialogForm);\r\n dialogHeader = $(\'<h3>\').attr(\'autofocus\', \'au" +
"tofocus\').appendTo(dialogBody);\r\n dialogDatePropertyNameBox = $(\'" +
"<input>\').attr({\'type\': \'hidden\', \'name\': \'key\'}).appendTo(dialogBody);\r\n " +
" dialogDateBox = $(\'<input>\').attr({\'type\': \'datetime\', \'name\': \'value\'}" +
").css({\'display\': \'block\', \'margin-top\': 15, \'margin-left\': \'auto\', \'margin-righ" +
"t\': \'auto\' }).appendTo(dialogBody);\r\n $(\'<input>\').attr({\'type\': " +
"\'hidden\', \'name\': \'redirect\'}).val(\'true\').appendTo(dialogBody);\r\n\r\n " +
" dialog.dialog({\r\n resizable: false,\r\n " +
"modal: true,\r\n autoOpen: false,\r\n buttons:" +
" {\r\n \"Update\": dateDialogUpdate,\r\n " +
" Cancel: function () {\r\n $(this).dialog(\"close\");\r\n " +
" }\r\n },\r\n open: funct" +
"ion(){\r\n dialog.dialog(\'widget\').find(\'.ui-dialog-buttonp" +
"ane :tabbable:first\').focus();\r\n }\r\n });\r\n " +
" dialogDateBox.datetimepicker({\r\n defaultDate: new" +
" Date(),\r\n ampm: true,\r\n changeYear: true," +
"\r\n changeMonth: true,\r\n dateFormat: \'yy/mm" +
"/dd\',\r\n });\r\n }\r\n return dialog;\r\n }" +
"\r\n\r\n function dateDialogUpdate(){\r\n var dateValue = dialogDate" +
"Box.val();\r\n\r\n if (useAjax){\r\n // Use Ajax\r\n " +
" var $dateField, $userField;\r\n $dateField = $(\'#\' + dateFiel" +
"d);\r\n if (userField)\r\n $userField = $(\'#\' + us" +
"erField);\r\n\r\n dialog.dialog(\"close\");\r\n\r\n var $aja" +
"xLoading = ($userField ? $userField.next(\'.ajaxLoading\') : $dateField.next(\'.aja" +
"xLoading\')).show();\r\n\r\n var data = {\r\n key: up" +
"datePropertyName,\r\n value: dateValue\r\n };\r\n " +
" $.getJSON(baseUpdateUrl, data, function (response, result) {\r\n " +
" if (result != \'success\' || response.Result != \'OK\') {\r\n " +
" alert(\'Unable to change \' + friendlyName + \' Date:\\n\' + response);" +
"\r\n $ajaxLoading.hide();\r\n } else {\r\n " +
" if (response.DateTimeFull){\r\n $" +
"dateField.attr(\'data-datetimeformatted\', response.DateTimeJavascript)\r\n " +
" .attr(\'data-discodatetime\', response.DateTimeSortable)\r\n " +
" .attr(\'title\', response.DateTimeFull)\r\n " +
" .text(response.DateTimeFriendly);\r\n " +
" }else{\r\n $dateField.attr(\'data-datetimeformatted\', \'" +
"\')\r\n .attr(\'data-discodatetime\', \'-1\')\r\n " +
" .attr(\'title\', notSetDisplay)\r\n " +
" .text(notSetDisplay);\r\n }\r\n " +
"if ($userField)\r\n $userField.text(\'by \' + response.Us" +
"erDescription);\r\n $ajaxLoading.hide().next(\'.ajaxOk\').sho" +
"w().delay(\'fast\').fadeOut(\'slow\');\r\n }\r\n })\r\n " +
" }else{\r\n // Post Form & Redirect\r\n dial" +
"og.dialog(\"disable\");\r\n dialog.dialog(\"option\", \"buttons\", null);" +
"\r\n\r\n dialogDatePropertyNameBox.val(updatePropertyName);\r\n\r\n " +
" dialogForm.submit();\r\n }\r\n }\r\n\r\n function dat" +
"eDialogOpen(FriendlyName, DateField, UserField, UpdatePropertyName, NotSetDispla" +
"y, MinDate, UseAjax){\r\n friendlyName = FriendlyName;\r\n dat" +
"eField = DateField;\r\n userField = UserField;\r\n updatePrope" +
"rtyName = UpdatePropertyName;\r\n notSetDisplay = NotSetDisplay;\r\n " +
" minDate = MinDate;\r\n useAjax = UseAjax;\r\n\r\n var d =" +
" dateDialogGet();\r\n\r\n d.dialog(\'option\', \'title\', friendlyName);\r\n " +
" dialogHeader.text(friendlyName + \' Date\');\r\n\r\n var dfVal = $" +
"(\'#\' + DateField).attr(\'data-datetimeformatted\');\r\n\r\n if (dfVal)\r\n " +
" dialogDateBox.datetimepicker(\'setDate\', new Date(dfVal));\r\n " +
" else\r\n dialogDateBox.datetimepicker(\'setDate\', new Date());\r\n" +
"\r\n if (MinDate)\r\n dialogDateBox.datetimepicker(\'option" +
"\', \'minDate\', MinDate);\r\n else\r\n dialogDateBox.datetim" +
"epicker(\'option\', \'minDate\', null);\r\n\r\n d.dialog(\'open\');\r\n }\r" +
"\n\r\n function dateDialogCreateUpdater(FriendlyName, DateField, UserField, " +
"UpdatePropertyName, NotSetDisplay, MinDate, UseAjax){\r\n $(\'<a>\').attr" +
"({href: \'#\', \'class\': \'button small\', style: \'margin-right: 5px;\'}).text(\'Update" +
"\').click(function(event){\r\n event.preventDefault();\r\n " +
" dateDialogOpen(FriendlyName, DateField, UserField, UpdatePropertyName, NotSe" +
"tDisplay, MinDate, UseAjax);\r\n }).insertBefore(\'#\' + DateField);\r\n " +
" }\r\n\r\n if (!document.DiscoFunctions)\r\n document.DiscoFunct" +
"ions = {};\r\n if (!document.DiscoFunctions.DateDialogCreateUpdater)\r\n " +
" document.DiscoFunctions.DateDialogCreateUpdater = dateDialogCreateUpdater" +
";\r\n })();\r\n $(function(){\r\n var jobOpenDate = \'");
WriteLiteral("\';\r\n var jobOpenDate = \'");
#line 240 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
#line 112 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Model.Job.OpenedDate.ToJavascriptDateTime());
#line default
#line hidden
WriteLiteral("\';\r\n\r\n document.DiscoFunctions.DateDialogCreateUpdater(\'Accounting Charge " +
"Required\', \'Job_JobMetaNonWarranty_AccountingChargeRequiredDate\', \'Job_JobMetaNo" +
"nWarranty_AccountingChargeRequiredUser\', \'NonWarrantyAccountingChargeRequired\', " +
"\'Not Required\', jobOpenDate, false);\r\n document.DiscoFunctions.DateDialog" +
"CreateUpdater(\'Accounting Charge Added\', \'Job_JobMetaNonWarranty_AccountingCharg" +
"eAddedDate\', \'Job_JobMetaNonWarranty_AccountingChargeAddedUser\', \'NonWarrantyAcc" +
"ountingChargeAdded\', \'Not Added\', jobOpenDate, false);\r\n document.DiscoFu" +
"nctions.DateDialogCreateUpdater(\'Accounting Charge Paid\', \'Job_JobMetaNonWarrant" +
"y_AccountingChargePaidDate\', \'Job_JobMetaNonWarranty_AccountingChargePaidUser\', " +
"\'NonWarrantyAccountingChargePaid\', \'Not Paid\', jobOpenDate, false);\r\n doc" +
"ument.DiscoFunctions.DateDialogCreateUpdater(\'Purchase Order Raised\', \'Job_JobMe" +
"taNonWarranty_PurchaseOrderRaisedDate\', \'Job_JobMetaNonWarranty_PurchaseOrderRai" +
"sedUser\', \'NonWarrantyPurchaseOrderRaised\', \'Not Raised\', jobOpenDate, true);\r\n " +
" document.DiscoFunctions.DateDialogCreateUpdater(\'Purchase Order Sent\', \'J" +
"ob_JobMetaNonWarranty_PurchaseOrderSentDate\', \'Job_JobMetaNonWarranty_PurchaseOr" +
"derSentUser\', \'NonWarrantyPurchaseOrderSent\', \'Not Sent\', jobOpenDate, true);\r\n " +
" document.DiscoFunctions.DateDialogCreateUpdater(\'Invoice Received\', \'Job_" +
"JobMetaNonWarranty_InvoiceReceivedDate\', \'Job_JobMetaNonWarranty_InvoiceReceived" +
"User\', \'NonWarrantyInvoiceReceived\', \'Not Received\', jobOpenDate, true);\r\n })" +
";\r\n</script>\r\n");
WriteLiteral("\';\r\n\r\n document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, \'Account" +
"ing Charge Required\', \'Job_JobMetaNonWarranty_AccountingChargeRequiredDate\', \'Jo" +
"b_JobMetaNonWarranty_AccountingChargeRequiredUser\', \'NonWarrantyAccountingCharge" +
"Required\', \'Not Required\', jobOpenDate, false);\r\n document.DiscoFunctions" +
".DateDialogCreateUpdater(updateUrl, \'Accounting Charge Added\', \'Job_JobMetaNonWa" +
"rranty_AccountingChargeAddedDate\', \'Job_JobMetaNonWarranty_AccountingChargeAdded" +
"User\', \'NonWarrantyAccountingChargeAdded\', \'Not Added\', jobOpenDate, false);\r\n " +
" document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, \'Accounting Cha" +
"rge Paid\', \'Job_JobMetaNonWarranty_AccountingChargePaidDate\', \'Job_JobMetaNonWar" +
"ranty_AccountingChargePaidUser\', \'NonWarrantyAccountingChargePaid\', \'Not Paid\', " +
"jobOpenDate, false);\r\n document.DiscoFunctions.DateDialogCreateUpdater(up" +
"dateUrl, \'Purchase Order Raised\', \'Job_JobMetaNonWarranty_PurchaseOrderRaisedDat" +
"e\', \'Job_JobMetaNonWarranty_PurchaseOrderRaisedUser\', \'NonWarrantyPurchaseOrderR" +
"aised\', \'Not Raised\', jobOpenDate, true);\r\n document.DiscoFunctions.DateD" +
"ialogCreateUpdater(updateUrl, \'Purchase Order Sent\', \'Job_JobMetaNonWarranty_Pur" +
"chaseOrderSentDate\', \'Job_JobMetaNonWarranty_PurchaseOrderSentUser\', \'NonWarrant" +
"yPurchaseOrderSent\', \'Not Sent\', jobOpenDate, true);\r\n document.DiscoFunc" +
"tions.DateDialogCreateUpdater(updateUrl, \'Invoice Received\', \'Job_JobMetaNonWarr" +
"anty_InvoiceReceivedDate\', \'Job_JobMetaNonWarranty_InvoiceReceivedUser\', \'NonWar" +
"rantyInvoiceReceived\', \'Not Received\', jobOpenDate, true);\r\n });\r\n</script>\r\n" +
"");
}
}
+14 -28
View File
@@ -1,4 +1,7 @@
@model Disco.Web.Models.Job.ShowModel
@{
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
}
<table id="jobNonWarrantyRepairs">
<tr>
<th style="width: 200px;">
@@ -25,20 +28,7 @@
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>
@CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.RepairerLoggedDate, "Not Logged", "Job_JobMetaNonWarranty_RepairerLoggedDate")
</td>
</tr>
<tr>
@@ -66,20 +56,16 @@
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>
@CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.RepairerCompletedDate, "Not Completed", "Job_JobMetaNonWarranty_RepairerCompletedDate")
</td>
</tr>
</table>
<script>
$(function () {
var updateUrl = '@(Url.Action(MVC.API.Job.Update(Model.Job.Id, null)))';
var jobOpenDate = '@(Model.Job.OpenedDate.ToJavascriptDateTime())';
document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Repairer Name', 'Job_JobMetaNonWarranty_RepairerLoggedDate', null, 'NonWarrantyRepairerLoggedDate', 'Not Logged', jobOpenDate, false);
document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Repair Completed', 'Job_JobMetaNonWarranty_RepairerCompletedDate', null, 'NonWarrantyRepairerCompletedDate', 'Not Completed', jobOpenDate, false);
});
</script>
@@ -31,16 +31,24 @@ namespace Disco.Web.Views.Job.JobParts
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.4.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Job/JobParts/Repairs.cshtml")]
public class Repairs : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
public partial class Repairs : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
{
public Repairs()
{
}
public override void Execute()
{
WriteLiteral("<table");
#line 2 "..\..\Views\Job\JobParts\Repairs.cshtml"
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
#line default
#line hidden
WriteLiteral("\r\n<table");
WriteLiteral(" id=\"jobNonWarrantyRepairs\"");
@@ -53,7 +61,7 @@ WriteLiteral(">\r\n Repairer Name\r\n </th>\r\n <td>\r\
WriteLiteral(" ");
#line 8 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 11 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.RepairerName));
@@ -64,7 +72,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 9 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 12 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(AjaxHelpers.AjaxSave());
@@ -75,7 +83,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 10 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 13 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -91,7 +99,7 @@ WriteLiteral(">\r\n $(function () {\r\n docume
" \'");
#line 16 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 19 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyRepairerName(Model.Job.Id, null)));
@@ -108,45 +116,13 @@ WriteLiteral(">\r\n Repair Logged\r\n </th>\r\n <td>\r\
WriteLiteral(" ");
#line 28 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.RepairerLoggedDate));
#line 31 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.RepairerLoggedDate, "Not Logged", "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("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th");
WriteLiteral(" style=\"width: 200px;\"");
@@ -155,7 +131,7 @@ WriteLiteral(">\r\n Repair Reference\r\n </th>\r\n <td>
WriteLiteral(" ");
#line 49 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 39 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.RepairerReference));
@@ -166,7 +142,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 50 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 40 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(AjaxHelpers.AjaxSave());
@@ -177,7 +153,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 51 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 41 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -193,7 +169,7 @@ WriteLiteral(">\r\n $(function () {\r\n docume
" \'");
#line 57 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 47 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyRepairerReference(Model.Job.Id, null)));
@@ -210,45 +186,37 @@ WriteLiteral(">\r\n Repair Completed\r\n </th>\r\n <td>
WriteLiteral(" ");
#line 69 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.RepairerCompletedDate));
#line 59 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.RepairerCompletedDate, "Not Completed", "Job_JobMetaNonWarranty_RepairerCompletedDate"));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
WriteLiteral("\r\n </td>\r\n </tr>\r\n</table>\r\n<script>\r\n $(function () {\r\n var " +
"updateUrl = \'");
#line 70 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line 65 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Url.Action(MVC.API.Job.Update(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral("\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
var dateField = $('#Job_JobMetaNonWarranty_RepairerCompletedDate');
document.DiscoFunctions.DateChangeHelper(
dateField,
'Unknown',
'");
WriteLiteral("\';\r\n var jobOpenDate = \'");
#line 77 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyRepairerCompletedDate(Model.Job.Id, null)));
#line 66 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Model.Job.OpenedDate.ToJavascriptDateTime());
#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");
WriteLiteral(@"';
document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Repairer Name', 'Job_JobMetaNonWarranty_RepairerLoggedDate', null, 'NonWarrantyRepairerLoggedDate', 'Not Logged', jobOpenDate, false);
document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Repair Completed', 'Job_JobMetaNonWarranty_RepairerCompletedDate', null, 'NonWarrantyRepairerCompletedDate', 'Not Completed', jobOpenDate, false);
});
</script>");
}
}
+6 -6
View File
@@ -121,12 +121,12 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
BuildVersion_BuildAction = ReBuild
BuildVersion_StartDate = 2001/1/1
BuildVersion_BuildVersioningStyle = None.None.None.None
BuildVersion_UpdateAssemblyVersion = False
BuildVersion_UpdateFileVersion = False
BuildVersion_DetectChanges = False
BuildVersion_UseGlobalSettings = False
BuildVersion_DetectChanges = True
BuildVersion_UpdateFileVersion = False
BuildVersion_UpdateAssemblyVersion = False
BuildVersion_BuildVersioningStyle = None.None.None.None
BuildVersion_StartDate = 2001/1/1
BuildVersion_BuildAction = ReBuild
EndGlobalSection
EndGlobal