Skip to content

A free open source IT asset/license management system

Merge branch 'develop' into saving_custom_report_template

Marcus Moore8bba11e1bba3
diff --cc app/Http/Controllers/ReportsController.php
index 8a2e1f5f97,c4b7ee0609..6ca919b2f4
--- a/app/Http/Controllers/ReportsController.php
+++ b/app/Http/Controllers/ReportsController.php
@@@ -399,9 -391,8 +392,8 @@@ class ReportsController extends Control
* @author [A. Gianotto] [<[email protected]>]
* @see ReportsController::postCustomReport() method that generates the CSV
* @since [v1.0]
- * @return \Illuminate\Contracts\View\View
*/
- public function getCustomReport(Request $request)
- public function getCustomReport() : View
++ public function getCustomReport(Request $request) : View
{
$this->authorize('reports.view');
$customfields = CustomField::get();
diff --cc app/Models/User.php
index 72bee9d45c,5b3d876827..30440c7886
--- a/app/Models/User.php
+++ b/app/Models/User.php
@@@ -336,19 -357,9 +358,19 @@@ class User extends SnipeModel implement
*/
public function licenses()
{
- return $this->belongsToMany(\App\Models\License::class, 'license_seats', 'assigned_to', 'license_id')->withPivot('id');
+ return $this->belongsToMany(\App\Models\License::class, 'license_seats', 'assigned_to', 'license_id')->withPivot('id', 'created_at', 'updated_at');
}
+ /**
+ * Establishes the user -> reportTemplates relationship
+ *
+ * @since [v6.2.4]
+ */
+ public function reportTemplates(): HasMany
+ {
+ return $this->hasMany(ReportTemplate::class);
+ }
+
/**
* Establishes a count of all items assigned
*
diff --cc resources/views/partials/forms/edit/category-select.blade.php
index a5b09e8799,bfa8e3b793..6a7a6a0916
--- a/resources/views/partials/forms/edit/category-select.blade.php
+++ b/resources/views/partials/forms/edit/category-select.blade.php
@@@ -4,19 -4,7 +4,19 @@@
{{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }}
<div class="col-md-7{{ (isset($item) && (Helper::checkIfRequired($item, $fieldname))) ? ' required' : '' }}">
- <select class="js-data-ajax" data-endpoint="categories/{{ (isset($category_type)) ? $category_type : 'assets' }}" data-placeholder="{{ trans('general.select_category') }}" name="{{ $fieldname }}" style="width: 100%" id="category_select_id" aria-label="{{ $fieldname }}" {!! ((isset($item)) && (Helper::checkIfRequired($item, $fieldname))) ? ' data-validation="required" required' : '' !!}{{ (isset($multiple) && ($multiple=='true')) ? " multiple='multiple'" : '' }}>
+ <select class="js-data-ajax" data-endpoint="categories/{{ (isset($category_type)) ? $category_type : 'assets' }}" data-placeholder="{{ trans('general.select_category') }}" name="{{ $fieldname }}" style="width: 100%" id="category_select_id" aria-label="{{ $fieldname }}" {!! ((isset($item)) && (Helper::checkIfRequired($item, $fieldname))) ? ' required ' : '' !!}{{ (isset($multiple) && ($multiple=='true')) ? " multiple='multiple'" : '' }}>
+ @isset ($selected)
+ @if (!is_iterable($selected))
+ @php
+ $selected = [$selected];
+ @endphp
+ @endif
+ @foreach ($selected as $category_id)
+ <option value="{{ $category_id }}" selected="selected" role="option" aria-selected="true" role="option">
+ {{ \App\Models\Category::find($category_id)->name }}
+ </option>
+ @endforeach
+ @endisset
@if ($category_id = old($fieldname, (isset($item)) ? $item->{$fieldname} : ''))
<option value="{{ $category_id }}" selected="selected" role="option" aria-selected="true" role="option">
{{ (\App\Models\Category::find($category_id)) ? \App\Models\Category::find($category_id)->name : '' }}
diff --cc resources/views/partials/forms/edit/company-select.blade.php
index 4c2730d37f,012e032866..5c2548d945
--- a/resources/views/partials/forms/edit/company-select.blade.php
+++ b/resources/views/partials/forms/edit/company-select.blade.php
@@@ -20,16 -20,9 +20,16 @@@
<!-- full company support is enabled or this user is a superadmin -->
<div id="{{ $fieldname }}" class="form-group{{ $errors->has($fieldname) ? ' has-error' : '' }}">
{{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }}
- <div class="col-md-6">
+ <div class="col-md-7">
<select class="js-data-ajax" data-endpoint="companies" data-placeholder="{{ trans('general.select_company') }}" name="{{ $fieldname }}" style="width: 100%" id="company_select"{{ (isset($multiple) && ($multiple=='true')) ? " multiple='multiple'" : '' }}>
+ @isset ($selected)
+ @foreach ($selected as $company_id)
+ <option value="{{ $company_id }}" selected="selected" role="option" aria-selected="true">
+ {{ \App\Models\Company::find($company_id)->name }}
+ </option>
+ @endforeach
+ @endisset
- @if ($company_id = Request::old($fieldname, (isset($item)) ? $item->{$fieldname} : ''))
+ @if ($company_id = old($fieldname, (isset($item)) ? $item->{$fieldname} : ''))
<option value="{{ $company_id }}" selected="selected">
{{ (\App\Models\Company::find($company_id)) ? \App\Models\Company::find($company_id)->name : '' }}
</option>
diff --cc resources/views/partials/forms/edit/location-select.blade.php
index 478e18c3c0,aad8af15e6..3b34db0ee4
--- a/resources/views/partials/forms/edit/location-select.blade.php
+++ b/resources/views/partials/forms/edit/location-select.blade.php
@@@ -3,14 -3,7 +3,14 @@@
{{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }}
<div class="col-md-7{{ ((isset($required) && ($required =='true'))) ? ' required' : '' }}">
- <select class="js-data-ajax" data-endpoint="locations" data-placeholder="{{ trans('general.select_location') }}" name="{{ $fieldname }}" style="width: 100%" id="{{ $fieldname }}_location_select" aria-label="{{ $fieldname }}" {!! ((isset($item)) && (Helper::checkIfRequired($item, $fieldname))) ? ' data-validation="required" required' : '' !!}{{ (isset($multiple) && ($multiple=='true')) ? " multiple='multiple'" : '' }}>
+ <select class="js-data-ajax" data-endpoint="locations" data-placeholder="{{ trans('general.select_location') }}" name="{{ $fieldname }}" style="width: 100%" id="{{ $fieldname }}_location_select" aria-label="{{ $fieldname }}" {!! ((isset($item)) && (Helper::checkIfRequired($item, $fieldname))) ? ' required ' : '' !!}{{ (isset($multiple) && ($multiple=='true')) ? " multiple='multiple'" : '' }}>
+ @isset($selected)
+ @foreach($selected as $location_id)
+ <option value="{{ $location_id }}" selected="selected" role="option" aria-selected="true" role="option">
+ {{ (\App\Models\Location::find($location_id))->name }}
+ </option>
+ @endforeach
+ @endisset
@if ($location_id = old($fieldname, (isset($item)) ? $item->{$fieldname} : ''))
<option value="{{ $location_id }}" selected="selected" role="option" aria-selected="true" role="option">
{{ (\App\Models\Location::find($location_id)) ? \App\Models\Location::find($location_id)->name : '' }}
diff --cc resources/views/partials/forms/edit/model-select.blade.php
index 8cccb4a603,c18d85af3b..bfeca7cf97
--- a/resources/views/partials/forms/edit/model-select.blade.php
+++ b/resources/views/partials/forms/edit/model-select.blade.php
@@@ -4,19 -4,7 +4,19 @@@
{{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }}
<div class="col-md-7{{ ((isset($field_req)) || ((isset($required) && ($required =='true')))) ? ' required' : '' }}">
- <select class="js-data-ajax" data-endpoint="models" data-placeholder="{{ trans('general.select_model') }}" name="{{ $fieldname }}" style="width: 100%" id="model_select_id" aria-label="{{ $fieldname }}"{!! (isset($field_req) ? ' data-validation="required" required' : '') !!}{{ (isset($multiple) && ($multiple=='true')) ? " multiple='multiple'" : '' }}>
+ <select class="js-data-ajax" data-endpoint="models" data-placeholder="{{ trans('general.select_model') }}" name="{{ $fieldname }}" style="width: 100%" id="model_select_id" aria-label="{{ $fieldname }}"{!! (isset($field_req) ? ' required ' : '') !!}{{ (isset($multiple) && ($multiple=='true')) ? " multiple='multiple'" : '' }}>
+ @isset ($selected)
+ @if (!is_iterable($selected))
+ @php
+ $selected = [$selected];
+ @endphp
+ @endif
+ @foreach ($selected as $model_id)
+ <option value="{{ $model_id }}" selected="selected" role="option" aria-selected="true">
+ {{ \App\Models\AssetModel::find($model_id)->name }}
+ </option>
+ @endforeach
+ @endisset
@if ($model_id = old($fieldname, ($item->{$fieldname} ?? request($fieldname) ?? '')))
<option value="{{ $model_id }}" selected="selected">
{{ (\App\Models\AssetModel::find($model_id)) ? \App\Models\AssetModel::find($model_id)->name : '' }}
diff --cc resources/views/partials/forms/edit/status-select.blade.php
index fb4d4798e5,836b8145a0..183dc9130f
--- a/resources/views/partials/forms/edit/status-select.blade.php
+++ b/resources/views/partials/forms/edit/status-select.blade.php
@@@ -4,14 -4,7 +4,14 @@@
{{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }}
<div class="col-md-7{{ ((isset($required)) && ($required=='true')) ? ' required' : '' }}">
- <select class="js-data-ajax" data-endpoint="statuslabels" data-placeholder="{{ trans('general.select_statuslabel') }}" name="{{ $fieldname }}" style="width: 100%" id="status_select_id" aria-label="{{ $fieldname }}" {!! ((isset($item)) && (Helper::checkIfRequired($item, $fieldname))) ? ' data-validation="required" required' : '' !!}{{ (isset($multiple) && ($multiple=='true')) ? " multiple='multiple'" : '' }}>
+ <select class="js-data-ajax" data-endpoint="statuslabels" data-placeholder="{{ trans('general.select_statuslabel') }}" name="{{ $fieldname }}" style="width: 100%" id="status_select_id" aria-label="{{ $fieldname }}" {!! ((isset($item)) && (Helper::checkIfRequired($item, $fieldname))) ? ' required ' : '' !!}{{ (isset($multiple) && ($multiple=='true')) ? " multiple='multiple'" : '' }}>
+ @isset ($selected)
+ @foreach ($selected as $status_id)
+ <option value="{{ $status_id }}" selected="selected" role="option" aria-selected="true">
+ {{ \App\Models\Statuslabel::find($status_id)->name }}
+ </option>
+ @endforeach
+ @endisset
@if ($status_id = old($fieldname, (isset($item)) ? $item->{$fieldname} : ''))
<option value="{{ $status_id }}" selected="selected" role="option" aria-selected="true" role="option">
{{ (\App\Models\Statuslabel::find($status_id)) ? \App\Models\Statuslabel::find($status_id)->name : '' }}
diff --cc resources/views/reports/custom.blade.php
index 0f19c4ddd4,de673377f8..255bc45335
--- a/resources/views/reports/custom.blade.php
+++ b/resources/views/reports/custom.blade.php
@@@ -67,118 -31,118 +67,118 @@@
<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">
+ <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" style="margin-left: 25px;">
- {{ Form::checkbox('location_address', '1', '1') }}
++ {{ Form::checkbox('location_address', '1', $template->checkmarkValue('location_address')) }}
+ {{ 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', '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" style="margin-left: 25px;">
- {{ Form::checkbox('rtd_location_address', '1', '1') }}
++ {{ Form::checkbox('rtd_location_address', '1', $template->checkmarkValue('rtd_location_address')) }}
+ {{ trans('general.address') }}
+ </label>
- <label class="form-control">
- {{ Form::checkbox('status', '1', '1') }}
- {{ trans('general.status') }}
- </label>
+ <label class="form-control">
+ {{ Form::checkbox('status', '1', $template->checkmarkValue('status')) }}
+ {{ 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('warranty', '1', $template->checkmarkValue('warranty')) }}
+ {{ 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('depreciation', '1', $template->checkmarkValue('depreciation')) }}
+ {{ 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('checkout_date', '1', $template->checkmarkValue('checkout_date')) }}
+ {{ trans('admin/hardware/table.checkout_date') }}
+ </label>
<label class="form-control">
- {{ Form::checkbox('checkin_date', '1', '1') }}
+ {{ Form::checkbox('checkin_date', '1', $template->checkmarkValue('checkin_date')) }}
{{ trans('admin/hardware/table.last_checkin_date') }}
</label>
@@@ -187,48 -151,48 +187,48 @@@
{{ 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', $template->checkmarkValue('url')) }}
- - {{ trans('admin/manufacturers/table.url') }}
- </label>
+ <label class="form-control" style="margin-left: 25px;">
- {{ Form::checkbox('url', '1', '1') }}
++ {{ Form::checkbox('url', '1', $template->checkmarkValue('url')) }}
+ {{ trans('general.url') }}
+ </label>
<!-- User fields -->
- <h2>{{ trans('general.checked_out_to') }} {{ trans('general.fields') }}:</h2>
+ <h2>{{ trans('general.checked_out_to_fields') }}: </h2>
<label class="form-control">
- {{ Form::checkbox('assigned_to', '1', '1') }}
+ {{ Form::checkbox('assigned_to', '1', $template->checkmarkValue('assigned_to')) }}
{{ trans('admin/licenses/table.assigned_to') }}
</label>
@@@ -315,66 -279,59 +315,70 @@@
<br>
@include ('partials.forms.edit.company-select', [
- 'translated_name' => trans('general.company'),
- 'multiple' => 'true',
- 'fieldname' => 'by_company_id[]',
- 'hide_new' => 'true',
- 'selected' => $template->selectValues('by_company_id', \App\Models\Company::class),
+ 'translated_name' => trans('general.company'),
+ 'fieldname' =>
+ 'by_company_id[]',
+ 'multiple' => 'true',
- 'hide_new' => 'true'
- ])
++ 'hide_new' => 'true',
++ 'selected' => $template->selectValues('by_company_id', \App\Models\Company::class),
+ ])
@include ('partials.forms.edit.location-select', [
- 'translated_name' => trans('general.location'),
- 'multiple' => 'true',
- 'fieldname' => 'by_location_id[]',
- 'hide_new' => 'true',
- 'selected' => $template->selectValues('by_location_id', \App\Models\Location::class),
+ 'translated_name' => trans('general.location'),
+ 'fieldname' => 'by_location_id[]',
+ 'multiple' => 'true',
- 'hide_new' => 'true'
- ])
++ 'hide_new' => 'true',
++ 'selected' => $template->selectValues('by_location_id', \App\Models\Location::class),
+ ])
@include ('partials.forms.edit.location-select', [
- 'translated_name' => trans('admin/hardware/form.default_location'),
- 'multiple' => 'true',
- 'fieldname' => 'by_rtd_location_id[]',
- 'hide_new' => 'true',
- 'selected' => $template->selectValues('by_rtd_location_id', \App\Models\Location::class),
- ])
- @include ('partials.forms.edit.department-select', [
- 'translated_name' => trans('general.department'),
- 'fieldname' => 'by_dept_id',
- 'hide_new' => 'true',
- 'selected' => $template->selectValue('by_dept_id', \App\Models\Department::class),
+ 'translated_name' => trans('admin/hardware/form.default_location'),
+ 'fieldname' => 'by_rtd_location_id[]',
+ 'multiple' => 'true',
- 'hide_new' => 'true'
- ])
++ 'hide_new' => 'true',
++ 'selected' => $template->selectValues('by_rtd_location_id', \App\Models\Location::class),
++ ])
+ @include ('partials.forms.edit.department-select',[
+ 'translated_name' => trans('general.department'),
+ 'fieldname' => 'by_dept_id[]',
+ 'multiple' => 'true',
- 'hide_new' => 'true'
- ])
++ 'hide_new' => 'true',
++ 'selected' => $template->selectValue('by_dept_id', \App\Models\Department::class),
+ ])
@include ('partials.forms.edit.supplier-select', [
- 'translated_name' => trans('general.supplier'),
- 'fieldname' => 'by_supplier_id[]',
- 'multiple' => 'true',
- 'hide_new' => 'true',
- 'selected' => $template->selectValues('by_supplier_id', \App\Models\Supplier::class),
+ 'translated_name' => trans('general.supplier'),
+ 'fieldname' => 'by_supplier_id[]',
+ 'multiple' => 'true',
- 'hide_new' => 'true'
- ])
++ 'hide_new' => 'true',
++ 'selected' => $template->selectValues('by_supplier_id', \App\Models\Supplier::class),
+ ])
@include ('partials.forms.edit.model-select', [
- 'translated_name' => trans('general.asset_model'),
- 'fieldname' => 'by_model_id[]',
- 'multiple' => 'true',
- 'hide_new' => 'true',
- 'selected' => $template->selectValues('by_model_id', \App\Models\AssetModel::class),
+ 'translated_name' => trans('general.asset_model'),
+ 'fieldname' => 'by_model_id[]',
+ 'multiple' => 'true',
- 'hide_new' => 'true'
- ])
++ 'hide_new' => 'true',
++ 'selected' => $template->selectValues('by_model_id', \App\Models\AssetModel::class),
+ ])
@include ('partials.forms.edit.manufacturer-select', [
- 'translated_name' => trans('general.manufacturer'),
- 'fieldname' => 'by_manufacturer_id',
- 'hide_new' => 'true',
- 'selected' => $template->selectValue('by_manufacturer_id', \App\Models\Manufacturer::class),
- ])
+ 'translated_name' => trans('general.manufacturer'),
+ 'fieldname' => 'by_manufacturer_id[]',
+ 'multiple' => 'true',
- 'hide_new' => 'true'
- ])
++ 'hide_new' => 'true',
++ 'selected' => $template->selectValue('by_manufacturer_id', \App\Models\Manufacturer::class),
++ ])
@include ('partials.forms.edit.category-select', [
- 'translated_name' => trans('general.category'),
- 'fieldname' => 'by_category_id',
- 'hide_new' => 'true',
- 'category_type' => 'asset',
- 'selected' => $template->selectValue('by_category_id', \App\Models\Category::class),
+ 'translated_name' => trans('general.category'),
+ 'fieldname' => 'by_category_id[]',
+ 'multiple' => 'true',
- 'hide_new' => 'true', 'category_type' => 'asset'
- ])
- @include ('partials.forms.edit.status-select', [
++ 'hide_new' => 'true',
++ 'category_type' => 'asset',
++ 'selected' => $template->selectValue('by_category_id', \App\Models\Category::class),
+ ])
+ @include ('partials.forms.edit.status-select', [
- 'translated_name' => trans('admin/hardware/form.status'),
- 'fieldname' => 'by_status_id[]',
- 'multiple' => 'true',
- 'hide_new' => 'true',
- 'selected' => $template->selectValues('by_status_id', \App\Models\Statuslabel::class),
+ 'translated_name' => trans('admin/hardware/form.status'),
+ 'fieldname' => 'by_status_id[]',
+ 'multiple' => 'true',
- 'hide_new' => 'true'])
++ 'hide_new' => 'true',
++ 'selected' => $template->selectValues('by_status_id', \App\Models\Statuslabel::class),
+ ])
<!-- Order Number -->
<div class="form-group">
@@@ -386,11 -343,11 +390,11 @@@
<!-- Purchase Date -->
<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>
+ <label for="purchase_start" class="col-md-3 control-label">{{ trans('general.purchase_date') }}</label>
<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="{{ $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="{{ $template->textValue('purchase_end') }}">
- <input type="text" class="form-control" name="purchase_start" aria-label="purchase_start" value="{{ old('purchase_start') }}">
- <span class="input-group-addon">{{ strtolower(trans('general.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_start" aria-label="purchase_start" value="{{ $template->textValue('purchase_start') }}">
++ <span class="input-group-addon">{{ strtolower(trans('general.to')) }}</span>
++ <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'))
@@@ -404,11 -361,11 +408,11 @@@
<!-- Created Date -->
<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>
+ <label for="created_start" class="col-md-3 control-label">{{ trans('general.created_at') }} </label>
<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="{{ $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="{{ $template->textValue('created_end') }}">
- <input type="text" class="form-control" name="created_start" aria-label="created_start" value="{{ old('created_start') }}">
- <span class="input-group-addon">{{ strtolower(trans('general.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_start" aria-label="created_start" value="{{ $template->textValue('created_start') }}">
++ <span class="input-group-addon">{{ strtolower(trans('general.to')) }}</span>
++ <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'))
@@@ -421,11 -378,11 +425,11 @@@
<!-- Checkout Date -->
<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>
+ <label for="checkout_date" class="col-md-3 control-label">{{ trans('general.checkout') }} </label>
<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>
+ <span class="input-group-addon">{{ strtolower(trans('general.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'))
@@@ -458,9 -415,9 +462,9 @@@
<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-7" id="datepicker">
- <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="{{ $template->textValue('expected_checkin_end') }}">
- <input type="text" class="form-control" name="expected_checkin_start" aria-label="expected_checkin_start" value="{{ old('expected_checkin_start') }}">
- <span class="input-group-addon">{{ strtolower(trans('general.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_start" aria-label="expected_checkin_start" value="{{ $template->textValue('expected_checkin_start') }}">
++ <span class="input-group-addon">{{ strtolower(trans('general.to')) }}</span>
++ <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'))
@@@ -476,9 -433,9 +480,9 @@@
<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-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>
+ <span class="input-group-addon">{{ strtolower(trans('general.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'))
@@@ -493,9 -450,9 +497,9 @@@
<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-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>
+ <span class="input-group-addon">{{ strtolower(trans('general.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'))