1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 20:52:56 +01:00

Updated vendors to new datatable class

This commit is contained in:
Hillel Coren 2016-05-23 21:07:06 +03:00
parent 541b19cd5f
commit b2beb8fb73
3 changed files with 4 additions and 3 deletions

View File

@ -74,6 +74,6 @@ class VendorDatatable extends EntityDatatable
]
];
}
}

View File

@ -8,7 +8,6 @@ use App\Ninja\Datatables\EntityDatatable;
class DatatableService
{
//public function createDatatable($entityType, $query, $columns, $actions = null, $showCheckbox = true, $orderColumns = [])
public function createDatatable(EntityDatatable $datatable, $query)
{
$table = Datatable::query($query);

View File

@ -8,6 +8,7 @@ use App\Models\Expense;
use App\Services\BaseService;
use App\Ninja\Repositories\VendorRepository;
use App\Ninja\Repositories\NinjaRepository;
use App\Ninja\Datatables\VendorDatatable;
class VendorService extends BaseService
{
@ -37,13 +38,14 @@ class VendorService extends BaseService
public function getDatatable($search)
{
$datatable = new VendorDatatable();
$query = $this->vendorRepo->find($search);
if(!Utils::hasPermission('view_all')){
$query->where('vendors.user_id', '=', Auth::user()->id);
}
return $this->datatableService->createDatatable(ENTITY_VENDOR, $query);
return $this->datatableService->createDatatable($datatable, $query);
}
}