2019-01-30 12:00:26 +01:00
|
|
|
@if (Utils::isSelfHost())
|
|
|
|
@foreach(Module::getOrdered() as $module)
|
|
|
|
@if(View::exists($module->getLowerName() . '::extend.list'))
|
|
|
|
@includeIf($module->getLowerName() . '::extend.list')
|
|
|
|
@endif
|
|
|
|
@endforeach
|
|
|
|
@endif
|
|
|
|
|
2018-01-31 17:16:48 +01:00
|
|
|
{!! Former::open(\App\Models\EntityModel::getFormUrl($entityType) . '/bulk')
|
2016-11-25 11:53:35 +01:00
|
|
|
->addClass('listForm_' . $entityType) !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2016-11-24 10:22:37 +01:00
|
|
|
<div style="display:none">
|
2016-11-25 11:53:35 +01:00
|
|
|
{!! Former::text('action')->id('action_' . $entityType) !!}
|
|
|
|
{!! Former::text('public_id')->id('public_id_' . $entityType) !!}
|
2016-11-24 10:22:37 +01:00
|
|
|
{!! Former::text('datatable')->value('true') !!}
|
|
|
|
</div>
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2016-11-24 10:22:37 +01:00
|
|
|
<div class="pull-left">
|
2017-12-03 09:58:23 +01:00
|
|
|
@if (in_array($entityType, [ENTITY_TASK, ENTITY_EXPENSE, ENTITY_PRODUCT, ENTITY_PROJECT]))
|
2019-01-30 12:00:26 +01:00
|
|
|
@can('createEntity', 'invoice')
|
2016-11-25 11:53:35 +01:00
|
|
|
{!! Button::primary(trans('texts.invoice'))->withAttributes(['class'=>'invoice', 'onclick' =>'submitForm_'.$entityType.'("invoice")'])->appendIcon(Icon::create('check')) !!}
|
2017-11-03 09:19:03 +01:00
|
|
|
@endcan
|
|
|
|
@endif
|
2015-05-27 18:52:10 +02:00
|
|
|
|
2016-12-14 20:47:22 +01:00
|
|
|
{!! DropdownButton::normal(trans('texts.archive'))
|
|
|
|
->withContents($datatable->bulkActions())
|
|
|
|
->withAttributes(['class'=>'archive'])
|
|
|
|
->split() !!}
|
2016-07-06 20:35:16 +02:00
|
|
|
|
2016-11-17 15:29:02 +01:00
|
|
|
|
2016-11-24 10:22:37 +01:00
|
|
|
<span id="statusWrapper_{{ $entityType }}" style="display:none">
|
|
|
|
<select class="form-control" style="width: 220px" id="statuses_{{ $entityType }}" multiple="true">
|
2016-11-20 15:08:36 +01:00
|
|
|
@if (count(\App\Models\EntityModel::getStatusesFor($entityType)))
|
|
|
|
<optgroup label="{{ trans('texts.entity_state') }}">
|
|
|
|
@foreach (\App\Models\EntityModel::getStatesFor($entityType) as $key => $value)
|
|
|
|
<option value="{{ $key }}">{{ $value }}</option>
|
|
|
|
@endforeach
|
|
|
|
</optgroup>
|
|
|
|
<optgroup label="{{ trans('texts.status') }}">
|
|
|
|
@foreach (\App\Models\EntityModel::getStatusesFor($entityType) as $key => $value)
|
|
|
|
<option value="{{ $key }}">{{ $value }}</option>
|
|
|
|
@endforeach
|
|
|
|
</optgroup>
|
|
|
|
@else
|
|
|
|
@foreach (\App\Models\EntityModel::getStatesFor($entityType) as $key => $value)
|
|
|
|
<option value="{{ $key }}">{{ $value }}</option>
|
|
|
|
@endforeach
|
|
|
|
@endif
|
|
|
|
</select>
|
2016-11-18 14:31:43 +01:00
|
|
|
</span>
|
2019-01-30 12:00:26 +01:00
|
|
|
|
|
|
|
<span class="well well-sm" id="sum_column_{{ $entityType }}" style="display:none;padding-left:12px;padding-right:12px;"></span>
|
2016-11-24 10:22:37 +01:00
|
|
|
</div>
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2016-11-24 10:22:37 +01:00
|
|
|
<div id="top_right_buttons" class="pull-right">
|
2017-02-21 12:47:37 +01:00
|
|
|
<input id="tableFilter_{{ $entityType }}" type="text" style="width:180px;margin-right:17px;background-color: white !important"
|
2016-11-24 10:22:37 +01:00
|
|
|
class="form-control pull-left" placeholder="{{ trans('texts.filter') }}" value="{{ Input::get('filter') }}"/>
|
|
|
|
|
2019-01-30 12:00:26 +01:00
|
|
|
@if (Utils::isSelfHost())
|
|
|
|
@stack('top_right_buttons')
|
|
|
|
@endif
|
|
|
|
|
2018-01-31 10:10:15 +01:00
|
|
|
@if ($entityType == ENTITY_PROPOSAL)
|
2018-01-31 12:51:18 +01:00
|
|
|
{!! DropdownButton::normal(trans('texts.proposal_templates'))
|
2018-01-31 10:10:15 +01:00
|
|
|
->withAttributes(['class'=>'templatesDropdown'])
|
|
|
|
->withContents([
|
2018-01-31 12:59:53 +01:00
|
|
|
['label' => trans('texts.new_proposal_template'), 'url' => url('/proposals/templates/create')],
|
2018-01-31 10:10:15 +01:00
|
|
|
]
|
|
|
|
)->split() !!}
|
2018-01-31 12:51:18 +01:00
|
|
|
{!! DropdownButton::normal(trans('texts.proposal_snippets'))
|
2018-01-31 10:10:15 +01:00
|
|
|
->withAttributes(['class'=>'snippetsDropdown'])
|
|
|
|
->withContents([
|
2018-01-31 12:59:53 +01:00
|
|
|
['label' => trans('texts.new_proposal_snippet'), 'url' => url('/proposals/snippets/create')],
|
2018-01-31 10:10:15 +01:00
|
|
|
]
|
|
|
|
)->split() !!}
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(function() {
|
|
|
|
$('.templatesDropdown:not(.dropdown-toggle)').click(function(event) {
|
2018-01-31 12:59:53 +01:00
|
|
|
openUrlOnClick('{{ url('/proposals/templates') }}', event);
|
2018-01-31 10:10:15 +01:00
|
|
|
});
|
|
|
|
$('.snippetsDropdown:not(.dropdown-toggle)').click(function(event) {
|
2018-01-31 12:59:53 +01:00
|
|
|
openUrlOnClick('{{ url('/proposals/snippets') }}', event);
|
2018-01-31 10:10:15 +01:00
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
@elseif ($entityType == ENTITY_PROPOSAL_SNIPPET)
|
2018-01-31 12:51:18 +01:00
|
|
|
{!! DropdownButton::normal(trans('texts.proposal_categories'))
|
2018-01-31 10:10:15 +01:00
|
|
|
->withAttributes(['class'=>'categoriesDropdown'])
|
2017-08-31 21:04:47 +02:00
|
|
|
->withContents([
|
2018-01-31 12:59:53 +01:00
|
|
|
['label' => trans('texts.new_proposal_category'), 'url' => url('/proposals/categories/create')],
|
2017-08-31 21:04:47 +02:00
|
|
|
]
|
|
|
|
)->split() !!}
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(function() {
|
2018-01-31 10:10:15 +01:00
|
|
|
$('.categoriesDropdown:not(.dropdown-toggle)').click(function(event) {
|
2018-01-31 12:59:53 +01:00
|
|
|
openUrlOnClick('{{ url('/proposals/categories') }}', event);
|
2017-08-31 21:04:47 +02:00
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
@elseif ($entityType == ENTITY_EXPENSE)
|
2017-07-31 21:14:14 +02:00
|
|
|
{!! DropdownButton::normal(trans('texts.recurring'))
|
|
|
|
->withAttributes(['class'=>'recurringDropdown'])
|
|
|
|
->withContents([
|
|
|
|
['label' => trans('texts.new_recurring_expense'), 'url' => url('/recurring_expenses/create')],
|
|
|
|
]
|
|
|
|
)->split() !!}
|
2019-01-30 12:00:26 +01:00
|
|
|
@if (Auth::user()->can('createEntity', ENTITY_EXPENSE_CATEGORY))
|
2018-02-19 06:41:36 +01:00
|
|
|
{!! 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
|
2017-07-31 21:14:14 +02:00
|
|
|
<script type="text/javascript">
|
|
|
|
$(function() {
|
2017-10-24 19:58:22 +02:00
|
|
|
$('.recurringDropdown:not(.dropdown-toggle)').click(function(event) {
|
|
|
|
openUrlOnClick('{{ url('/recurring_expenses') }}', event)
|
2017-07-31 21:14:14 +02:00
|
|
|
});
|
2017-10-24 19:58:22 +02:00
|
|
|
$('.categoriesDropdown:not(.dropdown-toggle)').click(function(event) {
|
|
|
|
openUrlOnClick('{{ url('/expense_categories') }}', event);
|
2017-07-31 21:14:14 +02:00
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
2019-01-30 12:00:26 +01:00
|
|
|
@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
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(function() {
|
|
|
|
$('.recurringDropdown:not(.dropdown-toggle)').click(function(event) {
|
|
|
|
openUrlOnClick('{{ url('/recurring_quotes') }}', event)
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
2019-04-29 20:43:42 +02:00
|
|
|
@elseif (($entityType == ENTITY_RECURRING_QUOTE || $entityType == ENTITY_INVOICE) && ! isset($clientId))
|
|
|
|
|
|
|
|
@if (Auth::user()->can('createEntity', ENTITY_RECURRING_INVOICE))
|
|
|
|
{!! DropdownButton::normal(trans('texts.recurring_invoices'))
|
|
|
|
->withAttributes(['class'=>'recurringDropdown'])
|
|
|
|
->withContents([
|
|
|
|
['label' => trans('texts.new_recurring_invoice'), 'url' => url('/recurring_invoices/create')],
|
|
|
|
]
|
|
|
|
)->split() !!}
|
|
|
|
@else
|
|
|
|
{!! DropdownButton::normal(trans('texts.recurring_invoices'))
|
|
|
|
->withAttributes(['class'=>'recurringDropdown'])
|
|
|
|
->split() !!}
|
|
|
|
@endif
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(function() {
|
|
|
|
$('.recurringDropdown:not(.dropdown-toggle)').click(function(event) {
|
|
|
|
openUrlOnClick('{{ url('/recurring_invoices') }}', event)
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
2016-11-29 18:47:26 +01:00
|
|
|
@elseif ($entityType == ENTITY_TASK)
|
2017-12-24 20:17:21 +01:00
|
|
|
{!! Button::normal(trans('texts.kanban'))->asLinkTo(url('/tasks/kanban' . (! empty($clientId) ? ('/' . $clientId . (! empty($projectId) ? '/' . $projectId : '')) : '')))->appendIcon(Icon::create('th')) !!}
|
2017-10-03 08:37:19 +02:00
|
|
|
{!! Button::normal(trans('texts.time_tracker'))->asLinkTo('javascript:openTimeTracker()')->appendIcon(Icon::create('time')) !!}
|
2016-11-29 18:47:26 +01:00
|
|
|
@endif
|
2015-08-04 16:33:30 +02:00
|
|
|
|
2019-01-30 12:00:26 +01:00
|
|
|
@if (Auth::user()->can('createEntity', $entityType) && empty($vendorId))
|
2018-01-31 12:59:53 +01:00
|
|
|
{!! Button::primary(mtrans($entityType, "new_{$entityType}"))
|
|
|
|
->asLinkTo(url(
|
2018-01-31 17:16:48 +01:00
|
|
|
(in_array($entityType, [ENTITY_PROPOSAL_SNIPPET, ENTITY_PROPOSAL_CATEGORY, ENTITY_PROPOSAL_TEMPLATE]) ? str_replace('_', 's/', Utils::pluralizeEntityType($entityType)) : Utils::pluralizeEntityType($entityType)) .
|
2018-01-31 12:59:53 +01:00
|
|
|
'/create/' . (isset($clientId) ? ($clientId . (isset($projectId) ? '/' . $projectId : '')) : '')
|
|
|
|
))
|
|
|
|
->appendIcon(Icon::create('plus-sign')) !!}
|
2016-11-24 10:22:37 +01:00
|
|
|
@endif
|
2016-07-06 20:35:16 +02:00
|
|
|
|
2016-11-24 10:22:37 +01:00
|
|
|
</div>
|
|
|
|
|
2016-11-25 11:53:35 +01:00
|
|
|
|
2016-11-24 10:22:37 +01:00
|
|
|
{!! Datatable::table()
|
2016-12-19 12:22:03 +01:00
|
|
|
->addColumn(Utils::trans($datatable->columnFields(), $datatable->entityType))
|
2018-05-08 21:54:12 +02:00
|
|
|
->setUrl(empty($url) ? url('api/' . Utils::pluralizeEntityType($entityType)) : $url)
|
2016-11-24 10:22:37 +01:00
|
|
|
->setCustomValues('entityType', Utils::pluralizeEntityType($entityType))
|
2017-12-24 20:01:17 +01:00
|
|
|
->setCustomValues('clientId', isset($clientId) && $clientId && empty($projectId))
|
2016-11-24 10:22:37 +01:00
|
|
|
->setOptions('sPaginationType', 'bootstrap')
|
2016-11-29 18:47:26 +01:00
|
|
|
->setOptions('aaSorting', [[isset($clientId) ? ($datatable->sortCol-1) : $datatable->sortCol, 'desc']])
|
2016-11-24 10:22:37 +01:00
|
|
|
->render('datatable') !!}
|
|
|
|
|
|
|
|
@if ($entityType == ENTITY_PAYMENT)
|
2017-02-09 11:46:58 +01:00
|
|
|
@include('partials/refund_payment')
|
2016-11-24 10:22:37 +01:00
|
|
|
@endif
|
2016-04-23 22:40:19 +02:00
|
|
|
|
2016-11-24 10:22:37 +01:00
|
|
|
{!! Former::close() !!}
|
2016-09-19 15:30:46 +02:00
|
|
|
|
2016-12-25 22:43:57 +01:00
|
|
|
<style type="text/css">
|
|
|
|
|
|
|
|
@foreach ($datatable->rightAlignIndices() as $index)
|
|
|
|
.listForm_{{ $entityType }} table.dataTable td:nth-child({{ $index }}) {
|
|
|
|
text-align: right;
|
|
|
|
}
|
|
|
|
@endforeach
|
|
|
|
|
|
|
|
@foreach ($datatable->centerAlignIndices() as $index)
|
|
|
|
.listForm_{{ $entityType }} table.dataTable td:nth-child({{ $index }}) {
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
@endforeach
|
|
|
|
|
|
|
|
|
|
|
|
</style>
|
|
|
|
|
2016-11-24 10:22:37 +01:00
|
|
|
<script type="text/javascript">
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2017-12-03 09:58:23 +01:00
|
|
|
var submittedForm;
|
2016-11-25 11:53:35 +01:00
|
|
|
function submitForm_{{ $entityType }}(action, id) {
|
2017-12-03 09:58:23 +01:00
|
|
|
// prevent duplicate form submissions
|
|
|
|
if (submittedForm) {
|
|
|
|
swal("{{ trans('texts.processing_request') }}")
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
submittedForm = true;
|
|
|
|
|
2016-11-25 11:53:35 +01:00
|
|
|
if (id) {
|
|
|
|
$('#public_id_{{ $entityType }}').val(id);
|
|
|
|
}
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2017-02-09 15:02:50 +01:00
|
|
|
if (action == 'delete' || action == 'emailInvoice') {
|
2016-11-25 11:53:35 +01:00
|
|
|
sweetConfirm(function() {
|
|
|
|
$('#action_{{ $entityType }}').val(action);
|
|
|
|
$('form.listForm_{{ $entityType }}').submit();
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
$('#action_{{ $entityType }}').val(action);
|
|
|
|
$('form.listForm_{{ $entityType }}').submit();
|
|
|
|
}
|
2015-03-16 22:45:25 +01:00
|
|
|
}
|
2016-07-06 20:35:16 +02:00
|
|
|
|
2016-11-25 11:53:35 +01:00
|
|
|
$(function() {
|
|
|
|
|
|
|
|
// Handle datatable filtering
|
|
|
|
var tableFilter = '';
|
|
|
|
var searchTimeout = false;
|
|
|
|
|
|
|
|
function filterTable_{{ $entityType }}(val) {
|
|
|
|
if (val == tableFilter) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
tableFilter = val;
|
|
|
|
var oTable0 = $('.listForm_{{ $entityType }} .data-table').dataTable();
|
|
|
|
oTable0.fnFilter(val);
|
|
|
|
}
|
|
|
|
|
|
|
|
$('#tableFilter_{{ $entityType }}').on('keyup', function(){
|
|
|
|
if (searchTimeout) {
|
|
|
|
window.clearTimeout(searchTimeout);
|
|
|
|
}
|
|
|
|
searchTimeout = setTimeout(function() {
|
|
|
|
filterTable_{{ $entityType }}($('#tableFilter_{{ $entityType }}').val());
|
|
|
|
}, 500);
|
|
|
|
})
|
|
|
|
|
|
|
|
if ($('#tableFilter_{{ $entityType }}').val()) {
|
|
|
|
filterTable_{{ $entityType }}($('#tableFilter_{{ $entityType }}').val());
|
|
|
|
}
|
|
|
|
|
2016-11-30 19:30:48 +01:00
|
|
|
$('.listForm_{{ $entityType }} .head0').click(function(event) {
|
|
|
|
if (event.target.type !== 'checkbox') {
|
|
|
|
$('.listForm_{{ $entityType }} .head0 input[type=checkbox]').click();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2016-11-25 11:53:35 +01:00
|
|
|
// Enable/disable bulk action buttons
|
|
|
|
window.onDatatableReady_{{ Utils::pluralizeEntityType($entityType) }} = function() {
|
|
|
|
$(':checkbox').click(function() {
|
|
|
|
setBulkActionsEnabled_{{ $entityType }}();
|
2019-01-30 12:00:26 +01:00
|
|
|
changeSumLabel();
|
2016-11-25 11:53:35 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
$('.listForm_{{ $entityType }} tbody tr').unbind('click').click(function(event) {
|
|
|
|
if (event.target.type !== 'checkbox' && event.target.type !== 'button' && event.target.tagName.toLowerCase() !== 'a') {
|
|
|
|
$checkbox = $(this).closest('tr').find(':checkbox:not(:disabled)');
|
|
|
|
var checked = $checkbox.prop('checked');
|
|
|
|
$checkbox.prop('checked', !checked);
|
|
|
|
setBulkActionsEnabled_{{ $entityType }}();
|
2019-01-30 12:00:26 +01:00
|
|
|
changeSumLabel();
|
2016-11-25 11:53:35 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
actionListHandler();
|
2017-10-14 19:55:37 +02:00
|
|
|
$('[data-toggle="tooltip"]').tooltip();
|
2016-11-25 11:53:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
$('.listForm_{{ $entityType }} .archive, .invoice').prop('disabled', true);
|
|
|
|
$('.listForm_{{ $entityType }} .archive:not(.dropdown-toggle)').click(function() {
|
|
|
|
submitForm_{{ $entityType }}('archive');
|
|
|
|
});
|
|
|
|
|
|
|
|
$('.listForm_{{ $entityType }} .selectAll').click(function() {
|
|
|
|
$(this).closest('table').find(':checkbox:not(:disabled)').prop('checked', this.checked);
|
|
|
|
});
|
|
|
|
|
|
|
|
function setBulkActionsEnabled_{{ $entityType }}() {
|
|
|
|
var buttonLabel = "{{ trans('texts.archive') }}";
|
|
|
|
var count = $('.listForm_{{ $entityType }} tbody :checkbox:checked').length;
|
|
|
|
$('.listForm_{{ $entityType }} button.archive, .listForm_{{ $entityType }} button.invoice').prop('disabled', !count);
|
|
|
|
if (count) {
|
|
|
|
buttonLabel += ' (' + count + ')';
|
|
|
|
}
|
|
|
|
$('.listForm_{{ $entityType }} button.archive').not('.dropdown-toggle').text(buttonLabel);
|
|
|
|
}
|
|
|
|
|
2019-01-30 12:00:26 +01:00
|
|
|
function sumColumnVars(currentSum, add) {
|
|
|
|
switch ("{{ $entityType }}") {
|
|
|
|
case "task":
|
|
|
|
if(currentSum == "") {
|
|
|
|
currentSum = "00:00:00";
|
|
|
|
}
|
|
|
|
currentSumMoment = moment.duration(currentSum);
|
|
|
|
addMoment = moment.duration(add);
|
|
|
|
return secondsToTime(currentSumMoment.add(addMoment).asSeconds(), true);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
if(currentSum == "") { currentSum = "0"}
|
|
|
|
return (convertStringToNumber(currentSum) + convertStringToNumber(add)).toFixed(2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function changeSumLabel() {
|
|
|
|
var dTable = $('.listForm_{{ $entityType }} .data-table').DataTable();
|
|
|
|
@if ($datatable->sumColumn() != null)
|
|
|
|
@if(in_array($entityType, [ENTITY_TASK]))
|
|
|
|
var sumColumnNodes = dTable.column( {{ $datatable->sumColumn() }} ).nodes();
|
|
|
|
@else
|
|
|
|
sumColumnNodes = dTable.column( {{ $datatable->sumColumn() }} ).data().toArray();
|
|
|
|
@endif
|
|
|
|
var sum = 0;
|
|
|
|
var cboxArray = dTable.column(0).nodes();
|
|
|
|
|
|
|
|
for (i = 0 ; i < sumColumnNodes.length ; i++) {
|
|
|
|
if(cboxArray[i].firstChild.checked) {
|
|
|
|
var value;
|
|
|
|
@if(in_array($entityType, [ENTITY_TASK]))
|
|
|
|
value = sumColumnNodes[i].firstChild.innerHTML;
|
|
|
|
@else
|
|
|
|
value = sumColumnNodes[i];
|
|
|
|
@endif
|
|
|
|
sum = sumColumnVars(sum, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sum) {
|
|
|
|
$('#sum_column_{{ $entityType }}').show().text("{{ trans('texts.total') }}: " + sum)
|
|
|
|
} else {
|
|
|
|
$('#sum_column_{{ $entityType }}').hide();
|
|
|
|
}
|
|
|
|
|
|
|
|
@endif
|
|
|
|
}
|
2016-11-25 11:53:35 +01:00
|
|
|
|
|
|
|
// Setup state/status filter
|
|
|
|
$('#statuses_{{ $entityType }}').select2({
|
|
|
|
placeholder: "{{ trans('texts.status') }}",
|
2016-11-28 09:55:00 +01:00
|
|
|
//allowClear: true,
|
2016-11-27 10:46:32 +01:00
|
|
|
templateSelection: function(data, container) {
|
|
|
|
if (data.id == 'archived') {
|
|
|
|
$(container).css('color', '#fff');
|
|
|
|
$(container).css('background-color', '#f0ad4e');
|
|
|
|
$(container).css('border-color', '#eea236');
|
|
|
|
} else if (data.id == 'deleted') {
|
|
|
|
$(container).css('color', '#fff');
|
|
|
|
$(container).css('background-color', '#d9534f');
|
|
|
|
$(container).css('border-color', '#d43f3a');
|
|
|
|
}
|
|
|
|
return data.text;
|
|
|
|
}
|
2016-11-25 11:53:35 +01:00
|
|
|
}).val('{{ session('entity_state_filter:' . $entityType, STATUS_ACTIVE) . ',' . session('entity_status_filter:' . $entityType) }}'.split(','))
|
|
|
|
.trigger('change')
|
|
|
|
.on('change', function() {
|
|
|
|
var filter = $('#statuses_{{ $entityType }}').val();
|
|
|
|
if (filter) {
|
|
|
|
filter = filter.join(',');
|
|
|
|
} else {
|
|
|
|
filter = '';
|
|
|
|
}
|
|
|
|
var url = '{{ URL::to('set_entity_filter/' . $entityType) }}' + '/' + filter;
|
|
|
|
$.get(url, function(data) {
|
2017-07-17 13:23:29 +02:00
|
|
|
refreshDatatable_{{ Utils::pluralizeEntityType($entityType) }}();
|
2016-11-25 11:53:35 +01:00
|
|
|
})
|
|
|
|
}).maximizeSelect2Height();
|
|
|
|
|
|
|
|
$('#statusWrapper_{{ $entityType }}').show();
|
|
|
|
|
2017-06-28 17:33:09 +02:00
|
|
|
|
|
|
|
@for ($i = 1; $i <= 10; $i++)
|
|
|
|
Mousetrap.bind('g {{ $i }}', function(e) {
|
2017-06-28 17:47:57 +02:00
|
|
|
var link = $('.data-table').find('tr:nth-child({{ $i }})').find('a').attr('href');
|
|
|
|
if (link) {
|
|
|
|
location.href = link;
|
|
|
|
}
|
2017-06-28 17:33:09 +02:00
|
|
|
});
|
|
|
|
@endfor
|
2016-11-25 11:53:35 +01:00
|
|
|
});
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2016-11-24 10:22:37 +01:00
|
|
|
</script>
|