mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-03 21:47:32 -05:00 
			
		
		
		
	Updated vendors to new datatable class
This commit is contained in:
		
							parent
							
								
									541b19cd5f
								
							
						
					
					
						commit
						b2beb8fb73
					
				@ -74,6 +74,6 @@ class VendorDatatable extends EntityDatatable
 | 
				
			|||||||
            ]
 | 
					            ]
 | 
				
			||||||
        ];
 | 
					        ];
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -8,7 +8,6 @@ use App\Ninja\Datatables\EntityDatatable;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
class DatatableService
 | 
					class DatatableService
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    //public function createDatatable($entityType, $query, $columns, $actions = null, $showCheckbox = true, $orderColumns = [])
 | 
					 | 
				
			||||||
    public function createDatatable(EntityDatatable $datatable, $query)
 | 
					    public function createDatatable(EntityDatatable $datatable, $query)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        $table = Datatable::query($query);
 | 
					        $table = Datatable::query($query);
 | 
				
			||||||
 | 
				
			|||||||
@ -8,6 +8,7 @@ use App\Models\Expense;
 | 
				
			|||||||
use App\Services\BaseService;
 | 
					use App\Services\BaseService;
 | 
				
			||||||
use App\Ninja\Repositories\VendorRepository;
 | 
					use App\Ninja\Repositories\VendorRepository;
 | 
				
			||||||
use App\Ninja\Repositories\NinjaRepository;
 | 
					use App\Ninja\Repositories\NinjaRepository;
 | 
				
			||||||
 | 
					use App\Ninja\Datatables\VendorDatatable;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class VendorService extends BaseService
 | 
					class VendorService extends BaseService
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@ -37,13 +38,14 @@ class VendorService extends BaseService
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    public function getDatatable($search)
 | 
					    public function getDatatable($search)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					        $datatable = new VendorDatatable();
 | 
				
			||||||
        $query = $this->vendorRepo->find($search);
 | 
					        $query = $this->vendorRepo->find($search);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if(!Utils::hasPermission('view_all')){
 | 
					        if(!Utils::hasPermission('view_all')){
 | 
				
			||||||
            $query->where('vendors.user_id', '=', Auth::user()->id);
 | 
					            $query->where('vendors.user_id', '=', Auth::user()->id);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return $this->datatableService->createDatatable(ENTITY_VENDOR, $query);
 | 
					        return $this->datatableService->createDatatable($datatable, $query);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user