<%@ LANGUAGE="JSCRIPT" %><% // // 23-Dec-08 rbd New DB caching hack // 18-Feb-09 rbd Remomve priority note, normalization may be individual or all) // 09-Jun-09 rbd (3.0 HF1) - Fix Must Run Before field. // 05-Oct-09 rbd (3.1) - Example dates in 2010 // 28-Nov-10 rbd 3.3 GEM:398 Protect against apostrophes in status and fail messages // by double-quoting them in form ASP code. // 20-Jan-11 rbd GEM:571 - Set our parent iframe's height. // 22-Jan-10 rbd GEM:571 - Do this when receiving POST responses as well. // Make IE fudge distance a manifest constant. Increase IE // fudge to 18. Add manifest constant for extra display dist. // 06-Feb-12 rbd GEM:296 - Enhance for creating new Plans. // 31-Oct-12 rbd Fix displayed numbers and counts for GEM:296. // No GEM (found testing ACP 7) // 22-Jan-14 rbd GEM:1083 No more DBRelay hack :-) Also get UserPriorities // from new ACP Scheduler object. // 15-Nov-14 rbd GEM:342 (not committed until 15-Dec-14) for Pause/Resume // 16-Dec-14 rbd GEM:1055 Add Duplicate Plan button and logic for duplicating Plans // 17-Dec-14 rbd GEM:342 Do not change Project icon when disabling Plan // 24-Jan-15 rbd GEM:1055 Improvements in ide/Show when running/not // 30-Jan-15 rbd GEM:1184 Accept , as decimal point. Numeric strings have // already been validated at POST time. // 17-Jan-19 rbd GEM:1660 Modern DOCTYPE and HTML declarations // 18-Jan-19 rbd GEM:1663 Modernize alerting with SweetAlert. // 19-Jan-19 rbd GEM:1664 Fix validation, needed an additional call on chained validations. // 07-Feb-18 rbd GEM:1766 Change usage of => to equivalent function() syntax for IE11 // 10-Sep-19 rbd GEM:1724 Extend validation to 2040. // 13-Jul-23 rbd GEM:1909 Make more responsive to changes in Fixed Time checkbox. var DB = Scheduler.Database; var formid = Request.Form("id").Item; // Both GET and POST have (at least) &id= var P; var newPlan = "no"; if(formid.substr(0, 3) == "NPL") { // If new, NPRnnnn where nnnn is PROJECT ID newPlan = "yes"; P = DB.AddNewPlan(formid.substr(3)); P.Name = "New Plan " + P.ID; P.Update(false); } else { P = DB.Plan(formid); } var _fxt = P.RunAtTime; Response.ExpiresAbsolute = new Date("Jan 1, 2000").getVarDate(); // Expire even with clocdk offsets Response.AddHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0"); if(Request.ServerVariables("REQUEST_METHOD").toLowerCase() != "post") { // === GET === %> Plan


Status:

Plan Name:
Description:
Priority: disabled <% } %> onblur="vn(this) && vnb(this);" onchange="vrs(this);"/>  runtime
Monitor Interval disabled <% } %> onblur="vn(this) && vnb(this);" onchange="vrs(this);" />  runtime
<% if(P.ObservationCount > 1 || P.FirstObservationSetCount > 1) { %>
Best Efforts: checked<% } %> size="20" /> Plan will run until an Observation fails a constraint.
<% } %>
runtime (Example: Feb 20, 2019 03:00:00 UTC)
runtime runtime
Fixed Time: Overrides dispatcher (use with caution)


 Resubmit  Disable     Delete  Duplicate     Save Changes

<% } else { // === POST === try { DB.BeginTransaction(); // Preserve database integrity! switch(Request.Form("op").Item.toLowerCase()) { case "del": DB.DeletePlan(P); Response.Write("Plan successfully deleted"); break; case "dis": // Disable Plan P.Disable(); Response.Write("Plan successfully disabled"); // [WARN] "disabled" used in rUpdateTree() above break; case "dup": // Duplicate Plan var NP = P.Duplicate(); Response.Write("<" + NP.ID + "><" + NP.Name + ">You should not see this"); // Feed new Plan ID & Name back to form for completion break; case "res": P.Resubmit(); P.Project.Disabled = false; // In case project disabled, now enabled it Response.Write("Plan successfully resubmitted"); break; case "upd": P.Name = Request.Form("pName").Item; P.Description = Request.Form("pDesc").Item; // If fixed time, priority and monitor are disabled in the form // and therefore will not be included in the formdata! if(Request.Form("pFixed")) { P.BasePriority = 0; P.MonitorInterval = 0; } else { P.BasePriority = Request.Form("pPrio").Item.replace(",","."); P.MonitorInterval = Request.Form("pMonInt").Item.replace(",","."); } P.BestEfforts = (Request.Form("pBest") ? true : false); if(Request.Form("pRunAfter").Item !== "") { P.Earliest = new Date(Request.Form("pRunAfter").Item.replace(/\s*UTC/, "")).getVarDate(); P.EarliestValid = true; } else { P.EarliestValid = false; } if(Request.Form("pRunBefore").Item !== "") { P.Latest = new Date(Request.Form("pRunBefore").Item.replace(/\s*UTC/, "")).getVarDate(); P.LatestValid = true; } else { P.LatestValid = false; } P.RunAtTime = (Request.Form("pFixed") ? true : false); P.Update(false); Response.Write("Plan successfully updated"); break; default: break; } DB.CommitTransaction(); } catch(ex) { DB.RollbackTransaction(); Response.Write("Failed: (" + ex.name + ") " + ex.description); } } %>