mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-11 08:04:09 -08:00
Merge branch 'develop'
This commit is contained in:
commit
557b8b0ded
|
@ -29,4 +29,13 @@ class ModalController extends Controller
|
||||||
function user() {
|
function user() {
|
||||||
return view('modals.user');
|
return view('modals.user');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function category() {
|
||||||
|
return view('modals.category');
|
||||||
|
}
|
||||||
|
|
||||||
|
function manufacturer() {
|
||||||
|
return view('modals.manufacturer');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,19 +143,17 @@
|
||||||
<th class="col-md-1" data-sortable="true">{{ trans('general.image') }}</th>
|
<th class="col-md-1" data-sortable="true">{{ trans('general.image') }}</th>
|
||||||
<th class="col-md-6" data-sortable="true">{{ trans('admin/hardware/table.asset_model') }}</th>
|
<th class="col-md-6" data-sortable="true">{{ trans('admin/hardware/table.asset_model') }}</th>
|
||||||
<th class="col-md-3" data-sortable="true">{{ trans('admin/accessories/general.remaining') }}</th>
|
<th class="col-md-3" data-sortable="true">{{ trans('admin/accessories/general.remaining') }}</th>
|
||||||
<th class="col-md-2" data-sortable="true">{{ trans('general.quantity') }}</th>
|
|
||||||
<th class="col-md-1 actions" data-sortable="false">{{ trans('table.actions') }}</th>
|
<th class="col-md-2 actions" data-sortable="false">{{ trans('table.actions') }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
@foreach($models as $requestableModel)
|
@foreach($models as $requestableModel)
|
||||||
<tr>
|
<tr>
|
||||||
<form action="{{route('account/request-item', ['itemType' => 'asset_model', 'itemId' => $requestableModel->id])}}"
|
|
||||||
method="POST"
|
|
||||||
accept-charset="utf-8">
|
|
||||||
{{ csrf_field() }}
|
|
||||||
<td>
|
<td>
|
||||||
|
|
||||||
@if ($requestableModel->image)
|
@if ($requestableModel->image)
|
||||||
<a href="{{ url('/') }}/uploads/models/{{ $requestableModel->image }}" data-toggle="lightbox" data-type="image">
|
<a href="{{ url('/') }}/uploads/models/{{ $requestableModel->image }}" data-toggle="lightbox" data-type="image">
|
||||||
<img src="{{ url('/') }}/uploads/models/{{ $requestableModel->image }}" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive">
|
<img src="{{ url('/') }}/uploads/models/{{ $requestableModel->image }}" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive">
|
||||||
|
@ -167,16 +165,20 @@
|
||||||
|
|
||||||
<td>{{$requestableModel->name}}</td>
|
<td>{{$requestableModel->name}}</td>
|
||||||
<td>{{$requestableModel->assets->where('requestable', '1')->count()}}</td>
|
<td>{{$requestableModel->assets->where('requestable', '1')->count()}}</td>
|
||||||
<td><input type="text" name="request-quantity" value=""></td>
|
|
||||||
<td>
|
<td>
|
||||||
|
<form action="{{route('account/request-item', ['itemType' => 'asset_model', 'itemId' => $requestableModel->id])}}" method="POST" accept-charset="utf-8">
|
||||||
|
{{ csrf_field() }}
|
||||||
|
<input type="text" style="width: 70px; margin-right: 10px;" class="form-control pull-left" name="request-quantity" value="" placeholder="{{ trans('general.qty') }}">
|
||||||
@if ($requestableModel->isRequestedBy(Auth::user()))
|
@if ($requestableModel->isRequestedBy(Auth::user()))
|
||||||
{{Form::submit(trans('button.cancel'), ['class' => 'btn btn-danger btn-sm'])}}
|
{{ Form::submit(trans('button.cancel'), ['class' => 'btn btn-danger btn-sm'])}}
|
||||||
@else
|
@else
|
||||||
{{Form::submit(trans('button.request'), ['class' => 'btn btn-primary btn-sm'])}}
|
{{ Form::submit(trans('button.request'), ['class' => 'btn btn-primary btn-sm'])}}
|
||||||
@endif
|
@endif
|
||||||
|
</form>
|
||||||
</td>
|
</td>
|
||||||
</form>
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@endforeach
|
@endforeach
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
|
|
||||||
<p>{{ trans('mail.user') }} <a href="{{ route('users.show', $user_id) }}">{{ $requested_by }}</a><br>
|
<p>{{ trans('mail.user') }} <a href="{{ route('users.show', $user_id) }}">{{ $requested_by }}</a><br>
|
||||||
{{ trans('mail.item') }} <a href="{{ $item_url }}">{{ $item_name }}</a> ({{ $item_type }}) <br>
|
{{ trans('mail.item') }} <a href="{{ $item_url }}">{{ $item_name }}</a> ({{ $item_type }}) <br>
|
||||||
{{ trans('mail.requested') }} {{ $requested_date }}
|
{{ trans('general.requested') }} {{ $requested_date }}
|
||||||
@if ($item_quantity > 1)
|
@if ($item_quantity > 1)
|
||||||
{{ trans('mail.quantity') }} {{ $item_quantity}}
|
<br> {{ trans('general.qty') }} {{ $item_quantity}}
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if ($snipeSettings->show_url_in_emails=='1')
|
@if ($snipeSettings->show_url_in_emails=='1')
|
||||||
|
|
39
resources/views/modals/category.blade.php
Normal file
39
resources/views/modals/category.blade.php
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span></button>
|
||||||
|
<h4 class="modal-title">{{ trans('admin/categories/general.create') }}</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="alert alert-danger" id="modal_error_msg" style="display:none">
|
||||||
|
</div>
|
||||||
|
<div class="dynamic-form-row">
|
||||||
|
<div class="col-md-4 col-xs-12"><label for="modal-name">{{ trans('general.name') }}:
|
||||||
|
</label></div>
|
||||||
|
<div class="col-md-8 col-xs-12 required">
|
||||||
|
<input type='text' id='modal-name' class="form-control">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="dynamic-form-row">
|
||||||
|
<div class="col-md-4 col-xs-12"><label for="modal-name">{{ trans('general.name') }}:
|
||||||
|
</label></div>
|
||||||
|
<div class="col-md-8 col-xs-12 required">
|
||||||
|
<select class="select2" id="modal-category_type" style="width: 100%">
|
||||||
|
<option value="asset">Asset</option>
|
||||||
|
<option value="accessory" disabled>Accessory</option>
|
||||||
|
<option value="consumable" disabled>Consumable</option>
|
||||||
|
<option value="component" disabled>Component</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('button.cancel') }}</button>
|
||||||
|
<button type="button" class="btn btn-primary" id="modal-save">{{ trans('general.save') }}</button>
|
||||||
|
</div>
|
||||||
|
</div><!-- /.modal-content -->
|
||||||
|
</div><!-- /.modal-dialog -->
|
25
resources/views/modals/manufacturer.blade.php
Normal file
25
resources/views/modals/manufacturer.blade.php
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span></button>
|
||||||
|
<h4 class="modal-title">{{ trans('admin/manufacturers/table.create') }}</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="alert alert-danger" id="modal_error_msg" style="display:none">
|
||||||
|
</div>
|
||||||
|
<div class="dynamic-form-row">
|
||||||
|
<div class="col-md-4 col-xs-12"><label for="modal-name">{{ trans('general.name') }}:
|
||||||
|
</label></div>
|
||||||
|
<div class="col-md-8 col-xs-12 required">
|
||||||
|
<input type='text' id='modal-name' class="form-control">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('button.cancel') }}</button>
|
||||||
|
<button type="button" class="btn btn-primary" id="modal-save">{{ trans('general.save') }}</button>
|
||||||
|
</div>
|
||||||
|
</div><!-- /.modal-content -->
|
||||||
|
</div><!-- /.modal-dialog -->
|
|
@ -15,6 +15,13 @@
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-1 col-sm-1 text-left">
|
||||||
|
@can('create', \App\Models\Category::class)
|
||||||
|
@if ((!isset($hide_new)) || ($hide_new!='true'))
|
||||||
|
<a href='{{ route('modal.category') }}' data-toggle="modal" data-target="#createModal" data-dependency="categorie" data-select='category_select_id' class="btn btn-sm btn-default">New</a>
|
||||||
|
@endif
|
||||||
|
@endcan
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{!! $errors->first($fieldname, '<div class="col-md-8 col-md-offset-3"><span class="alert-msg"><i class="fa fa-times"></i> :message</span></div>') !!}
|
{!! $errors->first($fieldname, '<div class="col-md-8 col-md-offset-3"><span class="alert-msg"><i class="fa fa-times"></i> :message</span></div>') !!}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
{{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }}
|
{{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }}
|
||||||
|
|
||||||
<div class="col-md-7{{ ((isset($required)) && ($required=='true')) ? ' required' : '' }}">
|
<div class="col-md-7{{ ((isset($required)) && ($required=='true')) ? ' required' : '' }}">
|
||||||
<select class="js-data-ajax" data-endpoint="manufacturers" name="{{ $fieldname }}" style="width: 100%" id="category_select_id">
|
<select class="js-data-ajax" data-endpoint="manufacturers" name="{{ $fieldname }}" style="width: 100%" id="manufacturer_select_id">
|
||||||
@if ($manufacturer_id = Input::old($fieldname, (isset($item)) ? $item->{$fieldname} : ''))
|
@if ($manufacturer_id = Input::old($fieldname, (isset($item)) ? $item->{$fieldname} : ''))
|
||||||
<option value="{{ $manufacturer_id }}" selected="selected">
|
<option value="{{ $manufacturer_id }}" selected="selected">
|
||||||
{{ (\App\Models\Manufacturer::find($manufacturer_id)) ? \App\Models\Manufacturer::find($manufacturer_id)->name : '' }}
|
{{ (\App\Models\Manufacturer::find($manufacturer_id)) ? \App\Models\Manufacturer::find($manufacturer_id)->name : '' }}
|
||||||
|
@ -16,6 +16,14 @@
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-1 col-sm-1 text-left">
|
||||||
|
@can('create', \App\Models\Manufacturer::class)
|
||||||
|
@if ((!isset($hide_new)) || ($hide_new!='true'))
|
||||||
|
<a href='{{ route('modal.manufacturer') }}' data-toggle="modal" data-target="#createModal" data-dependency="manufacturer" data-select='manufacturer_select_id' class="btn btn-sm btn-default">New</a>
|
||||||
|
@endif
|
||||||
|
@endcan
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{!! $errors->first($fieldname, '<div class="col-md-8 col-md-offset-3"><span class="alert-msg"><i class="fa fa-times"></i> :message</span></div>') !!}
|
{!! $errors->first($fieldname, '<div class="col-md-8 col-md-offset-3"><span class="alert-msg"><i class="fa fa-times"></i> :message</span></div>') !!}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -136,20 +136,12 @@
|
||||||
<td>{{ trans('admin/users/table.name') }}</td>
|
<td>{{ trans('admin/users/table.name') }}</td>
|
||||||
<td>{{ $user->present()->fullName() }}</td>
|
<td>{{ $user->present()->fullName() }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>{{ trans('admin/users/table.username') }}</td>
|
||||||
|
<td>{{ $user->username }}</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
@if ($user->last_login)
|
|
||||||
<tr>
|
|
||||||
<td>{{ trans('general.last_login') }}</td>
|
|
||||||
<td>{{ \App\Helpers\Helper::getFormattedDateObject($user->last_login, 'datetime', false) }}</td>
|
|
||||||
</tr>
|
|
||||||
@endif
|
|
||||||
|
|
||||||
@if (!is_null($user->department))
|
|
||||||
<tr>
|
|
||||||
<td>{{ trans('general.department') }}</td>
|
|
||||||
<td><a href="{{ route('departments.show', $user->department) }}">{{ $user->department->name }}</a></td>
|
|
||||||
</tr>
|
|
||||||
@endif
|
|
||||||
|
|
||||||
@if ($user->jobtitle)
|
@if ($user->jobtitle)
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -197,6 +189,19 @@
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
@endif
|
@endif
|
||||||
|
@if ($user->last_login)
|
||||||
|
<tr>
|
||||||
|
<td>{{ trans('general.last_login') }}</td>
|
||||||
|
<td>{{ \App\Helpers\Helper::getFormattedDateObject($user->last_login, 'datetime', false) }}</td>
|
||||||
|
</tr>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if (!is_null($user->department))
|
||||||
|
<tr>
|
||||||
|
<td>{{ trans('general.department') }}</td>
|
||||||
|
<td><a href="{{ route('departments.show', $user->department) }}">{{ $user->department->name }}</a></td>
|
||||||
|
</tr>
|
||||||
|
@endif
|
||||||
@if ($user->created_at)
|
@if ($user->created_at)
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ trans('general.created_at') }}</td>
|
<td>{{ trans('general.created_at') }}</td>
|
||||||
|
|
|
@ -82,6 +82,8 @@ Route::group(['middleware' => 'auth'], function () {
|
||||||
|
|
||||||
Route::group(['middleware' => 'auth','prefix' => 'modals'], function () {
|
Route::group(['middleware' => 'auth','prefix' => 'modals'], function () {
|
||||||
Route::get('location',['as' => 'modal.location','uses' => 'ModalController@location']);
|
Route::get('location',['as' => 'modal.location','uses' => 'ModalController@location']);
|
||||||
|
Route::get('category',['as' => 'modal.category','uses' => 'ModalController@category']);
|
||||||
|
Route::get('manufacturer',['as' => 'modal.manufacturer','uses' => 'ModalController@manufacturer']);
|
||||||
Route::get('model',['as' => 'modal.model','uses' => 'ModalController@model']);
|
Route::get('model',['as' => 'modal.model','uses' => 'ModalController@model']);
|
||||||
Route::get('statuslabel',['as' => 'modal.statuslabel','uses' => 'ModalController@statuslabel']);
|
Route::get('statuslabel',['as' => 'modal.statuslabel','uses' => 'ModalController@statuslabel']);
|
||||||
Route::get('supplier',['as' => 'modal.supplier','uses' => 'ModalController@supplier']);
|
Route::get('supplier',['as' => 'modal.supplier','uses' => 'ModalController@supplier']);
|
||||||
|
|
Loading…
Reference in a new issue