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

Update displayed titles of entities

Alan Lam 3 лет назад
Родитель
Сommit
cb5fb8f0ce
7 измененных файлов с 253 добавлено и 197 удалено
  1. 243 192
      composer.lock
  2. 1 1
      controllers/document.php
  3. 5 0
      controllers/location_form.php
  4. 1 1
      controllers/sale.php
  5. 1 1
      engine/Document.php
  6. 1 1
      engine/Sale.php
  7. 1 1
      views/document.php

Разница между файлами не показана из-за своего большого размера
+ 243 - 192
composer.lock


+ 1 - 1
controllers/document.php

@@ -103,7 +103,7 @@ $controller = new class($document_type, $document_number) {
 			$sale = $document->getSale();
 			if($sale) {
 				$core->addBreadcrumb("/leads", __("Leads"));
-				$core->addBreadcrumb($sale->getUrl(), __("Lead %d", $sale->getNumber()));
+				$core->addBreadcrumb($sale->getUrl(), $sale->getReference());
 			}
 
 			if($document->isPartOfAru()) {

+ 5 - 0
controllers/location_form.php

@@ -17,21 +17,26 @@ $user = $core->getUser();
 
 if(isset($id)) {
 	$location = Location::require($id);
+	$customer = $location->getCustomer();
 
 	$location->dts_updated = Database::dts();
 
+	$core->addBreadcrumb($customer->getUrl(), $customer->name);
 	$core->addBreadcrumb($location->getUrl(), $location->name);
 
 	$title = __("Update Location");
 }
 else {
 	$customer_id = $request->int("customer_id");
+	$customer = Customer::require($customer_id);
 
 	$location = new Location();
 	$location->customer_id = $customer_id;
 	$location->dts_created = Database::dts();
 
 	$title = __("Add Location");
+
+	$core->addBreadcrumb($customer->getUrl(), $customer->name);
 }
 
 $core->addBreadcrumb($_SERVER["REQUEST_URI"], $title);

+ 1 - 1
controllers/sale.php

@@ -76,7 +76,7 @@ $controller = new class($number) {
 		$this->user->requireAdmin();
 
 		$core->addBreadcrumb("/leads", __("Leads"));
-		$core->addBreadcrumb($sale->getUrl(), __("Lead %d", $sale->getNumber()));
+		$core->addBreadcrumb($sale->getUrl(), $sale->getTitle());
 
 		$core->addScript("/js/sale-item-modal.js");
 		$core->addScript("/js/sale-note-modal.js");

+ 1 - 1
engine/Document.php

@@ -245,7 +245,7 @@ class Document extends Model {
 	}
 
 	public function getTitle(): string {
-		return __("%s %d", $this->getDisplayType(), $this->number);
+		return __("%s %s", $this->getDisplayType(), $this->getReference());
 	}
 
 	/**

+ 1 - 1
engine/Sale.php

@@ -133,7 +133,7 @@ class Sale extends Model {
 	}
 
 	public function getTitle(): string {
-		return __("Lead %d", $this->getNumber());
+		return __("Lead %s", $this->getReference());
 	}
 
 	public function getDisplayPredictedSoldDate(string $format = "d/m/Y"): string {

+ 1 - 1
views/document.php

@@ -33,7 +33,7 @@ $location = $document->getLocation();
 		else if($sale) {
 			echo __("%s for %s",
 				htmlspecialchars($document->getTitle()),
-				"<a href=\"" . htmlspecialchars($sale->getUrl()) . "\">" . htmlspecialchars(__("Lead %d", $sale->getNumber())) . "</a>"
+				"<a href=\"" . htmlspecialchars($sale->getUrl()) . "\">" . htmlspecialchars($sale->getTitle()) . "</a>"
 			);
 		}
 		else {

Некоторые файлы не были показаны из-за большого количества измененных файлов