Bug Fix: Job Quick-Logging with Queues
Jobs logged cannot be quick-logged if they are added into a queue. 'Device Held' can only be configured if the authorization is given.
This commit is contained in:
@@ -34,7 +34,7 @@ namespace Disco.Web.Extensions
|
||||
var sb = new System.Text.StringBuilder(System.Web.HttpUtility.HtmlEncode(jst.Description));
|
||||
|
||||
foreach (var jq in jst.JobQueues)
|
||||
sb.AppendFormat(" <i class=\"fa fa-{0} fa-fw d-{1}\" title=\"{2}\"></i>", jq.Icon, jq.IconColour, jq.Name);
|
||||
sb.AppendFormat(" <i class=\"queue fa fa-{0} fa-fw d-{1}\" title=\"{2}\"></i>", jq.Icon, jq.IconColour, jq.Name);
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
@@ -732,7 +732,7 @@
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
#createJob_Container #createJob_QuickLogAutoCloseContainer input {
|
||||
margin-left: 6px;
|
||||
margin-left: 4px;
|
||||
}
|
||||
#createJob_Container #createJob_QuickLogTaskTimeContainer {
|
||||
display: none;
|
||||
@@ -746,7 +746,7 @@
|
||||
padding-right: 10px;
|
||||
}
|
||||
#createJob_Container #createJob_QuickLogTaskTimeContainer label {
|
||||
margin-right: 20px;
|
||||
margin-right: 15px;
|
||||
}
|
||||
#createJob_Container #createJob_QuickLogTaskTimeContainer #createJob_TaskTimeOtherMinutesContainer {
|
||||
display: none;
|
||||
|
||||
@@ -771,7 +771,7 @@
|
||||
}
|
||||
|
||||
input {
|
||||
margin-left: 6px;
|
||||
margin-left: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -788,7 +788,7 @@
|
||||
}
|
||||
|
||||
label {
|
||||
margin-right: 20px;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
#createJob_TaskTimeOtherMinutesContainer {
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -397,7 +397,11 @@ namespace Disco.Web.Controllers
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Authorization.Has(Claims.Job.Actions.Close) && m.QuickLog.HasValue && m.QuickLog.Value && m.QuickLogTaskTimeMinutes.HasValue && m.QuickLogTaskTimeMinutes.Value > 0)
|
||||
if (Authorization.Has(Claims.Job.Actions.Close)
|
||||
&& m.QuickLog.HasValue && m.QuickLog.Value
|
||||
&& m.QuickLogTaskTimeMinutes.HasValue && m.QuickLogTaskTimeMinutes.Value > 0
|
||||
&& (j.JobQueues == null || j.JobQueues.All(jqj => jqj.RemovedDate.HasValue))
|
||||
)
|
||||
{
|
||||
// Quick Log
|
||||
// Set Opened Date in the past
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
if (Authorization.Has(Claims.Job.Properties.DeviceHeld)){
|
||||
<div id="createJob_DeviceHeldContainer" class="createJob_Component">
|
||||
@Html.ValidationMessageFor(m => m.DeviceHeld)
|
||||
@Html.HiddenFor(m => m.DeviceHeld)
|
||||
@@ -50,6 +51,9 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
}else{
|
||||
@Html.Hidden("DeviceHeld", false)
|
||||
}
|
||||
<div id="createJob_CommentsContainer" class="createJob_Component">
|
||||
<table>
|
||||
<tr>
|
||||
@@ -69,11 +73,12 @@
|
||||
</div>
|
||||
<div id="createJob_QuickLogTaskTimeContainer">
|
||||
<h4>Task Time:</h4>
|
||||
<input type="radio" id="createJob_TaskTime10" name="QuickLogTaskTimeMinutes" value="10" /><label for="createJob_TaskTime10"> 10 Minutes</label>
|
||||
<input type="radio" id="createJob_TaskTime30" name="QuickLogTaskTimeMinutes" value="30" /><label for="createJob_TaskTime30"> 30 Minutes</label>
|
||||
<input type="radio" id="createJob_TaskTime60" name="QuickLogTaskTimeMinutes" value="60" /><label for="createJob_TaskTime60"> 1 Hour</label>
|
||||
<input type="radio" id="createJob_TaskTime120" name="QuickLogTaskTimeMinutes" value="120" /><label for="createJob_TaskTime120"> 2 Hours</label>
|
||||
<input type="radio" id="createJob_TaskTimeOther" name="QuickLogTaskTimeMinutes" value="" /><label for="createJob_TaskTimeOther"> Other</label>
|
||||
<input type="radio" id="createJob_TaskTime5" name="QuickLogTaskTimeMinutes" value="5" /><label for="createJob_TaskTime5">5 Minutes</label>
|
||||
<input type="radio" id="createJob_TaskTime10" name="QuickLogTaskTimeMinutes" value="10" /><label for="createJob_TaskTime10">10 Minutes</label>
|
||||
<input type="radio" id="createJob_TaskTime30" name="QuickLogTaskTimeMinutes" value="30" /><label for="createJob_TaskTime30">30 Minutes</label>
|
||||
<input type="radio" id="createJob_TaskTime60" name="QuickLogTaskTimeMinutes" value="60" /><label for="createJob_TaskTime60">1 Hour</label>
|
||||
<input type="radio" id="createJob_TaskTime120" name="QuickLogTaskTimeMinutes" value="120" /><label for="createJob_TaskTime120">2 Hours</label>
|
||||
<input type="radio" id="createJob_TaskTimeOther" name="QuickLogTaskTimeMinutes" value="" /><label for="createJob_TaskTimeOther">Other</label>
|
||||
<span id="createJob_TaskTimeOtherMinutesContainer">
|
||||
<input type="number" id="createJob_TaskTimeOtherMinutes" name="QuickLogTaskTimeMinutesOther" value="" disabled="disabled" />
|
||||
Minutes
|
||||
@@ -207,6 +212,7 @@
|
||||
//#region DeviceHeld
|
||||
var $deviceHeld = $('#DeviceHeld');
|
||||
|
||||
@if (Authorization.Has(Claims.Job.Properties.DeviceHeld)){<text>
|
||||
if ($('#DeviceSerialNumber').val()) {
|
||||
switch ($deviceHeld.val()) {
|
||||
case 'True':
|
||||
@@ -237,6 +243,7 @@
|
||||
$deviceHeld.val('False');
|
||||
$('#createJob_DeviceHeldContainer').hide();
|
||||
}
|
||||
</text>}
|
||||
//#endregion
|
||||
|
||||
@if (Authorization.Has(Claims.Job.Actions.Close)){
|
||||
@@ -251,6 +258,7 @@
|
||||
|
||||
$deviceHeld.change(validateQuickLog);
|
||||
$jobTypes.change(validateQuickLog);
|
||||
$('#createJob_SubTypes').on('change', 'input', validateQuickLog);
|
||||
validateQuickLog();
|
||||
|
||||
function validateQuickLog() {
|
||||
@@ -259,6 +267,7 @@
|
||||
if ($deviceHeld.val() === 'True') {
|
||||
quickLogAllowed = false;
|
||||
} else {
|
||||
// Allow Quick-Log only for certain Job Types
|
||||
var selectedType = $jobTypes.filter(':checked').val();
|
||||
switch (selectedType) {
|
||||
case 'HMisc':
|
||||
@@ -266,7 +275,11 @@
|
||||
case 'SImg':
|
||||
case 'SOS':
|
||||
case 'UMgmt':
|
||||
quickLogAllowed = true;
|
||||
// If Job-Queues are configured for a Sub-Type, don't allow quick-log.
|
||||
if ($('#createJob_SubType_' + $jobTypes.filter(':checked').val()).find('input:checked').closest('li').has('i.queue').length == 0)
|
||||
quickLogAllowed = true;
|
||||
else
|
||||
quickLogAllowed = false;
|
||||
break;
|
||||
default:
|
||||
quickLogAllowed = false;
|
||||
|
||||
@@ -249,6 +249,13 @@ WriteLiteral("\r\n </div>\r\n </div>
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 36 "..\..\Views\Job\Create.cshtml"
|
||||
if (Authorization.Has(Claims.Job.Properties.DeviceHeld)){
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"createJob_DeviceHeldContainer\"");
|
||||
@@ -260,7 +267,7 @@ WriteLiteral(">\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 37 "..\..\Views\Job\Create.cshtml"
|
||||
#line 38 "..\..\Views\Job\Create.cshtml"
|
||||
Write(Html.ValidationMessageFor(m => m.DeviceHeld));
|
||||
|
||||
|
||||
@@ -271,7 +278,7 @@ WriteLiteral("\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 38 "..\..\Views\Job\Create.cshtml"
|
||||
#line 39 "..\..\Views\Job\Create.cshtml"
|
||||
Write(Html.HiddenFor(m => m.DeviceHeld));
|
||||
|
||||
|
||||
@@ -311,6 +318,28 @@ WriteLiteral(" for=\"createJob_DeviceNotHeld\"");
|
||||
WriteLiteral(">Not Held</label>\r\n </td>\r\n </tr>\r\n " +
|
||||
"</table>\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 54 "..\..\Views\Job\Create.cshtml"
|
||||
}else{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 55 "..\..\Views\Job\Create.cshtml"
|
||||
Write(Html.Hidden("DeviceHeld", false));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 55 "..\..\Views\Job\Create.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"createJob_CommentsContainer\"");
|
||||
@@ -324,7 +353,7 @@ WriteLiteral(">\r\n <table>\r\n <tr>\r\n
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 60 "..\..\Views\Job\Create.cshtml"
|
||||
#line 64 "..\..\Views\Job\Create.cshtml"
|
||||
Write(Html.EditorFor(m => m.Comments));
|
||||
|
||||
|
||||
@@ -334,7 +363,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n
|
||||
" </div>\r\n");
|
||||
|
||||
|
||||
#line 65 "..\..\Views\Job\Create.cshtml"
|
||||
#line 69 "..\..\Views\Job\Create.cshtml"
|
||||
if (Authorization.Has(Claims.Job.Actions.Close)){
|
||||
|
||||
|
||||
@@ -372,6 +401,20 @@ WriteLiteral(">\r\n <h4>Task Time:</h4>\r\n <input
|
||||
|
||||
WriteLiteral(" type=\"radio\"");
|
||||
|
||||
WriteLiteral(" id=\"createJob_TaskTime5\"");
|
||||
|
||||
WriteLiteral(" name=\"QuickLogTaskTimeMinutes\"");
|
||||
|
||||
WriteLiteral(" value=\"5\"");
|
||||
|
||||
WriteLiteral(" /><label");
|
||||
|
||||
WriteLiteral(" for=\"createJob_TaskTime5\"");
|
||||
|
||||
WriteLiteral(">5 Minutes</label>\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"radio\"");
|
||||
|
||||
WriteLiteral(" id=\"createJob_TaskTime10\"");
|
||||
|
||||
WriteLiteral(" name=\"QuickLogTaskTimeMinutes\"");
|
||||
@@ -382,7 +425,7 @@ WriteLiteral(" /><label");
|
||||
|
||||
WriteLiteral(" for=\"createJob_TaskTime10\"");
|
||||
|
||||
WriteLiteral("> 10 Minutes</label>\r\n <input");
|
||||
WriteLiteral(">10 Minutes</label>\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"radio\"");
|
||||
|
||||
@@ -396,7 +439,7 @@ WriteLiteral(" /><label");
|
||||
|
||||
WriteLiteral(" for=\"createJob_TaskTime30\"");
|
||||
|
||||
WriteLiteral("> 30 Minutes</label>\r\n <input");
|
||||
WriteLiteral(">30 Minutes</label>\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"radio\"");
|
||||
|
||||
@@ -410,7 +453,7 @@ WriteLiteral(" /><label");
|
||||
|
||||
WriteLiteral(" for=\"createJob_TaskTime60\"");
|
||||
|
||||
WriteLiteral("> 1 Hour</label>\r\n <input");
|
||||
WriteLiteral(">1 Hour</label>\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"radio\"");
|
||||
|
||||
@@ -424,7 +467,7 @@ WriteLiteral(" /><label");
|
||||
|
||||
WriteLiteral(" for=\"createJob_TaskTime120\"");
|
||||
|
||||
WriteLiteral("> 2 Hours</label>\r\n <input");
|
||||
WriteLiteral(">2 Hours</label>\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"radio\"");
|
||||
|
||||
@@ -438,7 +481,7 @@ WriteLiteral(" /><label");
|
||||
|
||||
WriteLiteral(" for=\"createJob_TaskTimeOther\"");
|
||||
|
||||
WriteLiteral("> Other</label>\r\n <span");
|
||||
WriteLiteral(">Other</label>\r\n <span");
|
||||
|
||||
WriteLiteral(" id=\"createJob_TaskTimeOtherMinutesContainer\"");
|
||||
|
||||
@@ -459,7 +502,7 @@ WriteLiteral(" />\r\n Minutes\r\n </span>\r\n"
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 81 "..\..\Views\Job\Create.cshtml"
|
||||
#line 86 "..\..\Views\Job\Create.cshtml"
|
||||
Write(Html.ValidationMessageFor(m => m.QuickLogTaskTimeMinutes));
|
||||
|
||||
|
||||
@@ -468,7 +511,7 @@ WriteLiteral(" ");
|
||||
WriteLiteral("\r\n </div>\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 84 "..\..\Views\Job\Create.cshtml"
|
||||
#line 89 "..\..\Views\Job\Create.cshtml"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -529,13 +572,13 @@ WriteLiteral(">\r\n $(function () {\r\n var discoDialogMethods
|
||||
"tion-error\');\r\n isValid = false;\r\n }\r\n\r\n");
|
||||
|
||||
|
||||
#line 170 "..\..\Views\Job\Create.cshtml"
|
||||
#line 175 "..\..\Views\Job\Create.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 170 "..\..\Views\Job\Create.cshtml"
|
||||
#line 175 "..\..\Views\Job\Create.cshtml"
|
||||
if (Authorization.Has(Claims.Job.Actions.Close)){
|
||||
|
||||
|
||||
@@ -570,46 +613,79 @@ WriteLiteral(@"
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 194 "..\..\Views\Job\Create.cshtml"
|
||||
#line 199 "..\..\Views\Job\Create.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n return isValid;\r\n }\r\n\r\n validator.setting" +
|
||||
"s.submitHandler = function (form) {\r\n if (additionalValidation())" +
|
||||
" {\r\n discoDialogMethods.setButtons({});\r\n " +
|
||||
"form.submit();\r\n }\r\n }\r\n //#endregion\r\n\r\n " +
|
||||
" //#region DeviceHeld\r\n var $deviceHeld = $(\'#DeviceHeld\');\r" +
|
||||
"\n\r\n if ($(\'#DeviceSerialNumber\').val()) {\r\n switch ($d" +
|
||||
"eviceHeld.val()) {\r\n case \'True\':\r\n $(" +
|
||||
"\'#createJob_DeviceHeld\').prop(\'checked\', true);\r\n $(\'#cre" +
|
||||
"ateJob_DeviceNotHeld\').prop(\'checked\', false);\r\n break;\r\n" +
|
||||
" case \'False\':\r\n $(\'#createJob_DeviceH" +
|
||||
"eld\').prop(\'checked\', false);\r\n $(\'#createJob_DeviceNotHe" +
|
||||
"ld\').prop(\'checked\', true);\r\n break;\r\n " +
|
||||
" default:\r\n $(\'#createJob_DeviceHeld\').prop(\'checked\', fa" +
|
||||
"lse);\r\n $(\'#createJob_DeviceNotHeld\').prop(\'checked\', fal" +
|
||||
"se);\r\n break;\r\n }\r\n $(\'#cre" +
|
||||
"ateJob_DeviceHeldContainer\').find(\'input[type=\"radio\"]\').change(function () {\r\n " +
|
||||
" // Update Hidden Field with Boolean Value\r\n " +
|
||||
" // Set DeviceHeld\r\n var deviceHeldValue = \'\';\r\n " +
|
||||
" if ($(\'#createJob_DeviceHeld\').is(\':checked\'))\r\n " +
|
||||
"deviceHeldValue = \'True\';\r\n if ($(\'#createJob_DeviceNotHeld\')" +
|
||||
".is(\':checked\'))\r\n deviceHeldValue = \'False\';\r\n " +
|
||||
" $deviceHeld.val(deviceHeldValue).change();\r\n });\r\n " +
|
||||
" } else {\r\n // No Device Associated\r\n $devic" +
|
||||
"eHeld.val(\'False\');\r\n $(\'#createJob_DeviceHeldContainer\').hide();" +
|
||||
"\r\n }\r\n //#endregion\r\n\r\n");
|
||||
WriteLiteral(@"
|
||||
return isValid;
|
||||
}
|
||||
|
||||
validator.settings.submitHandler = function (form) {
|
||||
if (additionalValidation()) {
|
||||
discoDialogMethods.setButtons({});
|
||||
form.submit();
|
||||
}
|
||||
}
|
||||
//#endregion
|
||||
|
||||
//#region DeviceHeld
|
||||
var $deviceHeld = $('#DeviceHeld');
|
||||
|
||||
");
|
||||
|
||||
|
||||
#line 242 "..\..\Views\Job\Create.cshtml"
|
||||
#line 215 "..\..\Views\Job\Create.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 242 "..\..\Views\Job\Create.cshtml"
|
||||
#line 215 "..\..\Views\Job\Create.cshtml"
|
||||
if (Authorization.Has(Claims.Job.Properties.DeviceHeld)){
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n if ($(\'#DeviceSerialNumber\').val()) {\r\n switch ($dev" +
|
||||
"iceHeld.val()) {\r\n case \'True\':\r\n $(\'#" +
|
||||
"createJob_DeviceHeld\').prop(\'checked\', true);\r\n $(\'#creat" +
|
||||
"eJob_DeviceNotHeld\').prop(\'checked\', false);\r\n break;\r\n " +
|
||||
" case \'False\':\r\n $(\'#createJob_DeviceHel" +
|
||||
"d\').prop(\'checked\', false);\r\n $(\'#createJob_DeviceNotHeld" +
|
||||
"\').prop(\'checked\', true);\r\n break;\r\n d" +
|
||||
"efault:\r\n $(\'#createJob_DeviceHeld\').prop(\'checked\', fals" +
|
||||
"e);\r\n $(\'#createJob_DeviceNotHeld\').prop(\'checked\', false" +
|
||||
");\r\n break;\r\n }\r\n $(\'#creat" +
|
||||
"eJob_DeviceHeldContainer\').find(\'input[type=\"radio\"]\').change(function () {\r\n " +
|
||||
" // Update Hidden Field with Boolean Value\r\n " +
|
||||
"// Set DeviceHeld\r\n var deviceHeldValue = \'\';\r\n " +
|
||||
" if ($(\'#createJob_DeviceHeld\').is(\':checked\'))\r\n de" +
|
||||
"viceHeldValue = \'True\';\r\n if ($(\'#createJob_DeviceNotHeld\').i" +
|
||||
"s(\':checked\'))\r\n deviceHeldValue = \'False\';\r\n " +
|
||||
" $deviceHeld.val(deviceHeldValue).change();\r\n });\r\n " +
|
||||
" } else {\r\n // No Device Associated\r\n $deviceH" +
|
||||
"eld.val(\'False\');\r\n $(\'#createJob_DeviceHeldContainer\').hide();\r\n" +
|
||||
" }\r\n ");
|
||||
|
||||
|
||||
#line 246 "..\..\Views\Job\Create.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" //#endregion\r\n\r\n");
|
||||
|
||||
|
||||
#line 249 "..\..\Views\Job\Create.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 249 "..\..\Views\Job\Create.cshtml"
|
||||
if (Authorization.Has(Claims.Job.Actions.Close)){
|
||||
|
||||
|
||||
@@ -625,37 +701,43 @@ WriteLiteral("\r\n //#region QuickLog\r\n var $quickLog =
|
||||
"teJob_TaskTimeOtherMinutes\');\r\n var $quickLogTaskTimeValidationMessag" +
|
||||
"e = $quickLogTaskTimeContainer.find(\'[data-valmsg-for=\"QuickLogTaskTimeMinutes\"]" +
|
||||
"\');\r\n\r\n $deviceHeld.change(validateQuickLog);\r\n $jobTypes." +
|
||||
"change(validateQuickLog);\r\n validateQuickLog();\r\n\r\n functi" +
|
||||
"on validateQuickLog() {\r\n var quickLogAllowed = false;\r\n\r\n " +
|
||||
" if ($deviceHeld.val() === \'True\') {\r\n quickLogAllowe" +
|
||||
"d = false;\r\n } else {\r\n var selectedType = $jo" +
|
||||
"bTypes.filter(\':checked\').val();\r\n switch (selectedType) {\r\n " +
|
||||
" case \'HMisc\':\r\n case \'SApp\':\r\n " +
|
||||
" case \'SImg\':\r\n case \'SOS\':\r\n " +
|
||||
" case \'UMgmt\':\r\n quickLogAllowed = true" +
|
||||
";\r\n break;\r\n default:\r\n " +
|
||||
" quickLogAllowed = false;\r\n break" +
|
||||
";\r\n }\r\n }\r\n\r\n if (quickLogAllow" +
|
||||
"ed) {\r\n $quickLogContainer.slideDown();\r\n } el" +
|
||||
"se {\r\n if (init)\r\n $quickLogContainer." +
|
||||
"hide();\r\n else\r\n $quickLogContainer.sl" +
|
||||
"ideUp();\r\n $quickLog.prop(\'checked\', false).change();\r\n " +
|
||||
" }\r\n }\r\n\r\n $quickLog.change(function () {\r\n " +
|
||||
" if ($(this).is(\':checked\')) {\r\n $quickLogTaskTimeCo" +
|
||||
"ntainer.slideDown();\r\n } else {\r\n $quickLogTas" +
|
||||
"kTimeContainer.slideUp();\r\n }\r\n });\r\n\r\n $qu" +
|
||||
"ickLogTaskTimes.change(function () {\r\n if ($quickLogTaskTimes.fil" +
|
||||
"ter(\':checked\').val() === \"\") {\r\n $(\'#createJob_TaskTimeOther" +
|
||||
"MinutesContainer\').show();\r\n $quickLogTaskTimeOtherMinutes.at" +
|
||||
"tr(\'disabled\', null).focus().select();\r\n } else {\r\n " +
|
||||
" $(\'#createJob_TaskTimeOtherMinutesContainer\').hide();\r\n " +
|
||||
" $quickLogTaskTimeOtherMinutes.attr(\'disabled\', \'disabled\');\r\n }\r" +
|
||||
"\n });\r\n //#endregion\r\n ");
|
||||
"change(validateQuickLog);\r\n $(\'#createJob_SubTypes\').on(\'change\', \'in" +
|
||||
"put\', validateQuickLog);\r\n validateQuickLog();\r\n\r\n functio" +
|
||||
"n validateQuickLog() {\r\n var quickLogAllowed = false;\r\n\r\n " +
|
||||
" if ($deviceHeld.val() === \'True\') {\r\n quickLogAllowed" +
|
||||
" = false;\r\n } else {\r\n // Allow Quick-Log only" +
|
||||
" for certain Job Types\r\n var selectedType = $jobTypes.filter(" +
|
||||
"\':checked\').val();\r\n switch (selectedType) {\r\n " +
|
||||
" case \'HMisc\':\r\n case \'SApp\':\r\n " +
|
||||
" case \'SImg\':\r\n case \'SOS\':\r\n " +
|
||||
" case \'UMgmt\':\r\n // If Job-Queues are configured for " +
|
||||
"a Sub-Type, don\'t allow quick-log.\r\n if ($(\'#createJo" +
|
||||
"b_SubType_\' + $jobTypes.filter(\':checked\').val()).find(\'input:checked\').closest(" +
|
||||
"\'li\').has(\'i.queue\').length == 0)\r\n quickLogAllow" +
|
||||
"ed = true;\r\n else\r\n qu" +
|
||||
"ickLogAllowed = false;\r\n break;\r\n " +
|
||||
" default:\r\n quickLogAllowed = false;\r\n " +
|
||||
" break;\r\n }\r\n }\r\n\r\n " +
|
||||
" if (quickLogAllowed) {\r\n $quickLogContainer.slideDown();\r" +
|
||||
"\n } else {\r\n if (init)\r\n " +
|
||||
" $quickLogContainer.hide();\r\n else\r\n " +
|
||||
"$quickLogContainer.slideUp();\r\n $quickLog.prop(\'checked\', fal" +
|
||||
"se).change();\r\n }\r\n }\r\n\r\n $quickLog.change(" +
|
||||
"function () {\r\n if ($(this).is(\':checked\')) {\r\n " +
|
||||
" $quickLogTaskTimeContainer.slideDown();\r\n } else {\r\n " +
|
||||
" $quickLogTaskTimeContainer.slideUp();\r\n }\r\n }" +
|
||||
");\r\n\r\n $quickLogTaskTimes.change(function () {\r\n if ($" +
|
||||
"quickLogTaskTimes.filter(\':checked\').val() === \"\") {\r\n $(\'#cr" +
|
||||
"eateJob_TaskTimeOtherMinutesContainer\').show();\r\n $quickLogTa" +
|
||||
"skTimeOtherMinutes.attr(\'disabled\', null).focus().select();\r\n } e" +
|
||||
"lse {\r\n $(\'#createJob_TaskTimeOtherMinutesContainer\').hide();" +
|
||||
"\r\n $quickLogTaskTimeOtherMinutes.attr(\'disabled\', \'disabled\')" +
|
||||
";\r\n }\r\n });\r\n //#endregion\r\n ");
|
||||
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 307 "..\..\Views\Job\Create.cshtml"
|
||||
#line 320 "..\..\Views\Job\Create.cshtml"
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user