Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public IActionResult MyStaffList(
);
}
);

var searchSortPaginationOptions = new SearchSortFilterAndPaginateOptions(
new SearchOptions(searchString),
new SortOptions(sortBy, sortDirection),
Expand Down Expand Up @@ -354,8 +354,10 @@ bool signedOff
"Supervisor",
new
{
supervisorDelegateId = supervisorDelegateId, candidateAssessmentId = candidateAssessmentId,
viewMode = "View", resultId = resultId
supervisorDelegateId = supervisorDelegateId,
candidateAssessmentId = candidateAssessmentId,
viewMode = "View",
resultId = resultId
}
);
}
Expand Down Expand Up @@ -450,7 +452,8 @@ List<int> resultChecked
"Supervisor",
new
{
supervisorDelegateId = supervisorDelegateId, candidateAssessmentId = candidateAssessmentId,
supervisorDelegateId = supervisorDelegateId,
candidateAssessmentId = candidateAssessmentId,
viewMode = "Review"
}
);
Expand Down Expand Up @@ -648,11 +651,26 @@ public IActionResult EnrolDelegateSupervisorRole(int supervisorDelegateId)
[HttpPost]
[Route("/Supervisor/Staff/{supervisorDelegateId}/ProfileAssessment/Enrol/SupervisorRole")]
public IActionResult EnrolDelegateSetSupervisorRole(
EnrolDelegateSupervisorRoleViewModel model,
int supervisorDelegateId,
int selfAssessmentSupervisorRoleId
)
{
SessionEnrolOnRoleProfile sessionEnrolOnRoleProfile = TempData.Peek<SessionEnrolOnRoleProfile>();
if (!ModelState.IsValid)
{
ModelState.ClearErrorsForAllFieldsExcept("SelfAssessmentSupervisorRoleId");
var supervisorDelegate =
supervisorService.GetSupervisorDelegateDetailsById(supervisorDelegateId, GetAdminID(), 0);
var roleProfile = supervisorService.GetRoleProfileById((int)sessionEnrolOnRoleProfile.SelfAssessmentID);
var supervisorRoles =
supervisorService.GetSupervisorRolesForSelfAssessment(sessionEnrolOnRoleProfile.SelfAssessmentID.Value);
model.SupervisorDelegateDetail = supervisorDelegate;
model.RoleProfile = roleProfile;
model.SelfAssessmentSupervisorRoles = supervisorRoles;
return View("EnrolDelegateSupervisorRole", model);
}

sessionEnrolOnRoleProfile.SelfAssessmentSupervisorRoleId = selfAssessmentSupervisorRoleId;
TempData.Set(sessionEnrolOnRoleProfile);
return RedirectToAction(
Expand Down Expand Up @@ -713,7 +731,7 @@ public IActionResult EnrolDelegateConfirm(int delegateId, int supervisorDelegate
completeByDate
);
}

TempData.Clear();
return RedirectToAction("DelegateProfileAssessments", new { supervisorDelegateId = supervisorDelegateId });
}

Expand Down Expand Up @@ -797,7 +815,8 @@ SignOffProfileAssessmentViewModel model
"Supervisor",
new
{
supervisorDelegateId = supervisorDelegateId, candidateAssessmentId = candidateAssessmentId,
supervisorDelegateId = supervisorDelegateId,
candidateAssessmentId = candidateAssessmentId,
viewMode = "Review"
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
using DigitalLearningSolutions.Data.Models.Supervisor;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

public class EnrolDelegateSupervisorRoleViewModel
{
public SupervisorDelegateDetail SupervisorDelegateDetail { get; set; }
public RoleProfile RoleProfile { get; set; }
[Required(ErrorMessage = "Please choose a supervisor role")]
public int? SelfAssessmentSupervisorRoleId { get; set; }
public IEnumerable<SelfAssessmentSupervisorRole> SelfAssessmentSupervisorRoles { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,126 +1,126 @@
@using DigitalLearningSolutions.Web.ViewModels.Supervisor;
@model EnrolDelegateOnProfileAssessmentViewModel;
@{
var errorHasOccurred = !ViewData.ModelState.IsValid;
ViewData["Title"] = "Enrol on Profile Assessment";
ViewData["Application"] = "Supervisor";
var errorHasOccurred = !ViewData.ModelState.IsValid;
ViewData["Title"] = "Enrol on Profile Assessment";
ViewData["Application"] = "Supervisor";
}
<link rel="stylesheet" href="@Url.Content("~/css/frameworks/frameworksShared.css")" asp-append-version="true">
<link rel="stylesheet" href="@Url.Content("~/css/shared/searchableElements/searchableElements.css")" asp-append-version="true">
@section NavMenuItems {
<partial name="Shared/_NavMenuItems" />
<partial name="Shared/_NavMenuItems" />
}
@section NavBreadcrumbs {
<nav class="nhsuk-breadcrumb" aria-label="Breadcrumb">
<nav class="nhsuk-breadcrumb" aria-label="Breadcrumb">
<div class="nhsuk-width-container">
<ol class="nhsuk-breadcrumb__list">
<li class="nhsuk-breadcrumb__item"><a class="nhsuk-breadcrumb__link trigger-loader" asp-controller="Supervisor" asp-action="Index">Supervisor</a></li>
<li class="nhsuk-breadcrumb__item"><a class="nhsuk-breadcrumb__link trigger-loader" asp-controller="Supervisor" asp-action="MyStaffList">My Staff</a></li>
<li class="nhsuk-breadcrumb__item">
<a class="nhsuk-breadcrumb__link trigger-loader" asp-controller="Supervisor"
asp-action="DelegateProfileAssessments"
asp-route-supervisorDelegateId="@ViewContext.RouteData.Values["supervisorDelegateId"]">
@Model.SupervisorDelegateDetail.FirstName @Model.SupervisorDelegateDetail.LastName
</a>
</li>
<li class="nhsuk-breadcrumb__item">
Enrol
</li>
</ol>
<ol class="nhsuk-breadcrumb__list">
<li class="nhsuk-breadcrumb__item"><a class="nhsuk-breadcrumb__link trigger-loader" asp-controller="Supervisor" asp-action="Index">Supervisor</a></li>
<li class="nhsuk-breadcrumb__item"><a class="nhsuk-breadcrumb__link trigger-loader" asp-controller="Supervisor" asp-action="MyStaffList">My Staff</a></li>
<li class="nhsuk-breadcrumb__item">
<a class="nhsuk-breadcrumb__link trigger-loader" asp-controller="Supervisor"
asp-action="DelegateProfileAssessments"
asp-route-supervisorDelegateId="@ViewContext.RouteData.Values["supervisorDelegateId"]">
@Model.SupervisorDelegateDetail.FirstName @Model.SupervisorDelegateDetail.LastName
</a>
</li>
<li class="nhsuk-breadcrumb__item">
Enrol
</li>
</ol>
</div>
<p class="nhsuk-breadcrumb__back">
<a class="nhsuk-breadcrumb__backlink" asp-controller="Supervisor"
asp-action="DelegateProfileAssessments"
asp-route-supervisorDelegateId="@ViewContext.RouteData.Values["supervisorDelegateId"]">
Back to @Model.SupervisorDelegateDetail.FirstName @Model.SupervisorDelegateDetail.LastName
</a>
<a class="nhsuk-breadcrumb__backlink" asp-controller="Supervisor"
asp-action="DelegateProfileAssessments"
asp-route-supervisorDelegateId="@ViewContext.RouteData.Values["supervisorDelegateId"]">
Back to @Model.SupervisorDelegateDetail.FirstName @Model.SupervisorDelegateDetail.LastName
</a>
</p>
</nav>
</nav>
}
@if (errorHasOccurred)
{
<vc:error-summary order-of-property-names="@(new[] { nameof(Model.SessionEnrolOnRoleProfile.SelfAssessmentID) })" />
<vc:error-summary order-of-property-names="@(new[] { nameof(Model.SessionEnrolOnRoleProfile.SelfAssessmentID) })" />
}
<details class="nhsuk-details nhsuk-expander">
<summary class="nhsuk-details__summary">
<h1 class="nhsuk-details__summary-text nhsuk-u-margin-bottom-0">
@Model.SupervisorDelegateDetail.FirstName @Model.SupervisorDelegateDetail.LastName
</h1>
</summary>
<div class="nhsuk-details__text">
<partial name="Shared/_StaffDetails" model="Model.SupervisorDelegateDetail" />
</div>
<summary class="nhsuk-details__summary">
<h1 class="nhsuk-details__summary-text nhsuk-u-margin-bottom-0">
@Model.SupervisorDelegateDetail.FirstName @Model.SupervisorDelegateDetail.LastName
</h1>
</summary>
<div class="nhsuk-details__text">
<partial name="Shared/_StaffDetails" model="Model.SupervisorDelegateDetail" />
</div>
</details>
<h2>Enrol on Self Assessment</h2>
@if (Model.RoleProfiles.Any())
{
<h3>Choose a self assessment</h3>
<form method="post">
<table class="nhsuk-table-responsive">
<thead role="rowgroup" class="nhsuk-table__head">
<tr role="row">
<th role="columnheader" class="" scope="col">
Self assessment
</th>
<th role="columnheader" class="" scope="col">
Brand
</th>
<th role="columnheader" class="" scope="col">
Linked to role
</th>
<th role="columnheader" class="" scope="col">
Scope
</th>
</tr>
</thead>
<tbody class="nhsuk-table__body">
@foreach (var roleProfile in Model.RoleProfiles)
{
<tr role="row" class="nhsuk-table__row collaborator-row">
<td role="cell" class="nhsuk-table__cell">
<span class="nhsuk-table-responsive__heading">Self assessment </span>
<div class="nhsuk-radios__item">
<input class="nhsuk-radios__input" id="role-profile-check-@roleProfile.ID" asp-for="SessionEnrolOnRoleProfile.SelfAssessmentID" name="SelfAssessmentID" type="radio" value="@roleProfile.ID">
<label class="nhsuk-label nhsuk-radios__label" for="role-profile-check-@roleProfile.ID">
@roleProfile.RoleProfileName
</label>
</div>
</td>
<td role="cell" class="nhsuk-table__cell">
<span class="nhsuk-table-responsive__heading">Brand </span>
@roleProfile.Brand
</td>
<td role="cell" class="nhsuk-table__cell">
<span class="nhsuk-table-responsive__heading">Linked to role </span>
@(roleProfile.NRPProfessionalGroup != null ? @roleProfile.NRPProfessionalGroup : "None/Generic")
@(roleProfile.NRPSubGroupID != null ? " / " + roleProfile.NRPSubGroup : "")
@(roleProfile.NRPRoleID != null ? " / " + roleProfile.NRPRole : "")
</td>
<td role="cell" class="nhsuk-table__cell">
<span class="nhsuk-table-responsive__heading">Scope </span>
@(roleProfile.National ? "National" : "Local")
</td>
</tr>
}
<h3>Choose a self assessment</h3>
<form method="post">
<table class="nhsuk-table-responsive">
<thead role="rowgroup" class="nhsuk-table__head">
<tr role="row">
<th role="columnheader" class="" scope="col">
Self assessment
</th>
<th role="columnheader" class="" scope="col">
Brand
</th>
<th role="columnheader" class="" scope="col">
Linked to role
</th>
<th role="columnheader" class="" scope="col">
Scope
</th>
</tr>
</thead>
<tbody class="nhsuk-table__body">
@foreach (var roleProfile in Model.RoleProfiles)
{
<tr role="row" class="nhsuk-table__row collaborator-row">
<td role="cell" class="nhsuk-table__cell">
<span class="nhsuk-table-responsive__heading">Self assessment </span>
<div class="nhsuk-radios__item">
<input class="nhsuk-radios__input" id="role-profile-check-@roleProfile.ID" asp-for="SessionEnrolOnRoleProfile.SelfAssessmentID" name="SelfAssessmentID" type="radio" value="@roleProfile.ID">
<label class="nhsuk-label nhsuk-radios__label" for="role-profile-check-@roleProfile.ID">
@roleProfile.RoleProfileName
</label>
</div>
</td>
<td role="cell" class="nhsuk-table__cell">
<span class="nhsuk-table-responsive__heading">Brand </span>
@roleProfile.Brand
</td>
<td role="cell" class="nhsuk-table__cell">
<span class="nhsuk-table-responsive__heading">Linked to role </span>
@(roleProfile.NRPProfessionalGroup != null ? @roleProfile.NRPProfessionalGroup : "None/Generic")
@(roleProfile.NRPSubGroupID != null ? " / " + roleProfile.NRPSubGroup : "")
@(roleProfile.NRPRoleID != null ? " / " + roleProfile.NRPRole : "")
</td>
<td role="cell" class="nhsuk-table__cell">
<span class="nhsuk-table-responsive__heading">Scope </span>
@(roleProfile.National ? "National" : "Local")
</td>
</tr>
}

</tbody>
</table>
<button class="nhsuk-button nhsuk-u-margin-top-5" id="save-button" type="submit">Next</button>
</form>
</tbody>
</table>
<button class="nhsuk-button nhsuk-u-margin-top-5" id="save-button" type="submit">Next</button>
</form>
}
else
{
<h3>No self assessments available</h3>
<p>No self assessments are available for enrolment for this member of staff.</p>
<h3>No self assessments available</h3>
<p>No self assessments are available for enrolment for this member of staff.</p>
}

<div class="nhsuk-back-link">
<a class="nhsuk-back-link__link" asp-controller="Supervisor"
asp-action="DelegateProfileAssessments"
asp-route-supervisorDelegateId="@ViewContext.RouteData.Values["supervisorDelegateId"]">
<svg class="nhsuk-icon nhsuk-icon__chevron-left" focusable='false' xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
<path d="M13.41 12l5.3-5.29a1 1 0 1 0-1.42-1.42L12 10.59l-5.29-5.3a1 1 0 0 0-1.42 1.42l5.3 5.29-5.3 5.29a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l5.29-5.3 5.29 5.3a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42z"></path>
</svg>
Cancel
</a>
<a class="nhsuk-back-link__link" asp-controller="Supervisor"
asp-action="DelegateProfileAssessments"
asp-route-supervisorDelegateId="@ViewContext.RouteData.Values["supervisorDelegateId"]">
<svg class="nhsuk-icon nhsuk-icon__chevron-left" focusable='false' xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
<path d="M13.41 12l5.3-5.29a1 1 0 1 0-1.42-1.42L12 10.59l-5.29-5.3a1 1 0 0 0-1.42 1.42l5.3 5.29-5.3 5.29a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l5.29-5.3 5.29 5.3a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42z"></path>
</svg>
Cancel
</a>
</div>
Loading