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

Change default custom filter on leads page to "Open Leads"

Alan Lam 3 лет назад
Родитель
Сommit
0f21540b14
2 измененных файлов с 8 добавлено и 1 удалено
  1. 7 0
      controllers/sales.php
  2. 1 1
      views/sales.php

+ 7 - 0
controllers/sales.php

@@ -44,9 +44,16 @@ if($number) {
 
 $custom_filter = $request->string("custom_filter");
 switch($custom_filter) {
+	default:
+		$custom_filter = "open";
+		$nvp["status"] = new NotEqualsConstraint(SaleStatuses::COMPLETED);
+		break;
 	case "open":
 		$nvp["status"] = new NotEqualsConstraint(SaleStatuses::COMPLETED);
 		break;
+
+	case "all":
+		break;
 }
 
 $sort_options = [

+ 1 - 1
views/sales.php

@@ -18,6 +18,7 @@ use App\Helpers\HtmlHelper;
  */
 
 $custom_filter_options = [
+	"all" => __("All Leads"),
 	"open" => __("Open Leads"),
 ];
 
@@ -72,7 +73,6 @@ $custom_filter_options = [
 					<div class="mb-3">
 						<label class="form-label" for="custom-filter"><?=htmlspecialchars(__("Custom Filter"))?></label>
 						<select class="form-select" name="custom_filter" id="custom-filter">
-							<option value=""><?=htmlspecialchars(__("All Leads"))?></option>
 							<?php
 							HtmlHelper::renderOptions($custom_filter_options, $custom_filter);
 							?>