A free open source IT asset/license management system
Merge branch 'develop' into saving_custom_report_template
Marcus Moore530ea474d14a
diff --cc resources/views/reports/custom.blade.phpindex 7f9584adba,cc0ec158af..bd0deac117--- a/resources/views/reports/custom.blade.php+++ b/resources/views/reports/custom.blade.php@@@ -65,155 -31,160 +67,160 @@@<div class="col-md-4">- <label class="form-control">- <input type="checkbox" id="checkAll" checked="checked">- {{ trans('general.select_all') }}- </label>-- <label class="form-control">- {{ Form::checkbox('id', '1', '1') }}- {{ trans('general.id') }}- </label>-- <label class="form-control">- {{ Form::checkbox('company', '1', '1') }}- {{ trans('general.company') }}- </label>-- <label class="form-control">- {{ Form::checkbox('asset_tag', '1', '1') }}- {{ trans('general.asset_tag') }}- </label>-- <label class="form-control">- {{ Form::checkbox('asset_name', '1', '1') }}- {{ trans('admin/hardware/form.name') }}- </label>-- <label class="form-control">- {{ Form::checkbox('manufacturer', '1', '1') }}- {{ trans('general.manufacturer') }}- </label>-- <label class="form-control">- {{ Form::checkbox('model', '1', '1') }}- {{ trans('general.asset_models') }}- </label>-- <label class="form-control">- {{ Form::checkbox('category', '1', '1') }}- {{ trans('general.category') }}- </label>-- <label class="form-control">- {{ Form::checkbox('serial', '1', '1') }}- {{ trans('admin/hardware/table.serial') }}- </label>-- <label class="form-control">- {{ Form::checkbox('purchase_date', '1', '1') }}- {{ trans('admin/licenses/table.purchase_date') }}- </label>-- <label class="form-control">- {{ Form::checkbox('purchase_cost', '1', '1') }}- {{ trans('admin/hardware/form.cost') }}- </label>-- <label class="form-control">- {{ Form::checkbox('eol', '1', '1') }}- {{ trans('admin/hardware/table.eol') }}- </label>-- <label class="form-control">- {{ Form::checkbox('order', '1', '1') }}- {{ trans('admin/hardware/form.order') }}- </label>-- <label class="form-control">- {{ Form::checkbox('supplier', '1', '1') }}- {{ trans('general.suppliers') }}- </label>-- <label class="form-control">- {{ Form::checkbox('location', '1', '1') }}- {{ trans('general.location') }}- </label>-- <label class="form-control">- {{ Form::checkbox('location_address', '1', '1') }}- - {{ trans('general.address') }}- </label>-- <label class="form-control">- {{ Form::checkbox('rtd_location', '1', '1') }}- {{ trans('admin/hardware/form.default_location') }}- </label>-- <label class="form-control">- {{ Form::checkbox('rtd_location_address', '1', '1') }}- - {{ trans('general.address') }}- </label>-- <label class="form-control">- {{ Form::checkbox('status', '1', '1') }}- {{ trans('general.status') }}- </label>-- <label class="form-control">- {{ Form::checkbox('warranty', '1', '1') }}- {{ trans('admin/hardware/form.warranty') }}- </label>-- <label class="form-control">- {{ Form::checkbox('depreciation', '1', '1') }}- {{ trans('general.depreciation') }}- </label>-- <label class="form-control">- {{ Form::checkbox('checkout_date', '1', '1') }}- {{ trans('admin/hardware/table.checkout_date') }}- </label>-- <label class="form-control">- {{ Form::checkbox('checkin_date', '1', '1') }}+ <label class="form-control">+ <input type="checkbox" id="checkAll" checked="checked">+ {{ trans('general.select_all') }}+ </label>++ <label class="form-control">+ {{ Form::checkbox('id', '1', $template->checkmarkValue('id')) }}+ {{ trans('general.id') }}+ </label>++ <label class="form-control">+ {{ Form::checkbox('company', '1', $template->checkmarkValue('company')) }}+ {{ trans('general.company') }}+ </label>++ <label class="form-control">+ {{ Form::checkbox('asset_tag', '1', $template->checkmarkValue('asset_tag')) }}+ {{ trans('general.asset_tag') }}+ </label>++ <label class="form-control">+ {{ Form::checkbox('asset_name', '1', $template->checkmarkValue('asset_name')) }}+ {{ trans('admin/hardware/form.name') }}+ </label>++ <label class="form-control">+ {{ Form::checkbox('manufacturer', '1', $template->checkmarkValue('manufacturer')) }}+ {{ trans('general.manufacturer') }}+ </label>++ <label class="form-control">+ {{ Form::checkbox('model', '1', $template->checkmarkValue('model')) }}+ {{ trans('general.asset_models') }}+ </label>++ <label class="form-control">+ {{ Form::checkbox('category', '1', $template->checkmarkValue('category')) }}+ {{ trans('general.category') }}+ </label>++ <label class="form-control">+ {{ Form::checkbox('serial', '1', $template->checkmarkValue('serial')) }}+ {{ trans('admin/hardware/table.serial') }}+ </label>++ <label class="form-control">+ {{ Form::checkbox('purchase_date', '1', $template->checkmarkValue('purchase_date')) }}+ {{ trans('admin/licenses/table.purchase_date') }}+ </label>++ <label class="form-control">+ {{ Form::checkbox('purchase_cost', '1', $template->checkmarkValue('purchase_cost')) }}+ {{ trans('admin/hardware/form.cost') }}+ </label>++ <label class="form-control">+ {{ Form::checkbox('eol', '1', $template->checkmarkValue('eol')) }}+ {{ trans('admin/hardware/table.eol') }}+ </label>++ <label class="form-control">+ {{ Form::checkbox('order', '1', $template->checkmarkValue('order')) }}+ {{ trans('admin/hardware/form.order') }}+ </label>++ <label class="form-control">+ {{ Form::checkbox('supplier', '1', $template->checkmarkValue('supplier')) }}+ {{ trans('general.suppliers') }}+ </label>++ <label class="form-control">+ {{ Form::checkbox('location', '1', $template->checkmarkValue('location')) }}+ {{ trans('general.location') }}+ </label>++ <label class="form-control">+ {{ Form::checkbox('location_address', '1', $template->checkmarkValue('location_address')) }}+ - {{ trans('general.address') }}+ </label>++ <label class="form-control">+ {{ Form::checkbox('rtd_location', '1', $template->checkmarkValue('rtd_location')) }}+ {{ trans('admin/hardware/form.default_location') }}+ </label>++ <label class="form-control">+ {{ Form::checkbox('rtd_location_address', '1', $template->checkmarkValue('rtd_location_address')) }}+ - {{ trans('general.address') }}+ </label>++ <label class="form-control">+ {{ Form::checkbox('status', '1', $template->checkmarkValue('status')) }}+ {{ trans('general.status') }}+ </label>++ <label class="form-control">+ {{ Form::checkbox('warranty', '1', $template->checkmarkValue('warranty')) }}+ {{ trans('admin/hardware/form.warranty') }}+ </label>++ <label class="form-control">+ {{ Form::checkbox('depreciation', '1', $template->checkmarkValue('depreciation')) }}+ {{ trans('general.depreciation') }}+ </label>++ <label class="form-control">+ {{ Form::checkbox('checkout_date', '1', $template->checkmarkValue('checkout_date')) }}+ {{ trans('admin/hardware/table.checkout_date') }}+ </label>+- <label class="form-control">- {{ Form::checkbox('expected_checkin', '1', $template->checkmarkValue('expected_checkin')) }}- {{ trans('admin/hardware/form.expected_checkin') }}- </label>++ <label class="form-control">++ {{ Form::checkbox('checkin_date', '1', $template->checkmarkValue('checkin_date')) }}+ {{ trans('admin/hardware/table.last_checkin_date') }}+ </label>++ <label class="form-control">- {{ Form::checkbox('expected_checkin', '1', '1') }}++ {{ Form::checkbox('expected_checkin', '1', $template->checkmarkValue('expected_checkin')) }}+ {{ trans('admin/hardware/form.expected_checkin') }}+ </label>- <label class="form-control">- {{ Form::checkbox('created_at', '1', '1') }}- {{ trans('general.created_at') }}- </label>+ <label class="form-control">+ {{ Form::checkbox('created_at', '1', $template->checkmarkValue('created_at')) }}+ {{ trans('general.created_at') }}+ </label>- <label class="form-control">- {{ Form::checkbox('updated_at', '1', '1') }}- {{ trans('general.updated_at') }}- </label>+ <label class="form-control">+ {{ Form::checkbox('updated_at', '1', $template->checkmarkValue('updated_at')) }}+ {{ trans('general.updated_at') }}+ </label>- <label class="form-control">- {{ Form::checkbox('deleted_at', '1', '1') }}- {{ trans('general.deleted') }}- </label>+ <label class="form-control">+ {{ Form::checkbox('deleted_at', '1', $template->checkmarkValue('deleted_at')) }}+ {{ trans('general.deleted') }}+ </label>- <label class="form-control">- {{ Form::checkbox('last_audit_date', '1', '1') }}- {{ trans('general.last_audit') }}- </label>+ <label class="form-control">+ {{ Form::checkbox('last_audit_date', '1', $template->checkmarkValue('last_audit_date')) }}+ {{ trans('general.last_audit') }}+ </label>- <label class="form-control">- {{ Form::checkbox('next_audit_date', '1', '1') }}- {{ trans('general.next_audit_date') }}- </label>+ <label class="form-control">+ {{ Form::checkbox('next_audit_date', '1', $template->checkmarkValue('next_audit_date')) }}+ {{ trans('general.next_audit_date') }}+ </label>- <label class="form-control">- {{ Form::checkbox('notes', '1', '1') }}- {{ trans('general.notes') }}- </label>+ <label class="form-control">+ {{ Form::checkbox('notes', '1', $template->checkmarkValue('notes')) }}+ {{ trans('general.notes') }}+ </label>- <label class="form-control">- {{ Form::checkbox('url', '1', '1') }}- - {{ trans('admin/manufacturers/table.url') }}- </label>+ <label class="form-control">+ {{ Form::checkbox('url', '1', $template->checkmarkValue('url')) }}+ - {{ trans('admin/manufacturers/table.url') }}+ </label><!-- User fields -->@@@ -250,6 -221,38 +257,38 @@@{{ trans('admin/users/table.title') }}</label>+ <!-- new -->++ <label class="form-control">- {{ Form::checkbox('phone', '1', '1') }}++ {{ Form::checkbox('phone', '1', $template->checkmarkValue('phone')) }}+ {{ trans('admin/users/table.phone') }}+ </label>++ <label class="form-control">- {{ Form::checkbox('user_address', '1', '1') }}++ {{ Form::checkbox('user_address', '1', $template->checkmarkValue('user_address')) }}+ {{ trans('general.address') }}+ </label>++ <label class="form-control">- {{Form::checkbox('user_city', '1', '1')}}++ {{Form::checkbox('user_city', '1', $template->checkmarkValue('user_city'))}}+ {{ trans('general.city') }}+ </label>++ <label class="form-control">- {{Form::checkbox('user_state', '1', '1')}}++ {{Form::checkbox('user_state', '1', $template->checkmarkValue('user_state'))}}+ {{ trans('general.state') }}+ </label>++ <label class="form-control">- {{Form::checkbox('user_country', '1', '1')}}++ {{Form::checkbox('user_country', '1', $template->checkmarkValue('user_country'))}}+ {{ trans('general.country') }}+ </label>++ <label class="form-control">- {{Form::checkbox('user_zip', '1', '1')}}++ {{Form::checkbox('user_zip', '1', $template->checkmarkValue('user_zip'))}}+ {{ trans('general.zip') }}+ </label>+@if ($customfields->count() > 0)@@@ -346,63 -297,125 +385,125 @@@</div><!-- Purchase Date -->- <div class="form-group purchase-range">+ <div class="form-group purchase-range{{ ($errors->has('purchase_start') || $errors->has('purchase_end')) ? ' has-error' : '' }}"><label for="purchase_start" class="col-md-3 control-label">{{ trans('general.purchase_date') }} {{ trans('general.range') }}</label>- <div class="input-daterange input-group col-md-6" id="datepicker">+ <div class="input-daterange input-group col-md-7" id="datepicker">- <input type="text" class="form-control" name="purchase_start" aria-label="purchase_start" value="{{ old('purchase_start') }}">+ <input type="text" class="form-control" name="purchase_start" aria-label="purchase_start" value="{{ $template->textValue('purchase_start') }}"><span class="input-group-addon">to</span>- <input type="text" class="form-control" name="purchase_end" aria-label="purchase_end" value="{{ old('purchase_end') }}">+ <input type="text" class="form-control" name="purchase_end" aria-label="purchase_end" value="{{ $template->textValue('purchase_end') }}"></div>++ @if ($errors->has('purchase_start') || $errors->has('purchase_end'))+ <div class="col-md-9 col-lg-offset-3">+ {!! $errors->first('purchase_start', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}+ {!! $errors->first('purchase_end', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}+ </div>+ @endif+</div><!-- Created Date -->- <div class="form-group purchase-range">+ <div class="form-group purchase-range{{ ($errors->has('created_start') || $errors->has('created_end')) ? ' has-error' : '' }}"><label for="created_start" class="col-md-3 control-label">{{ trans('general.created_at') }} {{ trans('general.range') }}</label>- <div class="input-daterange input-group col-md-6" id="datepicker">+ <div class="input-daterange input-group col-md-7" id="datepicker">- <input type="text" class="form-control" name="created_start" aria-label="created_start" value="{{ old('created_start') }}">+ <input type="text" class="form-control" name="created_start" aria-label="created_start" value="{{ $template->textValue('created_start') }}"><span class="input-group-addon">to</span>- <input type="text" class="form-control" name="created_end" aria-label="created_end" value="{{ old('created_end') }}">+ <input type="text" class="form-control" name="created_end" aria-label="created_end" value="{{ $template->textValue('created_end') }}"></div>++ @if ($errors->has('created_start') || $errors->has('created_end'))+ <div class="col-md-9 col-lg-offset-3">+ {!! $errors->first('created_start', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}+ {!! $errors->first('created_end', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}+ </div>+ @endif</div><!-- Checkout Date -->- <div class="form-group checkout-range">+ <div class="form-group checkout-range{{ ($errors->has('checkout_date_start') || $errors->has('checkout_date_end')) ? ' has-error' : '' }}"><label for="checkout_date" class="col-md-3 control-label">{{ trans('general.checkout') }} {{ trans('general.range') }}</label>- <div class="input-daterange input-group col-md-6" id="datepicker">+ <div class="input-daterange input-group col-md-7" id="datepicker">- <input type="text" class="form-control" name="checkout_date_start" aria-label="checkout_date_start" value="{{ old('checkout_date_start') }}">+ <input type="text" class="form-control" name="checkout_date_start" aria-label="checkout_date_start" value="{{ $template->textValue('checkout_date_start') }}"><span class="input-group-addon">to</span>- <input type="text" class="form-control" name="checkout_date_end" aria-label="checkout_date_end" value="{{ old('checkout_date_end') }}">+ <input type="text" class="form-control" name="checkout_date_end" aria-label="checkout_date_end" value="{{ $template->textValue('checkout_date_end') }}"></div>++ @if ($errors->has('checkout_date_start') || $errors->has('checkout_date_end'))+ <div class="col-md-9 col-lg-offset-3">+ {!! $errors->first('checkout_date_start', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}+ {!! $errors->first('checkout_date_end', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}+ </div>+ @endif++ </div>++ <!-- Last Checkin Date -->+ <div class="form-group checkin-range{{ ($errors->has('checkin_date_start') || $errors->has('checkin_date_end')) ? ' has-error' : '' }}">+ <label for="checkin_date" class="col-md-3 control-label">{{ trans('admin/hardware/table.last_checkin_date') }}</label>+ <div class="input-daterange input-group col-md-7" id="datepicker">- <input type="text" class="form-control" name="checkin_date_start" aria-label="checkin_date_start" value="{{ old('checkin_date_start') }}">++ <input type="text" class="form-control" name="checkin_date_start" aria-label="checkin_date_start" value="{{ $template->textValue('checkin_date_start') }}">+ <span class="input-group-addon">{{ strtolower(trans('general.to')) }}</span>- <input type="text" class="form-control" name="checkin_date_end" aria-label="checkin_date_end" value="{{ old('checkin_date_end') }}">++ <input type="text" class="form-control" name="checkin_date_end" aria-label="checkin_date_end" value="{{ $template->textValue('checkin_date_end') }}">+ </div>++ @if ($errors->has('checkin_date_start') || $errors->has('checkin_date_end'))+ <div class="col-md-9 col-lg-offset-3">+ {!! $errors->first('checkin_date_start', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}+ {!! $errors->first('checkin_date_end', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}+ </div>+ @endif</div><!-- Expected Checkin Date -->- <div class="form-group expected_checkin-range">+ <div class="form-group expected_checkin-range{{ ($errors->has('expected_checkin_start') || $errors->has('expected_checkin_end')) ? ' has-error' : '' }}"><label for="expected_checkin_start" class="col-md-3 control-label">{{ trans('admin/hardware/form.expected_checkin') }}</label>- <div class="input-daterange input-group col-md-6" id="datepicker">+ <div class="input-daterange input-group col-md-7" id="datepicker">- <input type="text" class="form-control" name="expected_checkin_start" aria-label="expected_checkin_start" value="{{ old('expected_checkin_start') }}">+ <input type="text" class="form-control" name="expected_checkin_start" aria-label="expected_checkin_start" value="{{ $template->textValue('expected_checkin_start') }}"><span class="input-group-addon">to</span>- <input type="text" class="form-control" name="expected_checkin_end" aria-label="expected_checkin_end" value="{{ old('expected_checkin_end') }}">+ <input type="text" class="form-control" name="expected_checkin_end" aria-label="expected_checkin_end" value="{{ $template->textValue('expected_checkin_end') }}"></div>++ @if ($errors->has('expected_checkin_start') || $errors->has('expected_checkin_end'))+ <div class="col-md-9 col-lg-offset-3">+ {!! $errors->first('expected_checkin_start', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}+ {!! $errors->first('expected_checkin_end', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}+ </div>+ @endif+</div><!-- Last Audit Date -->- <div class="form-group last_audit-range">+ <div class="form-group last_audit-range{{ ($errors->has('last_audit_start') || $errors->has('last_audit_end')) ? ' has-error' : '' }}"><label for="last_audit_start" class="col-md-3 control-label">{{ trans('general.last_audit') }}</label>- <div class="input-daterange input-group col-md-6" id="datepicker">+ <div class="input-daterange input-group col-md-7" id="datepicker">- <input type="text" class="form-control" name="last_audit_start" aria-label="last_audit_start" value="{{ old('last_audit_start') }}">+ <input type="text" class="form-control" name="last_audit_start" aria-label="last_audit_start" value="{{ $template->textValue('last_audit_start') }}"><span class="input-group-addon">to</span>- <input type="text" class="form-control" name="last_audit_end" aria-label="last_audit_end" value="{{ old('last_audit_end') }}">+ <input type="text" class="form-control" name="last_audit_end" aria-label="last_audit_end" value="{{ $template->textValue('last_audit_end') }}"></div>++ @if ($errors->has('last_audit_start') || $errors->has('last_audit_end'))+ <div class="col-md-9 col-lg-offset-3">+ {!! $errors->first('last_audit_start', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}+ {!! $errors->first('last_audit_end', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}+ </div>+ @endif</div><!-- Next Audit Date -->- <div class="form-group next_audit-range">+ <div class="form-group next_audit-range{{ ($errors->has('next_audit_start') || $errors->has('next_audit_end')) ? ' has-error' : '' }}"><label for="next_audit_start" class="col-md-3 control-label">{{ trans('general.next_audit_date') }}</label>- <div class="input-daterange input-group col-md-6" id="datepicker">- <input type="text" class="form-control" name="next_audit_start" aria-label="nex_audit_start" value="{{ $template->textValue('next_audit_start') }}">+ <div class="input-daterange input-group col-md-7" id="datepicker">- <input type="text" class="form-control" name="next_audit_start" aria-label="next_audit_start" value="{{ old('next_audit_start') }}">++ <input type="text" class="form-control" name="next_audit_start" aria-label="next_audit_start" value="{{ $template->textValue('next_audit_start') }}"><span class="input-group-addon">to</span>- <input type="text" class="form-control" name="next_audit_end" aria-label="next_audit_end" value="{{ old('next_audit_end') }}">+ <input type="text" class="form-control" name="next_audit_end" aria-label="next_audit_end" value="{{ $template->textValue('next_audit_end') }}"></div>++ @if ($errors->has('next_audit_start') || $errors->has('next_audit_end'))+ <div class="col-md-9 col-lg-offset-3">+ {!! $errors->first('next_audit_start', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}+ {!! $errors->first('next_audit_end', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}+ </div>+ @endif</div><div class="col-md-9 col-md-offset-3">@@@ -538,35 -507,8 +646,35 @@@});$("#checkAll").change(function () {- $("input:checkbox").prop('checked', $(this).prop("checked"));+ $("input:checkbox").prop('checked', $(this).prop("checked"));});+ $("#savetemplateform").submit(function(e) {+ e.preventDefault(e);++ let form = $('#custom-report-form');+ $('<input>').attr({+ type: 'hidden',+ name: 'name',+ value: $('#name').val(),+ }).appendTo(form);++ form.attr('action', '{{ route('report-templates.store') }}').submit();+ });++ $('#saved_report_select')+ .on('select2:select', function (event) {+ window.location.href = '/reports/templates/' + event.params.data.id;+ })+ .on('select2:clearing', function (event) {+ window.location.href = '{{ route('reports/custom') }}';+ });++ $('#dataConfirmModal').on('show.bs.modal', function (event) {+ var content = $(event.relatedTarget).data('content');+ var title = $(event.relatedTarget).data('title');+ $(this).find(".modal-body").text(content);+ $(this).find(".modal-header").text(title);+ });</script>@stop