Skip to content

Commit

Permalink
add RDP declarations #2997
Browse files Browse the repository at this point in the history
  • Loading branch information
salomon-j committed Oct 5, 2023
1 parent f9efc0c commit c1e43da
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,10 @@ class ProjectController {
model.details.visible = model.details.visible && userHasViewAccess

boolean reportsVisible = config.includesContent(ProgramConfig.ProjectContent.REPORTING) && userHasViewAccess
Map reportingTab = [label: 'Reporting', visible:reportsVisible, type:'tab', template:'projectReporting', reports:project.reports, stopBinding:true, services: config.services, scores:scores, hideDueDate:true, isAdmin:user?.isAdmin, isGrantManager:user?.isCaseManager]
//temp using showMeriPlanComparison flag to identify that it's using the new program, will create a new flag otherwise
String projectReportingTemplate = (showMeriPlanComparison) ? 'rdpProjectReporting' : 'projectReporting'

Map reportingTab = [label: 'Reporting', visible:reportsVisible, type:'tab', template:projectReportingTemplate, reports:project.reports, stopBinding:true, services: config.services, scores:scores, hideDueDate:true, isAdmin:user?.isAdmin, isGrantManager:user?.isCaseManager, isRdpReport:showMeriPlanComparison]
if (reportingTab.visible) {
reportingTab.reportOrder = config?.projectReports?.collect{
[category:it.category, description:it.description, banner:it.banner, rejectionReasonCategoryOptions:it.rejectionReasonCategoryOptions?:[]]}?.unique({it.category}) ?: []
Expand Down
62 changes: 62 additions & 0 deletions grails-app/views/project/_rdpProjectReporting.gsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<div id="generate-report" class="validationEngineContainer">
<g:if test="${user?.isCaseManager || fc.userIsAlaOrFcAdmin()}">
<div data-bind="if:!reportsAreGenerated()" class="required">
<div class="alert alert-info">
Project reports cannot be created until the MERI plan has been approved
</div>
</div>
<div data-bind="if:anyReportData" class="required">
<div class="form-actions" >
<b>Grant manager actions:</b>
<div class="alert alert-info">
Please ensure the project start and end dates match the dates in the work order before pressing the "Generate Project Reports" button
</div>
<form id="reportingTabDatesForm">
<div class="row mb-2">
<div class="col-sm-2">
<label for="startDate">Project start date
<fc:iconHelp title="Start date">Date the project is intended to commence.</fc:iconHelp>
</label>
<div class="input-group input-append">
<fc:datePicker class="form-control form-control-sm" bs4="true" targetField="plannedStartDate.date" id= "startDate" name="startDate" data-validation-engine="validate[required, past[endDate]]"/>
</div>
</div>
<div class="col-sm-2">
<label for="endDate">Project end date
<fc:iconHelp title="End date">Date the project is intended to finish.</fc:iconHelp>
</label>
<div class="input-group input-append">
<fc:datePicker class="form-control form-control-sm" bs4="true" targetField="plannedEndDate.date" id="endDate" name="endDate" data-validation-engine="validate[required, future[startDate]"/>
</div>
</div>
</div>
</form>
<span class="grantManagerActionSpan">
<button type="button" id="generateReports" data-bind="click:generateProjectReports" class="btn btn-sm btn-success"><i class="fa fa-check"></i> Generate Project Reports</button>
</span>
</div>
</div>
</g:if>
<g:elseif test="${fc.userIsSiteAdmin()}">
<div class="alert alert-info">
You must be listed as a Grant Manager in the Project Access section of the Admin tab to create the reports for this project
</div>
</g:elseif>
</div>
<g:render template="/shared/categorizedReporting"></g:render>
<g:render template="/shared/declaration" model="${[declarationType:au.org.ala.merit.SettingPageType.RDP_REPORT_DECLARATION]}"/>


<g:render template="/shared/reportRejectionModal"/>
<script type="text/html" id="adjustment-instructions">
<fc:getSettingContent settingType="${au.org.ala.merit.SettingPageType.REPORT_ADJUSTMENT_INSTRUCTIONS}"/>
</script>

<g:if test="${user?.isCaseManager || fc.userIsAlaOrFcAdmin()}">
<asset:script type="text/javascript">
$(function() {
var config = _.extend(fcConfig, {adjustmentInstructionsSelector:'#adjustment-instructions', datesFormSelector:"#reportingTabDatesForm"});
ko.applyBindings(new GrantManagerReportsViewModel(config), document.getElementById('generate-report'));
});
</asset:script>
</g:if>
1 change: 1 addition & 0 deletions grails-app/views/project/meriPlan/_attachmentFooter.gsp
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
<h4>${heading}</h4>
<p>${attachmentText}</p>
<g:render template="/shared/declaration" model="[divId:'meriSubmissionDeclaration', declarationType:au.org.ala.merit.SettingPageType.RLP_MERI_DECLARATION]"/>
5 changes: 5 additions & 0 deletions grails-app/views/project/meriPlan/_attachmentRdpFooter.gsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<h4>${heading}</h4>
<p>${attachmentText}</p>
<g:render template="/shared/declaration" model="[divId:'meriSubmissionDeclaration', declarationType:au.org.ala.merit.SettingPageType.RDP_MERI_DECLARATION]"/>


Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<h4>${heading}</h4>
<p>${attachmentText}</p>


Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h4>${heading}</h4>
<p>${attachmentText}</p>
2 changes: 2 additions & 0 deletions src/main/groovy/au/org/ala/merit/SettingPageType.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,15 @@ enum SettingPageType {
LOCK_STOLEN_EMAIL_SUBJECT('lockStolenSubject', 'Subject line when someone overrides a lock', 'fielddata.lock.subject'),
LOCK_STOLEN_EMAIL('lockStolenEmail', 'Email content when someone overrides a lock', 'fielddata.lock.body'),
RLP_MERI_DECLARATION('rlpMeriDeclaration', 'Declaration when submitting RLP reports or MERI Plan', 'fielddata.rlp.meri.declaration'),
RDP_MERI_DECLARATION('rdpMeriDeclaration', 'Declaration when submitting RDP reports or MERI Plan', 'fielddata.rdp.meri.declaration'),
RLP_PLAN_SUBMITTED_EMAIL('rlpMeriPlanSubmitted', 'Project plan has been submitted email body text', 'fielddata.rlp.meriPlanSubmitted.emailText'),
RLP_PLAN_APPROVED_EMAIL('rlpMeriPlanApproved', 'Project plan has been approved email body text', 'fielddata.rlp.meriPlanApproved.emailText'),
RLP_PLAN_REJECTED_EMAIL('rlpMeriPlanRejected', 'Project plan has been rejected email body text', 'fielddata.rlp.meriPlanRejected.emailText'),
RLP_PLAN_SUBMITTED_EMAIL_SUBJECT_LINE('rlpMeriPlanSubmittedSubject', 'Subject line for the \'Project plan has been submitted\' email', 'fielddata.rlp.meriPlanSubmitted.emailSubject'),
RLP_PLAN_APPROVED_EMAIL_SUBJECT_LINE('rlpMeriPlanApprovedSubject', 'Subject line for the \'Project plan has been approved\' email', 'fielddata.rlp.meriPlanApproved.emailSubject'),
RLP_PLAN_REJECTED_EMAIL_SUBJECT_LINE('rlpMeriPlanRejectedSubject', 'Subject line for the \'Project plan has been rejected\' email', 'fielddata.rlp.meriPlanRejected.emailSubject'),
RLP_REPORT_DECLARATION('rlpReportDeclaration', 'Declaration when submitting RLP reports or MERI Plan', 'fielddata.rlp.report.declaration'),
RDP_REPORT_DECLARATION('rdpReportDeclaration', 'Declaration when submitting RDP reports or MERI Plan', 'fielddata.rdp.report.declaration'),
RLP_REPORT_SUBMITTED_EMAIL_SUBJECT('rlpReportSubmittedEmailSubject', 'RLP Report submitted email subject line text', 'fielddata.rlp.report.submitted.emailSubject'),
RLP_REPORT_SUBMITTED_EMAIL_BODY('rlpReportSubmittedEmailBody', 'RLP Report submitted email subject body text', 'fielddata.rlp.report.submitted.emailBody'),
RLP_REPORT_APPROVED_EMAIL_SUBJECT('rlpReportApprovedEmailSubject', 'RLP Report approved email subject line text', 'fielddata.rlp.report.approved.emailSubject'),
Expand Down
8 changes: 7 additions & 1 deletion src/main/scripts/releases/3.1/updateNhtProgramConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,13 @@ subProgram.config = {
"model": {
"titleHelpText":"Service and Target measure fields pre-populated through the Project Service/Target Measure/s to address threats field and Monitoring methodology sections"
}

},
{
"template": "attachmentRdpFooter",
"model": {
"heading": "MERI Attachments",
"attachmentText": "Please attach Project logic to your MERI plan using the documents function on the Admin tab. A \"Document type\" of \"Project Logic\" should be selected when uploading the document."
}
}
],
keyThreatCodes: [
Expand Down

0 comments on commit c1e43da

Please sign in to comment.