From 1d855a90eb368a590583b679bab4b13f693898ef Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 5 Apr 2017 22:42:54 +0300 Subject: [PATCH] Working on speech rec --- app/Ninja/Intents/BaseIntent.php | 2 +- app/Ninja/Intents/InvoiceIntent.php | 2 +- app/Ninja/Intents/WebApp/ListCreditIntent.php | 2 +- app/Ninja/Intents/WebApp/ListPaymentIntent.php | 2 +- app/Ninja/Intents/WebApp/ListQuoteIntent.php | 2 +- app/Ninja/Intents/WebApp/ListRecurringInvoiceIntent.php | 2 +- app/Ninja/Intents/WebApp/ListTaskIntent.php | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/Ninja/Intents/BaseIntent.php b/app/Ninja/Intents/BaseIntent.php index cce46d7db7ba..fa8d7da1d363 100644 --- a/app/Ninja/Intents/BaseIntent.php +++ b/app/Ninja/Intents/BaseIntent.php @@ -110,7 +110,7 @@ class BaseIntent return in_array($state, [STATUS_ACTIVE, STATUS_ARCHIVED, STATUS_DELETED]); }); - if (count($states)) { + if (count($states) || $this->hasField('Filter', 'all')) { session(['entity_state_filter:' . $entityType => join(',', $states)]); } } diff --git a/app/Ninja/Intents/InvoiceIntent.php b/app/Ninja/Intents/InvoiceIntent.php index fb3ec5c04877..a6b712c01304 100644 --- a/app/Ninja/Intents/InvoiceIntent.php +++ b/app/Ninja/Intents/InvoiceIntent.php @@ -117,7 +117,7 @@ class InvoiceIntent extends BaseIntent } } - if (count($statusIds)) { + if (count($statusIds) || $this->hasField('Filter', 'all')) { session(['entity_status_filter:' . $entityType => join(',', $statusIds)]); } } diff --git a/app/Ninja/Intents/WebApp/ListCreditIntent.php b/app/Ninja/Intents/WebApp/ListCreditIntent.php index dadc36080189..569ba3491537 100644 --- a/app/Ninja/Intents/WebApp/ListCreditIntent.php +++ b/app/Ninja/Intents/WebApp/ListCreditIntent.php @@ -10,7 +10,7 @@ class ListCreditIntent extends BaseIntent { $this->loadStates(ENTITY_CREDIT); - if ($client = $this->requestClient()) { + if (! $this->hasField('Filter', 'all') && $client = $this->requestClient()) { $url = $client->present()->url . '#credits'; } else { $url = '/credits'; diff --git a/app/Ninja/Intents/WebApp/ListPaymentIntent.php b/app/Ninja/Intents/WebApp/ListPaymentIntent.php index a545bd8559b3..4dd30a3f471f 100644 --- a/app/Ninja/Intents/WebApp/ListPaymentIntent.php +++ b/app/Ninja/Intents/WebApp/ListPaymentIntent.php @@ -10,7 +10,7 @@ class ListPaymentIntent extends BaseIntent { $this->loadStates(ENTITY_PAYMENT); - if ($client = $this->requestClient()) { + if (! $this->hasField('Filter', 'all') && $client = $this->requestClient()) { $url = $client->present()->url . '#payments'; } else { $url = '/payments'; diff --git a/app/Ninja/Intents/WebApp/ListQuoteIntent.php b/app/Ninja/Intents/WebApp/ListQuoteIntent.php index 1867d34e0dfe..8faa4f04e280 100644 --- a/app/Ninja/Intents/WebApp/ListQuoteIntent.php +++ b/app/Ninja/Intents/WebApp/ListQuoteIntent.php @@ -11,7 +11,7 @@ class ListQuoteIntent extends InvoiceIntent $this->loadStates(ENTITY_QUOTE); $this->loadStatuses(ENTITY_QUOTE); - if ($client = $this->requestClient()) { + if (! $this->hasField('Filter', 'all') && $client = $this->requestClient()) { $url = $client->present()->url . '#quotes'; } else { $url = '/quotes'; diff --git a/app/Ninja/Intents/WebApp/ListRecurringInvoiceIntent.php b/app/Ninja/Intents/WebApp/ListRecurringInvoiceIntent.php index d8823dd7bbcb..a0d5c5a23f59 100644 --- a/app/Ninja/Intents/WebApp/ListRecurringInvoiceIntent.php +++ b/app/Ninja/Intents/WebApp/ListRecurringInvoiceIntent.php @@ -10,7 +10,7 @@ class ListRecurringInvoiceIntent extends BaseIntent { $this->loadStates(ENTITY_RECURRING_INVOICE); - if ($client = $this->requestClient()) { + if (! $this->hasField('Filter', 'all') && $client = $this->requestClient()) { $url = $client->present()->url . '#recurring_invoices'; } else { $url = '/recurring_invoices'; diff --git a/app/Ninja/Intents/WebApp/ListTaskIntent.php b/app/Ninja/Intents/WebApp/ListTaskIntent.php index 05574761c836..da429572de34 100644 --- a/app/Ninja/Intents/WebApp/ListTaskIntent.php +++ b/app/Ninja/Intents/WebApp/ListTaskIntent.php @@ -10,7 +10,7 @@ class ListTaskIntent extends BaseIntent { $this->loadStates(ENTITY_TASK); - if ($client = $this->requestClient()) { + if (! $this->hasField('Filter', 'all') && $client = $this->requestClient()) { $url = $client->present()->url . '#tasks'; } else { $url = '/tasks';