@if (Utils::isSelfHost())
@foreach(Module::getOrdered() as $module)
@if(View::exists($module->getLowerName() . '::extend.list'))
@includeIf($module->getLowerName() . '::extend.list')
@endif
@endforeach
@endif
{!! 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('createEntity', '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 (Utils::isSelfHost())
@stack('top_right_buttons')
@endif
@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('createEntity', 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_RECURRING_INVOICE || $entityType == ENTITY_QUOTE) && ! isset($clientId))
@if (Auth::user()->can('createEntity', ENTITY_RECURRING_QUOTE))
{!! DropdownButton::normal(trans('texts.recurring_quotes'))
->withAttributes(['class'=>'recurringDropdown'])
->withContents([
['label' => trans('texts.new_recurring_quote'), 'url' => url('/recurring_quotes/create')],
]
)->split() !!}
@else
{!! DropdownButton::normal(trans('texts.recurring_quotes'))
->withAttributes(['class'=>'recurringDropdown'])
->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('createEntity', $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(empty($url) ? url('api/' . Utils::pluralizeEntityType($entityType)) : $url)
->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() !!}