Merge remote-tracking branch 'origin/develop'

This commit is contained in:
snipe 2023-05-09 16:29:53 -07:00
commit a43dea3c04
4 changed files with 54 additions and 95 deletions

View file

@ -17,5 +17,6 @@ return array(
'use_default_eula' => 'Use the <a href="#" data-toggle="modal" data-target="#eulaModal">primary default EULA</a> instead.', 'use_default_eula' => 'Use the <a href="#" data-toggle="modal" data-target="#eulaModal">primary default EULA</a> instead.',
'use_default_eula_disabled' => '<del>Use the primary default EULA instead.</del> No primary default EULA is set. Please add one in Settings.', 'use_default_eula_disabled' => '<del>Use the primary default EULA instead.</del> No primary default EULA is set. Please add one in Settings.',
'clone' => 'Clone Accessory', 'clone' => 'Clone Accessory',
'delete_disabled' => 'This accessory cannot be deleted yet because some items are still checked out.',
); );

View file

@ -92,6 +92,7 @@ return [
'debug_warning_text' => 'This application is running in production mode with debugging enabled. This can expose sensitive data if your application is accessible to the outside world. Disable debug mode by setting the <code>APP_DEBUG</code> value in your <code>.env</code> file to <code>false</code>.', 'debug_warning_text' => 'This application is running in production mode with debugging enabled. This can expose sensitive data if your application is accessible to the outside world. Disable debug mode by setting the <code>APP_DEBUG</code> value in your <code>.env</code> file to <code>false</code>.',
'delete' => 'Delete', 'delete' => 'Delete',
'delete_confirm' => 'Are you sure you wish to delete :item?', 'delete_confirm' => 'Are you sure you wish to delete :item?',
'delete_confirm_no_undo' => 'Are you sure you wish to delete :item? This can not be undone.',
'deleted' => 'Deleted', 'deleted' => 'Deleted',
'delete_seats' => 'Deleted Seats', 'delete_seats' => 'Deleted Seats',
'deletion_failed' => 'Deletion failed', 'deletion_failed' => 'Deletion failed',

View file

@ -12,43 +12,6 @@
@parent @parent
@stop @stop
{{-- Right header --}}
@section('header_right')
@can('manage', \App\Models\Accessory::class)
<div class="dropdown pull-right">
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
{{ trans('button.actions') }}
<span class="caret"></span>
</button>
<ul class="dropdown-menu pull-right" role="menu">
@if ($accessory->assigned_to != '')
@can('checkin', \App\Models\Accessory::class)
<li role="menuitem">
<a href="{{ route('accessories.checkin.show', $accessory->id) }}">{{ trans('admin/accessories/general.checkin') }}</a>
</li>
@endcan
@else
@can('checkout', \App\Models\Accessory::class)
<li role="menuitem">
<a href="{{ route('accessories.checkout.show', $accessory->id) }}">{{ trans('admin/accessories/general.checkout') }}</a>
</li>
@endcan
@endif
@can('update', \App\Models\Accessory::class)
<li role="menuitem">
<a href="{{ route('accessories.edit', $accessory->id) }}">{{ trans('admin/accessories/general.edit') }}</a>
</li>
@endcan
@can('update', \App\Models\Accessory::class)
<li role="menuitem">
<a href="{{ route('clone/accessories', $accessory->id) }}">{{ trans('admin/accessories/general.clone') }}</a>
</li>
@endcan
</ul>
</div>
@endcan
@stop
{{-- Page content --}} {{-- Page content --}}
@section('content') @section('content')
{{-- Page content --}} {{-- Page content --}}
@ -136,7 +99,7 @@
</div> </div>
</div> </div>
<!-- histor tab pane --> <!-- history tab pane -->
<div class="tab-pane fade" id="history"> <div class="tab-pane fade" id="history">
<div class="table table-responsive"> <div class="table table-responsive">
<div class="row"> <div class="row">
@ -274,10 +237,10 @@
</div> </div>
</div> <!-- /.tab-pane --> </div> <!-- /.tab-pane -->
@endcan @endcan
</div>
</div>
</div>
</div>
</div>
</div>
<!-- side address column --> <!-- side address column -->
@ -347,58 +310,44 @@
{{ $accessory->users_count }} {{ $accessory->users_count }}
</div> </div>
</div> </div>
</div>
<div class="col-md-3 pull-right">
@can('checkout', \App\Models\Accessory::class) @can('checkout', \App\Models\Accessory::class)
<div class="row"> <div class="text-center" style="padding-top:5px;">
<div class="col-md-12 text-center">
<a href="{{ route('accessories.checkout.show', $accessory->id) }}" style="margin-right:5px; width:100%" class="btn btn-primary btn-sm" {{ (($accessory->numRemaining() > 0 ) ? '' : ' disabled') }}>{{ trans('general.checkout') }}</a> <a href="{{ route('accessories.checkout.show', $accessory->id) }}" style="margin-right:5px; width:100%" class="btn btn-primary btn-sm" {{ (($accessory->numRemaining() > 0 ) ? '' : ' disabled') }}>{{ trans('general.checkout') }}</a>
</div> </div>
@endcan
@can('update', \App\Models\Accessory::class)
<div class="text-center" style="padding-top:5px;">
<a href="{{ route('accessories.edit', $accessory->id) }}" style="margin-right:5px; width:100%" class="btn btn-primary btn-sm">{{ trans('admin/accessories/general.edit') }}</a>
</div>
@endcan
@can('update', \App\Models\Accessory::class)
<div class="text-center" style="padding-top:5px;">
<a href="{{ route('clone/accessories', $accessory->id) }}" style="margin-right:5px; width:100%" class="btn btn-primary btn-sm">{{ trans('admin/accessories/general.clone') }}</a>
</div> </div>
@endcan @endcan
@can('delete', $accessory)
<div class="tab-pane fade" id="history"> @if ($accessory->users_count == 0)
<div class="row"> <div class="text-center" style="padding-top:5px;">
<div class="col-md-12"> <button class="btn btn-block btn-danger delete-asset" style="padding-top:5px;" data-toggle="modal" data-title="{{ trans('general.delete') }}" data-content="{{ trans('general.delete_confirm_no_undo', ['item' => $accessory->name]) }}" data-target="#dataConfirmModal">
<table {{ trans('general.delete') }}
class="table table-striped snipe-table" </button>
data-cookie-id-table="AccessoryHistoryTable" </div>
data-id-table="AccessoryHistoryTable" @else
id="AccessoryHistoryTable" <div class="text-center" style="padding-top:5px;">
data-pagination="true" <span data-tooltip="true" title=" {{ trans('admin/accessories/general.delete_disabled') }}">
data-show-columns="true" <a href="#" class="btn btn-block btn-danger disabled">
data-side-pagination="server" {{ trans('general.delete') }}
data-show-refresh="true" </a>
data-show-export="true" </span>
data-sort-order="desc" </div>
data-export-options='{
"fileName": "export-{{ str_slug($accessory->name) }}-history-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'
data-url="{{ route('api.activity.index', ['item_id' => $accessory->id, 'item_type' => 'accessory']) }}">
<thead>
<tr>
<th class="col-sm-2" data-visible="false" data-sortable="true" data-field="created_at" data-formatter="dateDisplayFormatter">{{ trans('general.record_created') }}</th>
<th class="col-sm-2"data-visible="true" data-sortable="true" data-field="admin" data-formatter="usersLinkObjFormatter">{{ trans('general.admin') }}</th>
<th class="col-sm-2" data-sortable="true" data-visible="true" data-field="action_type">{{ trans('general.action') }}</th>
<th class="col-sm-2" data-sortable="true" data-visible="true" data-field="item" data-formatter="polymorphicItemFormatter">{{ trans('general.item') }}</th>
<th class="col-sm-2" data-visible="true" data-field="target" data-formatter="polymorphicItemFormatter">{{ trans('general.target') }}</th>
<th class="col-sm-2" data-sortable="true" data-visible="true" data-field="note">{{ trans('general.notes') }}</th>
<th class="col-sm-2" data-visible="true" data-field="action_date" data-formatter="dateDisplayFormatter">{{ trans('general.date') }}</th>
@if ($snipeSettings->require_accept_signature=='1')
<th class="col-md-3" data-field="signature_file" data-visible="false" data-formatter="imageFormatter">{{ trans('general.signature') }}</th>
@endif @endif
</tr> @endcan
</thead> </div>
</table> </div>
</div> <!-- /.col-md-12-->
</div> <!-- /.row-->
</div><!--tab history-->
</div><!--col-md-3-->
</div><!--row-->
@ -411,5 +360,13 @@
@section('moar_scripts') @section('moar_scripts')
<script>
$('#dataConfirmModal').on('show.bs.modal', function (event) {
var content = $(event.relatedTarget).data('content');
var title = $(event.relatedTarget).data('title');
$(this).find(".modal-body").text(content);
$(this).find(".modal-header").text(title);
});
</script>
@include ('partials.bootstrap-table') @include ('partials.bootstrap-table')
@stop @stop