فهرست منبع

Fixes some URLs and breadcrumbs.

Alan Lam 8 سال پیش
والد
کامیت
ec4437fdf9
4فایلهای تغییر یافته به همراه8 افزوده شده و 6 حذف شده
  1. 6 3
      controllers/locations.php
  2. 1 1
      controllers/project_add.php
  3. 0 1
      views/project.php
  4. 1 1
      views/projects.php

+ 6 - 3
controllers/locations.php

@@ -1,12 +1,15 @@
 <?php
 
-$page_title = "Locations";
+
+Core::addBreadcrumb("/account", "Account");
+Core::addBreadcrumb("/account/locations", "Locations");
 
 $customer = Customer::getForAdmin();
 if(!$customer) throw new Exception("You do not have permission to access this page.");
 
-Core::addBreadcrumb("/account", "Account");
-Core::addBreadcrumb("/account/locations", $page_title);
+$page_title = "$customer->name";
+
+Core::addBreadcrumb("/account/locations?customer_id=$customer->id", $page_title);
 
 $locations = $customer->getLocations();
 

+ 1 - 1
controllers/project_add.php

@@ -14,7 +14,7 @@ Core::addBreadcrumb("/account/projects/add", $page_title);
 
 // Check templates
 $templates = $customer->getTemplates();
-if(empty($templates)) throw new Exception("A template must exist before a project can be created.");
+if(empty($templates)) throw new Exception("A template must exist for $customer->name before a project can be created.");
 
 $project = new Project;
 $project->customer_id = $customer->id;

+ 0 - 1
views/project.php

@@ -7,7 +7,6 @@ var projectID = <?=$project->id?>;
 <div class="container pt-3 my-4">
 	<h2><?=htmlspecialchars($project->name)?></h2>
 
-
 	<div class="card mb-3">
 		<div class="card-body">
 			Progress

+ 1 - 1
views/projects.php

@@ -7,7 +7,7 @@
 			</h2>
 		</div>
 		<div class="col text-right">
-			<a class="btn btn-outline-primary" href="/account/projects/add">Add</a>
+			<a class="btn btn-outline-primary" href="/account/projects/add?customer_id=<?=$customer->id?>">Add</a>
 		</div>
 	</div>