Compare commits
23 Commits
v8.3.5
...
form-row-c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f233bc218 | ||
|
|
448f4b94af | ||
|
|
7c58fb93a9 | ||
|
|
80e4e4a40e | ||
|
|
7161d56ae2 | ||
|
|
1e85c7b575 | ||
|
|
03130f0947 | ||
|
|
4812e25e5c | ||
|
|
e6c49da11c | ||
|
|
6f3ee1914a | ||
|
|
9232ee781e | ||
|
|
3d675d375c | ||
|
|
d2edc77197 | ||
|
|
53716cbe90 | ||
|
|
8ce3fe0df0 | ||
|
|
affee0a990 | ||
|
|
6d5f515f48 | ||
|
|
d96844498f | ||
|
|
08609d4f56 | ||
|
|
be344c440f | ||
|
|
96cc2c9ee9 | ||
|
|
fb1a89442c | ||
|
|
359e0197bf |
@@ -142,7 +142,7 @@ class IconHelper
|
||||
case 'more-files':
|
||||
return 'fa-solid fa-laptop-file';
|
||||
case 'maintenances':
|
||||
return 'fas fa-wrench';
|
||||
return 'fa-solid fa-screwdriver-wrench';
|
||||
case 'seats':
|
||||
return 'far fa-list-alt';
|
||||
case 'globe-us':
|
||||
|
||||
@@ -68,6 +68,12 @@ class MaintenancesController extends Controller
|
||||
{
|
||||
$this->authorize('update', Asset::class);
|
||||
|
||||
\Log::error(print_r($request->input('selected_assets[]'), true));
|
||||
|
||||
if (!$request->filled('selected_assets')) {
|
||||
return redirect()->back()->withInput()->with('error', 'No assets were selected.');
|
||||
}
|
||||
|
||||
$assets = Asset::whereIn('id', $request->input('selected_assets'))->get();
|
||||
|
||||
// Loop through the selected assets
|
||||
|
||||
@@ -20,6 +20,13 @@ class SnipeModel extends Model
|
||||
$this->attributes['purchase_date'] = $value;
|
||||
}
|
||||
|
||||
protected function purchaseDateForDatepicker(): Attribute
|
||||
{
|
||||
return Attribute:: make(
|
||||
get: fn(mixed $value, array $attributes) => array_key_exists('purchase_date', $attributes) ? Carbon::parse($attributes['purchase_date'])->format('Y-m-d') : null,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
protected function purchaseDateFormatted(): Attribute
|
||||
{
|
||||
|
||||
@@ -24,6 +24,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
|
||||
/**
|
||||
* This service provider handles setting the observers on models
|
||||
@@ -42,6 +43,9 @@ class AppServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot(UrlGenerator $url)
|
||||
{
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This is a workaround for proxies/reverse proxies that don't always pass the proper headers.
|
||||
*
|
||||
@@ -76,6 +80,9 @@ class AppServiceProvider extends ServiceProvider
|
||||
Consumable::observe(ConsumableObserver::class);
|
||||
License::observe(LicenseObserver::class);
|
||||
Setting::observe(SettingObserver::class);
|
||||
|
||||
// https://laravel.com/docs/11.x/blade#html-entity-encoding
|
||||
Blade::withoutDoubleEncoding();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
public/css/dist/all.css
vendored
2
public/css/dist/all.css
vendored
File diff suppressed because one or more lines are too long
@@ -2,8 +2,8 @@
|
||||
"/js/dist/all.js": "/js/dist/all.js?id=6ffdb46d7dcfceb395f453e15cfbc4be",
|
||||
"/css/dist/skins/skin-black-dark.css": "/css/dist/skins/skin-black-dark.css?id=bf1a348eae3e60c62b8879953f7df14c",
|
||||
"/css/dist/skins/_all-skins.css": "/css/dist/skins/_all-skins.css?id=f712d11cfca345b58c1d8a35df03d38d",
|
||||
"/css/build/overrides.css": "/css/build/overrides.css?id=f9623ce518286374061ab2e687625d44",
|
||||
"/css/build/app.css": "/css/build/app.css?id=83eea8dd4d4fca629261df8b71025a77",
|
||||
"/css/build/overrides.css": "/css/build/overrides.css?id=3a3b20a7cde391756b707a67a3e297e4",
|
||||
"/css/build/app.css": "/css/build/app.css?id=86244e556cc26877415e9ab63e8b7e33",
|
||||
"/css/build/AdminLTE.css": "/css/build/AdminLTE.css?id=bdf169bc2141f453390614c138cdce95",
|
||||
"/css/dist/skins/skin-yellow.css": "/css/dist/skins/skin-yellow.css?id=e1e6e1c64cf14fc350585aaeb0e42f6b",
|
||||
"/css/dist/skins/skin-yellow-dark.css": "/css/dist/skins/skin-yellow-dark.css?id=08ae1b3e66008966ce5d600ea3ad04a2",
|
||||
@@ -19,7 +19,7 @@
|
||||
"/css/dist/skins/skin-blue.css": "/css/dist/skins/skin-blue.css?id=68a92d85c8e351dfb38a835307f126ec",
|
||||
"/css/dist/skins/skin-blue-dark.css": "/css/dist/skins/skin-blue-dark.css?id=cbb20ad6182b658f34117bf96a621b63",
|
||||
"/css/dist/skins/skin-black.css": "/css/dist/skins/skin-black.css?id=84e2ee950ae04444988b37038e5a3951",
|
||||
"/css/dist/all.css": "/css/dist/all.css?id=b234d09cc37cdddb008d79d2a1f46660",
|
||||
"/css/dist/all.css": "/css/dist/all.css?id=d025bd7724d6b3510b3818f6f120f6ef",
|
||||
"/css/dist/signature-pad.css": "/css/dist/signature-pad.css?id=6a89d3cd901305e66ced1cf5f13147f7",
|
||||
"/css/dist/signature-pad.min.css": "/css/dist/signature-pad.min.css?id=6a89d3cd901305e66ced1cf5f13147f7",
|
||||
"/js/select2/i18n/af.js": "/js/select2/i18n/af.js?id=4f6fcd73488ce79fae1b7a90aceaecde",
|
||||
|
||||
@@ -1175,10 +1175,6 @@ input[type="radio"]:checked::before {
|
||||
display: table-row !important;
|
||||
}
|
||||
|
||||
.form-control-static {
|
||||
padding-top: 0px;
|
||||
}
|
||||
|
||||
|
||||
td.text-right.text-padding-number-cell {
|
||||
padding-right: 30px !important;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
return [
|
||||
'select_type' => 'Select Maintenance Type',
|
||||
'asset_maintenance_type' => 'Asset Maintenance Type',
|
||||
'asset_maintenance_type' => 'Maintenance Type',
|
||||
'title' => 'Title',
|
||||
'start_date' => 'Start Date',
|
||||
'completion_date' => 'Completion Date',
|
||||
|
||||
47
resources/views/blade/box.blade.php
Normal file
47
resources/views/blade/box.blade.php
Normal file
@@ -0,0 +1,47 @@
|
||||
@props([
|
||||
'item' => null,
|
||||
'border_class' => 'default',
|
||||
'header_icon' => null,
|
||||
'form_route' => null,
|
||||
])
|
||||
|
||||
|
||||
|
||||
<div {{ $attributes->merge(['class' => 'col-lg-6 col-lg-offset-3 col-md-10 col-md-offset-1 col-sm-12 col-sm-offset-0']) }}>
|
||||
|
||||
|
||||
<!-- CSRF Token -->
|
||||
{{ csrf_field() }}
|
||||
|
||||
<div class="box box-{{ $border_class }}">
|
||||
|
||||
<!-- .box-header -->
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title">
|
||||
@if ($header_icon)
|
||||
<x-icon type="{{ $header_icon }}" class="box-header-icon" />
|
||||
@endif
|
||||
{{ ($item->id) ? $item->display_name : trans('general.create') }}
|
||||
</h2>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
|
||||
<!-- box-body -->
|
||||
<div class="box-body">
|
||||
|
||||
{{ $slot }}
|
||||
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
|
||||
<div class="box-footer text-right">
|
||||
<button type="submit" class="btn btn-success">
|
||||
<x-icon type="checkmark" />
|
||||
{{ trans('general.save') }}
|
||||
</button>
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
|
||||
</div> <!-- /.box-default -->
|
||||
|
||||
</div>
|
||||
7
resources/views/blade/form-inline-help-text.blade.php
Normal file
7
resources/views/blade/form-inline-help-text.blade.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<!-- Help Text -->
|
||||
<div {{ $attributes->merge(['class' => 'col-md-8 col-md-offset-3']) }}>
|
||||
<p class="help-block">
|
||||
{{ $slot }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
7
resources/views/blade/form-inline-tooltip.blade.php
Normal file
7
resources/views/blade/form-inline-tooltip.blade.php
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
<!-- Info Tooltip -->
|
||||
<div class="col-md-1 text-left" style="padding-left:0; margin-top: 5px;">
|
||||
<x-form-tooltip>
|
||||
{{ $slot }}
|
||||
</x-form-tooltip>
|
||||
</div>
|
||||
71
resources/views/blade/form-input.blade.php
Normal file
71
resources/views/blade/form-input.blade.php
Normal file
@@ -0,0 +1,71 @@
|
||||
@aware(['name'])
|
||||
|
||||
@props([
|
||||
'class' => null,
|
||||
'new_model' => false,
|
||||
'category_type' => null,
|
||||
'modal_type' => false,
|
||||
'modal_id' => false,
|
||||
])
|
||||
|
||||
<?php
|
||||
|
||||
// Let's set some sane defaults here for smaller fields
|
||||
// This uses the form name to determine the appropriate class
|
||||
switch ($name) {
|
||||
case 'qty':
|
||||
case 'min_amt':
|
||||
case 'seats':
|
||||
$class_override = $new_model ? 'col-md-3' : 'col-md-4';
|
||||
break;
|
||||
case 'purchase_cost':
|
||||
case 'purchase_date':
|
||||
case 'termination_date':
|
||||
case 'expiration_date':
|
||||
case 'start_date':
|
||||
case 'end_date':
|
||||
$class_override = $new_model ? 'col-md-4' : 'col-md-5';
|
||||
break;
|
||||
case 'model_number':
|
||||
case 'item_no':
|
||||
case 'order_number':
|
||||
case 'purchase_order':
|
||||
$class_override = $new_model ? 'col-md-5' : 'col-md-6';
|
||||
break;
|
||||
default:
|
||||
$class_override = $new_model ? 'col-md-7' : 'col-md-8';
|
||||
break;
|
||||
}
|
||||
|
||||
// Use the explicit override if one is set
|
||||
if ($class) {
|
||||
$class_override = $class;
|
||||
}
|
||||
?>
|
||||
<!-- form-input blade component -->
|
||||
<div {{ $attributes->merge(['class' => $class_override]) }}>
|
||||
{{ $slot }}
|
||||
</div>
|
||||
|
||||
@if ($new_model)
|
||||
<div class="col-md-1 col-sm-1">
|
||||
@can('create', $new_model)
|
||||
<a href='{{ route('modal.show',[
|
||||
'type' => $modal_type ?? null,
|
||||
'category_type' => $category_type ?? null
|
||||
]) }}' data-toggle="modal" data-target="#createModal" data-select="{{ $modal_id }}" class="btn btn-sm btn-primary text-left">{{ trans('button.new') }}</a>
|
||||
@endcan
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@error($name)
|
||||
<div class="col-md-8 col-md-offset-3">
|
||||
<span class="alert-msg" aria-hidden="true">
|
||||
<x-icon type="x" />
|
||||
{{ $message }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
@enderror
|
||||
@@ -1,4 +1,6 @@
|
||||
@aware(['name'])
|
||||
|
||||
<!-- form-label blade component -->
|
||||
<label {{ $attributes->merge(['class' => 'control-label']) }}>
|
||||
<label {{ $attributes->merge(['class' => 'control-label col-md-3']) }} for="{{ $name }}">
|
||||
{{ $slot }}
|
||||
</label>
|
||||
@@ -1,76 +1,9 @@
|
||||
<!-- form-row blade component -->
|
||||
@props([
|
||||
'name' => null,
|
||||
'type' => 'text',
|
||||
'item' => null,
|
||||
'info_tooltip_text' => null,
|
||||
'help_text' => null,
|
||||
'label' => null,
|
||||
'input_div_class' => 'col-md-8',
|
||||
'errors_class' => $errors->has('support_url') ? ' has-error' : '',
|
||||
'input_icon' => null,
|
||||
'input_group_addon' => null,
|
||||
'rows' => null,
|
||||
'placeholder' => null,
|
||||
])
|
||||
|
||||
<div {{ $attributes->merge(['class' => 'form-group'. $errors_class]) }}>
|
||||
<!-- form-row blade component -->
|
||||
<div {{ $attributes->merge(['name' => $name]) }} class="form-group @error($name) has-error @enderror">
|
||||
{{ $slot }}
|
||||
</div>
|
||||
|
||||
<!-- form label -->
|
||||
@if (isset($label))
|
||||
<x-form-label :for="$name" class="{{ $label_class ?? 'col-md-3' }}">{{ $label }}</x-form-label>
|
||||
@endif
|
||||
|
||||
|
||||
@php
|
||||
$blade_type = in_array($type, ['text', 'email', 'url', 'tel', 'number', 'password']) ? 'text' : $type;
|
||||
@endphp
|
||||
|
||||
<div class="{{ $input_div_class }}">
|
||||
<x-dynamic-component
|
||||
:$name
|
||||
:$type
|
||||
:aria-label="$name"
|
||||
:component="'input.'.$blade_type"
|
||||
:id="$name"
|
||||
:required="Helper::checkIfRequired($item, $name)"
|
||||
:value="old($name, $item->{$name})"
|
||||
:input_icon="$input_icon"
|
||||
:input_group_addon="$input_group_addon"
|
||||
:rows="$rows"
|
||||
:placeholder="$placeholder"
|
||||
|
||||
/>
|
||||
</div>
|
||||
|
||||
@if ($info_tooltip_text)
|
||||
<!-- Info Tooltip -->
|
||||
<div class="col-md-1 text-left" style="padding-left:0; margin-top: 5px;">
|
||||
<x-form-tooltip>
|
||||
{{ $info_tooltip_text }}
|
||||
</x-form-tooltip>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@error($name)
|
||||
<div class="col-md-8 col-md-offset-3">
|
||||
<span class="alert-msg" aria-hidden="true">
|
||||
<x-icon type="x" />
|
||||
{{ $message }}
|
||||
</span>
|
||||
</div>
|
||||
@enderror
|
||||
|
||||
@if ($help_text)
|
||||
<!-- Help Text -->
|
||||
<div class="col-md-8 col-md-offset-3">
|
||||
<p class="help-block">
|
||||
{!! $help_text !!}
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
15
resources/views/blade/form.blade.php
Normal file
15
resources/views/blade/form.blade.php
Normal file
@@ -0,0 +1,15 @@
|
||||
@props([
|
||||
'item' => null,
|
||||
'update_route' => null,
|
||||
'create_route' => null,
|
||||
])
|
||||
|
||||
<form class="form-horizontal" id="create-form" method="post" action="{{ ($item->id) ? route($update_route, $item->id) : route($create_route) }}" autocomplete="off" enctype="multipart/form-data">
|
||||
|
||||
@if ($item->id)
|
||||
{{ method_field('PUT') }}
|
||||
@endif
|
||||
|
||||
{{ $slot }}
|
||||
|
||||
</form>
|
||||
@@ -1,13 +1,31 @@
|
||||
@aware(['name'])
|
||||
|
||||
@props([
|
||||
'value' => '',
|
||||
'required' => '',
|
||||
'value' => null,
|
||||
'required' => false,
|
||||
'end_date' => null,
|
||||
'col_size_class' => null,
|
||||
'name' => null,
|
||||
])
|
||||
|
||||
<!-- Datepicker -->
|
||||
<div class="input-group date {{ $col_size_class }}" data-provide="datepicker" data-date-today-highlight="true" data-date-language="{{ auth()->user()->locale }}" data-date-locale="{{ auth()->user()->locale }}" data-date-format="yyyy-mm-dd" data-date-autoclose="true" data-date-clear-btn="true"{{ $end_date ? ' data-date-end-date=' . $end_date : '' }}>
|
||||
<input type="text" placeholder="{{ trans('general.select_date') }}" value="{{ $value }}" maxlength="10" {{ $attributes->merge(['class' => 'form-control']) }} {{ $required=='1' ? 'required' : '' }}>
|
||||
<div
|
||||
{{ $attributes->merge(['class' => 'input-group date']) }}
|
||||
data-provide="datepicker"
|
||||
data-date-today-highlight="true"
|
||||
data-date-language="{{ auth()->user()->locale }}"
|
||||
data-date-locale="{{ auth()->user()->locale }}"
|
||||
data-date-format="yyyy-mm-dd"
|
||||
data-date-autoclose="true"
|
||||
data-date-clear-btn="true"{{ $end_date ? ' data-date-end-date=' . $end_date : '' }}>
|
||||
|
||||
<input
|
||||
type="text"
|
||||
name="{{ $name }}"
|
||||
placeholder="{{ trans('general.select_date') }}"
|
||||
value="{{ $value }}" maxlength="10"
|
||||
{{ $attributes->merge(['class' => 'form-control']) }}
|
||||
{{ $required ? ' required' : '' }}
|
||||
>
|
||||
<span class="input-group-addon"><x-icon type="calendar" /></span>
|
||||
|
||||
</div>
|
||||
@@ -1,3 +1,5 @@
|
||||
@aware(['name'])
|
||||
|
||||
@props([
|
||||
// <options> can either be provided as key => value pairs
|
||||
// or passed in via the default $slot
|
||||
@@ -5,9 +7,11 @@
|
||||
'selected' => null,
|
||||
'includeEmpty' => false,
|
||||
'forLivewire' => false,
|
||||
'name' => null
|
||||
])
|
||||
|
||||
<select
|
||||
name="{{ $name }}"
|
||||
{{ $attributes->class(['select2', 'livewire-select2' => $forLivewire]) }}
|
||||
@if($forLivewire) data-livewire-component="{{ $this->getId() }}" @endif
|
||||
>
|
||||
|
||||
44
resources/views/blade/input/select2-ajax.blade.php
Normal file
44
resources/views/blade/input/select2-ajax.blade.php
Normal file
@@ -0,0 +1,44 @@
|
||||
@aware(['name'])
|
||||
|
||||
@props([
|
||||
'selected' => null,
|
||||
'forLivewire' => false,
|
||||
'data_endpoint' => false,
|
||||
'data_placeholder' => false,
|
||||
'multiple' => false,
|
||||
'item_model' => null,
|
||||
'name' => null,
|
||||
'new_button' => false,
|
||||
])
|
||||
|
||||
@if (!$selected)
|
||||
@php
|
||||
$selected = old($name);
|
||||
@endphp
|
||||
@endif
|
||||
|
||||
|
||||
<select
|
||||
{{ ($multiple == 'true')? ' multiple' : '' }}
|
||||
{{ $attributes->class(['js-data-ajax select2', 'livewire-select2' => $forLivewire])->style(['width:100%']) }}
|
||||
@if($forLivewire) data-livewire-component="{{ $this->getId() }}" @endif
|
||||
data-endpoint="{{ $data_endpoint }}"
|
||||
data-placeholder="{{ $data_placeholder }}"
|
||||
name="{{ $name }}"
|
||||
>
|
||||
@if ($selected)
|
||||
|
||||
@if (is_integer($selected))
|
||||
<option value="{{ $selected }}" selected="selected" role="option" aria-selected="true">
|
||||
{{ $item_model::find($selected) ? $item_model::find($selected)->display_name : '' }}
|
||||
</option>
|
||||
@else
|
||||
@foreach ($selected as $key => $id)
|
||||
<option value="{{ $id }}" selected="selected" role="option" aria-selected="true">
|
||||
{{ $item_model::find($id) ? $item_model::find($id)->display_name : '' }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
|
||||
</select>
|
||||
7
resources/views/blade/input/static.blade.php
Normal file
7
resources/views/blade/input/static.blade.php
Normal file
@@ -0,0 +1,7 @@
|
||||
@props([
|
||||
'static_value' => false,
|
||||
])
|
||||
|
||||
<p class="form-control-static">
|
||||
{{ $slot ?? $static_value }}
|
||||
</p>
|
||||
@@ -1,21 +1,30 @@
|
||||
@aware(['name'])
|
||||
|
||||
@props([
|
||||
'input_group_addon' => null,
|
||||
'input_icon' => null,
|
||||
'name' => null,
|
||||
'input_group_addon' => false,
|
||||
'input_icon' => false,
|
||||
'input_group_text' => false,
|
||||
'required' => false,
|
||||
'item' => null,
|
||||
])
|
||||
<!-- input-text blade component -->
|
||||
@if ($input_group_addon)
|
||||
<div class="input-group">
|
||||
@endif
|
||||
|
||||
<input
|
||||
{{ $attributes->merge(['class' => 'form-control']) }}
|
||||
name="{{ $name }}"
|
||||
@required($required)
|
||||
/>
|
||||
|
||||
@if ($input_group_addon)
|
||||
<span class="input-group-addon">
|
||||
<x-icon :type="$input_icon" />
|
||||
@if ($input_icon)
|
||||
<x-icon :type="$input_icon" />
|
||||
@elseif ($input_group_text)
|
||||
{{ $input_group_text }}
|
||||
@endif
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
@aware(['name'])
|
||||
@props([
|
||||
'value' => '',
|
||||
'value' => null,
|
||||
'rows' => 5,
|
||||
'name' => null,
|
||||
])
|
||||
|
||||
<textarea
|
||||
{{ $attributes->merge(['class' => 'form-control']) }}
|
||||
rows="{{ $rows }}"
|
||||
name="{{ $name }}"
|
||||
>{{ $value }}</textarea>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
'helpPosition' => 'right',
|
||||
'helpText' => trans('help.components'),
|
||||
'formAction' => (isset($item->id)) ? route('components.update', ['component' => $item->id]) : route('components.store'),
|
||||
'container_classes' => 'col-lg-6 col-lg-offset-3 col-md-10 col-md-offset-1 col-sm-12 col-sm-offset-0',
|
||||
'index_route' => 'components.index',
|
||||
'options' => [
|
||||
'back' => trans('admin/hardware/form.redirect_to_type',['type' => trans('general.previous_page')]),
|
||||
@@ -16,20 +17,127 @@
|
||||
{{-- Page content --}}
|
||||
@section('inputFields')
|
||||
|
||||
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/components/table.title')])
|
||||
@include ('partials.forms.edit.category-select', ['translated_name' => trans('general.category'), 'fieldname' => 'category_id','category_type' => 'component'])
|
||||
@include ('partials.forms.edit.quantity')
|
||||
@include ('partials.forms.edit.minimum_quantity')
|
||||
<!-- Name -->
|
||||
<x-form-row name="name">
|
||||
<x-form-label>{{ trans('general.name') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.text
|
||||
required="true"
|
||||
:value="old('name', $item->name)"
|
||||
/>
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
|
||||
<!-- Category -->
|
||||
<x-form-row name="category_id">
|
||||
<x-form-label>{{ trans('general.category') }}</x-form-label>
|
||||
<x-form-input modal_type="category" modal_id="category_select_id" category_type="component" new_model="\App\Models\Category::class">
|
||||
<x-input.select2-ajax
|
||||
id="category_select_id"
|
||||
:data_placeholder="trans('general.select_asset')"
|
||||
:item="old('category_id', $item->category_id)"
|
||||
:new_button="true"
|
||||
:required="Helper::checkIfRequired($item, 'category_id')"
|
||||
:selected="old('category_id', $item->category_id)"
|
||||
data_endpoint="categories/component"
|
||||
item_model="\App\Models\Category"
|
||||
/>
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
|
||||
<!-- QTY -->
|
||||
<x-form-row name="qty">
|
||||
<x-form-label>{{ trans('general.quantity') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.text
|
||||
type="number"
|
||||
:value="old('qty', $item->qty)"
|
||||
input_min="1"
|
||||
required="true"
|
||||
/>
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
<!-- Minimum QTY -->
|
||||
<x-form-row name="min_amt">
|
||||
<x-form-label>{{ trans('general.min_amt') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.text
|
||||
type="number"
|
||||
:value="old('min_amt', $item->min_amt)"
|
||||
input_min="0"
|
||||
/>
|
||||
</x-form-input>
|
||||
<x-form-inline-tooltip>
|
||||
{{ trans('general.min_amt_help') }}
|
||||
</x-form-inline-tooltip>
|
||||
</x-form-row>
|
||||
|
||||
@include ('partials.forms.edit.serial', ['fieldname' => 'serial'])
|
||||
@include ('partials.forms.edit.manufacturer-select', ['translated_name' => trans('general.manufacturer'), 'fieldname' => 'manufacturer_id'])
|
||||
|
||||
<!-- Manufacturer -->
|
||||
<x-form-row name="manufacturer_id">
|
||||
<x-form-label>{{ trans('general.manufacturer') }}</x-form-label>
|
||||
<x-form-input modal_type="manufacturer" modal_id="manufacturer_select_id" new_model="\App\Models\Manufacturer::class">
|
||||
<x-input.select2-ajax
|
||||
id="manufacturer_select_id"
|
||||
:data_placeholder="trans('general.manufacturer')"
|
||||
:item="old('manufacturer_id', $item->manufacturer_id)"
|
||||
:new_button="true"
|
||||
:required="Helper::checkIfRequired($item, 'manufacturer_id')"
|
||||
:selected="old('manufacturer_id', $item->manufacturer_id)"
|
||||
data_endpoint="manufacturers"
|
||||
item_model="\App\Models\Manufacturer"
|
||||
/>
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
@include ('partials.forms.edit.model_number')
|
||||
@include ('partials.forms.edit.company-select', ['translated_name' => trans('general.company'), 'fieldname' => 'company_id'])
|
||||
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id'])
|
||||
@include ('partials.forms.edit.supplier-select', ['translated_name' => trans('general.supplier'), 'fieldname' => 'supplier_id'])
|
||||
@include ('partials.forms.edit.order_number')
|
||||
@include ('partials.forms.edit.datepicker', ['translated_name' => trans('general.purchase_date'),'fieldname' => 'purchase_date'])
|
||||
@include ('partials.forms.edit.purchase_cost', ['unit_cost' => trans('general.unit_cost')])
|
||||
@include ('partials.forms.edit.notes')
|
||||
|
||||
<!--- Purchase Date -->
|
||||
<x-form-row name="purchase_date">
|
||||
<x-form-label>{{ trans('general.purchase_date') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.datepicker :value="old('purchase_date', $item->purchase_date_for_datepicker)" />
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
|
||||
<!-- Purchase Cost -->
|
||||
<x-form-row name="purchase_cost">
|
||||
<x-form-label>{{ trans('general.unit_cost') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.text
|
||||
type="number"
|
||||
:input_group_text="$snipeSettings->default_currency"
|
||||
:value="old('purchase_cost', $item->purchase_cost)"
|
||||
input_group_addon="left"
|
||||
input_max="99999999999999999.000"
|
||||
input_min="0"
|
||||
input_min="0.00"
|
||||
input_step="0.001"
|
||||
maxlength="25"
|
||||
/>
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
<!-- Notes -->
|
||||
<x-form-row name="notes">
|
||||
<x-form-label>{{ trans('general.notes') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.textarea
|
||||
:value="old('notes', $item->notes)"
|
||||
placeholder="{{ trans('general.placeholders.notes') }}"
|
||||
/>
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
@include ('partials.forms.edit.image-upload', ['image_path' => app('components_upload_path')])
|
||||
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
'helpText' => trans('help.consumables'),
|
||||
'formAction' => (isset($item->id)) ? route('consumables.update', ['consumable' => $item->id]) : route('consumables.store'),
|
||||
'index_route' => 'consumables.index',
|
||||
'container_classes' => 'col-lg-6 col-lg-offset-3 col-md-10 col-md-offset-1 col-sm-12 col-sm-offset-0',
|
||||
'options' => [
|
||||
'back' => trans('admin/hardware/form.redirect_to_type',['type' => trans('general.previous_page')]),
|
||||
'index' => trans('admin/hardware/form.redirect_to_all', ['type' => 'consumables']),
|
||||
@@ -15,19 +16,115 @@
|
||||
@section('inputFields')
|
||||
|
||||
@include ('partials.forms.edit.company-select', ['translated_name' => trans('general.company'), 'fieldname' => 'company_id'])
|
||||
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/consumables/table.title')])
|
||||
|
||||
<!-- Name -->
|
||||
<x-form-row name="name">
|
||||
<x-form-label>{{ trans('general.name') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.text
|
||||
required="true"
|
||||
:value="old('name', $item->name)"
|
||||
/>
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
@include ('partials.forms.edit.category-select', ['translated_name' => trans('general.category'), 'fieldname' => 'category_id', 'required' => 'true', 'category_type' => 'consumable'])
|
||||
@include ('partials.forms.edit.supplier-select', ['translated_name' => trans('general.supplier'), 'fieldname' => 'supplier_id'])
|
||||
@include ('partials.forms.edit.manufacturer-select', ['translated_name' => trans('general.manufacturer'), 'fieldname' => 'manufacturer_id'])
|
||||
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id'])
|
||||
@include ('partials.forms.edit.model_number')
|
||||
@include ('partials.forms.edit.item_number')
|
||||
@include ('partials.forms.edit.order_number')
|
||||
@include ('partials.forms.edit.datepicker', ['translated_name' => trans('general.purchase_date'),'fieldname' => 'purchase_date'])
|
||||
@include ('partials.forms.edit.purchase_cost', [ 'unit_cost' => trans('general.unit_cost')])
|
||||
@include ('partials.forms.edit.quantity')
|
||||
@include ('partials.forms.edit.minimum_quantity')
|
||||
@include ('partials.forms.edit.notes')
|
||||
|
||||
<!-- Model Number -->
|
||||
<x-form-row name="model_number">
|
||||
<x-form-label>{{ trans('general.model_no') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.text :value="old('model_number', $item->model_number)"
|
||||
/>
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
<!-- Item Number -->
|
||||
<x-form-row name="item_no">
|
||||
<x-form-label>{{ trans('admin/consumables/general.item_no') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.text :value="old('item_no', $item->item_no)" />
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
|
||||
<!-- Order Number -->
|
||||
<x-form-row name="order_number">
|
||||
<x-form-label>{{ trans('general.order_number') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.text :value="old('order_number', $item->order_number)" />
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
<!--- Purchase Date -->
|
||||
<x-form-row name="purchase_date">
|
||||
<x-form-label>{{ trans('general.purchase_date') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.datepicker :value="old('purchase_date', $item->purchase_date_for_datepicker)" />
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
<!-- Purchase Cost -->
|
||||
<x-form-row name="purchase_cost">
|
||||
<x-form-label>{{ trans('general.unit_cost') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.text
|
||||
type="number"
|
||||
:input_group_text="$snipeSettings->default_currency"
|
||||
:value="old('purchase_cost', $item->purchase_cost)"
|
||||
input_group_addon="left"
|
||||
input_max="99999999999999999.000"
|
||||
input_min="0"
|
||||
input_min="0.00"
|
||||
input_step="0.001"
|
||||
maxlength="25"
|
||||
/>
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
<!-- QTY -->
|
||||
<x-form-row name="qty">
|
||||
<x-form-label>{{ trans('general.quantity') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.text
|
||||
type="number"
|
||||
:value="old('qty', $item->qty)"
|
||||
input_min="1"
|
||||
required="true"
|
||||
/>
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
<!-- Minimum QTY -->
|
||||
<x-form-row name="min_amt">
|
||||
<x-form-label>{{ trans('general.min_amt') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.text
|
||||
type="number"
|
||||
:value="old('min_amt', $item->min_amt)"
|
||||
input_min="0"
|
||||
/>
|
||||
</x-form-input>
|
||||
<x-form-inline-tooltip>
|
||||
{{ trans('general.min_amt_help') }}
|
||||
</x-form-inline-tooltip>
|
||||
</x-form-row>
|
||||
|
||||
|
||||
<!-- Notes -->
|
||||
<x-form-row name="notes">
|
||||
<x-form-label>{{ trans('general.notes') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.textarea
|
||||
:value="old('notes', $item->notes)"
|
||||
placeholder="{{ trans('general.placeholders.notes') }}"
|
||||
/>
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
@include ('partials.forms.edit.image-upload', ['image_path' => app('consumables_upload_path')])
|
||||
|
||||
@stop
|
||||
|
||||
@@ -1181,7 +1181,10 @@ dir="{{ Helper::determineLanguageDirection() }}">
|
||||
highlight: function(inputElement) {
|
||||
|
||||
// We have to go two levels up if it's an input group
|
||||
if ($(inputElement).parent().hasClass('input-group')) {
|
||||
if ($(inputElement).hasClass('select2') || $(inputElement).hasClass('js-data-ajax')) {
|
||||
$(inputElement).parent().parent().addClass('has-error');
|
||||
|
||||
} else if ($(inputElement).parent().hasClass('input-group')) {
|
||||
$(inputElement).parent().parent().parent().addClass('has-error');
|
||||
} else {
|
||||
$(inputElement).parent().addClass('has-error');
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
'topSubmit' => true,
|
||||
'formAction' => ($item->id) ? route('licenses.update', ['license' => $item->id]) : route('licenses.store'),
|
||||
'index_route' => 'licenses.index',
|
||||
'container_classes' => 'col-lg-6 col-lg-offset-3 col-md-10 col-md-offset-1 col-sm-12 col-sm-offset-0',
|
||||
'options' => [
|
||||
'back' => trans('admin/hardware/form.redirect_to_type',['type' => trans('general.previous_page')]),
|
||||
'index' => trans('admin/hardware/form.redirect_to_all', ['type' => 'licenses']),
|
||||
@@ -13,24 +14,52 @@
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('inputFields')
|
||||
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/licenses/form.name')])
|
||||
|
||||
<!-- Name -->
|
||||
<x-form-row name="name">
|
||||
<x-form-label>{{ trans('general.name') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.text
|
||||
required="true"
|
||||
:value="old('name', $item->name)"
|
||||
/>
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
@include ('partials.forms.edit.category-select', ['translated_name' => trans('admin/categories/general.category_name'), 'fieldname' => 'category_id', 'required' => 'true', 'category_type' => 'license'])
|
||||
|
||||
|
||||
|
||||
<!-- Seats -->
|
||||
<div class="form-group {{ $errors->has('seats') ? ' has-error' : '' }}">
|
||||
<label for="seats" class="col-md-3 control-label">{{ trans('admin/licenses/form.seats') }}</label>
|
||||
<div class="col-md-7 col-sm-12">
|
||||
<div class="col-md-12" style="padding-left:0px">
|
||||
<input class="form-control" type="text" name="seats" id="seats" value="{{ old('seats', $item->seats) }}" minlength="1" required style="width: 97px;">
|
||||
</div>
|
||||
</div>
|
||||
{!! $errors->first('seats', '<div class="col-md-8 col-md-offset-3"><span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span></div>') !!}
|
||||
</div>
|
||||
@include ('partials.forms.edit.minimum_quantity')
|
||||
<!-- Seats -->
|
||||
<x-form-row name="seats">
|
||||
<x-form-label>{{ trans('admin/licenses/form.seats') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.text
|
||||
type="number"
|
||||
:value="old('seats', $item->seats)"
|
||||
input_min="1"
|
||||
required="true"
|
||||
/>
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
<!-- Serial-->
|
||||
<!-- Minimum QTY -->
|
||||
<x-form-row name="min_amt">
|
||||
<x-form-label>{{ trans('general.min_amt') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.text
|
||||
type="number"
|
||||
:value="old('min_amt', $item->min_amt)"
|
||||
input_min="0"
|
||||
/>
|
||||
</x-form-input>
|
||||
<x-form-inline-tooltip>
|
||||
{{ trans('general.min_amt_help') }}
|
||||
</x-form-inline-tooltip>
|
||||
</x-form-row>
|
||||
|
||||
|
||||
<!-- Serial-->
|
||||
@can('viewKeys', $item)
|
||||
<div class="form-group {{ $errors->has('serial') ? ' has-error' : '' }}">
|
||||
<label for="serial" class="col-md-3 control-label">{{ trans('admin/licenses/form.license_key') }}</label>
|
||||
@@ -77,46 +106,71 @@
|
||||
|
||||
|
||||
@include ('partials.forms.edit.supplier-select', ['translated_name' => trans('general.supplier'), 'fieldname' => 'supplier_id'])
|
||||
@include ('partials.forms.edit.order_number')
|
||||
@include ('partials.forms.edit.purchase_cost')
|
||||
@include ('partials.forms.edit.datepicker', ['translated_name' => trans('general.purchase_date'),'fieldname' => 'purchase_date'])
|
||||
|
||||
<!-- Order Number -->
|
||||
<x-form-row name="order_number">
|
||||
<x-form-label>{{ trans('general.order_number') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.text :value="old('order_number', $item->order_number)" />
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
{{-- @TODO How does this differ from Order #? --}}
|
||||
<!-- Purchase Order -->
|
||||
<x-form-row name="purchase_order">
|
||||
<x-form-label>{{ trans('admin/licenses/form.purchase_order') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.text :value="old('purchase_order', $item->purchase_order)" />
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
|
||||
<!-- Purchase Cost -->
|
||||
<x-form-row name="purchase_cost">
|
||||
<x-form-label>{{ trans('general.unit_cost') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.text
|
||||
type="number"
|
||||
:input_group_text="$snipeSettings->default_currency"
|
||||
:value="old('purchase_cost', $item->purchase_cost)"
|
||||
input_group_addon="left"
|
||||
input_max="99999999999999999.000"
|
||||
input_min="0"
|
||||
input_min="0.00"
|
||||
input_step="0.001"
|
||||
maxlength="25"
|
||||
/>
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
<!--- Purchase Date -->
|
||||
<x-form-row name="purchase_date">
|
||||
<x-form-label>{{ trans('general.purchase_date') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.datepicker
|
||||
:value="old('purchase_date', $item->purchase_date_for_datepicker)"
|
||||
input_group_addon="left"/>
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
<!-- Expiration Date -->
|
||||
<div class="form-group {{ $errors->has('expiration_date') ? ' has-error' : '' }}">
|
||||
<label for="expiration_date" class="col-md-3 control-label">{{ trans('admin/licenses/form.expiration') }}</label>
|
||||
|
||||
<div class="input-group col-md-4">
|
||||
<div class="input-group date" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-autoclose="true" data-date-clear-btn="true">
|
||||
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="expiration_date" id="expiration_date" value="{{ old('expiration_date', ($item->expiration_date) ? $item->expiration_date->format('Y-m-d') : '') }}" maxlength="10">
|
||||
<span class="input-group-addon"><x-icon type="calendar" /></span>
|
||||
</div>
|
||||
{!! $errors->first('expiration_date', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<x-form-row name="expiration_date">
|
||||
<x-form-label>{{ trans('admin/licenses/form.expiration') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.datepicker :value="old('expiration_date', $item->expiration_date)" />
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
<!-- Termination Date -->
|
||||
<div class="form-group {{ $errors->has('termination_date') ? ' has-error' : '' }}">
|
||||
<label for="termination_date" class="col-md-3 control-label">{{ trans('admin/licenses/form.termination_date') }}</label>
|
||||
<x-form-row name="termination_date">
|
||||
<x-form-label>{{ trans('admin/licenses/form.termination_date') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.datepicker :value="old('termination_date', $item->termination_date)" />
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
|
||||
<div class="input-group col-md-4">
|
||||
<div class="input-group date" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-autoclose="true" data-date-clear-btn="true">
|
||||
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="termination_date" id="termination_date" value="{{ old('termination_date', ($item->termination_date) ? $item->termination_date->format('Y-m-d') : '') }}" maxlength="10">
|
||||
<span class="input-group-addon"><x-icon type="calendar" /></span>
|
||||
</div>
|
||||
{!! $errors->first('termination_date', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- @TODO How does this differ from Order #? --}}
|
||||
<!-- Purchase Order -->
|
||||
<div class="form-group {{ $errors->has('purchase_order') ? ' has-error' : '' }}">
|
||||
<label for="purchase_order" class="col-md-3 control-label">{{ trans('admin/licenses/form.purchase_order') }}</label>
|
||||
<div class="col-md-3 text-right">
|
||||
<input class="form-control" type="text" name="purchase_order" id="purchase_order" value="{{ old('purchase_order', $item->purchase_order) }}" maxlength="191" />
|
||||
{!! $errors->first('purchase_order', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include ('partials.forms.edit.depreciation')
|
||||
|
||||
@@ -131,6 +185,15 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include ('partials.forms.edit.notes')
|
||||
<!-- Notes -->
|
||||
<x-form-row name="notes">
|
||||
<x-form-label>{{ trans('general.notes') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.textarea
|
||||
:value="old('notes', $item->notes)"
|
||||
placeholder="{{ trans('general.placeholders.notes') }}"
|
||||
/>
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
@stop
|
||||
|
||||
@@ -9,7 +9,13 @@
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('inputFields')
|
||||
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/locations/table.name')])
|
||||
|
||||
<!-- Name -->
|
||||
<x-form-row
|
||||
:label="trans('general.name')"
|
||||
:$item
|
||||
name="name"
|
||||
/>
|
||||
|
||||
<!-- parent -->
|
||||
@include ('partials.forms.edit.location-select', ['translated_name' => trans('admin/locations/table.parent'), 'fieldname' => 'parent_id'])
|
||||
@@ -63,20 +69,14 @@
|
||||
|
||||
@include ('partials.forms.edit.image-upload', ['image_path' => app('locations_upload_path')])
|
||||
|
||||
<div class="form-group{!! $errors->has('notes') ? ' has-error' : '' !!}">
|
||||
<label for="notes" class="col-md-3 control-label">{{ trans('general.notes') }}</label>
|
||||
<div class="col-md-8">
|
||||
<x-input.textarea
|
||||
name="notes"
|
||||
id="notes"
|
||||
:value="old('notes', $item->notes)"
|
||||
placeholder="{{ trans('general.placeholders.notes') }}"
|
||||
aria-label="notes"
|
||||
rows="5"
|
||||
/>
|
||||
{!! $errors->first('notes', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
<!-- Notes -->
|
||||
<x-form-row
|
||||
:label="trans('general.notes')"
|
||||
:$item
|
||||
name="notes"
|
||||
type="textarea"
|
||||
placeholder="{{ trans('general.placeholders.notes') }}"
|
||||
/>
|
||||
|
||||
@stop
|
||||
|
||||
|
||||
@@ -11,196 +11,204 @@
|
||||
@stop
|
||||
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ URL::previous() }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.back') }}</a>
|
||||
@stop
|
||||
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
@if ($item->id)
|
||||
<form class="form-horizontal" method="post" action="{{ route('maintenances.update', $item->id) }}" autocomplete="off" enctype="multipart/form-data">
|
||||
{{ method_field('PUT') }}
|
||||
@else
|
||||
<form class="form-horizontal" method="post" action="{{ route('maintenances.store') }}" autocomplete="off" enctype="multipart/form-data">
|
||||
@endif
|
||||
<!-- CSRF Token -->
|
||||
{{ csrf_field() }}
|
||||
|
||||
<div class="box box-default">
|
||||
|
||||
<!-- Initiate form component -->
|
||||
<x-form :$item update_route="maintenances.update" create_route="maintenances.store">
|
||||
|
||||
<!-- Start box component -->
|
||||
<x-box :$item header_icon="maintenances">
|
||||
|
||||
<!-- This is an existing maintenance -->
|
||||
@if ($item->id)
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title">
|
||||
{{ $item->title }}
|
||||
</h2>
|
||||
</div><!-- /.box-header -->
|
||||
@endif
|
||||
|
||||
<div class="box-body">
|
||||
@if ($item->asset)
|
||||
<x-form-row name="asset">
|
||||
<x-form-label>{{ trans('general.asset') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.static>
|
||||
{{ $item->asset->display_name }}
|
||||
</x-input.static>
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
@include ('partials.forms.edit.name', ['translated_name' => trans('general.name'), 'required' => 'true'])
|
||||
@if ($item->asset->company)
|
||||
<x-form-row name="company">
|
||||
<x-form-label>{{ trans('general.company') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.static>
|
||||
{{ $item->asset->company->display_name }}
|
||||
</x-input.static>
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
<!-- This is a new maintenance -->
|
||||
@if (!$item->id)
|
||||
@endif
|
||||
|
||||
@if ($item->asset->location)
|
||||
<x-form-row name="location">
|
||||
<x-form-label>
|
||||
{{ trans('general.location') }}
|
||||
</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.static>
|
||||
{{ $item->asset->location->display_name }}
|
||||
</x-input.static>
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
@endif
|
||||
|
||||
@include ('partials.forms.edit.asset-select', [
|
||||
'translated_name' => trans('general.assets'),
|
||||
'fieldname' => 'selected_assets[]',
|
||||
'multiple' => true,
|
||||
'required' => true,
|
||||
'select_id' => 'assigned_assets_select',
|
||||
'asset_selector_div_id' => 'assets_for_maintenance_div',
|
||||
'asset_ids' => $item->id ? $item->asset()->pluck('id')->toArray() : old('selected_assets'),
|
||||
'asset_id' => $item->id ? $item->asset()->pluck('id')->toArray() : null
|
||||
])
|
||||
@else
|
||||
|
||||
@if ($item->asset->company)
|
||||
<div class="form-group">
|
||||
<label for="company" class="control-label col-md-3">
|
||||
{{ trans('general.company') }}
|
||||
</label>
|
||||
|
||||
<div class="col-md-9">
|
||||
<p class="form-control-static">
|
||||
{{ $item->asset->company->name }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="form-group">
|
||||
<label for="asset" class="control-label col-md-3">
|
||||
{{ trans('general.asset') }}
|
||||
</label>
|
||||
|
||||
<div class="col-md-9">
|
||||
<p class="form-control-static">
|
||||
{{ $item->asset ? $item->asset->present()->fullName : '' }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($item->asset->location)
|
||||
<div class="form-group">
|
||||
<label for="location" class="control-label col-md-3">
|
||||
{{ trans('general.location') }}
|
||||
</label>
|
||||
|
||||
<div class="col-md-9">
|
||||
<p class="form-control-static">
|
||||
{{ $item->asset->location->name }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@endif
|
||||
|
||||
<!-- Name -->
|
||||
<x-form-row name="name">
|
||||
<x-form-label>{{ trans('general.name') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.text
|
||||
required="true"
|
||||
:value="old('name', $item->name)"
|
||||
/>
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
@include ('partials.forms.edit.maintenance_type')
|
||||
@if (!$item->id)
|
||||
<!-- Assets (multiple select for new maintenance) -->
|
||||
<x-form-row name="selected_assets[]">
|
||||
<x-form-label>{{ trans('general.assets') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.select2-ajax
|
||||
:item="$item->id ? $item->asset()->pluck('id')->toArray() : old('selected_assets')"
|
||||
item_model="\App\Models\Asset"
|
||||
:required="Helper::checkIfRequired($item, 'asset_id')"
|
||||
multiple="true"
|
||||
data_endpoint="hardware"
|
||||
:selected="old('selected_assets[]', request('asset_id'))"
|
||||
:data_placeholder="trans('general.select_asset')"
|
||||
/>
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
@endif
|
||||
|
||||
<!-- Start Date -->
|
||||
<div class="form-group {{ $errors->has('start_date') ? ' has-error' : '' }}">
|
||||
<label for="start_date" class="col-md-3 control-label">
|
||||
{{ trans('admin/maintenances/form.start_date') }}
|
||||
</label>
|
||||
|
||||
<div class="col-md-4">
|
||||
<x-input.datepicker
|
||||
name="start_date"
|
||||
:value="old('start_date', $item->start_date)"
|
||||
placeholder="{{ trans('general.select_date') }}"
|
||||
required="{{ Helper::checkIfRequired($item, 'start_date') }}"
|
||||
/>
|
||||
{!! $errors->first('start_date', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
<!-- Maintenance Type -->
|
||||
<x-form-row name="asset_maintenance_type">
|
||||
<x-form-label>{{ trans('admin/asset_maintenances/form.asset_maintenance_type') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.select
|
||||
:options="$maintenanceType"
|
||||
:selected="old('asset_maintenance_type', $item->asset_maintenance_type)"
|
||||
:required="Helper::checkIfRequired($item, 'asset_maintenance_type')"
|
||||
data-placeholder="{{ trans('admin/maintenances/form.select_type')}}"
|
||||
includeEmpty="true"
|
||||
style="width:100%;"
|
||||
/>
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
|
||||
|
||||
<!-- Completion Date -->
|
||||
<div class="form-group {{ $errors->has('completion_date') ? ' has-error' : '' }}">
|
||||
<label for="start_date" class="col-md-3 control-label">{{ trans('admin/maintenances/form.completion_date') }}</label>
|
||||
|
||||
<div class="input-group col-md-4">
|
||||
<x-input.datepicker
|
||||
name="completion_date"
|
||||
:value="old('start_date', $item->completion_date)"
|
||||
placeholder="{{ trans('general.select_date') }}"
|
||||
required="Helper::checkIfRequired($item, 'completion_date')"
|
||||
/>
|
||||
{!! $errors->first('completion_date', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include ('partials.forms.edit.supplier-select', ['translated_name' => trans('general.supplier'), 'fieldname' => 'supplier_id'])
|
||||
<!--- Start Date -->
|
||||
<x-form-row name="start_date">
|
||||
<x-form-label>{{ trans('admin/maintenances/form.start_date') }}</x-form-label>
|
||||
<x-form-input class="col-md-5">
|
||||
<x-input.datepicker :value="old('start_date', $item->start_date)" required="true" />
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
|
||||
<!-- Warranty -->
|
||||
<!--- Completion Date -->
|
||||
<x-form-row name="completion_date">
|
||||
<x-form-label>{{ trans('admin/maintenances/form.completion_date') }}</x-form-label>
|
||||
<x-form-input class="col-md-5">
|
||||
<x-input.datepicker :value="old('completion_date', $item->completion_date)"
|
||||
/>
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
<!-- Cost -->
|
||||
<x-form-row name="cost">
|
||||
<x-form-label>{{ trans('admin/maintenances/form.cost') }}</x-form-label>
|
||||
<x-form-input class="col-md-5">
|
||||
<x-input.text
|
||||
type="number"
|
||||
:input_group_text="$snipeSettings->default_currency"
|
||||
:value="old('cost', $item->cost)"
|
||||
input_group_addon="left"
|
||||
input_max="99999999999999999.000"
|
||||
input_min="0"
|
||||
input_min="0.00"
|
||||
input_step="0.001"
|
||||
maxlength="25"
|
||||
/>
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
|
||||
<!-- URL -->
|
||||
<x-form-row name="url">
|
||||
<x-form-label>{{ trans('general.url') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.text
|
||||
name="url"
|
||||
type="url"
|
||||
:value="old('url', $item->url)"
|
||||
input_icon="link"
|
||||
input_group_addon="left"
|
||||
placeholder="https://example.com"
|
||||
/>
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
<!-- Supplier -->
|
||||
<x-form-row name="supplier_id">
|
||||
|
||||
<x-form-label>{{ trans('general.supplier') }}</x-form-label>
|
||||
|
||||
<x-form-input>
|
||||
<x-input.select2-ajax
|
||||
item="$item->supplier"
|
||||
item_model="\App\Models\Supplier"
|
||||
name="supplier_id"
|
||||
:selected="old('supplier_id', $item->supplier_id)"
|
||||
data_endpoint="suppliers"
|
||||
:data_placeholder="trans('general.select_supplier')"
|
||||
/>
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
<!-- Warranty? -->
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-3 col-sm-9">
|
||||
<label class="form-control">
|
||||
<input type="checkbox" value="1" name="is_warranty" id="is_warranty" {{ old('is_warranty', $item->is_warranty) == '1' ? ' checked="checked"' : '' }}>
|
||||
<input type="checkbox" value="1" name="is_warranty" id="is_warranty" @checked(old('is_warranty', $item->is_warranty))>
|
||||
{{ trans('admin/maintenances/form.is_warranty') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Asset Maintenance Cost -->
|
||||
<div class="form-group {{ $errors->has('cost') ? ' has-error' : '' }}">
|
||||
<label for="cost" class="col-md-3 control-label">{{ trans('admin/maintenances/form.cost') }}</label>
|
||||
<div class="col-md-3 text-right">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">
|
||||
@if (($item->asset) && ($item->asset->location) && ($item->asset->location->currency!=''))
|
||||
{{ $item->asset->location->currency }}
|
||||
@else
|
||||
{{ $snipeSettings->default_currency }}
|
||||
@endif
|
||||
</span>
|
||||
<input class="form-control" type="number" name="cost" min="0.00" max="99999999999999999.000" step="0.001" aria-label="cost" id="cost" value="{{ old('cost', $item->cost) }}" maxlength="25" />
|
||||
{!! $errors->first('cost', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group {{ $errors->has('url') ? ' has-error' : '' }}">
|
||||
<label for="url" class="col-md-3 control-label">{{ trans('general.url') }}</label>
|
||||
<div class="col-md-7">
|
||||
<input class="form-control" name="url" type="url" id="url" value="{{ old('url', $item->url) }}" placeholder="https://example.com">
|
||||
{!! $errors->first('url', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@include ('partials.forms.edit.image-upload', ['image_path' => app('maintenances_path')])
|
||||
|
||||
|
||||
<!-- Notes -->
|
||||
<div class="form-group {{ $errors->has('notes') ? ' has-error' : '' }}">
|
||||
<label for="notes" class="col-md-3 control-label">{{ trans('admin/maintenances/form.notes') }}</label>
|
||||
<div class="col-md-7">
|
||||
<textarea class="col-md-6 form-control" id="notes" name="notes">{{ old('notes', $item->notes) }}</textarea>
|
||||
<p class="help-block">{!! trans('general.markdown') !!}</p>
|
||||
{!! $errors->first('notes', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- .box-body -->
|
||||
<x-form-row name="notes">
|
||||
<x-form-label>{{ trans('general.notes') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.textarea
|
||||
:value="old('notes', $item->notes)"
|
||||
placeholder="{{ trans('general.placeholders.notes') }}"
|
||||
/>
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
|
||||
|
||||
|
||||
<!-- End box component -->
|
||||
</x-box>
|
||||
<!-- Start form component -->
|
||||
</x-form>
|
||||
|
||||
<div class="box-footer text-right">
|
||||
<button type="submit" class="btn btn-success"><x-icon type="checkmark" /> {{ trans('general.save') }}</button>
|
||||
</div>
|
||||
</div> <!-- .box-default -->
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stop
|
||||
|
||||
@@ -32,15 +32,16 @@
|
||||
<p class="help-block" id="uploadFile-status">{{ trans('general.upload_filetypes_help', ['allowed_filetypes' => config('filesystems.allowed_upload_extensions'), 'size' => Helper::file_upload_max_size_readable()]) }}</p>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<x-input.textarea
|
||||
name="notes"
|
||||
:value="old('notes')"
|
||||
placeholder="Notes (Optional)"
|
||||
rows="3"
|
||||
aria-label="file"
|
||||
/>
|
||||
</div>
|
||||
<!-- Notes -->
|
||||
<x-form-row name="notes">
|
||||
<x-form-label>{{ trans('general.notes') }}</x-form-label>
|
||||
<x-form-input>
|
||||
<x-input.textarea
|
||||
:value="old('notes')"
|
||||
placeholder="{{ trans('general.placeholders.notes') }}"
|
||||
/>
|
||||
</x-form-input>
|
||||
</x-form-row>
|
||||
</div>
|
||||
|
||||
</div> <!-- /.modal-body-->
|
||||
|
||||
@@ -9,12 +9,38 @@
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('inputFields')
|
||||
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/models/table.name'), 'required' => 'true'])
|
||||
|
||||
<!-- Name -->
|
||||
<x-form-row
|
||||
:label="trans('general.name')"
|
||||
:$item
|
||||
name="name"
|
||||
/>
|
||||
|
||||
@include ('partials.forms.edit.category-select', ['translated_name' => trans('admin/categories/general.category_name'), 'fieldname' => 'category_id', 'required' => 'true', 'category_type' => 'asset'])
|
||||
@include ('partials.forms.edit.manufacturer-select', ['translated_name' => trans('general.manufacturer'), 'fieldname' => 'manufacturer_id'])
|
||||
@include ('partials.forms.edit.model_number')
|
||||
|
||||
<!-- Model Number -->
|
||||
<x-form-row
|
||||
:label="trans('general.model_no')"
|
||||
:$item
|
||||
name="model_number"
|
||||
/>
|
||||
|
||||
@include ('partials.forms.edit.depreciation')
|
||||
@include ('partials.forms.edit.minimum_quantity')
|
||||
|
||||
<!-- Minimum QTY -->
|
||||
<x-form-row
|
||||
:label="trans('general.min_amt')"
|
||||
:$item
|
||||
name="min_amt"
|
||||
type="number"
|
||||
input_div_class="col-md-4 col-xs-9"
|
||||
info_tooltip_text="{{ trans('general.min_amt_help') }}"
|
||||
input_min="0"
|
||||
|
||||
/>
|
||||
|
||||
|
||||
<!-- require serial boolean -->
|
||||
<div class="form-group">
|
||||
@@ -25,40 +51,41 @@
|
||||
<div class="col-md-9">
|
||||
<div class="form-inline" style="display: flex; align-items: center; gap: 8px;">
|
||||
<input type="checkbox" name="require_serial" value="1" @checked(old('require_serial', $item->require_serial)) id="require_serial" aria-label="require_serial" />
|
||||
<a
|
||||
href="#"
|
||||
data-tooltip="true"
|
||||
title="{{ trans('admin/hardware/general.require_serial_help') }}"
|
||||
style="display: inline-flex; align-items: center;"
|
||||
>
|
||||
<x-icon type="info-circle" />
|
||||
<span class="sr-only">{{ trans('admin/hardware/general.require_serial_help') }}</span>
|
||||
</a>
|
||||
<x-form-tooltip>
|
||||
{{ trans('admin/hardware/general.require_serial_help') }}
|
||||
</x-form-tooltip>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- EOL -->
|
||||
|
||||
<div class="form-group {{ $errors->has('eol') ? ' has-error' : '' }}">
|
||||
<label for="eol" class="col-md-3 control-label">{{ trans('general.eol') }}</label>
|
||||
<div class="col-md-3 col-sm-4 col-xs-7">
|
||||
<div class="input-group">
|
||||
<input class="form-control" type="text" name="eol" id="eol" value="{{ old('eol', isset($item->eol)) ? $item->eol : '' }}" />
|
||||
<span class="input-group-addon">
|
||||
{{ trans('general.months') }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
{!! $errors->first('eol', '<span class="alert-msg" aria-hidden="true"><br><i class="fas fa-times"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
<x-form-row
|
||||
:label="trans('general.eol')"
|
||||
:$item
|
||||
name="eol"
|
||||
type="number"
|
||||
input_div_class="col-md-4"
|
||||
input_group_text="{{ trans('general.months') }}"
|
||||
input_group_addon="left"
|
||||
maxlength="3"
|
||||
min="0"
|
||||
/>
|
||||
|
||||
|
||||
<!-- Custom Fieldset -->
|
||||
<!-- If $item->id is null we are cloning the model and we need the $model_id variable -->
|
||||
@livewire('custom-field-set-default-values-for-model', ["model_id" => $item->id ?? $model_id ?? null])
|
||||
|
||||
@include ('partials.forms.edit.notes')
|
||||
<!-- Notes -->
|
||||
<x-form-row
|
||||
:label="trans('general.notes')"
|
||||
:$item
|
||||
name="notes"
|
||||
type="textarea"
|
||||
placeholder="{{ trans('general.placeholders.notes') }}"
|
||||
/>
|
||||
|
||||
@include ('partials.forms.edit.requestable', ['requestable_text' => trans('admin/models/general.requestable')])
|
||||
@include ('partials.forms.edit.image-upload', ['image_path' => app('models_upload_path')])
|
||||
|
||||
|
||||
@@ -10,7 +10,13 @@
|
||||
{{-- Page content --}}
|
||||
@section('inputFields')
|
||||
|
||||
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/suppliers/table.name')])
|
||||
<!-- Name -->
|
||||
<x-form-row
|
||||
:label="trans('general.name')"
|
||||
:$item
|
||||
name="name"
|
||||
/>
|
||||
|
||||
@include ('partials.forms.edit.address')
|
||||
|
||||
<div class="form-group {{ $errors->has('contact') ? ' has-error' : '' }}">
|
||||
@@ -33,7 +39,15 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include ('partials.forms.edit.notes')
|
||||
<!-- Notes -->
|
||||
<x-form-row
|
||||
:label="trans('general.notes')"
|
||||
:$item
|
||||
name="notes"
|
||||
type="textarea"
|
||||
placeholder="{{ trans('general.placeholders.notes') }}"
|
||||
/>
|
||||
|
||||
@include ('partials.forms.edit.image-upload', ['image_path' => app('suppliers_upload_path')])
|
||||
|
||||
@stop
|
||||
|
||||
Reference in New Issue
Block a user