@using EnVisage.Code @using Kendo.Mvc.UI @model EnVisage.Models.ProjectModel @{ ViewBag.Title = Model.Id != Guid.Empty ? "Edit " + Model.Name : "Add New Project"; var hasActualsAllocations = Model.TeamsUsage != null && Model.TeamsUsage.Any(t => t.Value.HasActualsResourceAllocations); if (Model.HasChildren && !hasActualsAllocations && Model.Parts != null && Model.Parts.Count > 0) { foreach (var part in Model.Parts) { if (part.TeamsUsage != null && part.TeamsUsage.Any(t => t.Value.HasActualsResourceAllocations)) { hasActualsAllocations = true; break; } } } var editProjectSessionKey = Guid.NewGuid(); } @section stylesheets { @Styles.Render(String.Format("{0}/{1}", Constants.C_BUNDLE_STYLES_KENDO_PATH, "kendo-commonstyles")) @Styles.Render(String.Format("{0}/{1}", Constants.C_BUNDLE_STYLES_BASE_PATH, "prevu-projecteditstyles")) } @section Scripts { @Scripts.Render(String.Format("{0}/{1}", Constants.C_BUNDLE_SCRIPTS_BASE_PATH, "flot-scripts")) @Scripts.Render(String.Format("{0}/{1}", Constants.C_BUNDLE_SCRIPTS_BASE_PATH, "kendo-grid")) @Scripts.Render(String.Format("{0}/{1}", Constants.C_BUNDLE_SCRIPTS_BASE_PATH, "prevu-angularservices")) @Scripts.Render(String.Format("{0}/{1}", Constants.C_BUNDLE_SCRIPTS_BASE_PATH, "prevu-scenariodetails")) @Scripts.Render(String.Format("{0}/{1}", Constants.C_BUNDLE_SCRIPTS_BASE_PATH, "prevu-projecteditpage")) }
@using (Html.BeginForm("Edit", "Project", FormMethod.Post, new { @class = "form-horizontal", id = "frmEditProject" })) {
@Html.AntiForgeryToken() @Html.HiddenFor(model => model.Id) @Html.HiddenFor(model => model.PartForScenarioId) @Html.HiddenFor(model => model.SaveAsCopy) @Html.HiddenFor(model => model.ContinueToScenarios) @Html.HiddenFor(model => model.PartsCount) @Html.HiddenFor(model => model.InitialHasChildrenState)
General Project Information
@Html.LabelFor(model => model.Name, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Name, new { @class = "form-control input-required", id = "IDDDD" }) @Html.ValidationMessageFor(model => model.Name)
@Html.LabelFor(model => model.Number, new { @class = "control-label text-normal text-italic" }) @Html.TextBoxFor(model => model.Number, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Number)
@Html.LabelFor(model => model.Color, new { @class = "control-label text-normal text-italic" }) @Html.TextBoxFor(model => model.Color, new { @class = "form-control", @id = "input-color" }) @Html.ValidationMessageFor(model => model.Color)
@Html.LabelFor(model => model.CompanyId, new { @class = "control-label" }) @Html.DropDownListFor(model => model.CompanyId, Utils.GetAllCompanies(true), new { @class = "form-control forselect2 input-required" }) @Html.ValidationMessageFor(model => model.CompanyId)
@Html.LabelFor(model => model.HasChildren, new { @class = "control-label text-normal text-italic" }) @Html.CheckBoxFor(model => model.HasChildren, new { @class = "switcher form-control" }) @Html.ValidationMessageFor(model => model.HasChildren)
@if (Model.ShowProjectDates) {
@Html.TextBoxFor(model => model.ProjectMinStartDate, new { @class = "form-control", disabled = "disabled" })
To
@Html.TextBoxFor(model => model.ProjectMaxEndDate, new { @class = "form-control", disabled = "disabled" })
}
Project Details @Html.EditorFor(t => t.Parts)
@{ if (Model.UserDefinedFields == null) { Model.UserDefinedFields = new List(); } } @if (Model.UserDefinedFields.Count > 0) {
User Defined Fields
@Html.EditorFor(t => t.UserDefinedFields)
} @Html.ValidationSummary(false, "The project could not be saved due to the following errors:") @if (Model == null || Model.Id == Guid.Empty) {
Please note! System will automatically give you and all contributors of teams selected the Full Access permissions for this project. Other permissions need to be manually set up through Administration.
}
}
@if (SecurityManager.CheckSecurityObjectPermission(Areas.Scenarios, AccessLevel.Write)) { if (!Model.HasChildren) {
Compare Add Scenario

} }
@if (Model.HasChildren) { foreach (EnVisage.Models.ProjectPartModel pm in Model.Parts) { List partScenarios = new List(); if (Model.Scenarios != null) { partScenarios = Model.Scenarios.Where(s => s.Type != ScenarioType.Actuals && s.ProjectId == pm.Id).OrderByDescending(s => s.Status).ThenBy(s => s.Name).ToList(); } if (partScenarios.Count > 0) { foreach (var scenario in partScenarios) { @ScenarioRow(scenario, pm.Id) } } } } else if (Model.Scenarios != null) { foreach (var scenario in Model.Scenarios.OrderByDescending(s => s.Status).ThenBy(s => s.Name)) { if (scenario.Type != ScenarioType.Actuals) { @ScenarioRow(scenario, Model.Id) } } }
Status Name Projected Revenue Expected Gross Margin Calculated Gross Margin Start Date End Date
@if (SecurityManager.CheckSecurityObjectPermission(Areas.Scenarios, AccessLevel.Write)) { Compare Add Scenario@Html.Raw("  "); } @pm.Name
@if (Model.HasChildren) {
@Html.Partial("../Scenarios/_masterScenarioCalendar", Model.Id) }
Add Note

@if (Model.Notes.Count == 0) { } else { foreach (var note in Model.Notes) { } }
Date Author Title Details
There are no notes for this project
@((note.DateAdded == null) ? "N/A" : note.DateAdded.ToString("d")) @(note.Author != null ? note.Author.UserName : String.Empty) @note.Title @(!string.IsNullOrEmpty(note.Details) ? (note.Details.Length < 200 ? note.Details : note.Details.Substring(0, 197) + "...") : "") Edit Delete
@helper ScenarioRow(EnVisage.Models.ScenarioTabModel scenario, Guid projectId) { var projectUrl = Url.Action("Edit", "Project", new { id = Model.Id }); var scenarioUrl = Url.Action("Details", "Scenarios", new { id = scenario.Id }); var scenarioHref = scenarioUrl + "?backUrl=" + Url.Encode(projectUrl) + "&backName=project"; var scenarioToggleStatusModel = new { scenarioId = scenario.Id, projectId = scenario.ProjectId, startDate = scenario.StartDate.HasValue ? scenario.StartDate.Value.ToShortDateString() : null, endDate = scenario.EndDate.HasValue ? scenario.EndDate.Value.ToShortDateString() : null, }; var actButtonClass = ""; var actButtonTitle = ""; var actButtonIconClass = ""; if (scenario.Status.HasValue) { if (scenario.Status.Value == ScenarioStatus.Active) { actButtonClass = "btn-warning"; actButtonTitle = "Deactivate"; actButtonIconClass = "fa-times-circle-o"; } else { actButtonClass = "btn-primary"; actButtonTitle = "Activate"; actButtonIconClass = "fa fa-check-circle-o"; } } var isProtfolio = scenario.Type == ScenarioType.Portfolio; var isDraft = scenario.Status == ScenarioStatus.Draft; var isStarted = scenario.StartDate.HasValue && scenario.StartDate > DateTime.Today; var isComparable = isProtfolio && isStarted && !isDraft; var disabled = isComparable ? "" : "disabled"; var comparable = isComparable ? "comparable" : ""; var chkCompareTitle = ""; if (isDraft) { chkCompareTitle = "Not able to compare draft scenarios."; } else if (!isStarted) { chkCompareTitle = "Not able to compare scenarios with a Start Date in the past."; } @scenario.Status @scenario.Name @(scenario.ProjectedRevenue.HasValue ? scenario.ProjectedRevenue.Value.ToString("#") : string.Empty) @(scenario.ExpectedGrossMargin.HasValue ? scenario.ExpectedGrossMargin.Value.ToString("p") : string.Empty) @(scenario.CalculatedGrossMargin.HasValue ? scenario.CalculatedGrossMargin.Value.ToString("p") : string.Empty) @(scenario.StartDate.HasValue ? scenario.StartDate.Value.ToShortDateString() : string.Empty) @(scenario.EndDate.HasValue ? scenario.EndDate.Value.ToShortDateString() : string.Empty) Delete }