{!! Former::open(\App\Models\EntityModel::getFormUrl($entityType) . '/bulk') ->addClass('listForm_' . $entityType) !!}
{!! Former::text('action')->id('action_' . $entityType) !!} {!! Former::text('public_id')->id('public_id_' . $entityType) !!} {!! Former::text('datatable')->value('true') !!}
@if (in_array($entityType, [ENTITY_TASK, ENTITY_EXPENSE, ENTITY_PRODUCT, ENTITY_PROJECT])) @can('create', 'invoice') {!! Button::primary(trans('texts.invoice'))->withAttributes(['class'=>'invoice', 'onclick' =>'submitForm_'.$entityType.'("invoice")'])->appendIcon(Icon::create('check')) !!} @endcan @endif {!! DropdownButton::normal(trans('texts.archive')) ->withContents($datatable->bulkActions()) ->withAttributes(['class'=>'archive']) ->split() !!}  
@if ($entityType == ENTITY_PROPOSAL) {!! DropdownButton::normal(trans('texts.proposal_templates')) ->withAttributes(['class'=>'templatesDropdown']) ->withContents([ ['label' => trans('texts.new_proposal_template'), 'url' => url('/proposals/templates/create')], ] )->split() !!} {!! DropdownButton::normal(trans('texts.proposal_snippets')) ->withAttributes(['class'=>'snippetsDropdown']) ->withContents([ ['label' => trans('texts.new_proposal_snippet'), 'url' => url('/proposals/snippets/create')], ] )->split() !!} @elseif ($entityType == ENTITY_PROPOSAL_SNIPPET) {!! DropdownButton::normal(trans('texts.proposal_categories')) ->withAttributes(['class'=>'categoriesDropdown']) ->withContents([ ['label' => trans('texts.new_proposal_category'), 'url' => url('/proposals/categories/create')], ] )->split() !!} @elseif ($entityType == ENTITY_EXPENSE) {!! DropdownButton::normal(trans('texts.recurring')) ->withAttributes(['class'=>'recurringDropdown']) ->withContents([ ['label' => trans('texts.new_recurring_expense'), 'url' => url('/recurring_expenses/create')], ] )->split() !!} @if (Auth::user()->can('create', ENTITY_EXPENSE_CATEGORY)) {!! DropdownButton::normal(trans('texts.categories')) ->withAttributes(['class'=>'categoriesDropdown']) ->withContents([ ['label' => trans('texts.new_expense_category'), 'url' => url('/expense_categories/create')], ] )->split() !!} @else {!! DropdownButton::normal(trans('texts.categories')) ->withAttributes(['class'=>'categoriesDropdown']) ->split() !!} @endif @elseif ($entityType == ENTITY_TASK) {!! Button::normal(trans('texts.kanban'))->asLinkTo(url('/tasks/kanban' . (! empty($clientId) ? ('/' . $clientId . (! empty($projectId) ? '/' . $projectId : '')) : '')))->appendIcon(Icon::create('th')) !!} {!! Button::normal(trans('texts.time_tracker'))->asLinkTo('javascript:openTimeTracker()')->appendIcon(Icon::create('time')) !!} @endif @if (Auth::user()->can('create', $entityType) && empty($vendorId)) {!! Button::primary(mtrans($entityType, "new_{$entityType}")) ->asLinkTo(url( (in_array($entityType, [ENTITY_PROPOSAL_SNIPPET, ENTITY_PROPOSAL_CATEGORY, ENTITY_PROPOSAL_TEMPLATE]) ? str_replace('_', 's/', Utils::pluralizeEntityType($entityType)) : Utils::pluralizeEntityType($entityType)) . '/create/' . (isset($clientId) ? ($clientId . (isset($projectId) ? '/' . $projectId : '')) : '') )) ->appendIcon(Icon::create('plus-sign')) !!} @endif
{!! Datatable::table() ->addColumn(Utils::trans($datatable->columnFields(), $datatable->entityType)) ->setUrl(url('api/' . Utils::pluralizeEntityType($entityType) . '/' . (isset($clientId) ? (isset($projectId) ? ($clientId . '/' . $projectId) : $clientId) : (isset($vendorId) ? $vendorId : '')))) ->setCustomValues('entityType', Utils::pluralizeEntityType($entityType)) ->setCustomValues('clientId', isset($clientId) && $clientId && empty($projectId)) ->setOptions('sPaginationType', 'bootstrap') ->setOptions('aaSorting', [[isset($clientId) ? ($datatable->sortCol-1) : $datatable->sortCol, 'desc']]) ->render('datatable') !!} @if ($entityType == ENTITY_PAYMENT) @include('partials/refund_payment') @endif {!! Former::close() !!}