Skip to content

Commit

Permalink
closed:#628 Item reminder is not reminding with notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Batuhan Baş committed Nov 16, 2018
1 parent f549547 commit c81f156
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/Http/ViewComposers/Header.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public function compose(View $view)
$bills = [];
$invoices = [];
$items = [];
$items_reminder = [];
$notifications = 0;
$company = null;

Expand Down Expand Up @@ -55,6 +56,10 @@ public function compose(View $view)
$items[$data['item_id']] = $data['name'];
$notifications++;
break;
case 'App\Notifications\Common\ItemReminder':
$items_reminder[$data['item_id']] = $data['name'];
$notifications++;
break;
}
}

Expand All @@ -68,6 +73,7 @@ public function compose(View $view)
'bills' => $bills,
'invoices' => $invoices,
'items' => $items,
'items_reminder' => $items_reminder,
'company' => $company,
'updates' => $updates,
]);
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en-GB/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
'overdue_invoices' => '{1} :count overdue invoice|[2,*] :count overdue invoices',
'upcoming_bills' => '{1} :count upcoming bill|[2,*] :count upcoming bills',
'items_stock' => '{1} :count item out of stock|[2,*] :count items out of stock',
'items_reminder' => '{1} You have :count item left|[2,*] You have :count items left',
'view_all' => 'View All'
],
'docs_link' => 'https://akaunting.com/docs',
Expand Down
7 changes: 7 additions & 0 deletions resources/views/partials/admin/header.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,13 @@
</a>
</li>
@endif
@if (count($items_reminder))
<li>
<a href="{{ url('auth/users/' . $user->id . '/read-items') }}">
<i class="fa fa-cubes text-red"></i> {{ trans_choice('header.notifications.items_reminder', count($items_reminder), ['count' => count($items_reminder)]) }}
</a>
</li>
@endif
</ul>
</li>
<li class="footer"><a href="#">{{ trans('header.notifications.view_all') }}</a></li>
Expand Down

0 comments on commit c81f156

Please sign in to comment.