0853bcee50
completes #150
687 lines
23 KiB
C#
687 lines
23 KiB
C#
#pragma warning disable 1591
|
|
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// This code was generated by a tool.
|
|
// Runtime Version:4.0.30319.42000
|
|
//
|
|
// Changes to this file may cause incorrect behavior and will be lost if
|
|
// the code is regenerated.
|
|
// </auto-generated>
|
|
//------------------------------------------------------------------------------
|
|
|
|
namespace Disco.Web.Areas.Config.Views.JobPreferences.Parts
|
|
{
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Net;
|
|
using System.Text;
|
|
using System.Web;
|
|
using System.Web.Helpers;
|
|
using System.Web.Mvc;
|
|
using System.Web.Mvc.Ajax;
|
|
using System.Web.Mvc.Html;
|
|
using System.Web.Routing;
|
|
using System.Web.Security;
|
|
using System.Web.UI;
|
|
using System.Web.WebPages;
|
|
using Disco;
|
|
using Disco.Models.Repository;
|
|
using Disco.Services;
|
|
using Disco.Services.Authorization;
|
|
using Disco.Services.Web;
|
|
using Disco.Web;
|
|
using Disco.Web.Extensions;
|
|
|
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
|
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/JobPreferences/Parts/General.cshtml")]
|
|
public partial class General : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.JobPreferences.IndexModel>
|
|
{
|
|
public General()
|
|
{
|
|
}
|
|
public override void Execute()
|
|
{
|
|
|
|
#line 2 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
|
|
Authorization.Require(Claims.Config.JobPreferences.Show);
|
|
|
|
var canConfig = Authorization.Has(Claims.Config.JobPreferences.Configure);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n<div");
|
|
|
|
WriteLiteral(" id=\"Config_JobPref_General\"");
|
|
|
|
WriteLiteral(" class=\"form\"");
|
|
|
|
WriteLiteral(" style=\"width: 530px;\"");
|
|
|
|
WriteLiteral(">\r\n <h2>General Preferences</h2>\r\n <table>\r\n <tr>\r\n <td");
|
|
|
|
WriteLiteral(" colspan=\"2\"");
|
|
|
|
WriteLiteral(">\r\n <div>Initial Comments Template:</div>\r\n");
|
|
|
|
|
|
#line 13 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 13 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
if (canConfig)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 15 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
Write(Html.EditorFor(model => model.InitialCommentsTemplate));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 15 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 16 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
Write(AjaxHelpers.AjaxRemove());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 16 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 17 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
Write(AjaxHelpers.AjaxSave());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 17 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 18 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
Write(AjaxHelpers.AjaxLoader());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 18 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(@">
|
|
$(function () {
|
|
var field = $('#InitialCommentsTemplate');
|
|
var fieldRemove = field.next('.ajaxRemove');
|
|
var fieldOriginalWidth, fieldOriginalHeight;
|
|
|
|
document.DiscoFunctions.PropertyChangeHelper(
|
|
field,
|
|
'None',
|
|
'");
|
|
|
|
|
|
#line 28 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
Write(Url.Action(MVC.API.JobPreferences.UpdateInitialCommentsTemplate()));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(@"',
|
|
'initialCommentsTemplate'
|
|
);
|
|
|
|
field.change(function () {
|
|
if (!!field.val()) {
|
|
fieldRemove.show();
|
|
} else {
|
|
fieldRemove.hide();
|
|
}
|
|
}).attr('placeholder', 'None');
|
|
|
|
fieldRemove.click(function () {
|
|
field.val('').trigger('change');
|
|
});
|
|
|
|
if (!!field.val()) {
|
|
fieldRemove.show();
|
|
} else {
|
|
fieldRemove.hide();
|
|
}
|
|
});
|
|
</script>
|
|
");
|
|
|
|
|
|
#line 51 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
}
|
|
else
|
|
{
|
|
if (string.IsNullOrWhiteSpace(Model.InitialCommentsTemplate))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral("><None Specified></span>\r\n");
|
|
|
|
|
|
#line 57 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" class=\"code\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 61 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
Write(Model.InitialCommentsTemplate);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </div>\r\n");
|
|
|
|
|
|
#line 63 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
}
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" class=\"info-box\"");
|
|
|
|
WriteLiteral(">\r\n <p");
|
|
|
|
WriteLiteral(" class=\"fa-p\"");
|
|
|
|
WriteLiteral(">\r\n <i");
|
|
|
|
WriteLiteral(" class=\"fa fa-fw fa-info-circle\"");
|
|
|
|
WriteLiteral("></i>This template is added to the Comments box shown when creating a job. Expres" +
|
|
"sions can be included. Add expressions inside curly braces, for example:\r\n " +
|
|
" <div");
|
|
|
|
WriteLiteral(" class=\"code\"");
|
|
|
|
WriteLiteral(@">Justification for {#JobType}: </div>
|
|
</p>
|
|
<p>
|
|
The following additional variables are available:
|
|
<ul>
|
|
<li><code>#TechUser</code>: The user creating the job</li>
|
|
<li><code>#User</code>: The user linked to the job (or <code>null</code> if no user is associated)</li>
|
|
<li><code>#Device</code>: The user linked to the job (or <code>null</code> if no user is associated)</li>
|
|
<li><code>#JobType</code>: The selected job type (for example 'Hardware - Warranty')</li>
|
|
<li><code>#JobSubTypes</code>: A list of selected job sub-types (for example ['Motherboard', 'Screen'])</li>
|
|
</ul>
|
|
</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th");
|
|
|
|
WriteLiteral(" style=\"width: 140px\"");
|
|
|
|
WriteLiteral(">\r\n Long Running Threshold:\r\n </th>\r\n <td>\r\n" +
|
|
"");
|
|
|
|
|
|
#line 88 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 88 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
if (canConfig)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 90 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
Write(Html.DropDownListFor(model => model.LongRunningJobDaysThreshold, Model.LongRunningJobDaysThresholdOptions().Select(o => new SelectListItem() { Value = o.Key.ToString(), Text = o.Value })));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 90 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 91 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
Write(AjaxHelpers.AjaxSave());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 91 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 92 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
Write(AjaxHelpers.AjaxLoader());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 92 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(">\r\n $(function () {\r\n document.DiscoFun" +
|
|
"ctions.PropertyChangeHelper(\r\n $(\'#LongRunningJobDays" +
|
|
"Threshold\'),\r\n null,\r\n \'");
|
|
|
|
|
|
#line 98 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
Write(Url.Action(MVC.API.JobPreferences.UpdateLongRunningJobDaysThreshold()));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\',\r\n \'LongRunningJobDaysThreshold\');\r\n " +
|
|
" });\r\n </script>\r\n");
|
|
|
|
|
|
#line 102 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 105 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
Write(Model.LongRunningJobDaysThresholdOptions().First(o => o.Key == Model.LongRunningJobDaysThreshold).Value);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 105 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral(">\r\n Jobs which have been open for longer than the threshold ar" +
|
|
"e considered \'long-running\' and will appear in the <code>Long Running Jobs</code" +
|
|
"> list.\r\n </div>\r\n");
|
|
|
|
|
|
#line 110 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 110 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
if (Authorization.Has(Claims.Job.Lists.LongRunningJobs))
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 111 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
Write(Html.ActionLinkSmallButton("Show Long Running Jobs", MVC.Job.LongRunning()));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 111 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
|
|
" Stale Threshold:\r\n </th>\r\n <td>\r\n");
|
|
|
|
|
|
#line 119 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 119 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
if (canConfig)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 121 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
Write(Html.DropDownListFor(model => model.StaleJobMinutesThreshold, Model.StaleJobMinutesThresholdOptions().Select(o => new SelectListItem() { Value = o.Key.ToString(), Text = o.Value })));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 121 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 122 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
Write(AjaxHelpers.AjaxSave());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 122 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 123 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
Write(AjaxHelpers.AjaxLoader());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 123 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(">\r\n $(function () {\r\n document.DiscoFun" +
|
|
"ctions.PropertyChangeHelper(\r\n $(\'#StaleJobMinutesThr" +
|
|
"eshold\'),\r\n null,\r\n \'");
|
|
|
|
|
|
#line 129 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
Write(Url.Action(MVC.API.JobPreferences.UpdateStaleJobMinutesThreshold()));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\',\r\n \'StaleJobMinutesThreshold\');\r\n " +
|
|
" });\r\n </script>\r\n");
|
|
|
|
|
|
#line 133 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 136 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
Write(Model.StaleJobMinutesThresholdOptions().First(o => o.Key == Model.StaleJobMinutesThreshold).Value);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 136 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral(">\r\n Jobs which have no recoded action for longer than the thre" +
|
|
"shold are considered \'stale\' and will appear in the <code>Stale Jobs</code> list" +
|
|
".\r\n </div>\r\n");
|
|
|
|
|
|
#line 141 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 141 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
if (Authorization.Has(Claims.Job.Lists.LongRunningJobs))
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 142 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
Write(Html.ActionLinkSmallButton("Show Stale Jobs", MVC.Job.Stale()));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 142 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
|
|
" Lodgment:\r\n </th>\r\n <td>\r\n");
|
|
|
|
|
|
#line 150 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 150 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
if (canConfig)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 152 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
Write(Html.CheckBoxFor(model => model.LodgmentIncludeAllAttachmentsByDefault));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 152 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <label");
|
|
|
|
WriteLiteral(" for=\"LodgmentIncludeAllAttachmentsByDefault\"");
|
|
|
|
WriteLiteral(">Include All Attachments by Default</label>\r\n");
|
|
|
|
|
|
#line 154 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 154 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
Write(AjaxHelpers.AjaxSave());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 154 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 155 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
Write(AjaxHelpers.AjaxLoader());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 155 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" class=\"info-box\"");
|
|
|
|
WriteLiteral(">\r\n <p");
|
|
|
|
WriteLiteral(" class=\"fa-p\"");
|
|
|
|
WriteLiteral(">\r\n <i");
|
|
|
|
WriteLiteral(" class=\"fa fa-info-circle\"");
|
|
|
|
WriteLiteral("></i>If enabled, all attachments will be selected by default when lodging a job.\r" +
|
|
"\n </p>\r\n </div>\r\n");
|
|
|
|
WriteLiteral(" <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(">\r\n $(function () {\r\n document.DiscoFunctions.PropertyC" +
|
|
"hangeHelper(\r\n $(\'#LodgmentIncludeAllAttachmentsByDefault\'),\r" +
|
|
"\n null,\r\n \'");
|
|
|
|
|
|
#line 166 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
Write(Url.Action(MVC.API.JobPreferences.UpdateLodgmentIncludeAllAttachmentsByDefault()));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\',\r\n \'includeAllAttachmentsByDefault\');\r\n });\r\n " +
|
|
" </script>\r\n");
|
|
|
|
|
|
#line 170 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span>\r\n");
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 174 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
Write(Model.LodgmentIncludeAllAttachmentsByDefault ? "Yes" : "No");
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </span>\r\n");
|
|
|
|
|
|
#line 176 "..\..\Areas\Config\Views\JobPreferences\Parts\General.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n </tr>\r\n </table>\r\n</div>");
|
|
|
|
}
|
|
}
|
|
}
|
|
#pragma warning restore 1591
|