all
This commit is contained in:
@ -0,0 +1,35 @@
|
||||
<div id="{{ (isset($id_divname)) ? $id_divname : 'assetsBulkEditToolbar' }}" style="min-width:400px">
|
||||
{{ Form::open([
|
||||
'method' => 'POST',
|
||||
'route' => ['hardware/bulkedit'],
|
||||
'class' => 'form-inline',
|
||||
'id' => (isset($id_formname)) ? $id_formname : 'assetsBulkForm',
|
||||
]) }}
|
||||
|
||||
{{-- The sort and order will only be used if the cookie is actually empty (like on first-use) --}}
|
||||
<input name="sort" type="hidden" value="assets.id">
|
||||
<input name="order" type="hidden" value="asc">
|
||||
<label for="bulk_actions">
|
||||
<span class="sr-only">
|
||||
{{ trans('button.bulk_actions') }}
|
||||
</span>
|
||||
</label>
|
||||
<select name="bulk_actions" class="form-control select2" aria-label="bulk_actions" style="min-width: 350px;">
|
||||
@if((isset($status)) && ($status == 'Deleted'))
|
||||
@can('delete', \App\Models\Asset::class)
|
||||
<option value="restore">{{trans('button.restore')}}</option>
|
||||
@endcan
|
||||
@else
|
||||
@can('update', \App\Models\Asset::class)
|
||||
<option value="edit">{{ trans('button.edit') }}</option>
|
||||
@endcan
|
||||
@can('delete', \App\Models\Asset::class)
|
||||
<option value="delete">{{ trans('button.delete') }}</option>
|
||||
@endcan
|
||||
<option value="labels" accesskey="l">{{ trans_choice('button.generate_labels', 2) }}</option>
|
||||
@endif
|
||||
</select>
|
||||
|
||||
<button class="btn btn-primary" id="{{ (isset($id_button)) ? $id_button : 'bulkAssetEditButton' }}" disabled>{{ trans('button.go') }}</button>
|
||||
{{ Form::close() }}
|
||||
</div>
|
@ -0,0 +1,75 @@
|
||||
<script nonce="{{ csrf_token() }}">
|
||||
|
||||
// create the assigned assets listing box for the right side of the screen
|
||||
$(function() {
|
||||
$('#assigned_user').on("change",function () {
|
||||
var userid = $('#assigned_user option:selected').val();
|
||||
|
||||
if(userid=='') {
|
||||
console.warn('no user selected');
|
||||
$('#current_assets_box').fadeOut();
|
||||
$('#current_assets_content').html("");
|
||||
} else {
|
||||
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '{{ config('app.url') }}/api/v1/users/' + userid + '/assets',
|
||||
headers: {
|
||||
"X-Requested-With": 'XMLHttpRequest',
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
$('#current_assets_box').fadeIn();
|
||||
|
||||
var table_html = '<div class="row">';
|
||||
table_html += '<div class="col-md-12">';
|
||||
table_html += '<table class="table table-striped">';
|
||||
table_html += '<thead><tr>';
|
||||
table_html += '<th></th>';
|
||||
table_html += '<th>{{ trans('admin/hardware/form.name') }}</th>';
|
||||
table_html += '<th>{{ trans('admin/hardware/form.tag') }}</th>';
|
||||
table_html += '<th>{{ trans('admin/hardware/form.serial') }}</th>';
|
||||
table_html += '</tr></thead><tbody>';
|
||||
|
||||
$('#current_assets_content').append('');
|
||||
|
||||
if (data.rows.length > 0) {
|
||||
|
||||
for (var i in data.rows) {
|
||||
var asset = data.rows[i];
|
||||
table_html += '<tr>';
|
||||
if (asset.image != null) {
|
||||
table_html += '<td class="col-md-1"><a href="' + asset.image + '" data-toggle="lightbox" data-type="image"><img src="' + asset.image + '" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;"></a></td>';
|
||||
} else {
|
||||
table_html += "<td></td> ";
|
||||
}
|
||||
table_html += '<td><a href="{{ config('app.url') }}/hardware/' + asset.id + '">';
|
||||
|
||||
if ((asset.name == '') && (asset.name != null)) {
|
||||
table_html += " " + asset.model.name;
|
||||
} else {
|
||||
table_html += asset.name;
|
||||
table_html += " (" + asset.model.name + ")";
|
||||
}
|
||||
|
||||
table_html += '</a></td>';
|
||||
table_html += '<td class="col-md-4">' + asset.asset_tag + '</td>';
|
||||
table_html += '<td class="col-md-4">' + asset.serial + '</td>';
|
||||
table_html += "</tr>";
|
||||
}
|
||||
} else {
|
||||
table_html += '<tr><td colspan="4">{{ trans('admin/users/message.user_has_no_assets_assigned') }}</td></tr>';
|
||||
}
|
||||
$('#current_assets_content').html(table_html + '</tbody></table></div></div>');
|
||||
|
||||
},
|
||||
error: function (data) {
|
||||
$('#current_assets_box').fadeOut();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
@ -0,0 +1,937 @@
|
||||
@push('css')
|
||||
<link rel="stylesheet" href="{{ url(mix('css/dist/bootstrap-table.css')) }}">
|
||||
@endpush
|
||||
|
||||
@push('js')
|
||||
|
||||
<script src="{{ url(mix('js/dist/bootstrap-table.js')) }}"></script>
|
||||
|
||||
<script nonce="{{ csrf_token() }}">
|
||||
$(function () {
|
||||
|
||||
var locale = '{{ config('app.locale') }}';
|
||||
var blockedFields = "searchable,sortable,switchable,title,visible,formatter,class".split(",");
|
||||
|
||||
var keyBlocked = function(key) {
|
||||
for(var j in blockedFields) {
|
||||
if (key === blockedFields[j]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
$('.snipe-table').bootstrapTable('destroy').each(function () {
|
||||
|
||||
data_export_options = $(this).attr('data-export-options');
|
||||
export_options = data_export_options ? JSON.parse(data_export_options) : {};
|
||||
export_options['htmlContent'] = false; // this is already the default; but let's be explicit about it
|
||||
export_options['jspdf']= {"orientation": "l"};
|
||||
// the following callback method is necessary to prevent XSS vulnerabilities
|
||||
// (this is taken from Bootstrap Tables's default wrapper around jQuery Table Export)
|
||||
export_options['onCellHtmlData'] = function (cell, rowIndex, colIndex, htmlData) {
|
||||
if (cell.is('th')) {
|
||||
return cell.find('.th-inner').text()
|
||||
}
|
||||
return htmlData
|
||||
}
|
||||
$(this).bootstrapTable({
|
||||
classes: 'table table-responsive table-no-bordered',
|
||||
ajaxOptions: {
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
}
|
||||
},
|
||||
// reorderableColumns: true,
|
||||
stickyHeader: true,
|
||||
stickyHeaderOffsetLeft: parseInt($('body').css('padding-left'), 10),
|
||||
stickyHeaderOffsetRight: parseInt($('body').css('padding-right'), 10),
|
||||
locale: '{{ app()->getLocale() }}',
|
||||
undefinedText: '',
|
||||
iconsPrefix: 'fa',
|
||||
cookieStorage: '{{ config('session.bs_table_storage') }}',
|
||||
cookie: true,
|
||||
cookieExpire: '2y',
|
||||
showColumnsToggleAll: true,
|
||||
minimumCountColumns: 2,
|
||||
mobileResponsive: true,
|
||||
maintainSelected: true,
|
||||
trimOnSearch: false,
|
||||
showSearchClearButton: true,
|
||||
addrbar: {{ (config('session.bs_table_addrbar') == 'true') ? 'true' : 'false'}}, // deeplink search phrases, sorting, etc
|
||||
paginationFirstText: "{{ trans('general.first') }}",
|
||||
paginationLastText: "{{ trans('general.last') }}",
|
||||
paginationPreText: "{{ trans('general.previous') }}",
|
||||
paginationNextText: "{{ trans('general.next') }}",
|
||||
pageList: ['10','20', '30','50','100','150','200'{!! ((config('app.max_results') > 200) ? ",'500'" : '') !!}{!! ((config('app.max_results') > 500) ? ",'".config('app.max_results')."'" : '') !!}],
|
||||
pageSize: {{ (($snipeSettings->per_page!='') && ($snipeSettings->per_page > 0)) ? $snipeSettings->per_page : 20 }},
|
||||
paginationVAlign: 'both',
|
||||
queryParams: function (params) {
|
||||
var newParams = {};
|
||||
for(var i in params) {
|
||||
if(!keyBlocked(i)) { // only send the field if it's not in blockedFields
|
||||
newParams[i] = params[i];
|
||||
}
|
||||
}
|
||||
return newParams;
|
||||
},
|
||||
formatLoadingMessage: function () {
|
||||
return '<h2><i class="fas fa-spinner fa-spin" aria-hidden="true"></i> {{ trans('general.loading') }} </h2>';
|
||||
},
|
||||
icons: {
|
||||
advancedSearchIcon: 'fas fa-search-plus',
|
||||
paginationSwitchDown: 'fa-caret-square-o-down',
|
||||
paginationSwitchUp: 'fa-caret-square-o-up',
|
||||
fullscreen: 'fa-expand',
|
||||
columns: 'fa-columns',
|
||||
refresh: 'fas fa-sync-alt',
|
||||
export: 'fa-download',
|
||||
clearSearch: 'fa-times'
|
||||
},
|
||||
exportOptions: export_options,
|
||||
exportTypes: ['xlsx', 'excel', 'csv', 'pdf','json', 'xml', 'txt', 'sql', 'doc' ],
|
||||
onLoadSuccess: function () {
|
||||
$('[data-tooltip="true"]').tooltip(); // Needed to attach tooltips after ajax call
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function dateRowCheckStyle(value) {
|
||||
if ((value.days_to_next_audit) && (value.days_to_next_audit < {{ $snipeSettings->audit_warning_days ?: 0 }})) {
|
||||
return { classes : "danger" }
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
// These methods dynamically add/remove hidden input values in the bulk actions form
|
||||
$('.snipe-table').on('check.bs.table .btSelectItem', function (row, $element) {
|
||||
var buttonName = $(this).data('bulk-button-id');
|
||||
var tableId = $(this).data('id-table');
|
||||
|
||||
$(buttonName).removeAttr('disabled');
|
||||
$(buttonName).after('<input id="' + tableId + '_checkbox_' + $element.id + '" type="hidden" name="ids[]" value="' + $element.id + '">');
|
||||
});
|
||||
|
||||
$('.snipe-table').on('check-all.bs.table', function (event, rowsAfter) {
|
||||
|
||||
var buttonName = $(this).data('bulk-button-id');
|
||||
$(buttonName).removeAttr('disabled');
|
||||
var tableId = $(this).data('id-table');
|
||||
|
||||
for (var i in rowsAfter) {
|
||||
// Do not select things that were already selected
|
||||
if($('#'+ tableId + '_checkbox_' + rowsAfter[i].id).length == 0) {
|
||||
$(buttonName).after('<input id="' + tableId + '_checkbox_' + rowsAfter[i].id + '" type="hidden" name="ids[]" value="' + rowsAfter[i].id + '">');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('.snipe-table').on('uncheck.bs.table .btSelectItem', function (row, $element) {
|
||||
var tableId = $(this).data('id-table');
|
||||
$( "#" + tableId + "_checkbox_" + $element.id).remove();
|
||||
});
|
||||
|
||||
|
||||
// Handle whether the edit button should be disabled
|
||||
$('.snipe-table').on('uncheck.bs.table', function () {
|
||||
var buttonName = $(this).data('bulk-button-id');
|
||||
|
||||
if ($(this).bootstrapTable('getSelections').length == 0) {
|
||||
|
||||
$(buttonName).attr('disabled', 'disabled');
|
||||
}
|
||||
});
|
||||
|
||||
$('.snipe-table').on('uncheck-all.bs.table', function (event, rowsAfter, rowsBefore) {
|
||||
|
||||
var buttonName = $(this).data('bulk-button-id');
|
||||
$(buttonName).attr('disabled', 'disabled');
|
||||
var tableId = $(this).data('id-table');
|
||||
|
||||
for (var i in rowsBefore) {
|
||||
$('#' + tableId + "_checkbox_" + rowsBefore[i].id).remove();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// Initialize sort-order for bulk actions (label-generation) for snipe-tables
|
||||
$('.snipe-table').each(function (i, table) {
|
||||
table_cookie_segment = $(table).data('cookie-id-table');
|
||||
sort = '';
|
||||
order = '';
|
||||
cookies = document.cookie.split(";");
|
||||
for(i in cookies) {
|
||||
cookiedef = cookies[i].split("=", 2);
|
||||
cookiedef[0] = cookiedef[0].trim();
|
||||
if (cookiedef[0] == table_cookie_segment + ".bs.table.sortOrder") {
|
||||
order = cookiedef[1];
|
||||
}
|
||||
if (cookiedef[0] == table_cookie_segment + ".bs.table.sortName") {
|
||||
sort = cookiedef[1];
|
||||
}
|
||||
}
|
||||
if (sort && order) {
|
||||
domnode = $($(this).data('bulk-form-id')).get(0);
|
||||
if ( domnode && domnode.elements && domnode.elements.sort ) {
|
||||
domnode.elements.sort.value = sort;
|
||||
domnode.elements.order.value = order;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// If sort order changes, update the sort-order for bulk-actions (for label-generation)
|
||||
$('.snipe-table').on('sort.bs.table', function (event, name, order) {
|
||||
domnode = $($(this).data('bulk-form-id')).get(0);
|
||||
// make safe in case there isn't a bulk-form-id, or it's not found, or has no 'sort' element
|
||||
if ( domnode && domnode.elements && domnode.elements.sort ) {
|
||||
domnode.elements.sort.value = name;
|
||||
domnode.elements.order.value = order;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
// This only works for model index pages because it uses the row's model ID
|
||||
function genericRowLinkFormatter(destination) {
|
||||
return function (value,row) {
|
||||
if (value) {
|
||||
return '<a href="{{ config('app.url') }}/' + destination + '/' + row.id + '">' + value + '</a>';
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Use this when we're introspecting into a column object and need to link
|
||||
function genericColumnObjLinkFormatter(destination) {
|
||||
return function (value,row) {
|
||||
if ((value) && (value.status_meta)) {
|
||||
|
||||
var text_color;
|
||||
var icon_style;
|
||||
var text_help;
|
||||
var status_meta = {
|
||||
'deployed': '{{ strtolower(trans('general.deployed')) }}',
|
||||
'deployable': '{{ strtolower(trans('admin/hardware/general.deployable')) }}',
|
||||
'archived': '{{ strtolower(trans('general.archived')) }}',
|
||||
'pending': '{{ strtolower(trans('general.pending')) }}'
|
||||
}
|
||||
|
||||
switch (value.status_meta) {
|
||||
case 'deployed':
|
||||
text_color = 'blue';
|
||||
icon_style = 'fa-circle';
|
||||
text_help = '<label class="label label-default">{{ trans('general.deployed') }}</label>';
|
||||
break;
|
||||
case 'deployable':
|
||||
text_color = 'green';
|
||||
icon_style = 'fa-circle';
|
||||
text_help = '';
|
||||
break;
|
||||
case 'pending':
|
||||
text_color = 'orange';
|
||||
icon_style = 'fa-circle';
|
||||
text_help = '';
|
||||
break;
|
||||
default:
|
||||
text_color = 'red';
|
||||
icon_style = 'fa-times';
|
||||
text_help = '';
|
||||
}
|
||||
|
||||
return '<nobr><a href="{{ config('app.url') }}/' + destination + '/' + value.id + '" data-tooltip="true" title="'+ status_meta[value.status_meta] + '"> <i class="fa ' + icon_style + ' text-' + text_color + '"></i> ' + value.name + ' ' + text_help + ' </a> </nobr>';
|
||||
} else if ((value) && (value.name)) {
|
||||
|
||||
// Add some overrides for any funny urls we have
|
||||
var dest = destination;
|
||||
var dpolymorphicItemFormatterest = '';
|
||||
if (destination=='fieldsets') {
|
||||
var dpolymorphicItemFormatterest = 'fields/';
|
||||
}
|
||||
|
||||
return '<nobr><a href="{{ config('app.url') }}/' + dpolymorphicItemFormatterest + dest + '/' + value.id + '">' + value.name + '</a></span>';
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function hardwareAuditFormatter(value, row) {
|
||||
return '<a href="{{ config('app.url') }}/hardware/audit/' + row.id + '/" class="btn btn-sm bg-yellow" data-tooltip="true" title="Audit this item">{{ trans('general.audit') }}</a>';
|
||||
}
|
||||
|
||||
|
||||
// Make the edit/delete buttons
|
||||
function genericActionsFormatter(owner_name, element_name) {
|
||||
if (!element_name) {
|
||||
element_name = '';
|
||||
}
|
||||
|
||||
return function (value,row) {
|
||||
|
||||
var actions = '<nobr>';
|
||||
|
||||
// Add some overrides for any funny urls we have
|
||||
var dest = owner_name;
|
||||
|
||||
if (dest =='groups') {
|
||||
var dest = 'admin/groups';
|
||||
}
|
||||
|
||||
if (dest =='maintenances') {
|
||||
var dest = 'hardware/maintenances';
|
||||
}
|
||||
|
||||
if(element_name != '') {
|
||||
dest = dest + '/' + row.owner_id + '/' + element_name;
|
||||
}
|
||||
|
||||
if ((row.available_actions) && (row.available_actions.clone === true)) {
|
||||
actions += '<a href="{{ config('app.url') }}/' + dest + '/' + row.id + '/clone" class="actions btn btn-sm btn-info" data-tooltip="true" title="{{ trans('general.clone_item') }}"><i class="far fa-clone" aria-hidden="true"></i><span class="sr-only">Clone</span></a> ';
|
||||
}
|
||||
|
||||
if ((row.available_actions) && (row.available_actions.update === true)) {
|
||||
actions += '<a href="{{ config('app.url') }}/' + dest + '/' + row.id + '/edit" class="actions btn btn-sm btn-warning" data-tooltip="true" title="{{ trans('general.update') }}"><i class="fas fa-pencil-alt" aria-hidden="true"></i><span class="sr-only">{{ trans('general.update') }}</span></a> ';
|
||||
} else {
|
||||
if ((row.available_actions) && (row.available_actions.update != true)) {
|
||||
actions += '<span data-tooltip="true" title="{{ trans('general.cannot_be_edited') }}"><a class="btn btn-warning btn-sm disabled" onClick="return false;"><i class="fas fa-pencil-alt"></i></a></span> ';
|
||||
}
|
||||
}
|
||||
|
||||
if ((row.available_actions) && (row.available_actions.delete === true)) {
|
||||
|
||||
// use the asset tag if no name is provided
|
||||
var name_for_box = row.name
|
||||
if (row.name=='') {
|
||||
var name_for_box = row.asset_tag
|
||||
}
|
||||
|
||||
actions += '<a href="{{ config('app.url') }}/' + dest + '/' + row.id + '" '
|
||||
+ ' class="actions btn btn-danger btn-sm delete-asset" data-tooltip="true" '
|
||||
+ ' data-toggle="modal" '
|
||||
+ ' data-content="{{ trans('general.sure_to_delete') }} ' + name_for_box + '?" '
|
||||
+ ' data-title="{{ trans('general.delete') }}" onClick="return false;">'
|
||||
+ '<i class="fas fa-trash" aria-hidden="true"></i><span class="sr-only">{{ trans('general.delete') }}</span></a> ';
|
||||
} else {
|
||||
// Do not show the delete button on things that are already deleted
|
||||
if ((row.available_actions) && (row.available_actions.restore != true)) {
|
||||
actions += '<span data-tooltip="true" title="{{ trans('general.cannot_be_deleted') }}"><a class="btn btn-danger btn-sm delete-asset disabled" onClick="return false;"><i class="fas fa-trash"></i></a></span> ';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ((row.available_actions) && (row.available_actions.restore === true)) {
|
||||
actions += '<form style="display: inline;" method="POST" action="{{ config('app.url') }}/' + dest + '/' + row.id + '/restore"> ';
|
||||
actions += '@csrf';
|
||||
actions += '<button class="btn btn-sm btn-warning" data-tooltip="true" title="{{ trans('general.restore') }}"><i class="fas fa-retweet"></i></button> ';
|
||||
}
|
||||
|
||||
actions +='</nobr>';
|
||||
return actions;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// This handles the icons and display of polymorphic entries
|
||||
function polymorphicItemFormatter(value) {
|
||||
|
||||
var item_destination = '';
|
||||
var item_icon;
|
||||
|
||||
if ((value) && (value.type)) {
|
||||
|
||||
if (value.type == 'asset') {
|
||||
item_destination = 'hardware';
|
||||
item_icon = 'fas fa-barcode';
|
||||
} else if (value.type == 'accessory') {
|
||||
item_destination = 'accessories';
|
||||
item_icon = 'far fa-keyboard';
|
||||
} else if (value.type == 'component') {
|
||||
item_destination = 'components';
|
||||
item_icon = 'far fa-hdd';
|
||||
} else if (value.type == 'consumable') {
|
||||
item_destination = 'consumables';
|
||||
item_icon = 'fas fa-tint';
|
||||
} else if (value.type == 'license') {
|
||||
item_destination = 'licenses';
|
||||
item_icon = 'far fa-save';
|
||||
} else if (value.type == 'user') {
|
||||
item_destination = 'users';
|
||||
item_icon = 'fas fa-user';
|
||||
} else if (value.type == 'location') {
|
||||
item_destination = 'locations'
|
||||
item_icon = 'fas fa-map-marker-alt';
|
||||
} else if (value.type == 'model') {
|
||||
item_destination = 'models'
|
||||
item_icon = '';
|
||||
}
|
||||
|
||||
// display the username if it's checked out to a user, but don't do it if the username's there already
|
||||
if (value.username && !value.name.match('\\(') && !value.name.match('\\)')) {
|
||||
value.name = value.name + ' (' + value.username + ')';
|
||||
}
|
||||
|
||||
return '<nobr><a href="{{ config('app.url') }}/' + item_destination +'/' + value.id + '" data-tooltip="true" title="' + value.type + '"><i class="' + item_icon + ' text-{{ $snipeSettings->skin!='' ? $snipeSettings->skin : 'blue' }} "></i> ' + value.name + '</a></nobr>';
|
||||
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// This just prints out the item type in the activity report
|
||||
function itemTypeFormatter(value, row) {
|
||||
|
||||
if ((row) && (row.item) && (row.item.type)) {
|
||||
return row.item.type;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Convert line breaks to <br>
|
||||
function notesFormatter(value) {
|
||||
if (value) {
|
||||
return value.replace(/(?:\r\n|\r|\n)/g, '<br />');
|
||||
}
|
||||
}
|
||||
|
||||
// Check if checkbox should be selectable
|
||||
// Selectability is determined by the API field "selectable" which is set at the Presenter/API Transformer
|
||||
// However since different bulk actions have different requirements, we have to walk through the available_actions object
|
||||
// to determine whether to disable it
|
||||
function checkboxEnabledFormatter (value, row) {
|
||||
|
||||
// add some stuff to get the value of the select2 option here?
|
||||
|
||||
if ((row.available_actions) && (row.available_actions.bulk_selectable) && (row.available_actions.bulk_selectable.delete !== true)) {
|
||||
return {
|
||||
disabled:true,
|
||||
//checked: false, <-- not sure this will work the way we want?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// We need a special formatter for license seats, since they don't work exactly the same
|
||||
// Checkouts need the license ID, checkins need the specific seat ID
|
||||
|
||||
function licenseSeatInOutFormatter(value, row) {
|
||||
// The user is allowed to check the license seat out and it's available
|
||||
if ((row.available_actions.checkout === true) && (row.user_can_checkout === true) && ((!row.asset_id) && (!row.assigned_to))) {
|
||||
return '<a href="{{ config('app.url') }}/licenses/' + row.license_id + '/checkout/'+row.id+'" class="btn btn-sm bg-maroon" data-tooltip="true" title="{{ trans('general.checkout_tooltip') }}">{{ trans('general.checkout') }}</a>';
|
||||
} else {
|
||||
return '<a href="{{ config('app.url') }}/licenses/' + row.id + '/checkin" class="btn btn-sm bg-purple" data-tooltip="true" title="Check in this license seat.">{{ trans('general.checkin') }}</a>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function genericCheckinCheckoutFormatter(destination) {
|
||||
return function (value,row) {
|
||||
|
||||
// The user is allowed to check items out, AND the item is deployable
|
||||
if ((row.available_actions.checkout == true) && (row.user_can_checkout == true) && ((!row.asset_id) && (!row.assigned_to))) {
|
||||
|
||||
return '<a href="{{ config('app.url') }}/' + destination + '/' + row.id + '/checkout" class="btn btn-sm bg-maroon" data-tooltip="true" title="{{ trans('general.checkout_tooltip') }}">{{ trans('general.checkout') }}</a>';
|
||||
|
||||
// The user is allowed to check items out, but the item is not able to be checked out
|
||||
} else if (((row.user_can_checkout == false)) && (row.available_actions.checkout == true) && (!row.assigned_to)) {
|
||||
|
||||
// We use slightly different language for assets versus other things, since they are the only
|
||||
// item that has a status label
|
||||
if (destination =='hardware') {
|
||||
return '<span data-tooltip="true" title="{{ trans('admin/hardware/general.undeployable_tooltip') }}"><a class="btn btn-sm bg-maroon disabled">{{ trans('general.checkout') }}</a></span>';
|
||||
} else {
|
||||
return '<span data-tooltip="true" title="{{ trans('general.undeployable_tooltip') }}"><a class="btn btn-sm bg-maroon disabled">{{ trans('general.checkout') }}</a></span>';
|
||||
}
|
||||
|
||||
// The user is allowed to check items in
|
||||
} else if (row.available_actions.checkin == true) {
|
||||
if (row.assigned_to) {
|
||||
return '<a href="{{ config('app.url') }}/' + destination + '/' + row.id + '/checkin" class="btn btn-sm bg-purple" data-tooltip="true" title="Check this item in so it is available for re-imaging, re-issue, etc.">{{ trans('general.checkin') }}</a>';
|
||||
} else if (row.assigned_pivot_id) {
|
||||
return '<a href="{{ config('app.url') }}/' + destination + '/' + row.assigned_pivot_id + '/checkin" class="btn btn-sm bg-purple" data-tooltip="true" title="Check this item in so it is available for re-imaging, re-issue, etc.">{{ trans('general.checkin') }}</a>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// This is only used by the requestable assets section
|
||||
function assetRequestActionsFormatter (row, value) {
|
||||
if (value.assigned_to_self == true){
|
||||
return '<button class="btn btn-danger btn-sm disabled" data-tooltip="true" title="Cancel this item request">{{ trans('button.cancel') }}</button>';
|
||||
} else if (value.available_actions.cancel == true) {
|
||||
return '<form action="{{ config('app.url') }}/account/request-asset/'+ value.id + '" method="POST">@csrf<button class="btn btn-danger btn-sm" data-tooltip="true" title="Cancel this item request">{{ trans('button.cancel') }}</button></form>';
|
||||
} else if (value.available_actions.request == true) {
|
||||
return '<form action="{{ config('app.url') }}/account/request-asset/'+ value.id + '" method="POST">@csrf<button class="btn btn-primary btn-sm" data-tooltip="true" title="Request this item">{{ trans('button.request') }}</button></form>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
var formatters = [
|
||||
'hardware',
|
||||
'accessories',
|
||||
'consumables',
|
||||
'components',
|
||||
'locations',
|
||||
'users',
|
||||
'manufacturers',
|
||||
'maintenances',
|
||||
'statuslabels',
|
||||
'models',
|
||||
'licenses',
|
||||
'categories',
|
||||
'suppliers',
|
||||
'departments',
|
||||
'companies',
|
||||
'depreciations',
|
||||
'fieldsets',
|
||||
'groups',
|
||||
'kits'
|
||||
];
|
||||
|
||||
for (var i in formatters) {
|
||||
window[formatters[i] + 'LinkFormatter'] = genericRowLinkFormatter(formatters[i]);
|
||||
window[formatters[i] + 'LinkObjFormatter'] = genericColumnObjLinkFormatter(formatters[i]);
|
||||
window[formatters[i] + 'ActionsFormatter'] = genericActionsFormatter(formatters[i]);
|
||||
window[formatters[i] + 'InOutFormatter'] = genericCheckinCheckoutFormatter(formatters[i]);
|
||||
}
|
||||
|
||||
var child_formatters = [
|
||||
['kits', 'models'],
|
||||
['kits', 'licenses'],
|
||||
['kits', 'consumables'],
|
||||
['kits', 'accessories'],
|
||||
];
|
||||
|
||||
for (var i in child_formatters) {
|
||||
var owner_name = child_formatters[i][0];
|
||||
var child_name = child_formatters[i][1];
|
||||
window[owner_name + '_' + child_name + 'ActionsFormatter'] = genericActionsFormatter(owner_name, child_name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// This is gross, but necessary so that we can package the API response
|
||||
// for custom fields in a more useful way.
|
||||
function customFieldsFormatter(value, row) {
|
||||
|
||||
|
||||
if ((!this) || (!this.title)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
var field_column = this.title;
|
||||
|
||||
// Pull out any HTMl that might be passed via the presenter
|
||||
// (for example, the locked icon for encrypted fields)
|
||||
var field_column_plain = field_column.replace(/<(?:.|\n)*?> ?/gm, '');
|
||||
if ((row.custom_fields) && (row.custom_fields[field_column_plain])) {
|
||||
|
||||
// If the field type needs special formatting, do that here
|
||||
if ((row.custom_fields[field_column_plain].field_format) && (row.custom_fields[field_column_plain].value)) {
|
||||
if (row.custom_fields[field_column_plain].field_format=='URL') {
|
||||
return '<a href="' + row.custom_fields[field_column_plain].value + '" target="_blank" rel="noopener">' + row.custom_fields[field_column_plain].value + '</a>';
|
||||
} else if (row.custom_fields[field_column_plain].field_format=='BOOLEAN') {
|
||||
return (row.custom_fields[field_column_plain].value == 1) ? "<span class='fas fa-check-circle' style='color:green'>" : "<span class='fas fa-times-circle' style='color:red' />";
|
||||
} else if (row.custom_fields[field_column_plain].field_format=='EMAIL') {
|
||||
return '<a href="mailto:' + row.custom_fields[field_column_plain].value + '" style="white-space: nowrap" data-tooltip="true" title="{{ trans('general.send_email') }}"><i class="fa-regular fa-envelope" aria-hidden="true"></i> ' + row.custom_fields[field_column_plain].value + '</a>';
|
||||
}
|
||||
}
|
||||
return row.custom_fields[field_column_plain].value;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function createdAtFormatter(value) {
|
||||
if ((value) && (value.formatted)) {
|
||||
return value.formatted;
|
||||
}
|
||||
}
|
||||
|
||||
function externalLinkFormatter(value) {
|
||||
|
||||
if (value) {
|
||||
if ((value.indexOf("{") === -1) || (value.indexOf("}") ===-1)) {
|
||||
return '<nobr><a href="' + value + '" target="_blank" title="External link to ' + value + '" data-tooltip="true"><i class="fa fa-external-link"></i> ' + value + '</a></nobr>';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
function groupsFormatter(value) {
|
||||
|
||||
if (value) {
|
||||
var groups = '';
|
||||
for (var index in value.rows) {
|
||||
groups += '<a href="{{ config('app.url') }}/admin/groups/' + value.rows[index].id + '" class="label label-default">' + value.rows[index].name + '</a> ';
|
||||
}
|
||||
return groups;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function changeLogFormatter(value) {
|
||||
|
||||
var result = '';
|
||||
var pretty_index = '';
|
||||
|
||||
for (var index in value) {
|
||||
|
||||
|
||||
// Check if it's a custom field
|
||||
if (index.startsWith('_snipeit_')) {
|
||||
pretty_index = index.replace("_snipeit_", "Custom:_");
|
||||
} else {
|
||||
pretty_index = index;
|
||||
}
|
||||
|
||||
extra_pretty_index = prettyLog(pretty_index);
|
||||
|
||||
result += extra_pretty_index + ': <del>' + value[index].old + '</del> <i class="fas fa-long-arrow-alt-right" aria-hidden="true"></i> ' + value[index].new + '<br>'
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
function prettyLog(str) {
|
||||
let frags = str.split('_');
|
||||
for (let i = 0; i < frags.length; i++) {
|
||||
frags[i] = frags[i].charAt(0).toUpperCase() + frags[i].slice(1);
|
||||
}
|
||||
return frags.join(' ');
|
||||
}
|
||||
|
||||
// Show the warning if below min qty
|
||||
function minAmtFormatter(row, value) {
|
||||
|
||||
if ((row) && (row!=undefined)) {
|
||||
if (value.free_seats_count <= value.min_amt) {
|
||||
return '<span class="text-danger text-bold" data-tooltip="true" title="{{ trans('admin/licenses/general.below_threshold_short') }}">' + value.min_amt + '</span>';
|
||||
}
|
||||
return value.min_amt
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Create a linked phone number in the table list
|
||||
function phoneFormatter(value) {
|
||||
if (value) {
|
||||
return '<span style="white-space: nowrap;"><a href="tel:' + value + '" data-tooltip="true" title="{{ trans('general.call') }}"><i class="fa-solid fa-phone" aria-hidden="true"></i> ' + value + '</a></span>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function deployedLocationFormatter(row, value) {
|
||||
if ((row) && (row!=undefined)) {
|
||||
return '<a href="{{ config('app.url') }}/locations/' + row.id + '">' + row.name + '</a>';
|
||||
} else if (value.rtd_location) {
|
||||
return '<a href="{{ config('app.url') }}/locations/' + value.rtd_location.id + '">' + value.rtd_location.name + '</a>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function groupsAdminLinkFormatter(value, row) {
|
||||
return '<a href="{{ config('app.url') }}/admin/groups/' + row.id + '">' + value + '</a>';
|
||||
}
|
||||
|
||||
function assetTagLinkFormatter(value, row) {
|
||||
if ((row.asset) && (row.asset.id)) {
|
||||
if (row.asset.deleted_at!='') {
|
||||
return '<span style="white-space: nowrap;"><i class="fas fa-times text-danger"></i><span class="sr-only">{{ trans('admin/hardware/general.deleted') }}</span> <del><a href="{{ config('app.url') }}/hardware/' + row.asset.id + '" data-tooltip="true" title="{{ trans('admin/hardware/general.deleted') }}">' + row.asset.asset_tag + '</a></del></span>';
|
||||
}
|
||||
return '<a href="{{ config('app.url') }}/hardware/' + row.asset.id + '">' + row.asset.asset_tag + '</a>';
|
||||
}
|
||||
return '';
|
||||
|
||||
}
|
||||
|
||||
function departmentNameLinkFormatter(value, row) {
|
||||
if ((row.assigned_user) && (row.assigned_user.department) && (row.assigned_user.department.name)) {
|
||||
return '<a href="{{ config('app.url') }}/departments/' + row.assigned_user.department.id + '">' + row.assigned_user.department.name + '</a>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function assetNameLinkFormatter(value, row) {
|
||||
if ((row.asset) && (row.asset.name)) {
|
||||
return '<a href="{{ config('app.url') }}/hardware/' + row.asset.id + '">' + row.asset.name + '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
function assetSerialLinkFormatter(value, row) {
|
||||
|
||||
if ((row.asset) && (row.asset.serial)) {
|
||||
if (row.asset.deleted_at!='') {
|
||||
return '<span style="white-space: nowrap;"><i class="fas fa-times text-danger"></i><span class="sr-only">deleted</span> <del><a href="{{ config('app.url') }}/hardware/' + row.asset.id + '" data-tooltip="true" title="{{ trans('admin/hardware/general.deleted') }}">' + row.asset.serial + '</a></del></span>';
|
||||
}
|
||||
return '<a href="{{ config('app.url') }}/hardware/' + row.asset.id + '">' + row.asset.serial + '</a>';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
function trueFalseFormatter(value) {
|
||||
if ((value) && ((value == 'true') || (value == '1'))) {
|
||||
return '<i class="fas fa-check text-success"></i><span class="sr-only">{{ trans('general.true') }}</span>';
|
||||
} else {
|
||||
return '<i class="fas fa-times text-danger"></i><span class="sr-only">{{ trans('general.false') }}</span>';
|
||||
}
|
||||
}
|
||||
|
||||
function dateDisplayFormatter(value) {
|
||||
if (value) {
|
||||
return value.formatted;
|
||||
}
|
||||
}
|
||||
|
||||
function iconFormatter(value) {
|
||||
if (value) {
|
||||
return '<i class="' + value + ' icon-med"></i>';
|
||||
}
|
||||
}
|
||||
|
||||
function emailFormatter(value) {
|
||||
if (value) {
|
||||
return '<a href="mailto:' + value + '" style="white-space: nowrap" data-tooltip="true" title="{{ trans('general.send_email') }}"><i class="fa-regular fa-envelope" aria-hidden="true"></i> ' + value + '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
function linkFormatter(value) {
|
||||
if (value) {
|
||||
return '<a href="' + value + '">' + value + '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
function assetCompanyFilterFormatter(value, row) {
|
||||
if (value) {
|
||||
return '<a href="{{ config('app.url') }}/hardware/?company_id=' + row.id + '">' + value + '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
function assetCompanyObjFilterFormatter(value, row) {
|
||||
if ((row) && (row.company)) {
|
||||
return '<a href="{{ config('app.url') }}/hardware/?company_id=' + row.company.id + '">' + row.company.name + '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
function usersCompanyObjFilterFormatter(value, row) {
|
||||
if (value) {
|
||||
return '<a href="{{ config('app.url') }}/users/?company_id=' + row.id + '">' + value + '</a>';
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
function employeeNumFormatter(value, row) {
|
||||
|
||||
if ((row) && (row.assigned_to) && ((row.assigned_to.employee_number))) {
|
||||
return '<a href="{{ config('app.url') }}/users/' + row.assigned_to.id + '">' + row.assigned_to.employee_number + '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
function orderNumberObjFilterFormatter(value, row) {
|
||||
if (value) {
|
||||
return '<a href="{{ config('app.url') }}/hardware/?order_number=' + row.order_number + '">' + row.order_number + '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
function auditImageFormatter(value){
|
||||
if (value){
|
||||
return '<a href="' + value.url + '" data-toggle="lightbox" data-type="image"><img src="' + value.url + '" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive"></a>'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function imageFormatter(value, row) {
|
||||
|
||||
if (value) {
|
||||
|
||||
// This is a clunky override to handle unusual API responses where we're presenting a link instead of an array
|
||||
if (row.avatar) {
|
||||
var altName = '';
|
||||
}
|
||||
else if (row.name) {
|
||||
var altName = row.name;
|
||||
}
|
||||
else if ((row) && (row.model)) {
|
||||
var altName = row.model.name;
|
||||
}
|
||||
return '<a href="' + value + '" data-toggle="lightbox" data-type="image"><img src="' + value + '" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive" alt="' + altName + '"></a>';
|
||||
}
|
||||
}
|
||||
function downloadFormatter(value) {
|
||||
if (value) {
|
||||
return '<a href="' + value + '" target="_blank"><i class="fas fa-download"></i></a>';
|
||||
}
|
||||
}
|
||||
|
||||
function fileUploadFormatter(value) {
|
||||
if ((value) && (value.url) && (value.inlineable)) {
|
||||
return '<a href="' + value.url + '" data-toggle="lightbox" data-type="image"><img src="' + value.url + '" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive"></a>';
|
||||
} else if ((value) && (value.url)) {
|
||||
return '<a href="' + value.url + '" class="btn btn-default"><i class="fas fa-download"></i></a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function fileUploadNameFormatter(value) {
|
||||
console.dir(value);
|
||||
if ((value) && (value.filename) && (value.url)) {
|
||||
return '<a href="' + value.url + '">' + value.filename + '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
function labelPerPageFormatter(value, row, index, field) {
|
||||
if (row) {
|
||||
if (!row.hasOwnProperty('sheet_info')) { return 1; }
|
||||
else { return row.sheet_info.labels_per_page; }
|
||||
}
|
||||
}
|
||||
|
||||
function labelRadioFormatter(value, row, index, field) {
|
||||
if (row) {
|
||||
return row.name == '{{ str_replace("\\", "\\\\", $snipeSettings->label2_template) }}';
|
||||
}
|
||||
}
|
||||
|
||||
function labelSizeFormatter(value, row) {
|
||||
if (row) {
|
||||
return row.width + ' x ' + row.height + ' ' + row.unit;
|
||||
}
|
||||
}
|
||||
|
||||
function cleanFloat(number) {
|
||||
if(!number) { // in a JavaScript context, meaning, if it's null or zero or unset
|
||||
return 0.0;
|
||||
}
|
||||
if ("{{$snipeSettings->digit_separator}}" == "1.234,56") {
|
||||
// yank periods, change commas to periods
|
||||
periodless = number.toString().replace(/\./g,"");
|
||||
decimalfixed = periodless.replace(/,/g,".");
|
||||
} else {
|
||||
// yank commas, that's it.
|
||||
decimalfixed = number.toString().replace(/\,/g,"");
|
||||
}
|
||||
return parseFloat(decimalfixed);
|
||||
}
|
||||
|
||||
function sumFormatter(data) {
|
||||
if (Array.isArray(data)) {
|
||||
var field = this.field;
|
||||
var total_sum = data.reduce(function(sum, row) {
|
||||
|
||||
return (sum) + (cleanFloat(row[field]) || 0);
|
||||
}, 0);
|
||||
|
||||
return numberWithCommas(total_sum.toFixed(2));
|
||||
}
|
||||
return 'not an array';
|
||||
}
|
||||
|
||||
function sumFormatterQuantity(data){
|
||||
if(Array.isArray(data)) {
|
||||
|
||||
// Prevents issues on page load where data is an empty array
|
||||
if(data[0] == undefined){
|
||||
return 0.00
|
||||
}
|
||||
// Check that we are actually trying to sum cost from a table
|
||||
// that has a quantity column. We must perform this check to
|
||||
// support licences which use seats instead of qty
|
||||
if('qty' in data[0]) {
|
||||
var multiplier = 'qty';
|
||||
} else if('seats' in data[0]) {
|
||||
var multiplier = 'seats';
|
||||
} else {
|
||||
return 'no quantity';
|
||||
}
|
||||
var total_sum = data.reduce(function(sum, row) {
|
||||
return (sum) + (cleanFloat(row["purchase_cost"])*row[multiplier] || 0);
|
||||
}, 0);
|
||||
return numberWithCommas(total_sum.toFixed(2));
|
||||
}
|
||||
return 'not an array';
|
||||
}
|
||||
|
||||
function numberWithCommas(value) {
|
||||
|
||||
if ((value) && ("{{$snipeSettings->digit_separator}}" == "1.234,56")){
|
||||
var parts = value.toString().split(".");
|
||||
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ".");
|
||||
return parts.join(",");
|
||||
} else {
|
||||
var parts = value.toString().split(",");
|
||||
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
return parts.join(".");
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
$(function () {
|
||||
$('#bulkEdit').click(function () {
|
||||
var selectedIds = $('.snipe-table').bootstrapTable('getSelections');
|
||||
$.each(selectedIds, function(key,value) {
|
||||
$( "#bulkForm" ).append($('<input type="hidden" name="ids[' + value.id + ']" value="' + value.id + '">' ));
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
$(function() {
|
||||
|
||||
// This handles the search box highlighting on both ajax and client-side
|
||||
// bootstrap tables
|
||||
var searchboxHighlighter = function (event) {
|
||||
|
||||
$('.search-input').each(function (index, element) {
|
||||
|
||||
if ($(element).val() != '') {
|
||||
$(element).addClass('search-highlight');
|
||||
$(element).next().children().addClass('search-highlight');
|
||||
} else {
|
||||
$(element).removeClass('search-highlight');
|
||||
$(element).next().children().removeClass('search-highlight');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$('.search button[name=clearSearch]').click(searchboxHighlighter);
|
||||
searchboxHighlighter({ name:'pageload'});
|
||||
$('.search-input').keyup(searchboxHighlighter);
|
||||
|
||||
// This is necessary to make the bootstrap tooltips work inside of the
|
||||
// wenzhixin/bootstrap-table formatters
|
||||
$('#table').on('post-body.bs.table', function () {
|
||||
$('[data-tooltip="true"]').tooltip({
|
||||
container: 'body'
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
@endpush
|
@ -0,0 +1,15 @@
|
||||
@can('admin')
|
||||
@if ((config('services.baremetrics.enabled')=='true') && (config('services.baremetrics.app_key')) && (config('services.baremetrics.stripe_id')))
|
||||
<script>
|
||||
!function(){if(window.barepay&&window.barepay.created)window.console&&console.error&&console.error("Barepay snippet included twice.");else{window.barepay={created:!0};var a=document.createElement("script");a.src="https://baremetrics-dunning.baremetrics.com/js/application.js",a.async=!0;var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b),
|
||||
|
||||
window.barepay.params = {
|
||||
access_token_id: "{{ config('services.baremetrics.app_key') }}", // Your Recover API public key
|
||||
customer_oid: "{{ config('services.baremetrics.stripe_id') }}" // Customer ID whose card you're looking to update
|
||||
}
|
||||
|
||||
}}();
|
||||
</script>
|
||||
@else
|
||||
@endif
|
||||
@endcan
|
@ -0,0 +1,24 @@
|
||||
<div class="form-group" id="assignto_selector"{!! (isset($style)) ? ' style="'.e($style).'"' : '' !!}>
|
||||
{{ Form::label('checkout_to_type', trans('admin/hardware/form.checkout_to'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-8">
|
||||
<div class="btn-group" data-toggle="buttons">
|
||||
@if ((isset($user_select)) && ($user_select!='false'))
|
||||
<label class="btn btn-default active">
|
||||
<input name="checkout_to_type" value="user" aria-label="checkout_to_type" type="radio" checked="checked"><i class="fas fa-user" aria-hidden="true"></i> {{ trans('general.user') }}
|
||||
</label>
|
||||
@endif
|
||||
@if ((isset($asset_select)) && ($asset_select!='false'))
|
||||
<label class="btn btn-default">
|
||||
<input name="checkout_to_type" value="asset" aria-label="checkout_to_type" type="radio"><i class="fas fa-barcode" aria-hidden="true"></i> {{ trans('general.asset') }}
|
||||
</label>
|
||||
@endif
|
||||
@if ((isset($location_select)) && ($location_select!='false'))
|
||||
<label class="btn btn-default">
|
||||
<input name="checkout_to_type" value="location" aria-label="checkout_to_type" class="active" type="radio"><i class="fas fa-map-marker-alt" aria-hidden="true"></i> {{ trans('general.location') }}
|
||||
</label>
|
||||
@endif
|
||||
|
||||
{!! $errors->first('checkout_to_type', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,5 @@
|
||||
<div class="row">
|
||||
<div class="col-md-10 col-md-offset-2">
|
||||
{!! Helper::showDemoModeFieldWarning() !!}
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,20 @@
|
||||
<!-- Accessory -->
|
||||
<div id="assigned_accessory" class="form-group{{ $errors->has($fieldname) ? ' has-error' : '' }}"{!! (isset($style)) ? ' style="'.e($style).'"' : '' !!}>
|
||||
{{ 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 select2" data-endpoint="accessories" data-placeholder="{{ trans('general.select_accessory') }}" name="{{ $fieldname }}" style="width: 100%" id="{{ (isset($select_id)) ? $select_id : 'assigned_accessory_select' }}"{{ (isset($multiple)) ? ' multiple' : '' }}>
|
||||
|
||||
@if ((!isset($unselect)) && ($accessory_id = Request::old($fieldname, (isset($accessory) ? $accessory->id : (isset($item) ? $item->{$fieldname} : '')))))
|
||||
<option value="{{ $accessory_id }}" selected="selected">
|
||||
{{ (\App\Models\Accessory::find($accessory_id)) ? \App\Models\Accessory::find($accessory_id)->present()->name : '' }}
|
||||
</option>
|
||||
@else
|
||||
@if(!isset($multiple))
|
||||
<option value="">{{ trans('general.select_accessory') }}</option>
|
||||
@endif
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
{!! $errors->first($fieldname, '<div class="col-md-8 col-md-offset-3"><span class="alert-msg"><i class="fas fa-times"></i> :message</span></div>') !!}
|
||||
|
||||
</div>
|
@ -0,0 +1,48 @@
|
||||
<div class="form-group {{ $errors->has('address') ? ' has-error' : '' }}">
|
||||
{{ Form::label('address', trans('general.address'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-7">
|
||||
{{Form::text('address', old('address', $item->address), array('class' => 'form-control', 'aria-label'=>'address', 'maxlength'=>'191')) }}
|
||||
{!! $errors->first('address', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group {{ $errors->has('address2') ? ' has-error' : '' }}">
|
||||
<label class="sr-only " for="address2">{{ trans('general.address') }}</label>
|
||||
<div class="col-md-7 col-md-offset-3">
|
||||
{{Form::text('address2', old('address2', $item->address2), array('class' => 'form-control', 'aria-label'=>'address2', 'maxlength'=>'191')) }}
|
||||
{!! $errors->first('address2', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group {{ $errors->has('city') ? ' has-error' : '' }}">
|
||||
{{ Form::label('city', trans('general.city'), array('class' => 'col-md-3 control-label', 'maxlength'=>'191')) }}
|
||||
<div class="col-md-7">
|
||||
{{Form::text('city', old('city', $item->city), array('class' => 'form-control', 'aria-label'=>'city')) }}
|
||||
{!! $errors->first('city', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group {{ $errors->has('state') ? ' has-error' : '' }}">
|
||||
{{ Form::label('state', trans('general.state'), array('class' => 'col-md-3 control-label', 'maxlength'=>'191')) }}
|
||||
<div class="col-md-7">
|
||||
{{Form::text('state', old('state', $item->state), array('class' => 'form-control', 'aria-label'=>'state')) }}
|
||||
{!! $errors->first('state', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group {{ $errors->has('country') ? ' has-error' : '' }}">
|
||||
{{ Form::label('country', trans('general.country'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-7">
|
||||
{!! Form::countries('country', old('country', $item->country), 'select2') !!}
|
||||
{!! $errors->first('country', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group {{ $errors->has('zip') ? ' has-error' : '' }}">
|
||||
{{ Form::label('zip', trans('general.zip'), array('class' => 'col-md-3 control-label', 'maxlength'=>'10')) }}
|
||||
<div class="col-md-7">
|
||||
{{Form::text('zip', old('zip', $item->zip), array('class' => 'form-control')) }}
|
||||
{!! $errors->first('zip', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,20 @@
|
||||
<!-- Asset -->
|
||||
<div id="assigned_asset" class="form-group{{ $errors->has($fieldname) ? ' has-error' : '' }}"{!! (isset($style)) ? ' style="'.e($style).'"' : '' !!}>
|
||||
{{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-8{{ ((isset($required) && ($required =='true'))) ? ' required' : '' }}">
|
||||
<select class="js-data-ajax select2" data-endpoint="hardware" data-placeholder="{{ trans('general.select_asset') }}" aria-label="{{ $fieldname }}" name="{{ $fieldname }}" style="width: 100%" id="{{ (isset($select_id)) ? $select_id : 'assigned_asset_select' }}"{{ (isset($multiple)) ? ' multiple' : '' }}{!! (!empty($asset_status_type)) ? ' data-asset-status-type="' . $asset_status_type . '"' : '' !!}>
|
||||
|
||||
@if ((!isset($unselect)) && ($asset_id = old($fieldname, (isset($asset) ? $asset->id : (isset($item) ? $item->{$fieldname} : '')))))
|
||||
<option value="{{ $asset_id }}" selected="selected" role="option" aria-selected="true" role="option">
|
||||
{{ (\App\Models\Asset::find($asset_id)) ? \App\Models\Asset::find($asset_id)->present()->fullName : '' }}
|
||||
</option>
|
||||
@else
|
||||
@if(!isset($multiple))
|
||||
<option value="" role="option">{{ trans('general.select_asset') }}</option>
|
||||
@endif
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
{!! $errors->first($fieldname, '<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>
|
@ -0,0 +1,28 @@
|
||||
<!-- Asset Model -->
|
||||
<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-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'" : '' }}>
|
||||
@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 : '' }}
|
||||
</option>
|
||||
@else
|
||||
<option value="" role="option">{{ trans('general.select_category') }}</option>
|
||||
@endif
|
||||
|
||||
</select>
|
||||
</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.show',['type' => 'category', 'category_type' => isset($category_type) ? $category_type : 'assets' ]) }}' data-toggle="modal" data-target="#createModal" data-select='category_select_id' class="btn btn-sm btn-primary">{{ trans('button.new') }}</a>
|
||||
@endif
|
||||
@endcan
|
||||
</div>
|
||||
|
||||
|
||||
{!! $errors->first($fieldname, '<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>
|
@ -0,0 +1,8 @@
|
||||
<!-- Category -->
|
||||
<div class="form-group {{ $errors->has('category_id') ? ' has-error' : '' }}">
|
||||
<label for="category_id" class="col-md-3 control-label">{{ trans('general.category') }}</label>
|
||||
<div class="col-md-7 col-sm-12{{ (Helper::checkIfRequired($item, 'category_id')) ? ' required' : '' }}">
|
||||
{{ Form::select('category_id', $category_list , old('category_id', $item->category_id), array('class'=>'select2', 'style'=>'width:100%')) }}
|
||||
{!! $errors->first('category_id', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,39 @@
|
||||
<!-- Company -->
|
||||
@if (($snipeSettings->full_multiple_companies_support=='1') && (!Auth::user()->isSuperUser()))
|
||||
<!-- full company support is enabled and this user isn't a superadmin -->
|
||||
<div class="form-group">
|
||||
{{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-6">
|
||||
<select class="js-data-ajax" disabled="true" data-endpoint="companies" data-placeholder="{{ trans('general.select_company') }}" name="{{ $fieldname }}" style="width: 100%" id="company_select" aria-label="{{ $fieldname }}"{{ (isset($multiple) && ($multiple=='true')) ? " multiple='multiple'" : '' }}>
|
||||
@if ($company_id = old($fieldname, (isset($item)) ? $item->{$fieldname} : ''))
|
||||
<option value="{{ $company_id }}" selected="selected" role="option" aria-selected="true" role="option">
|
||||
{{ (\App\Models\Company::find($company_id)) ? \App\Models\Company::find($company_id)->name : '' }}
|
||||
</option>
|
||||
@else
|
||||
<option value="" role="option">{{ trans('general.select_company') }}</option>
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@else
|
||||
<!-- 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">
|
||||
<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'" : '' }}>
|
||||
@if ($company_id = Request::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>
|
||||
@else
|
||||
<option value="">{{ trans('general.select_company') }}</option>
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
{!! $errors->first($fieldname, '<div class="col-md-8 col-md-offset-3"><span class="alert-msg"><i class="fas fa-times"></i> :message</span></div>') !!}
|
||||
|
||||
{!! $errors->first($fieldname, '<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>
|
||||
|
||||
@endif
|
@ -0,0 +1,11 @@
|
||||
@if (\App\Models\Company::isCurrentUserAuthorized())
|
||||
<div class="form-group {{ $errors->has('company_id') ? ' has-error' : '' }}">
|
||||
<div class="col-md-3 control-label">
|
||||
{{ Form::label('company_id', trans('general.company'), array('class' => 'col-md-3 control-label', 'for' => 'company_id')) }}
|
||||
</div>
|
||||
<div class="col-md-7 col-sm-12{{ (Helper::checkIfRequired($item, 'company_id')) ? ' required' : '' }}">
|
||||
{{ Form::select('company_id', $company_list , old('company_id', $item->company_id), array('class'=>'select2', 'style'=>'width:100%')) }}
|
||||
{!! $errors->first('company_id', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
@ -0,0 +1,20 @@
|
||||
<!-- Consumable -->
|
||||
<div id="assigned_consumable" class="form-group{{ $errors->has($fieldname) ? ' has-error' : '' }}"{!! (isset($style)) ? ' style="'.e($style).'"' : '' !!}>
|
||||
{{ 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 select2" data-endpoint="consumables" data-placeholder="{{ trans('general.select_consumable') }}" name="{{ $fieldname }}" style="width: 100%" id="{{ (isset($select_id)) ? $select_id : 'assigned_consumable_select' }}"{{ (isset($multiple)) ? ' multiple' : '' }}>
|
||||
|
||||
@if ((!isset($unselect)) && ($consumable_id = Request::old($fieldname, (isset($consumable) ? $consumable->id : (isset($item) ? $item->{$fieldname} : '')))))
|
||||
<option value="{{ $consumable_id }}" selected="selected">
|
||||
{{ (\App\Models\Consumable::find($consumable_id)) ? \App\Models\Consumable::find($consumable_id)->present()->name : '' }}
|
||||
</option>
|
||||
@else
|
||||
@if(!isset($multiple))
|
||||
<option value="">{{ trans('general.select_consumable') }}</option>
|
||||
@endif
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
{!! $errors->first($fieldname, '<div class="col-md-8 col-md-offset-3"><span class="alert-msg"><i class="fas fa-times"></i> :message</span></div>') !!}
|
||||
|
||||
</div>
|
@ -0,0 +1,12 @@
|
||||
<!-- Datepicker -->
|
||||
<div class="form-group{{ $errors->has($fieldname) ? ' has-error' : '' }}">
|
||||
{{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="input-group col-md-4">
|
||||
<div class="input-group date" data-provide="datepicker" data-date-clear-btn="true" data-date-format="yyyy-mm-dd" data-autoclose="true">
|
||||
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="{{ $fieldname }}" id="{{ $fieldname }}" value="{{ old($fieldname, ($item->{$fieldname}) ? date('Y-m-d', strtotime($item->{$fieldname})) : '') }}" readonly style="background-color:inherit" maxlength="10">
|
||||
<span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
{!! $errors->first($fieldname, '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -0,0 +1,20 @@
|
||||
<div id="assigned_user" 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">
|
||||
<select class="js-data-ajax" data-endpoint="departments" data-placeholder="{{ trans('general.select_department') }}" name="{{ $fieldname }}" style="width: 100%" id="department_select" aria-label="{{ $fieldname }}"{{ (isset($multiple) && ($multiple=='true')) ? " multiple='multiple'" : '' }}>
|
||||
@if ($department_id = old($fieldname, (isset($item)) ? $item->{$fieldname} : ''))
|
||||
<option value="{{ $department_id }}" selected="selected" role="option" aria-selected="true" role="option">
|
||||
{{ (\App\Models\Department::find($department_id)) ? \App\Models\Department::find($department_id)->name : '' }}
|
||||
</option>
|
||||
@else
|
||||
<option value="" role="option">{{ trans('general.select_department') }}</option>
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
{!! $errors->first($fieldname, '<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>
|
@ -0,0 +1,8 @@
|
||||
<!-- Depreciation -->
|
||||
<div class="form-group {{ $errors->has('depreciation_id') ? ' has-error' : '' }}">
|
||||
<label for="depreciation_id" class="col-md-3 control-label">{{ trans('general.depreciation') }}</label>
|
||||
<div class="col-md-7">
|
||||
{{ Form::select('depreciation_id', $depreciation_list , old('depreciation_id', $item->depreciation_id), array('class'=>'select2', 'style'=>'width:350px', 'aria-label'=>'depreciation_id')) }}
|
||||
{!! $errors->first('depreciation_id', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,7 @@
|
||||
<div class="form-group {{ $errors->has('email') ? ' has-error' : '' }}">
|
||||
{{ Form::label('email', trans('admin/suppliers/table.email'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-7">
|
||||
{{Form::text('email', old('email', $item->email), array('class' => 'form-control')) }}
|
||||
{!! $errors->first('email', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,11 @@
|
||||
<!-- EOL Date -->
|
||||
<div class="form-group {{ $errors->has('asset_eol_date') ? ' has-error' : '' }}">
|
||||
<label for="asset_eol_date" class="col-md-3 control-label">{{ trans('admin/hardware/form.eol_date') }}</label>
|
||||
<div class="input-group col-md-4">
|
||||
<div class="input-group date" data-provide="datepicker" data-date-clear-btn="true" data-date-format="yyyy-mm-dd" data-autoclose="true">
|
||||
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="asset_eol_date" id="asset_eol_date" readonly value="{{ old('asset_eol_date', optional($item->asset_eol_date)->format('Y-m-d') ?? $item->asset_eol_date ?? '') }}" style="background-color:inherit" />
|
||||
<span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
{!! $errors->first('asset_eol_date', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,7 @@
|
||||
<div class="form-group {{ $errors->has('fax') ? ' has-error' : '' }}">
|
||||
{{ Form::label('fax', trans('admin/suppliers/table.fax'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-7">
|
||||
{{Form::text('fax', old('fax', $item->fax), array('class' => 'form-control')) }}
|
||||
{!! $errors->first('fax', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,42 @@
|
||||
<!-- Image stuff - kept in /resources/views/partials/forms/edit/image-upload.blade.php -->
|
||||
<!-- Image Delete -->
|
||||
@if (isset($item) && ($item->image) && ($item->image!=''))
|
||||
<div class="form-group{{ $errors->has('image_delete') ? ' has-error' : '' }}">
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
<label class="form-control">
|
||||
{{ Form::checkbox('image_delete', '1', old('image_delete'), ['aria-label'=>'image_delete']) }}
|
||||
{{ trans('general.image_delete') }}
|
||||
{!! $errors->first('image_delete', '<span class="alert-msg">:message</span>') !!}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
<img src="{{ Storage::disk('public')->url($image_path.e($item->image)) }}" class="img-responsive">
|
||||
{!! $errors->first('image_delete', '<span class="alert-msg">:message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Image Upload and preview -->
|
||||
|
||||
<div class="form-group {{ $errors->has((isset($fieldname) ? $fieldname : 'image')) ? 'has-error' : '' }}">
|
||||
<label class="col-md-3 control-label" for="{{ (isset($fieldname) ? $fieldname : 'image') }}">{{ trans('general.image_upload') }}</label>
|
||||
<div class="col-md-9">
|
||||
|
||||
<input type="file" id="{{ (isset($fieldname) ? $fieldname : 'image') }}" name="{{ (isset($fieldname) ? $fieldname : 'image') }}" aria-label="{{ (isset($fieldname) ? $fieldname : 'image') }}" class="sr-only">
|
||||
|
||||
<label class="btn btn-default" aria-hidden="true">
|
||||
{{ trans('button.select_file') }}
|
||||
<input type="file" name="{{ (isset($fieldname) ? $fieldname : 'image') }}" class="js-uploadFile" id="uploadFile" data-maxsize="{{ Helper::file_upload_max_size() }}" accept="image/gif,image/jpeg,image/webp,image/png,image/svg,image/svg+xml,image/avif" style="display:none; max-width: 90%" aria-label="{{ (isset($fieldname) ? $fieldname : 'image') }}" aria-hidden="true">
|
||||
</label>
|
||||
<span class='label label-default' id="uploadFile-info"></span>
|
||||
|
||||
<p class="help-block" id="uploadFile-status">{{ trans('general.image_filetypes_help', ['size' => Helper::file_upload_max_size_readable()]) }}</p>
|
||||
{!! $errors->first('image', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
</div>
|
||||
<div class="col-md-4 col-md-offset-3" aria-hidden="true">
|
||||
<img id="uploadFile-imagePreview" style="max-width: 300px; display: none;" alt="{{ trans('general.alt_uploaded_image_thumbnail') }}">
|
||||
</div>
|
||||
</div>
|
||||
|
@ -0,0 +1,8 @@
|
||||
<!-- Item Number -->
|
||||
<div class="form-group {{ $errors->has('item_no') ? ' has-error' : '' }}">
|
||||
<label for="item_no" class="col-md-3 control-label">{{ trans('admin/consumables/general.item_no') }}</label>
|
||||
<div class="col-md-7 col-sm-12{{ (Helper::checkIfRequired($item, 'item_no')) ? ' required' : '' }}">
|
||||
<input class="form-control" type="text" name="item_no" id="item_no" value="{{ old('item_no', $item->item_no) }}" />
|
||||
{!! $errors->first('item_no', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,27 @@
|
||||
<div id="kit_id" class="form-group{{ $errors->has($fieldname) ? ' has-error' : '' }}"{!! (isset($style)) ? ' style="'.e($style).'"' : '' !!}>
|
||||
|
||||
{{ 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="kits" data-placeholder="{{ trans('partials/forms/general.placeholder_kit') }}" name="{{ $fieldname }}" style="width: 100%" id="kit_id_select">
|
||||
@if ($kit_id = Request::old($fieldname, (isset($item)) ? $item->{$fieldname} : ''))
|
||||
<option value="{{ $kit_id }}" selected="selected">
|
||||
{{ (\App\Models\User::find($kit_id)) ? \App\Models\User::find($kit_id)->present()->fullName : '' }}
|
||||
</option>
|
||||
@else
|
||||
<option value="">{{ trans('partials/forms/general.placeholder_kit') }}</option>
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 col-sm-1 text-left">
|
||||
@can('create', \App\Models\PredefinedKit::class)
|
||||
@if ((!isset($hide_new)) || ($hide_new!='true'))
|
||||
{{-- <a href='{{ route('modal.show, 'kit') }}' data-toggle="modal" data-target="#createModal" data-select='kit_id_select' class="btn btn-sm btn-default">{{ trans('buttons.new') }}</a> --}}
|
||||
@endif
|
||||
@endcan
|
||||
</div>
|
||||
|
||||
{!! $errors->first($fieldname, '<div class="col-md-8 col-md-offset-3"><span class="alert-msg"><i class="fas fa-times"></i> :message</span></div>') !!}
|
||||
|
||||
</div>
|
@ -0,0 +1,20 @@
|
||||
<!-- License -->
|
||||
<div id="assigned_license" class="form-group{{ $errors->has($fieldname) ? ' has-error' : '' }}"{!! (isset($style)) ? ' style="'.e($style).'"' : '' !!}>
|
||||
{{ 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 select2" data-endpoint="licenses" data-placeholder="{{ trans('general.select_license') }}" name="{{ $fieldname }}" style="width: 100%" id="{{ (isset($select_id)) ? $select_id : 'assigned_license_select' }}"{{ (isset($multiple)) ? ' multiple' : '' }}>
|
||||
|
||||
@if ((!isset($unselect)) && ($license_id = Request::old($fieldname, (isset($license) ? $license->id : (isset($item) ? $item->{$fieldname} : '')))))
|
||||
<option value="{{ $license_id }}" selected="selected">
|
||||
{{ (\App\Models\License::find($license_id)) ? \App\Models\License::find($license_id)->present()->fullName : '' }}
|
||||
</option>
|
||||
@else
|
||||
@if(!isset($multiple))
|
||||
<option value="">{{ trans('general.select_license') }}</option>
|
||||
@endif
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
{!! $errors->first($fieldname, '<div class="col-md-8 col-md-offset-3"><span class="alert-msg"><i class="fas fa-times"></i> :message</span></div>') !!}
|
||||
|
||||
</div>
|
@ -0,0 +1,22 @@
|
||||
<!-- Location -->
|
||||
<div id="location_id" class="form-group{{ $errors->has('location_id') ? ' has-error' : '' }}"{!! (isset($style)) ? ' style="'.e($style).'"' : '' !!}>
|
||||
|
||||
{{ Form::label('location_id', $translated_name, array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-7">
|
||||
<select class="js-data-ajax" data-endpoint="locations" data-placeholder="{{ trans('general.select_location') }}" name="location_id" style="width: 100%" id="location_id_location_select" aria-label="location_id">
|
||||
@if ($location_id = old('location_id', (isset($user)) ? $user->location_id : ''))
|
||||
<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 : '' }}
|
||||
</option>
|
||||
@else
|
||||
<option value="" role="option">{{ trans('general.select_location') }}</option>
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{!! $errors->first('location_id', '<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>
|
||||
|
||||
|
||||
|
@ -0,0 +1,52 @@
|
||||
<!-- Location -->
|
||||
<div id="{{ $fieldname }}" class="form-group{{ $errors->has($fieldname) ? ' has-error' : '' }}"{!! (isset($style)) ? ' style="'.e($style).'"' : '' !!}>
|
||||
|
||||
{{ 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'" : '' }}>
|
||||
@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 : '' }}
|
||||
</option>
|
||||
@else
|
||||
<option value="" role="option">{{ trans('general.select_location') }}</option>
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 col-sm-1 text-left">
|
||||
@can('create', \App\Models\Location::class)
|
||||
@if ((!isset($hide_new)) || ($hide_new!='true'))
|
||||
<a href='{{ route('modal.show', 'location') }}' data-toggle="modal" data-target="#createModal" data-select='{{ $fieldname }}_location_select' class="btn btn-sm btn-primary">{{ trans('button.new') }}</a>
|
||||
@endif
|
||||
@endcan
|
||||
</div>
|
||||
|
||||
{!! $errors->first($fieldname, '<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>') !!}
|
||||
|
||||
@if (isset($help_text))
|
||||
<div class="col-md-7 col-sm-11 col-md-offset-3">
|
||||
<p class="help-block">{{ $help_text }}</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (isset($hide_location_radio))
|
||||
<!-- Update actual location -->
|
||||
<div class="form-group">
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
<label class="form-control">
|
||||
{{ Form::radio('update_default_location', '1', old('update_default_location'), ['checked'=> 'checked', 'aria-label'=>'update_default_location']) }}
|
||||
{{ trans('admin/hardware/form.asset_location') }}
|
||||
</label>
|
||||
<label class="form-control">
|
||||
{{ Form::radio('update_default_location', '0', old('update_default_location'), ['aria-label'=>'update_default_location']) }}
|
||||
{{ trans('admin/hardware/form.asset_location_update_default_current') }}
|
||||
</label>
|
||||
</div>
|
||||
</div> <!--/form-group-->
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -0,0 +1,8 @@
|
||||
<!-- Location -->
|
||||
<div class="form-group {{ $errors->has('location_id') ? ' has-error' : '' }}">
|
||||
<label for="location_id" class="col-md-3 control-label">{{ trans('general.location') }}</label>
|
||||
<div class="col-md-7 col-sm-12{{ (Helper::checkIfRequired($item, 'location_id')) ? ' required' : '' }}">
|
||||
{{ Form::select('location_id', $location_list , old('location_id', $item->location_id), array('class'=>'select2', 'style'=>'width:350px')) }}
|
||||
{!! $errors->first('location_id', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,9 @@
|
||||
<!-- Improvement Type -->
|
||||
<div class="form-group {{ $errors->has('asset_maintenance_type') ? ' has-error' : '' }}">
|
||||
<label for="asset_maintenance_type" class="col-md-3 control-label">{{ trans('admin/asset_maintenances/form.asset_maintenance_type') }}
|
||||
</label>
|
||||
<div class="col-md-7{{ (Helper::checkIfRequired($item, 'asset_maintenance_type')) ? ' required' : '' }}">
|
||||
{{ Form::select('asset_maintenance_type', $assetMaintenanceType , old('asset_maintenance_type', $item->asset_maintenance_type), ['class'=>'select2', 'style'=>'min-width:350px', 'aria-label'=>'asset_maintenance_type']) }}
|
||||
{!! $errors->first('asset_maintenance_type', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,29 @@
|
||||
<!-- Asset Model -->
|
||||
<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-7{{ ((isset($required)) && ($required=='true')) ? ' required' : '' }}">
|
||||
<select class="js-data-ajax" data-endpoint="manufacturers" data-placeholder="{{ trans('general.select_manufacturer') }}" name="{{ $fieldname }}" style="width: 100%" id="manufacturer_select_id" aria-label="{{ $fieldname }}" {!! ((isset($item)) && (Helper::checkIfRequired($item, $fieldname))) ? ' data-validation="required" required' : '' !!}{{ (isset($multiple) && ($multiple=='true')) ? " multiple='multiple'" : '' }}>
|
||||
@if ($manufacturer_id = old($fieldname, (isset($item)) ? $item->{$fieldname} : ''))
|
||||
<option value="{{ $manufacturer_id }}" selected="selected" role="option" aria-selected="true" role="option">
|
||||
{{ (\App\Models\Manufacturer::find($manufacturer_id)) ? \App\Models\Manufacturer::find($manufacturer_id)->name : '' }}
|
||||
</option>
|
||||
@else
|
||||
<option value="" role="option">{{ trans('general.select_manufacturer') }}</option>
|
||||
@endif
|
||||
|
||||
</select>
|
||||
</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.show', 'manufacturer') }}' data-toggle="modal" data-target="#createModal" data-select='manufacturer_select_id' class="btn btn-sm btn-primary">{{ trans('button.new') }}</a>
|
||||
@endif
|
||||
@endcan
|
||||
</div>
|
||||
|
||||
|
||||
{!! $errors->first($fieldname, '<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>
|
@ -0,0 +1,8 @@
|
||||
<!-- Manufacturer -->
|
||||
<div class="form-group {{ $errors->has('manufacturer_id') ? ' has-error' : '' }}">
|
||||
<label for="manufacturer_id" class="col-md-3 control-label">{{ trans('general.manufacturer') }}</label>
|
||||
<div class="col-md-7{{ (Helper::checkIfRequired($item, 'manufacturer_id')) ? ' required' : '' }}">
|
||||
{{ Form::select('manufacturer_id', $manufacturer_list , old('manufacturer_id', $item->manufacturer_id), array('class'=>'select2', 'style'=>'width:100%')) }}
|
||||
{!! $errors->first('manufacturer_id', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,18 @@
|
||||
<!-- Min QTY -->
|
||||
<div class="form-group{{ $errors->has('min_amt') ? ' has-error' : '' }}">
|
||||
<label for="min_amt" class="col-md-3 control-label">{{ trans('general.min_amt') }}</label>
|
||||
<div class="col-md-9{{ (Helper::checkIfRequired($item, 'min_amt')) ? ' required' : '' }}">
|
||||
<div class="col-md-2" style="padding-left:0px">
|
||||
<input class="form-control col-md-3" type="text" name="min_amt" id="min_amt" aria-label="min_amt" value="{{ old('min_amt', $item->min_amt) }}" />
|
||||
</div>
|
||||
<div class="col-md-7" style="margin-left: -15px;">
|
||||
<a href="#" data-tooltip="true" title="{{ trans('general.min_amt_help') }}"><i class="fas fa-info-circle" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.min_amt_help') }}</span>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
{!! $errors->first('min_amt', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,30 @@
|
||||
<!-- Asset Model -->
|
||||
<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-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'" : '' }}>
|
||||
@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 : '' }}
|
||||
</option>
|
||||
@else
|
||||
<option value="" role="option">{{ trans('general.select_model') }}</option>
|
||||
@endif
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-1 col-sm-1 text-left">
|
||||
@can('create', \App\Models\AssetModel::class)
|
||||
@if ((!isset($hide_new)) || ($hide_new!='true'))
|
||||
<a href='{{ route('modal.show', 'model') }}' data-toggle="modal" data-target="#createModal" data-select='model_select_id' class="btn btn-sm btn-primary">{{ trans('button.new') }}</a>
|
||||
<span class="mac_spinner" style="padding-left: 10px; color: green; display:none; width: 30px;">
|
||||
<i class="fas fa-spinner fa-spin" aria-hidden="true"></i>
|
||||
</span>
|
||||
@endif
|
||||
@endcan
|
||||
</div>
|
||||
|
||||
{!! $errors->first($fieldname, '<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>
|
@ -0,0 +1,8 @@
|
||||
<!-- Model Number -->
|
||||
<div class="form-group {{ $errors->has('model_number') ? ' has-error' : '' }}">
|
||||
<label for="model_number" class="col-md-3 control-label">{{ trans('general.model_no') }}</label>
|
||||
<div class="col-md-7">
|
||||
<input class="form-control" type="text" name="model_number" aria-label="model_number" id="model_number" value="{{ old('model_number', $item->model_number) }}" />
|
||||
{!! $errors->first('model_number', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,8 @@
|
||||
<!-- Name -->
|
||||
<div class="form-group {{ $errors->has('name') ? ' has-error' : '' }}">
|
||||
<label for="name" class="col-md-3 control-label">{{ $translated_name }}</label>
|
||||
<div class="col-md-7 col-sm-12{{ (Helper::checkIfRequired($item, 'name')) ? ' required' : '' }}">
|
||||
<input class="form-control" type="text" name="name" aria-label="name" id="name" value="{{ old('name', $item->name) }}"{!! (Helper::checkIfRequired($item, 'name')) ? ' data-validation="required" required' : '' !!} />
|
||||
{!! $errors->first('name', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,8 @@
|
||||
<!-- Notes -->
|
||||
<div class="form-group{{ $errors->has('notes') ? ' has-error' : '' }}">
|
||||
<label for="notes" class="col-md-3 control-label">{{ trans('admin/hardware/form.notes') }}</label>
|
||||
<div class="col-md-7 col-sm-12">
|
||||
<textarea class="col-md-6 form-control" id="notes" aria-label="notes" name="notes" style="min-width:100%;">{{ old('notes', $item->notes) }}</textarea>
|
||||
{!! $errors->first('notes', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,8 @@
|
||||
<!-- Order Number -->
|
||||
<div class="form-group {{ $errors->has('order_number') ? ' has-error' : '' }}">
|
||||
<label for="order_number" class="col-md-3 control-label">{{ trans('general.order_number') }}</label>
|
||||
<div class="col-md-7 col-sm-12">
|
||||
<input class="form-control" type="text" name="order_number" aria-label="order_number" id="order_number" value="{{ old('order_number', $item->order_number) }}" />
|
||||
{!! $errors->first('order_number', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,113 @@
|
||||
@foreach ($permissions as $area => $permissionsArray)
|
||||
@if (count($permissionsArray) == 1)
|
||||
<?php $localPermission = $permissionsArray[0]; ?>
|
||||
<tbody class="permissions-group">
|
||||
<tr class="header-row permissions-row">
|
||||
<td class="col-md-5 tooltip-base permissions-item"
|
||||
data-tooltip="true"
|
||||
data-placement="right"
|
||||
title="{{ $localPermission['note'] }}"
|
||||
>
|
||||
@unless (empty($localPermission['label']))
|
||||
<h2>{{ $area . ': ' . $localPermission['label'] }}</h2>
|
||||
@else
|
||||
<h2>{{ $area }}</h2>
|
||||
@endunless
|
||||
</td>
|
||||
|
||||
<td class="col-md-1 permissions-item">
|
||||
<label class="sr-only" for="{{ 'permission['.$localPermission['permission'].']' }}">{{ 'permission['.$localPermission['permission'].']' }}</label>
|
||||
@if (($localPermission['permission'] == 'superuser') && (!Auth::user()->isSuperUser()))
|
||||
{{ Form::radio('permission['.$localPermission['permission'].']', '1',$userPermissions[$localPermission['permission'] ] == '1',['disabled'=>"disabled", 'aria-label'=> 'permission['.$localPermission['permission'].']']) }}
|
||||
@elseif (($localPermission['permission'] == 'admin') && (!Auth::user()->hasAccess('admin')))
|
||||
{{ Form::radio('permission['.$localPermission['permission'].']', '1',$userPermissions[$localPermission['permission'] ] == '1',['disabled'=>"disabled", 'aria-label'=> 'permission['.$localPermission['permission'].']']) }}
|
||||
@else
|
||||
{{ Form::radio('permission['.$localPermission['permission'].']', '1',$userPermissions[$localPermission['permission'] ] == '1',['value'=>"grant", 'aria-label'=> 'permission['.$localPermission['permission'].']']) }}
|
||||
@endif
|
||||
|
||||
|
||||
</td>
|
||||
<td class="col-md-1 permissions-item">
|
||||
<label class="sr-only" for="{{ 'permission['.$localPermission['permission'].']' }}">{{ 'permission['.$localPermission['permission'].']' }}</label>
|
||||
@if (($localPermission['permission'] == 'superuser') && (!Auth::user()->isSuperUser()))
|
||||
{{ Form::radio('permission['.$localPermission['permission'].']', '-1',$userPermissions[$localPermission['permission'] ] == '-1',['disabled'=>"disabled", 'aria-label'=> 'permission['.$localPermission['permission'].']']) }}
|
||||
@elseif (($localPermission['permission'] == 'admin') && (!Auth::user()->hasAccess('admin')))
|
||||
{{ Form::radio('permission['.$localPermission['permission'].']', '-1',$userPermissions[$localPermission['permission'] ] == '-1',['disabled'=>"disabled", 'aria-label'=> 'permission['.$localPermission['permission'].']']) }}
|
||||
@else
|
||||
{{ Form::radio('permission['.$localPermission['permission'].']', '-1',$userPermissions[$localPermission['permission'] ] == '-1',['value'=>"deny", 'aria-label'=> 'permission['.$localPermission['permission'].']']) }}
|
||||
@endif
|
||||
</td>
|
||||
<td class="col-md-1 permissions-item">
|
||||
<label class="sr-only" for="{{ 'permission['.$localPermission['permission'].']' }}">
|
||||
{{ 'permission['.$localPermission['permission'].']' }}</label>
|
||||
@if (($localPermission['permission'] == 'superuser') && (!Auth::user()->isSuperUser()))
|
||||
{{ Form::radio('permission['.$localPermission['permission'].']','0',$userPermissions[$localPermission['permission'] ] == '0',['disabled'=>"disabled", 'aria-label'=> 'permission['.$localPermission['permission'].']'] ) }}
|
||||
@elseif (($localPermission['permission'] == 'admin') && (!Auth::user()->hasAccess('admin')))
|
||||
{{ Form::radio('permission['.$localPermission['permission'].']','0',$userPermissions[$localPermission['permission'] ] == '0',['disabled'=>"disabled", 'aria-label'=> 'permission['.$localPermission['permission'].']'] ) }}
|
||||
@else
|
||||
{{ Form::radio('permission['.$localPermission['permission'].']','0',$userPermissions[$localPermission['permission'] ] == '0',['value'=>"inherit", 'aria-label'=> 'permission['.$localPermission['permission'].']'] ) }}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@else <!-- count($permissionsArray) == 1-->
|
||||
<tbody class="permissions-group">
|
||||
<tr class="header-row permissions-row">
|
||||
<td class="col-md-5 header-name">
|
||||
<h2> {{ $area }}</h2>
|
||||
</td>
|
||||
<td class="col-md-1 permissions-item">
|
||||
<label for="{{ $area }}" class="sr-only">{{ $area }}</label>
|
||||
{{ Form::radio("$area", '1',false,['value'=>"grant", 'data-checker-group' => str_slug($area), 'aria-label' => $area]) }}
|
||||
</td>
|
||||
<td class="col-md-1 permissions-item">
|
||||
<label for="{{ $area }}" class="sr-only">{{ $area }}</label>
|
||||
{{ Form::radio("$area", '-1',false,['value'=>"deny", 'data-checker-group' => str_slug($area), 'aria-label' => $area]) }}
|
||||
</td>
|
||||
<td class="col-md-1 permissions-item">
|
||||
<label for="{{ $area }}" class="sr-only">{{ $area }}</label>
|
||||
{{ Form::radio("$area", '0',false,['value'=>"inherit", 'data-checker-group' => str_slug($area), 'aria-label' => $area] ) }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@foreach ($permissionsArray as $index => $permission)
|
||||
<tr class="permissions-row">
|
||||
@if ($permission['display'])
|
||||
<td
|
||||
class="col-md-5 tooltip-base permissions-item"
|
||||
data-tooltip="true"
|
||||
data-placement="right"
|
||||
title="{{ $permission['note'] }}"
|
||||
>
|
||||
{{ $permission['label'] }}
|
||||
</td>
|
||||
<td class="col-md-1 permissions-item">
|
||||
<label class="sr-only" for="{{ 'permission['.$permission['permission'].']' }}">{{ 'permission['.$permission['permission'].']' }}</label>
|
||||
|
||||
@if (($permission['permission'] == 'superuser') && (!Auth::user()->isSuperUser()))
|
||||
{{ Form::radio('permission['.$permission['permission'].']', '1', $userPermissions[$permission['permission'] ] == '1', ["value"=>"grant", 'disabled'=>'disabled', 'class'=>'radiochecker-'.str_slug($area), 'aria-label'=>'permission['.$permission['permission'].']']) }}
|
||||
@else
|
||||
{{ Form::radio('permission['.$permission['permission'].']', '1', $userPermissions[ $permission['permission'] ] == '1', ["value"=>"grant",'class'=>'radiochecker-'.str_slug($area), 'aria-label' =>'permission['.$permission['permission'].']']) }}
|
||||
@endif
|
||||
</td>
|
||||
<td class="col-md-1 permissions-item">
|
||||
@if (($permission['permission'] == 'superuser') && (!Auth::user()->isSuperUser()))
|
||||
{{ Form::radio('permission['.$permission['permission'].']', '-1', $userPermissions[$permission['permission'] ] == '-1', ["value"=>"deny", 'disabled'=>'disabled', 'class'=>'radiochecker-'.str_slug($area), 'aria-label'=>'permission['.$permission['permission'].']']) }}
|
||||
@else
|
||||
{{ Form::radio('permission['.$permission['permission'].']', '-1', $userPermissions[$permission['permission'] ] == '-1', ["value"=>"deny",'class'=>'radiochecker-'.str_slug($area), 'aria-label'=>'permission['.$permission['permission'].']']) }}
|
||||
@endif
|
||||
</td>
|
||||
<td class="col-md-1 permissions-item">
|
||||
@if (($permission['permission'] == 'superuser') && (!Auth::user()->isSuperUser()))
|
||||
{{ Form::radio('permission['.$permission['permission'].']', '0', $userPermissions[$permission['permission']] =='0', ["value"=>"inherit", 'disabled'=>'disabled', 'class'=>'radiochecker-'.str_slug($area), 'aria-label'=>'permission['.$permission['permission'].']']) }}
|
||||
@else
|
||||
{{ Form::radio('permission['.$permission['permission'].']', '0', $userPermissions[$permission['permission']] =='0', ["value"=>"inherit", 'class'=>'radiochecker-'.str_slug($area), 'aria-label'=>'permission['.$permission['permission'].']']) }}
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
@endif
|
||||
@endforeach
|
@ -0,0 +1,7 @@
|
||||
<div class="form-group {{ $errors->has('phone') ? ' has-error' : '' }}">
|
||||
{{ Form::label('phone', trans('admin/suppliers/table.phone'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-7">
|
||||
{{Form::text('phone', old('phone', $item->phone), array('class' => 'form-control', 'aria-label'=>'phone')) }}
|
||||
{!! $errors->first('phone', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,20 @@
|
||||
<!-- Purchase Cost -->
|
||||
<div class="form-group {{ $errors->has('purchase_cost') ? ' has-error' : '' }}">
|
||||
<label for="purchase_cost" class="col-md-3 control-label">{{ trans('general.purchase_cost') }}</label>
|
||||
<div class="col-md-9">
|
||||
<div class="input-group col-md-4" style="padding-left: 0px;">
|
||||
<input class="form-control" type="text" name="purchase_cost" aria-label="purchase_cost" id="purchase_cost" value="{{ old('purchase_cost', Helper::formatCurrencyOutput($item->purchase_cost)) }}" />
|
||||
<span class="input-group-addon">
|
||||
@if (isset($currency_type))
|
||||
{{ $currency_type }}
|
||||
@else
|
||||
{{ $snipeSettings->default_currency }}
|
||||
@endif
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-md-9" style="padding-left: 0px;">
|
||||
{!! $errors->first('purchase_cost', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
@ -0,0 +1,11 @@
|
||||
<!-- Purchase Date -->
|
||||
<div class="form-group {{ $errors->has('purchase_date') ? ' has-error' : '' }}">
|
||||
<label for="purchase_date" class="col-md-3 control-label">{{ trans('general.purchase_date') }}</label>
|
||||
<div class="input-group col-md-4">
|
||||
<div class="input-group date" data-provide="datepicker" data-date-clear-btn="true" data-date-format="yyyy-mm-dd" data-autoclose="true">
|
||||
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="purchase_date" id="purchase_date" readonly value="{{ old('purchase_date', ($item->purchase_date) ? $item->purchase_date->format('Y-m-d') : '') }}" style="background-color:inherit">
|
||||
<span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
{!! $errors->first('purchase_date', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,11 @@
|
||||
|
||||
<!-- QTY -->
|
||||
<div class="form-group {{ $errors->has('qty') ? ' has-error' : '' }}">
|
||||
<label for="qty" class="col-md-3 control-label">{{ trans('general.quantity') }}</label>
|
||||
<div class="col-md-7{{ (Helper::checkIfRequired($item, 'qty')) ? ' required' : '' }}">
|
||||
<div class="col-md-3" style="padding-left:0px">
|
||||
<input class="form-control" type="text" name="qty" aria-label="qty" id="qty" value="{{ old('qty', $item->qty) }}" {!! (Helper::checkIfRequired($item, 'qty')) ? ' data-validation="required" required' : '' !!}/>
|
||||
</div>
|
||||
{!! $errors->first('qty', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,9 @@
|
||||
<!-- Requestable -->
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-3 col-md-9">
|
||||
<label class="form-control" for="requestable">
|
||||
<input type="checkbox" value="1" name="requestable" id="requestable" {{ old('requestable', $item->requestable) == '1' ? ' checked="checked"' : '' }}> {{ $requestable_text }}
|
||||
</label>
|
||||
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,8 @@
|
||||
<!-- Serial -->
|
||||
<div class="form-group {{ $errors->has('serial') ? ' has-error' : '' }}">
|
||||
<label for="{{ $fieldname }}" class="col-md-3 control-label">{{ trans('admin/hardware/form.serial') }} </label>
|
||||
<div class="col-md-7 col-sm-12{{ (Helper::checkIfRequired($item, 'serial')) ? ' required' : '' }}">
|
||||
<input class="form-control" type="text" name="{{ $fieldname }}" id="{{ $fieldname }}" value="{{ old((isset($old_val_name) ? $old_val_name : $fieldname), $item->serial) }}" />
|
||||
{!! $errors->first('serial', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,29 @@
|
||||
<!-- Asset Model -->
|
||||
<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-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'" : '' }}>
|
||||
@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 : '' }}
|
||||
</option>
|
||||
@else
|
||||
<option value="" role="option">{{ trans('general.select_status') }}</option>
|
||||
@endif
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 col-sm-1 text-left">
|
||||
@can('create', \App\Models\Statuslabel::class)
|
||||
@if ((!isset($hide_new)) || ($hide_new!='true'))
|
||||
<a href='{{ route('modal.show', 'statuslabel') }}' data-toggle="modal" data-target="#createModal" data-select='status_select_id' class="btn btn-sm btn-primary">{{ trans('button.new') }}</a>
|
||||
@endif
|
||||
@endcan
|
||||
</div>
|
||||
|
||||
|
||||
{!! $errors->first($fieldname, '<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>
|
@ -0,0 +1,22 @@
|
||||
<!-- Status -->
|
||||
<div class="form-group {{ $errors->has('status_id') ? ' has-error' : '' }}">
|
||||
<label for="status_id" class="col-md-3 control-label">{{ trans('admin/hardware/form.status') }}</label>
|
||||
<div class="col-md-7 col-sm-11{{ (Helper::checkIfRequired($item, 'status_id')) ? ' required' : '' }}">
|
||||
{{ Form::select('status_id', $statuslabel_list , old('status_id', $item->status_id), array('class'=>'select2 status_id', 'style'=>'width:100%','id'=>'status_select_id', 'aria-label'=>'status_id', 'data-validation' => "required")) }}
|
||||
{!! $errors->first('status_id', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
<div class="col-md-2 col-sm-2 text-left">
|
||||
|
||||
@can('create', \App\Models\Statuslabel::class)
|
||||
<a href='{{ route('modal.show', 'statuslabel') }}' data-toggle="modal" data-target="#createModal" data-select='status_select_id' class="btn btn-sm btn-primary">{{ trans('button.new') }}</a>
|
||||
@endcan
|
||||
|
||||
<span class="status_spinner" style="padding-left: 10px; color: green; display:none; width: 30px;"><i class="fas fa-spinner fa-spin" aria-hidden="true"></i> </span>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-7 col-sm-11 col-md-offset-3" id="status_helptext">
|
||||
<p id="selected_status_status" style="display:none;"></p>
|
||||
</div>
|
||||
|
||||
</div>
|
@ -0,0 +1,5 @@
|
||||
<button type="submit" class="btn btn-primary pull-right">
|
||||
<i class="fas fa-check icon-white"></i>
|
||||
{{ trans('general.save') }}
|
||||
</button>
|
||||
|
@ -0,0 +1,7 @@
|
||||
<!-- partials/forms/edit/submit.blade.php -->
|
||||
|
||||
<div class="box-footer text-right" style="padding-bottom: 0px;">
|
||||
<a class="btn btn-link pull-left" href="{{ URL::previous() }}">{{ trans('button.cancel') }}</a>
|
||||
<button type="submit" accesskey="s" class="btn btn-primary"><i class="fas fa-check icon-white" aria-hidden="true"></i> {{ trans('general.save') }}</button>
|
||||
</div>
|
||||
<!-- / partials/forms/edit/submit.blade.php -->
|
@ -0,0 +1,27 @@
|
||||
<div id="assigned_user" class="form-group{{ $errors->has($fieldname) ? ' has-error' : '' }}">
|
||||
|
||||
{{ 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="suppliers" data-placeholder="{{ trans('general.select_supplier') }}" name="{{ $fieldname }}" style="width: 100%" id="supplier_select" aria-label="{{ $fieldname }}"{{ (isset($multiple) && ($multiple=='true')) ? " multiple='multiple'" : '' }}>
|
||||
@if ($supplier_id = old($fieldname, (isset($item)) ? $item->{$fieldname} : ''))
|
||||
<option value="{{ $supplier_id }}" selected="selected" role="option" aria-selected="true" role="option">
|
||||
{{ (\App\Models\Supplier::find($supplier_id)) ? \App\Models\Supplier::find($supplier_id)->name : '' }}
|
||||
</option>
|
||||
@else
|
||||
<option value="" role="option">{{ trans('general.select_supplier') }}</option>
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 col-sm-1 text-left">
|
||||
@can('create', \App\Models\Supplier::class)
|
||||
@if ((!isset($hide_new)) || ($hide_new!='true'))
|
||||
<a href='{{ route('modal.show', 'supplier') }}' data-toggle="modal" data-target="#createModal" data-select='supplier_select' class="btn btn-sm btn-primary">{{ trans('button.new') }}</a>
|
||||
@endif
|
||||
@endcan
|
||||
</div>
|
||||
|
||||
{!! $errors->first($fieldname, '<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>
|
@ -0,0 +1,11 @@
|
||||
<!-- Supplier -->
|
||||
<div class="form-group {{ $errors->has('supplier_id') ? ' has-error' : '' }}">
|
||||
<label for="supplier_id" class="col-md-3 control-label">{{ trans('general.supplier') }}</label>
|
||||
<div class="col-md-7{{ (Helper::checkIfRequired($item, 'supplier_id')) ? ' required' : '' }}">
|
||||
{{ Form::select('supplier_id', $supplier_list , old('supplier_id', $item->supplier_id), ['class'=>'select2', 'style'=>'min-width:350px', 'id' => 'supplier_select_id']) }}
|
||||
{!! $errors->first('supplier_id', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
<div class="col-md-1 col-sm-1 text-left">
|
||||
<a href='{{ route('modal.show', 'supplier') }}' data-toggle="modal" data-target="#createModal" data-dependency="supplier" data-select='supplier_select_id' class="btn btn-sm btn-primary">{{ trans('button.new') }}</a>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,66 @@
|
||||
<!-- {{ $logoVariable }}logo image upload -->
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">
|
||||
<label {!! $errors->has($logoVariable) ? 'class="alert-msg"' : '' !!} for="{{ $logoVariable }}">
|
||||
{{ ucwords(str_replace('_', ' ', $logoVariable)) }}
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<label class="btn btn-default{{ (config('app.lock_passwords')) ? ' disabled' : '' }}">
|
||||
{{ trans('button.select_file') }}
|
||||
<input type="file" name="{{ $logoVariable }}" class="js-uploadFile" id="{{ $logoId }}" accept="{{ (isset($allowedTypes) ? $allowedTypes : "image/gif,image/jpeg,image/webp,image/png,image/svg,image/svg+xml") }}" data-maxsize="{{ $maxSize ?? Helper::file_upload_max_size() }}"
|
||||
style="display:none; max-width: 90%"{{ (config('app.lock_passwords')) ? ' disabled' : '' }}>
|
||||
</label>
|
||||
|
||||
<span class='label label-default' id="{{ $logoId }}-info"></span>
|
||||
|
||||
{!! $errors->first($logoVariable, '<span class="alert-msg">:message</span>') !!}
|
||||
|
||||
|
||||
<p class="help-block" style="!important" id="{{ $logoId }}-status">
|
||||
{{ $helpBlock }}
|
||||
</p>
|
||||
|
||||
@if (config('app.lock_passwords')===true)
|
||||
<p class="text-warning"><i class="fas fa-lock"></i> {{ trans('general.feature_disabled') }}</p>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
|
||||
@if (($setting->$logoVariable!='') && (Storage::disk('public')->exists(e($snipeSettings->$logoVariable))))
|
||||
<div class="pull-left" style="padding-right: 20px;">
|
||||
<a href="{{ Storage::disk('public')->url(e($snipeSettings->$logoVariable)) }}"{!! ($logoVariable!='favicon') ? ' data-toggle="lightbox"' : '' !!}>
|
||||
<img id="{{ $logoId }}-imagePreview" style="height: 80px; padding-bottom: 5px;" alt="" src="{{ Storage::disk('public')->url(e($snipeSettings->$logoVariable)) }}">
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div id="{{ $logoId }}-previewContainer" style="display: none;">
|
||||
<img id="{{ $logoId }}-imagePreview" style="height: 80px;">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
@if (($setting->$logoVariable!='') && (Storage::disk('public')->exists(e($snipeSettings->$logoVariable))))
|
||||
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
<label id="{{ $logoId }}-deleteCheckbox" for="{{ $logoClearVariable }}" style="font-weight: normal" class="form-control">
|
||||
{{ Form::checkbox($logoClearVariable, '1', Request::old($logoClearVariable)) }}
|
||||
Remove current {{ ucwords(str_replace('_', ' ', $logoVariable)) }} image
|
||||
</label>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,27 @@
|
||||
<div id="assigned_user" class="form-group{{ $errors->has($fieldname) ? ' has-error' : '' }}"{!! (isset($style)) ? ' style="'.e($style).'"' : '' !!}>
|
||||
|
||||
{{ 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="users" data-placeholder="{{ trans('general.select_user') }}" name="{{ $fieldname }}" style="width: 100%" id="assigned_user_select" aria-label="{{ $fieldname }}">
|
||||
@if ($user_id = old($fieldname, (isset($item)) ? $item->{$fieldname} : ''))
|
||||
<option value="{{ $user_id }}" selected="selected" role="option" aria-selected="true" role="option">
|
||||
{{ (\App\Models\User::find($user_id)) ? \App\Models\User::find($user_id)->present()->fullName : '' }}
|
||||
</option>
|
||||
@else
|
||||
<option value="" role="option">{{ trans('general.select_user') }}</option>
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 col-sm-1 text-left">
|
||||
@can('create', \App\Models\User::class)
|
||||
@if ((!isset($hide_new)) || ($hide_new!='true'))
|
||||
<a href='{{ route('modal.show', 'user') }}' data-toggle="modal" data-target="#createModal" data-select='assigned_user_select' class="btn btn-sm btn-primary">{{ trans('button.new') }}</a>
|
||||
@endif
|
||||
@endcan
|
||||
</div>
|
||||
|
||||
{!! $errors->first($fieldname, '<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>
|
@ -0,0 +1,13 @@
|
||||
<!-- Warranty -->
|
||||
<div class="form-group {{ $errors->has('warranty_months') ? ' has-error' : '' }}">
|
||||
<label for="warranty_months" class="col-md-3 control-label">{{ trans('admin/hardware/form.warranty') }}</label>
|
||||
<div class="col-md-9">
|
||||
<div class="input-group col-md-3" style="padding-left: 0px;">
|
||||
<input class="form-control" type="text" name="warranty_months" id="warranty_months" value="{{ Request::old('warranty_months', $item->warranty_months) }}" maxlength="3" />
|
||||
<span class="input-group-addon">{{ trans('admin/hardware/form.months') }}</span>
|
||||
</div>
|
||||
<div class="col-md-9" style="padding-left: 0px;">
|
||||
{!! $errors->first('warranty_months', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,383 @@
|
||||
@once
|
||||
@push('css')
|
||||
<style>
|
||||
:root {
|
||||
--l2fd-background-color: rgb(246, 250, 255);
|
||||
--l2fd-border-color: #d2d6de;
|
||||
--l2fd-font-color: #555555;
|
||||
|
||||
--list-padding: 2px;
|
||||
|
||||
--listitem-font-color: #555555;
|
||||
--listitem-padding: 8px;
|
||||
--listitem-spacing: 2px;
|
||||
--listitem-background-color: white;
|
||||
--listitem-border-color: #ccc;
|
||||
--listitem-border-radius: 2px;
|
||||
|
||||
--listitem-hover-font-color: var(--listitem-font-color);
|
||||
--listitem-hover-background-color: var(--listitem-background-color);
|
||||
--listitem-hover-border-color: rgb(102, 175, 233);
|
||||
|
||||
--listitem-selected-font-color: var(--listitem-font-color);
|
||||
--listitem-selected-background-color: rgb(236, 240, 245);
|
||||
--listitem-selected-border-color: var(--listitem-hover-border-color);
|
||||
|
||||
--buttonbar-button-font-color: #555555;
|
||||
--buttonbar-button-background-color: white;
|
||||
--buttonbar-button-border-color: #ccc;
|
||||
--buttonbar-button-border-radius: 2px;
|
||||
|
||||
--buttonbar-button-hover-font-color: var(--buttonbar-button-font-color);
|
||||
--buttonbar-button-hover-background-color: var(--buttonbar-button-background-color);
|
||||
--buttonbar-button-hover-border-color: var(--listitem-hover-border-color);
|
||||
|
||||
--buttonbar-button-disabled-font-color: var(--buttonbar-button-font-color);
|
||||
--buttonbar-button-disabled-background-color: #eee;
|
||||
--buttonbar-button-disabled-border-color: var(--buttonbar-button-border-color);
|
||||
}
|
||||
|
||||
.l2fd-root,
|
||||
.l2fd-root * {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.l2fd-root {
|
||||
height: 400px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.l2fd-title {
|
||||
font-size: 1.4em;
|
||||
padding: 6px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.l2fd-list {
|
||||
overflow-y: scroll;
|
||||
padding: var(--list-padding);
|
||||
}
|
||||
|
||||
.l2fd-main {
|
||||
flex: 1;
|
||||
display: grid;
|
||||
grid-template-areas:
|
||||
'fields-title options-title'
|
||||
'fields-list options-list'
|
||||
'fields-buttons options-buttons';
|
||||
grid-template-columns: 50% 50%;
|
||||
grid-template-rows: max-content auto max-content;
|
||||
|
||||
background-color: var(--l2fd-background-color);
|
||||
border: 1px solid var(--l2fd-border-color);
|
||||
color: var(--l2fd-font-color);
|
||||
}
|
||||
|
||||
.l2fd-listitem {
|
||||
color: var(--listitem-font-color);
|
||||
cursor: pointer;
|
||||
padding: var(--listitem-padding);
|
||||
margin-bottom: var(--listitem-spacing);
|
||||
background-color: var(--listitem-background-color);
|
||||
border: 1px solid var(--listitem-border-color);
|
||||
border-radius: var(--listitem-border-radius);
|
||||
}
|
||||
.l2fd-listitem:hover {
|
||||
color: var(--listitem-hover-font-color);
|
||||
background-color: var(--listitem-hover-background-color);
|
||||
border: 1px solid var(--listitem-hover-border-color);
|
||||
}
|
||||
.l2fd-listitem.selected {
|
||||
color: var(--listitem-selected-font-color);
|
||||
background-color: var(--listitem-selected-background-color);
|
||||
border: 1px solid var(--listitem-selected-border-color);
|
||||
}
|
||||
|
||||
.l2fd-itemgrid {
|
||||
display: grid;
|
||||
grid-template-areas:
|
||||
'label-title source-title'
|
||||
'label-field source-field';
|
||||
grid-template-columns: 50% 50%;
|
||||
grid-template-rows: auto auto;
|
||||
}
|
||||
|
||||
.l2fd-listitem label {
|
||||
cursor: pointer;
|
||||
font-size: 0.9em;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.l2fd-buttonbar {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
height: 35px;
|
||||
}
|
||||
.l2fd-buttonbar > button {
|
||||
flex: 1 1 100%;
|
||||
background-color: var(--buttonbar-button-background-color);
|
||||
border: 1px solid var(--buttonbar-button-border-color);
|
||||
border-radius: var(--buttonbar-button-border-radius);
|
||||
color: var(--buttonbar-button-font-color);
|
||||
}
|
||||
.l2fd-buttonbar > button:hover {
|
||||
background-color: var(--buttonbar-button-hover-background-color);
|
||||
border: 1px solid var(--buttonbar-button-hover-border-color);
|
||||
color: var(--buttonbar-button-hover-font-color);
|
||||
}
|
||||
.l2fd-buttonbar > button.disabled {
|
||||
background-color: var(--buttonbar-button-disabled-background-color);
|
||||
border: 1px solid var(--buttonbar-button-disabled-border-color);
|
||||
color: var(--buttonbar-button-disabled-font-color);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
</style>
|
||||
@endpush
|
||||
@endonce
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
document.addEventListener('alpine:init', () => {
|
||||
|
||||
Alpine.data('{{ $name }}', () => ({
|
||||
|
||||
_name: '{{ $name }}',
|
||||
_defaultValue: '{{ $value }}',
|
||||
_init: function() {
|
||||
this.fields = this.fromString(this._defaultValue);
|
||||
this.$watch('valueString', () => {
|
||||
this.$refs.input.form.dispatchEvent(new Event('change'));
|
||||
});
|
||||
},
|
||||
|
||||
/* Fields */
|
||||
fields: [],
|
||||
get _templateField() { return ({ options: [ this._templateOption ] }); },
|
||||
_selectedField: null,
|
||||
get selectedField() { return this._selectedField; },
|
||||
set selectedField(field) {
|
||||
this._selectedField = field;
|
||||
this.selectedOption = null;
|
||||
},
|
||||
get selectedFieldIndex() {
|
||||
return this.selectedField ? this.fields.indexOf(this.selectedField) : -1;
|
||||
},
|
||||
shiftSelectedField: function(offset) {
|
||||
this.shiftArrayValue(this.fields, this.selectedField, offset);
|
||||
},
|
||||
trashSelectedField: function() {
|
||||
this.fields.splice(this.fields.indexOf(this.selectedField), 1);
|
||||
this.selectedField = null;
|
||||
},
|
||||
addField: function() {
|
||||
let newField = JSON.parse(JSON.stringify(this._templateField));
|
||||
this.fields.push(newField);
|
||||
this.selectedField = newField;
|
||||
},
|
||||
|
||||
/* Options */
|
||||
get _templateOption() { return ({ label: '', datasource: '' }); },
|
||||
selectedOption: null,
|
||||
get selectedOptionIndex() {
|
||||
return this.selectedOption ? this.selectedField.options.indexOf(this.selectedOption) : -1;
|
||||
},
|
||||
shiftSelectedOption: function(offset) {
|
||||
this.shiftArrayValue(this.selectedField.options, this.selectedOption, offset);
|
||||
},
|
||||
trashSelectedOption: function() {
|
||||
this.selectedField.options.splice(this.selectedField.options.indexOf(this.selectedOption), 1);
|
||||
this.selectedOption = null;
|
||||
},
|
||||
addOption: function() {
|
||||
let newOption = JSON.parse(JSON.stringify(this._templateOption));
|
||||
this.selectedField.options.push(newOption);
|
||||
this.selectedOption = newOption;
|
||||
},
|
||||
|
||||
|
||||
/* Helpers */
|
||||
|
||||
shiftArrayValue: function(array, value, offset) {
|
||||
let oldIndex = array.indexOf(value);
|
||||
let newIndex = oldIndex + offset;
|
||||
newIndex = Math.max(newIndex, 0);
|
||||
newIndex = Math.min(newIndex, array.length);
|
||||
|
||||
array.splice(newIndex, 0, array.splice(oldIndex, 1)[0]);
|
||||
},
|
||||
|
||||
get valueString() { return this.toString(this.fields); },
|
||||
onTest: function(a) {
|
||||
console.log('test', a);
|
||||
},
|
||||
|
||||
getFieldLabel: function(field) {
|
||||
return field.options.map(option => option.label).join(' | ');
|
||||
},
|
||||
fromString: function(string) {
|
||||
return string
|
||||
.split(';').filter(fieldString => fieldString !== '')
|
||||
.map(fieldString => ({
|
||||
options: fieldString
|
||||
.split('|').filter(optionString => optionString !== '')
|
||||
.map(optionString => {
|
||||
let [l,d] = optionString.split('=');
|
||||
return { label: l, datasource: d };
|
||||
})
|
||||
}));
|
||||
},
|
||||
toString: function(fields) {
|
||||
return fields
|
||||
.map(field => field.options
|
||||
.map(option => option.label + '=' + option.datasource)
|
||||
.join('|')
|
||||
)
|
||||
.join(';');
|
||||
},
|
||||
|
||||
}));
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@php
|
||||
$selector = '[x-data="'.$name.'"]';
|
||||
@endphp
|
||||
@push('css')
|
||||
<style>
|
||||
|
||||
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
<div x-data="{{ $name }}" x-init="_init" class="l2fd-root">
|
||||
<input type="hidden" name="{{ $name }}" x-model="valueString" x-ref="input" />
|
||||
<div class="l2fd-main">
|
||||
<h1 class="l2fd-title" style="grid-area: fields-title">Fields</h1>
|
||||
<div class="l2fd-list" style="grid-area: fields-list">
|
||||
<template x-for="(field, index) in fields">
|
||||
<div
|
||||
x-bind:key="'field-' + index"
|
||||
x-bind:class="{
|
||||
'l2fd-listitem': true,
|
||||
'selected': selectedField === field
|
||||
}"
|
||||
x-on:click="selectedField = field" >
|
||||
<label><span x-text="index+1"></span>: <span x-text="getFieldLabel(field)"></span></label>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div class="l2fd-buttonbar" style="grid-area: fields-buttons">
|
||||
<button
|
||||
x-on:click.prevent="if(!$event.target.classList.contains('disabled')) shiftSelectedField(-1)"
|
||||
x-bind:class="{ 'disabled': !selectedField || selectedFieldIndex == 0 }"
|
||||
><i class="fa-solid fa-caret-up"></i></button>
|
||||
<button
|
||||
x-on:click.prevent="if(!$event.target.classList.contains('disabled')) shiftSelectedField(+1)"
|
||||
x-bind:class="{ 'disabled': !selectedField || selectedFieldIndex == fields.length - 1 }"
|
||||
><i class="fa-solid fa-caret-down"></i></button>
|
||||
<button
|
||||
x-on:click.prevent="if(!$event.target.classList.contains('disabled')) addField()"
|
||||
x-bind:class="{}"
|
||||
><i class="fa-solid fa-plus"></i></button>
|
||||
<button
|
||||
x-on:click.prevent="if(!$event.target.classList.contains('disabled')) trashSelectedField()"
|
||||
x-bind:class="{ 'disabled': !selectedField }"
|
||||
><i class="fa-solid fa-trash"></i></button>
|
||||
</div>
|
||||
|
||||
<h1 class="l2fd-title" style="grid-area: options-title">Options</h1>
|
||||
<div class="l2fd-list" style="grid-area: options-list">
|
||||
<template x-if="selectedField">
|
||||
<template x-for="(option, index) in selectedField.options">
|
||||
<div
|
||||
x-bind:key="'option-' + index"
|
||||
x-bind:class="{
|
||||
'l2fd-listitem': true,
|
||||
'l2fd-itemgrid': true,
|
||||
'selected': selectedOption == option
|
||||
}"
|
||||
x-on:click="selectedOption = option" >
|
||||
<label style="grid-area: label-title">Label</label>
|
||||
<input style="grid-area: label-field" x-model="option.label" />
|
||||
<label style="grid-area: source-title">DataSource</label>
|
||||
<select style="grid-area: source-field" x-model="option.datasource">
|
||||
<optgroup label="Asset">
|
||||
<option value="asset_tag">{{trans('admin/hardware/table.asset_tag')}}</option>
|
||||
<option value="name">{{trans('admin/hardware/form.name')}}</option>
|
||||
<option value="serial">{{trans('admin/hardware/table.serial')}}</option>
|
||||
<option value="asset_eol_date">{{trans('admin/hardware/form.eol_date')}}</option>
|
||||
<option value="order_number">{{trans('admin/hardware/form.order')}}</option>
|
||||
<option value="purchase_date">{{trans('admin/hardware/table.purchase_date')}}</option>
|
||||
<option value="assignedTo">{{trans('admin/hardware/table.assigned_to')}}</option>
|
||||
<option value="last_audit_date">{{trans('general.last_audit')}}</option>
|
||||
<option value="next_audit_date">{{trans('general.next_audit_date')}}</option>
|
||||
</optgroup>
|
||||
<optgroup label="Asset Model">
|
||||
<option value="model.name">{{trans('admin/models/table.name')}}</option>
|
||||
<option value="model.model_number">{{trans('admin/models/table.modelnumber')}}</option>
|
||||
</optgroup>
|
||||
<optgroup label="Manufacturer">
|
||||
<option value="model.manufacturer.name">{{trans('admin/hardware/form.manufacturer')}}</option>
|
||||
<option value="model.manufacturer.support_email">{{trans('admin/manufacturers/table.support_email')}}</option>
|
||||
<option value="model.manufacturer.support_phone">{{trans('admin/manufacturers/table.support_phone')}}</option>
|
||||
<option value="model.manufacturer.support_url">{{trans('general.url')}}</option>
|
||||
</optgroup>
|
||||
<optgroup label="Category">
|
||||
<option value="model.category.name">{{trans('admin/categories/general.category_name')}}</option>
|
||||
</optgroup>
|
||||
<optgroup label="Status">
|
||||
<option value="assetstatus.name">{{trans('admin/statuslabels/table.name')}}</option>
|
||||
</optgroup>
|
||||
<optgroup label="Supplier">
|
||||
<option value="supplier.name">{{trans('admin/suppliers/table.name')}}</option>
|
||||
</optgroup>
|
||||
<optgroup label="Default Location">
|
||||
<option value="defaultLoc.name">{{trans('admin/hardware/form.default_location')}}</option>
|
||||
<option value="defaultLoc.phone">{{trans('admin/hardware/form.default_location_phone')}}</option>
|
||||
</optgroup>
|
||||
<optgroup label="Location">
|
||||
<option value="location.name">{{trans('admin/locations/table.name')}}</option>
|
||||
<option value="location.phone">{{trans('admin/locations/table.phone')}}</option>
|
||||
</optgroup>
|
||||
<optgroup label="Company">
|
||||
<option value="company.email">{{trans('admin/companies/table.email')}}</option>
|
||||
<option value="company.name">{{trans('admin/companies/table.name')}}</option>
|
||||
<option value="company.phone">{{trans('admin/companies/table.phone')}}</option>
|
||||
</optgroup>
|
||||
<optgroup label="Custom Fields">
|
||||
@foreach($customFields as $customField)
|
||||
<option value="{{ $customField->db_column }}">{{ $customField->name }}</option>
|
||||
@endforeach
|
||||
</optgroup>
|
||||
</select>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
<template x-if="!selectedField">
|
||||
<div>Please select a field</div>
|
||||
</template>
|
||||
</div>
|
||||
<div class="l2fd-buttonbar" style="grid-area: options-buttons">
|
||||
<button
|
||||
x-on:click.prevent="if(!$event.target.classList.contains('disabled')) shiftSelectedOption(-1)"
|
||||
x-bind:class="{ 'disabled': !selectedField || !selectedOption || selectedOptionIndex == 0 }"
|
||||
><i class="fa-solid fa-caret-up"></i></button>
|
||||
<button
|
||||
x-on:click.prevent="if(!$event.target.classList.contains('disabled')) shiftSelectedOption(+1)"
|
||||
x-bind:class="{ 'disabled': !selectedField || !selectedOption || selectedOptionIndex == selectedField.options.length - 1 }"
|
||||
><i class="fa-solid fa-caret-down"></i></button>
|
||||
<button
|
||||
x-on:click.prevent="if(!$event.target.classList.contains('disabled')) addOption()"
|
||||
x-bind:class="{ 'disabled': !selectedField }"
|
||||
><i class="fa-solid fa-plus"></i></button>
|
||||
<button
|
||||
x-on:click.prevent="if(!$event.target.classList.contains('disabled')) trashSelectedOption()"
|
||||
x-bind:class="{ 'disabled': !selectedField || !selectedOption }"
|
||||
><i class="fa-solid fa-trash"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,98 @@
|
||||
@once
|
||||
@push('css')
|
||||
<style>
|
||||
:root {
|
||||
--l2p-height: 400px;
|
||||
--l2p-background-color: aliceblue;
|
||||
}
|
||||
|
||||
.l2p-root,
|
||||
.l2p-root * {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.l2p-root {
|
||||
width: 100%;
|
||||
height: var(--l2p-height);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.l2p-root > .l2p-top {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: end;
|
||||
}
|
||||
|
||||
.l2p-root > .l2p-top > label {
|
||||
flex: 1;
|
||||
font-size: 0.9em;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.l2p-root > .l2p-top > .l2p-pop-button {
|
||||
padding: 3px 6px;
|
||||
}
|
||||
|
||||
.l2p-root > iframe {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
background-color: var(--l2p-background-color);
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
@endonce
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
document.addEventListener('alpine:init', () => {
|
||||
|
||||
Alpine.data('label2_preview', () => ({
|
||||
|
||||
_form: null,
|
||||
_init: function() {
|
||||
this._form = this.$root.closest('form');
|
||||
this._form.addEventListener('change', this.updateURL.bind(this));
|
||||
},
|
||||
|
||||
updateURL: function() {
|
||||
|
||||
let params = {
|
||||
settings: Object.assign({}, ...$(this._form)
|
||||
.serializeArray()
|
||||
.filter((value, index, all) => value.name.includes('label2_'))
|
||||
.map((value, index, all) => ({[value.name]: value.value}))
|
||||
)
|
||||
};
|
||||
|
||||
let template = params.settings.label2_template;
|
||||
if (!template) return;
|
||||
|
||||
this.previewURL = '{{ route("labels.show", ["labelName" => ":label"]) }}'
|
||||
.replace(':label', template.replaceAll('\\', '/'))
|
||||
.concat('?', $.param(params), '#toolbar=0');
|
||||
},
|
||||
|
||||
_previewURL: '',
|
||||
get previewURL() { return this._previewURL; },
|
||||
set previewURL(url) {
|
||||
this._previewURL = url;
|
||||
if (this._popped) this._popped.location = this.previewURL;
|
||||
},
|
||||
|
||||
_popped: null,
|
||||
popout: function() { this._popped = window.open(this.previewURL); }
|
||||
}));
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
<div x-data="label2_preview" x-init="_init" class="l2p-root">
|
||||
<div class="l2p-top">
|
||||
<label for="label2-preview">Preview</label>
|
||||
<button class="l2p-pop-button btn btn-default" x-on:click.prevent="popout" title="Pop Out"><i class="fa-solid fa-maximize"></i></button>
|
||||
</div>
|
||||
<iframe id="label2-preview" x-bind:src="previewURL"></iframe>
|
||||
</div>
|
@ -0,0 +1,20 @@
|
||||
@can('delete', \App\Models\Location::class)
|
||||
<div id="locationsBulkEditToolbar">
|
||||
{{ Form::open([
|
||||
'method' => 'POST',
|
||||
'route' => ['locations.bulkdelete.show'],
|
||||
'class' => 'form-inline',
|
||||
'id' => 'locationsBulkForm']) }}
|
||||
|
||||
<div id="locations-toolbar">
|
||||
<label for="bulk_actions" class="sr-only">{{ trans('general.bulk_actions') }}</label>
|
||||
<select name="bulk_actions" class="form-control select2" style="width: 200px;" aria-label="bulk_actions">
|
||||
<option value="delete">{{ trans('general.bulk_delete') }}</option>
|
||||
</select>
|
||||
<button class="btn btn-primary" id="bulkLocationsEditButton" disabled>{{ trans('button.go') }}</button>
|
||||
</div>
|
||||
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
@endcan
|
||||
|
@ -0,0 +1,23 @@
|
||||
<div id="modelsBulkEditToolbar">
|
||||
{{ Form::open([
|
||||
'method' => 'POST',
|
||||
'route' => ['models.bulkedit.index'],
|
||||
'class' => 'form-inline',
|
||||
'id' => 'modelsBulkForm']) }}
|
||||
|
||||
@if (request('status')!='deleted')
|
||||
@can('delete', \App\Models\AssetModel::class)
|
||||
<div id="models-toolbar">
|
||||
<label for="bulk_actions" class="sr-only">{{ trans('general.bulk_actions') }}</label>
|
||||
<select name="bulk_actions" class="form-control select2" style="width: 200px;" aria-label="bulk_actions">
|
||||
<option value="edit">{{ trans('general.bulk_edit') }}</option>
|
||||
<option value="delete">{{ trans('general.bulk_delete') }}</option>
|
||||
</select>
|
||||
<button class="btn btn-primary" id="bulkModelsEditButton" disabled>{{ trans('button.go') }}</button>
|
||||
</div>
|
||||
@endcan
|
||||
@endif
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
|
||||
|
@ -0,0 +1,3 @@
|
||||
<a style="padding-left: 10px; font-size: 18px;" class="text-dark-gray" data-trigger="focus" tabindex="0" role="button" data-toggle="popover" title="More Info" data-placement="right" data-html="true" data-content="{{ (isset($helpText)) ? $helpText : 'Help Info Missing' }}">
|
||||
<i class="far fa-life-ring" aria-hidden="true"><span class="sr-only">{{ trans('general.moreinfo') }}</span></i>
|
||||
</a>
|
@ -0,0 +1,23 @@
|
||||
<div id="userBulkEditToolbar">
|
||||
{{ Form::open([
|
||||
'method' => 'POST',
|
||||
'route' => ['users/bulkedit'],
|
||||
'class' => 'form-inline',
|
||||
'id' => 'usersBulkForm']) }}
|
||||
|
||||
@if (request('status')!='deleted')
|
||||
@can('delete', \App\Models\User::class)
|
||||
<div id="users-toolbar">
|
||||
<label for="bulk_actions" class="sr-only">{{ trans('general.bulk_actions') }}</label>
|
||||
<select name="bulk_actions" class="form-control select2" style="min-width:300px;" aria-label="bulk_actions">
|
||||
<option value="edit">{{ trans('general.bulk_edit') }}</option>
|
||||
<option value="delete">{!! trans('general.bulk_checkin_delete') !!}</option>
|
||||
<option value="merge">{!! trans('general.merge_users') !!}</option>
|
||||
<option value="bulkpasswordreset">{{ trans('button.send_password_link') }}</option>
|
||||
</select>
|
||||
<button class="btn btn-primary" id="bulkUserEditButton" disabled>{{ trans('button.go') }}</button>
|
||||
</div>
|
||||
@endcan
|
||||
@endif
|
||||
{{ Form::close() }}
|
||||
</div>
|
Reference in New Issue
Block a user