Преглед на файлове

Add "Email Area Manager" checkbox and update layout

Alan Lam преди 8 години
родител
ревизия
bae3c4f0ad
променени са 2 файла, в които са добавени 24 реда и са изтрити 4 реда
  1. 5 0
      controllers/test.php
  2. 19 4
      views/test_verify_form.php

+ 5 - 0
controllers/test.php

@@ -318,6 +318,7 @@ else if(Core::$user->level >= User::LEVEL_ADMIN) {
 
 				$email_customer = http::value("email_customer");
 				$email_location = http::value("email_location");
+				$email_location_area_manager = http::value("email_location_area_manager");
 
 				if($email_customer && $customer->email_after_test && $customer->email) {
 					$test->sendResultEmail($customer->email);
@@ -327,6 +328,10 @@ else if(Core::$user->level >= User::LEVEL_ADMIN) {
 					$test->sendResultEmail($location->email);
 				}
 
+				if($email_location_area_manager && $customer->email_locations_after_test && $location->area_manager_email) {
+					$test->sendResultEmail($location->area_manager_email);
+				}
+
 				if(EMAIL_TEST_RESULT) {
 					$test->sendResultEmail(EMAIL_TEST_RESULT);
 				}

+ 19 - 4
views/test_verify_form.php

@@ -295,10 +295,11 @@ function render_card_list_group($details) {
 							if($customer->email) {
 								?>
 								<div class="row mb-1">
-									<div class="col-sm offset-sm-4">
+									<div class="col-sm-4">Email Headquarters</div>
+									<div class="col-sm">
 										<div class="form-check">
 											<input class="form-check-input" type="checkbox" name="email_customer" id="email-customer" value="1" <?=Form::checked($customer->email_after_test)?> />
-											<label class="form-check-label" for="email-customer">Email Headquarters (<?=htmlspecialchars($customer->email)?>)</label>
+											<label class="form-check-label" for="email-customer"><?=htmlspecialchars($customer->email)?></label>
 										</div>
 									</div>
 								</div>
@@ -307,10 +308,24 @@ function render_card_list_group($details) {
 							if($location->email) {
 								?>
 								<div class="row mb-1">
-									<div class="col-sm offset-sm-4">
+									<div class="col-sm-4">Email Venue</div>
+									<div class="col-sm">
 										<div class="form-check">
 											<input class="form-check-input" type="checkbox" name="email_location" id="email-location" value="1" <?=Form::checked($customer->email_locations_after_test)?> />
-											<label class="form-check-label" for="email-location">Email Venue (<?=htmlspecialchars($location->email)?>)</label>
+											<label class="form-check-label" for="email-location"><?=htmlspecialchars($location->email)?></label>
+										</div>
+									</div>
+								</div>
+								<?php
+							}
+							if($location->area_manager_email) {
+								?>
+								<div class="row mb-1">
+									<div class="col-sm-4">Email Area Manager</div>
+									<div class="col-sm">
+										<div class="form-check">
+											<input class="form-check-input" type="checkbox" name="email_location_area_manager" id="email-location-area-manager" value="1" <?=Form::checked($customer->email_locations_after_test)?> />
+											<label class="form-check-label" for="email-location-area-manager"><?=htmlspecialchars($location->area_manager_email)?></label>
 										</div>
 									</div>
 								</div>