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

Add "Important" badge for status fields

Alan Lam 3 лет назад
Родитель
Сommit
e9d00099b6
2 измененных файлов с 61 добавлено и 35 удалено
  1. 30 17
      views/document.php
  2. 31 18
      views/sale.php

+ 30 - 17
views/document.php

@@ -30,6 +30,12 @@ $location = $document->getLocation();
 				"<a href=\"" . htmlspecialchars($related_document->getUrl()) . "\">" . htmlspecialchars($related_document->getTitle()) . "</a>"
 				"<a href=\"" . htmlspecialchars($related_document->getUrl()) . "\">" . htmlspecialchars($related_document->getTitle()) . "</a>"
 			);
 			);
 		}
 		}
+		else if($sale) {
+			echo __("%s for %s",
+				htmlspecialchars($document->getTitle()),
+				"<a href=\"" . htmlspecialchars($sale->getUrl()) . "\">" . htmlspecialchars(__("Lead %d", $sale->getNumber())) . "</a>"
+			);
+		}
 		else {
 		else {
 			echo htmlspecialchars($document->getTitle());
 			echo htmlspecialchars($document->getTitle());
 		}
 		}
@@ -52,9 +58,18 @@ $location = $document->getLocation();
 						?>
 						?>
 						<div class="col-sm-6">
 						<div class="col-sm-6">
 							<div class="mb-3">
 							<div class="mb-3">
-								<label for="invoice-status" class="form-label">
-									<?=htmlspecialchars(__("Status"))?>
-								</label>
+								<div class="row">
+									<div class="col">
+										<label for="invoice-status" class="form-label">
+											<b><?=htmlspecialchars(__("Status"))?></b>
+										</label>
+									</div>
+									<div class="col-auto">
+										<span class="badge rounded-pill text-bg-danger">
+											<?=htmlspecialchars(__("Important"))?>
+										</span>
+									</div>
+								</div>
 								<select class="form-control" name="invoice_status" id="invoice-status">
 								<select class="form-control" name="invoice_status" id="invoice-status">
 									<?php
 									<?php
 									HtmlHelper::renderOptions(SaleOrderStatuses::options(), $document->invoice_status);
 									HtmlHelper::renderOptions(SaleOrderStatuses::options(), $document->invoice_status);
@@ -68,9 +83,18 @@ $location = $document->getLocation();
 						?>
 						?>
 						<div class="col-sm-6">
 						<div class="col-sm-6">
 							<div class="mb-3">
 							<div class="mb-3">
-								<label for="aru-status" class="form-label">
-									<?=htmlspecialchars(__("Status"))?>
-								</label>
+								<div class="row">
+									<div class="col">
+										<label for="aru-status" class="form-label">
+											<b><?=htmlspecialchars(__("Status"))?></b>
+										</label>
+									</div>
+									<div class="col-auto">
+										<span class="badge rounded-pill text-bg-danger">
+											<?=htmlspecialchars(__("Important"))?>
+										</span>
+									</div>
+								</div>
 								<select class="form-control" name="aru_status" id="aru-status">
 								<select class="form-control" name="aru_status" id="aru-status">
 									<?php
 									<?php
 									HtmlHelper::renderOptions(AruStatuses::options(), $document->aru_status);
 									HtmlHelper::renderOptions(AruStatuses::options(), $document->aru_status);
@@ -306,17 +330,6 @@ $location = $document->getLocation();
 						<?php
 						<?php
 					}
 					}
 
 
-					if($sale) {
-						?>
-						<dt><?=htmlspecialchars(__("Related Lead"))?></dt>
-						<dd>
-							<a href="<?=htmlspecialchars($sale->getUrl())?>">
-								<?=htmlspecialchars($sale->getTitle())?>
-							</a>
-						</dd>
-						<?php
-					}
-
 					if($document->hasCosts()) {
 					if($document->hasCosts()) {
 						$delivery_notes = $document->getDeliveryNotes();
 						$delivery_notes = $document->getDeliveryNotes();
 
 

+ 31 - 18
views/sale.php

@@ -27,18 +27,18 @@ $user = $core->getUser();
 				<h4><?=htmlspecialchars(__("Main Details"))?></h4>
 				<h4><?=htmlspecialchars(__("Main Details"))?></h4>
 
 
 				<div class="mb-3">
 				<div class="mb-3">
-					<label class="form-label" for="currency"><?=htmlspecialchars(__("Currency"))?></label>
-					<select class="form-control" name="currency" id="currency">
-						<?php
-						HtmlHelper::renderOptions(Currencies::options(), $sale->currency);
-						?>
-					</select>
-				</div>
-
-				<div class="mb-3">
-					<label class="form-label" for="status">
-						<?=htmlspecialchars(__("Status"))?>
-					</label>
+					<div class="row">
+						<div class="col">
+							<label class="form-label" for="status">
+								<b><?=htmlspecialchars(__("Status"))?></b>
+							</label>
+						</div>
+						<div class="col-auto">
+							<span class="badge rounded-pill text-bg-danger">
+								<?=htmlspecialchars(__("Important"))?>
+							</span>
+						</div>
+					</div>
 					<select class="form-control" name="status" id="status">
 					<select class="form-control" name="status" id="status">
 						<?php
 						<?php
 						HtmlHelper::renderOptions(SaleStatuses::options(), $sale->status);
 						HtmlHelper::renderOptions(SaleStatuses::options(), $sale->status);
@@ -46,13 +46,26 @@ $user = $core->getUser();
 					</select>
 					</select>
 				</div>
 				</div>
 
 
-				<div class="mb-3">
-					<label for="tax-rate" class="form-label">
-						<?=htmlspecialchars(__("Tax Rate (%)"))?>
-					</label>
-					<input class="form-control" type="number" name="tax_rate" id="tax-rate" value="<?=$sale->tax_rate?>" min="0" max="100.00" step="0.01" placeholder="Type tax rate" required />
+				<div class="row">
+					<div class="col-md">
+						<div class="mb-3">
+							<label class="form-label" for="currency"><?=htmlspecialchars(__("Currency"))?></label>
+							<select class="form-control" name="currency" id="currency">
+								<?php
+								HtmlHelper::renderOptions(Currencies::options(), $sale->currency);
+								?>
+							</select>
+						</div>
+					</div>
+					<div class="col-md">
+						<div class="mb-3">
+							<label for="tax-rate" class="form-label">
+								<?=htmlspecialchars(__("Tax Rate (%)"))?>
+							</label>
+							<input class="form-control" type="number" name="tax_rate" id="tax-rate" value="<?=$sale->tax_rate?>" min="0" max="100.00" step="0.01" placeholder="Type tax rate" required />
+						</div>
+					</div>
 				</div>
 				</div>
-
 			</div>
 			</div>
 			<div class="col-xl-6">
 			<div class="col-xl-6">