Просмотр исходного кода

Remove hardcoded company elements

Alan Lam 7 лет назад
Родитель
Сommit
014493f74a

+ 3 - 0
config.template.php

@@ -2,11 +2,14 @@
 
 define("SESSION_NAME", "name");
 define("APP_NAME", "name");
+define("COMPANY_NAME", "Check Policy Limited");
+define("COMPANY_NUMBER", "09506865");
 
 define("LOCALE", "en_GB");
 
 define("ADDRESS", "Check Policy Limited\n8 Market Street, Liskeard\nCornwall, PL14 3JJ");
 define("PHONE", "07841 353775");
+define("FACEBOOK", "https://www.facebook.com/checkpolicy");
 define("WHATSAPP", "447841353775");
 
 define("INVOICE_BANK_NAME", "Bank");

+ 2 - 2
controllers/reports_presentation.php

@@ -13,8 +13,8 @@ $presentation = new PhpPresentation(); // 960x720
 $slide = $presentation->getActiveSlide();
 
 $shape = $slide->createDrawingShape();
-$shape->setName("Check Policy logo")
-	  ->setDescription("Check Policy logo")
+$shape->setName(APP_NAME . " logo")
+	  ->setDescription(APP_NAME . " logo")
 	  ->setPath("./public/img/logo.png")
 	  ->setWidth(200)
 	  ->setOffsetX(380)

+ 1 - 6
controllers/test_invoice.php

@@ -62,12 +62,7 @@ $address_parts = array_filter([
 	$address->postal_code,
 ]);
 
-$bill_to_address_parts = [
-	"8 Market Street",
-	"Liskeard",
-	"Cornwall",
-	"PL14 3JJ",
-];
+$bill_to_address_parts = explode("\n", ADDRESS);
 
 list($date_start, $time_start) = explode(" ", $test->dts_start);
 list($date_end, $time_end) = explode(" ", $test->dts_end);

+ 3 - 3
controllers/test_pdf.php

@@ -179,9 +179,9 @@ ob_start()
 			<br />
 			<table width="100%">
 				<tr>
-					<td width="33%"><strong>Check Policy Limited</strong></td>
-					<td width="33%" align="middle">8 Market Street, Liskeard, Cornwall, PL14 3JJ</td>
-					<td width="33%" align="right">Company Number: 09506865</td>
+					<td width="33%"><strong><?=htmlspecialchars(COMPANY_NAME)?></strong></td>
+					<td width="33%" align="middle"><?=htmlspecialchars(ADDRESS)?></td>
+					<td width="33%" align="right">Company Number: <?=htmlspecialchars(COMPANY_NUMBER)?></td>
 				</tr>
 			</table>
 		</htmlpagefooter>

+ 20 - 6
engine/email_builder.php

@@ -6,6 +6,7 @@ class EmailBuilder {
 
 	public function __construct() {
 
+		$app_name = APP_NAME;
 		$protocol = PROTOCOL;
 		$domain = DOMAIN;
 
@@ -14,7 +15,7 @@ class EmailBuilder {
 <html xmlns="http://www.w3.org/1999/xhtml">
 	<head>
 		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-		<title>Check Policy</title>
+		<title>{$app_name}</title>
 		<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
 	</head>
 	<body>
@@ -25,7 +26,7 @@ class EmailBuilder {
 						<tr>
 							<td align="center" style="padding: 40px 0 40px 0; border-bottom: 1px solid #cccccc;">
 								<a href="{$protocol}://{$domain}">
-									<img src="../public/img/logo.png" width="386" height="80" style="display: block;" alt="Check Policy logo" />
+									<img src="../public/img/logo.png" width="386" height="80" style="display: block;" alt="{$app_name} logo" />
 								</a>
 							</td>
 						</tr>
@@ -85,10 +86,23 @@ EOD;
 
 	public function build() {
 
+		$facebook = "";
+		if(FACEBOOK) {
+			$facebook = '<a href="' . FACEBOOK . '" style="color: #ffffff;"><font color="#ffffff">Facebook</font></a><br />';
+		}
+
+		$whatsapp = "";
+		if(WHATSAPP) {
+			$whatsapp = '<a href="https://api.whatsapp.com/send?phone=' . WHATSAPP . '" style="color: #ffffff;"><font color="#ffffff">WhatsApp</font></a><br />';
+		}
+
+		$app_name = APP_NAME;
+		$year = date("Y");
+
 		$this->parts[] = <<<EOD
 									<tr>
 										<td style="font-family: Arial, sans-serif;">
-											Check Policy Team
+										{$app_name} Team
 										</td>
 									</tr>
 								</table>
@@ -99,11 +113,11 @@ EOD;
 								<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
 									<tr>
 										<td style="font-family: Arial, sans-serif;">
-											<b><font color="#ffffff">&copy; Check Policy 2018</font></b>
+											<b><font color="#ffffff">&copy; {$app_name} {$year}</font></b>
 										</td>
 										<td align="right" style="font-family: Arial, sans-serif;">
-											<a href="https://www.facebook.com/checkpolicy" style="color: #ffffff;"><font color="#ffffff">Facebook</font></a><br />
-											<a href="https://api.whatsapp.com/send?phone=447841353775" style="color: #ffffff;"><font color="#ffffff">WhatsApp</font></a>
+											{$facebook}
+											{$whatsapp}
 										</td>
 									</tr>
 								</table>

+ 1 - 1
engine/test.php

@@ -216,7 +216,7 @@ class Test extends Model {
 		$mail = new Email;
 		$mail->setHtmlContent($content);
 		$mail->setFrom(EMAIL_NO_REPLY, EMAIL_FROM_NAME);
-		$mail->addAddress(EMAIL_CONTACT, "Check Policy Contact");
+		$mail->addAddress(EMAIL_CONTACT, APP_NAME . " Contact");
 		$mail->setSubject("Test declined: $project->name / $location->name");
 		$mail->send();
 	}

+ 1 - 1
views/header.php

@@ -28,7 +28,7 @@ if($print) $body_class = "print";
 		<meta property="og:description" content="<?=htmlspecialchars(__("Age Verification Testing and Training across the UK"))?>" />
 		<meta property="og:type" content="website" />
 		<meta property="og:image" content="<?=PROTOCOL?>://<?=DOMAIN?>/img/logo.png" />
-		<meta property="og:image:alt" content="Check Policy logo" />
+		<meta property="og:image:alt" content="<?=htmlspecialchars(APP_NAME)?> logo" />
 		<meta property="og:url" content="<?=PROTOCOL?>://<?=DOMAIN?><?=htmlspecialchars($_SERVER["REQUEST_URI"])?>" />
 
 		<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" rel="stylesheet" />

+ 1 - 1
views/home.php

@@ -42,7 +42,7 @@
 	<div class="py-4">
 
 		<div class="text-lg-center">
-			<h2><?=htmlspecialchars(__("What else can Check Policy do for you?"))?></h2>
+			<h2><?=htmlspecialchars(__("What else can %s do for you?", APP_NAME))?></h2>
 		</div>
 
 		<div class="row">

+ 2 - 2
views/modal_services_1.php

@@ -14,12 +14,12 @@
 
 					<p><?=htmlspecialchars(__("If you are selling age-related products or services such as cigarettes, alcohol and gambling. Then it is advisable to be tested independently to ensure you are able to identify and refuse persons wishing to purchase your services. Again this sounds very easy, to ask someones age and verify it, but in reality it's quite an issue."))?></p>
 
-					<p><?=htmlspecialchars(__("A simple check by one of Check Policy's mystery shoppers will determine whether you and your staff are adhering to guidelines when serving age-related products."))?></p>
+					<p><?=htmlspecialchars(__("A simple check by one of %s's mystery shoppers will determine whether you and your staff are adhering to guidelines when serving age-related products.", APP_NAME))?></p>
 
 					<p><?=htmlspecialchars(__("How it works:"))?><br />
 					<?=htmlspecialchars(__("One of our Shoppers will visit your site and try to purchase an age-related product or service. If they are successful and not asked any questions to verify their age you will fail. The test report will be sent to you immediately upon completing the test by our automated system; designed to show the full procedure of the test and after you can make a decision to opt for further training if needed."))?></p>
 
-					<p><?=htmlspecialchars(__("Check Policy is here to help and guide you along the way."))?></p>
+					<p><?=htmlspecialchars(__("%s is here to help and guide you along the way.", APP_NAME))?></p>
 				</div>
 			</form>
 		</div>

+ 1 - 1
views/modal_services_3.php

@@ -14,7 +14,7 @@
 
 					<p><?=htmlspecialchars(__("Unlike our other tests which are quite specific, this service is tailored to suit your business. We were approached by several clients to test their premises for various company policy related issues such as attire, attitude and so on."))?></p>
 
-					<p><?=htmlspecialchars(__("First impressions count, so if your staff aren't presenting the \"Face of the Company\" correctly, you may lose that client and all the possible benefits with it. A simple test by Check Policy will help you train your staff accordingly and keep them sharp with company policy."))?></p>
+					<p><?=htmlspecialchars(__("First impressions count, so if your staff aren't presenting the \"Face of the Company\" correctly, you may lose that client and all the possible benefits with it. A simple test by %s will help you train your staff accordingly and keep them sharp with company policy.", APP_NAME))?></p>
 				</div>
 			</form>
 		</div>

+ 1 - 1
views/privacy_policy.php

@@ -1,7 +1,7 @@
 <div class="container mt-3 py-4">
 	<h2>What is this Privacy Policy for?</h2>
 
-	<p>This privacy policy is for this website and served by Check Policy Limited and governs the privacy of its users who choose to use it.</p>
+	<p>This privacy policy is for this website and served by <?=htmlspecialchars(COMPANY_NAME)?> and governs the privacy of its users who choose to use it.</p>
 
 	<p>The policy sets out the different areas where user privacy is concerned and outlines the obligations & requirements of the users, the website and website owners. Furthermore the way this website processes, stores and protects user data and information will also be detailed within this policy.</p>
 

+ 1 - 1
views/services.php

@@ -1,6 +1,6 @@
 <div class="container mt-3 py-4">
 
-	<h2><?=htmlspecialchars(__("Check Policy Services"))?></h2>
+	<h2><?=htmlspecialchars(__("%s Services", APP_NAME))?></h2>
 
 	<div class="row">
 		<div class="col-md-4 mb-3 text-center">

+ 4 - 5
views/terms_and_conditions.php

@@ -7,10 +7,9 @@
 			<p>AGREEMENT</p>
 			<ol>
 				<li>
-					<p>In registering with Check Policy Limited, You ("you" or "your") confirm that, by entering
-					into this agreement, Check Policy Limited whose company registration number is
-					09506865 and whose registered office address is 8 Market Street, Liskeard, Cornwall. PL14
-					3JJ ("the Company") has engaged you as a self-employed Approved Tester to provide the
+					<p>In registering with <?=htmlspecialchars(COMPANY_NAME)?>, You ("you" or "your") confirm that, by entering
+					into this agreement, <?=htmlspecialchars(COMPANY_NAME)?> whose company registration number is
+					<?=htmlspecialchars(COMPANY_NUMBER)?> and whose registered office address is <?=htmlspecialchars(ADDRESS)?> ("the Company") has engaged you as a self-employed Approved Tester to provide the
 					Services (defined below).</p>
 				</li>
 			</ol>
@@ -152,7 +151,7 @@
 					sent to <a href="mailto:legal@check-policy.com">legal@check-policy.com</a>.</p>
 				</li>
 				<li>
-					<p>In the event that any aspect of the Assignment is found to be fraudulent, Check Policy reserves
+					<p>In the event that any aspect of the Assignment is found to be fraudulent, the Company reserves
 					the right to terminate this agreement with immediate effect and withhold any payments due.
 					Furthermore, your details may be disclosed to our Client for the purpose of investigating
 					allegations.</p>