Use Helper alias

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2021-09-28 19:44:55 -07:00
parent 9a83b90e44
commit 61f16f47a2
53 changed files with 112 additions and 111 deletions

View file

@ -21,7 +21,7 @@ class AssetFileRequest extends Request
*/ */
public function rules() public function rules()
{ {
$max_file_size = \App\Helpers\Helper::file_upload_max_size(); $max_file_size = Helper::file_upload_max_size();
return [ return [
'file.*' => 'required|mimes:png,gif,jpg,svg,jpeg,doc,docx,pdf,txt,zip,rar,xls,xlsx,lic,xml,rtf,webp|max:'.$max_file_size, 'file.*' => 'required|mimes:png,gif,jpg,svg,jpeg,doc,docx,pdf,txt,zip,rar,xls,xlsx,lic,xml,rtf,webp|max:'.$max_file_size,

View file

@ -24,7 +24,7 @@ class ActionlogsTransformer
{ {
$icon = $actionlog->present()->icon(); $icon = $actionlog->present()->icon();
if ($actionlog->filename != '') { if ($actionlog->filename != '') {
$icon = e(\App\Helpers\Helper::filetype_icon($actionlog->filename)); $icon = e(Helper::filetype_icon($actionlog->filename));
} }
// This is necessary since we can't escape special characters within a JSON object // This is necessary since we can't escape special characters within a JSON object
@ -75,7 +75,7 @@ class ActionlogsTransformer
[ [
'url' => route('show/assetfile', ['assetId' => $actionlog->item->id, 'fileId' => $actionlog->id]), 'url' => route('show/assetfile', ['assetId' => $actionlog->item->id, 'fileId' => $actionlog->id]),
'filename' => $actionlog->filename, 'filename' => $actionlog->filename,
'inlineable' => (bool) \App\Helpers\Helper::show_file_inline($actionlog->filename), 'inlineable' => (bool) Helper::show_file_inline($actionlog->filename),
] : null, ] : null,
'item' => ($actionlog->item) ? [ 'item' => ($actionlog->item) ? [

View file

@ -88,7 +88,7 @@ class AssetsTransformer
foreach ($asset->model->fieldset->fields as $field) { foreach ($asset->model->fieldset->fields as $field) {
if ($field->isFieldDecryptable($asset->{$field->convertUnicodeDbSlug()})) { if ($field->isFieldDecryptable($asset->{$field->convertUnicodeDbSlug()})) {
$decrypted = \App\Helpers\Helper::gracefulDecrypt($field, $asset->{$field->convertUnicodeDbSlug()}); $decrypted = Helper::gracefulDecrypt($field, $asset->{$field->convertUnicodeDbSlug()});
$value = (Gate::allows('superadmin')) ? $decrypted : strtoupper(trans('admin/custom_fields/general.encrypted')); $value = (Gate::allows('superadmin')) ? $decrypted : strtoupper(trans('admin/custom_fields/general.encrypted'));
$fields_array[$field->name] = [ $fields_array[$field->name] = [

View file

@ -62,9 +62,9 @@ class DepreciationReportTransformer
* Override the previously set null values if there is a valid model and associated depreciation * Override the previously set null values if there is a valid model and associated depreciation
*/ */
if (($asset->model) && ($asset->model->depreciation)) { if (($asset->model) && ($asset->model->depreciation)) {
$depreciated_value = \App\Helpers\Helper::formatCurrencyOutput($asset->getDepreciatedValue()); $depreciated_value = Helper::formatCurrencyOutput($asset->getDepreciatedValue());
$monthly_depreciation = \App\Helpers\Helper::formatCurrencyOutput(($asset->model->eol > 0 ? ($asset->purchase_cost / $asset->model->eol) : 0)); $monthly_depreciation = Helper::formatCurrencyOutput(($asset->model->eol > 0 ? ($asset->purchase_cost / $asset->model->eol) : 0));
$diff = \App\Helpers\Helper::formatCurrencyOutput(($asset->purchase_cost - $asset->getDepreciatedValue())); $diff = Helper::formatCurrencyOutput(($asset->purchase_cost - $asset->getDepreciatedValue()));
} }
if ($asset->assigned) { if ($asset->assigned) {

View file

@ -30,7 +30,7 @@ class CheckinAssetNotification extends Notification
$this->expected_checkin = ''; $this->expected_checkin = '';
if ($this->item->expected_checkin) { if ($this->item->expected_checkin) {
$this->expected_checkin = \App\Helpers\Helper::getFormattedDateObject($this->item->expected_checkin, 'date', $this->expected_checkin = Helper::getFormattedDateObject($this->item->expected_checkin, 'date',
false); false);
} }
} }

View file

@ -33,12 +33,12 @@ class CheckoutAssetNotification extends Notification
$this->expected_checkin = ''; $this->expected_checkin = '';
if ($this->item->last_checkout) { if ($this->item->last_checkout) {
$this->last_checkout = \App\Helpers\Helper::getFormattedDateObject($this->item->last_checkout, 'date', $this->last_checkout = Helper::getFormattedDateObject($this->item->last_checkout, 'date',
false); false);
} }
if ($this->item->expected_checkin) { if ($this->item->expected_checkin) {
$this->expected_checkin = \App\Helpers\Helper::getFormattedDateObject($this->item->expected_checkin, 'date', $this->expected_checkin = Helper::getFormattedDateObject($this->item->expected_checkin, 'date',
false); false);
} }
} }

View file

@ -397,6 +397,7 @@ return [
'Google2FA' => PragmaRX\Google2FALaravel\Facade::class, 'Google2FA' => PragmaRX\Google2FALaravel\Facade::class,
'Image' => Intervention\Image\ImageServiceProvider::class, 'Image' => Intervention\Image\ImageServiceProvider::class,
'Carbon' => Carbon\Carbon::class, 'Carbon' => Carbon\Carbon::class,
'Helper' => App\Helpers\Helper::class, // makes it much easier to use 'Helper::blah' in blades (which is where we usually use this)
], ],

View file

@ -50,7 +50,7 @@
<label for="title" class="col-md-3 control-label"> <label for="title" class="col-md-3 control-label">
{{ trans('admin/asset_maintenances/form.title') }} {{ trans('admin/asset_maintenances/form.title') }}
</label> </label>
<div class="col-md-7{{ (\App\Helpers\Helper::checkIfRequired($item, 'title')) ? ' required' : '' }}"> <div class="col-md-7{{ (Helper::checkIfRequired($item, 'title')) ? ' required' : '' }}">
<input class="form-control" type="text" name="title" id="title" value="{{ old('title', $item->title) }}" /> <input class="form-control" type="text" name="title" id="title" value="{{ old('title', $item->title) }}" />
{!! $errors->first('title', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!} {!! $errors->first('title', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div> </div>
@ -60,7 +60,7 @@
<div class="form-group {{ $errors->has('start_date') ? ' has-error' : '' }}"> <div class="form-group {{ $errors->has('start_date') ? ' has-error' : '' }}">
<label for="start_date" class="col-md-3 control-label">{{ trans('admin/asset_maintenances/form.start_date') }}</label> <label for="start_date" class="col-md-3 control-label">{{ trans('admin/asset_maintenances/form.start_date') }}</label>
<div class="input-group col-md-3{{ (\App\Helpers\Helper::checkIfRequired($item, 'start_date')) ? ' required' : '' }}"> <div class="input-group col-md-3{{ (Helper::checkIfRequired($item, 'start_date')) ? ' required' : '' }}">
<div class="input-group date" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-autoclose="true"> <div class="input-group date" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-autoclose="true">
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="start_date" id="start_date" value="{{ old('start_date', $item->start_date) }}"> <input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="start_date" id="start_date" value="{{ old('start_date', $item->start_date) }}">
<span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span> <span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span>
@ -75,7 +75,7 @@
<div class="form-group {{ $errors->has('completion_date') ? ' has-error' : '' }}"> <div class="form-group {{ $errors->has('completion_date') ? ' has-error' : '' }}">
<label for="start_date" class="col-md-3 control-label">{{ trans('admin/asset_maintenances/form.completion_date') }}</label> <label for="start_date" class="col-md-3 control-label">{{ trans('admin/asset_maintenances/form.completion_date') }}</label>
<div class="input-group col-md-3{{ (\App\Helpers\Helper::checkIfRequired($item, 'completion_date')) ? ' required' : '' }}"> <div class="input-group col-md-3{{ (Helper::checkIfRequired($item, 'completion_date')) ? ' required' : '' }}">
<div class="input-group date" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-autoclose="true"> <div class="input-group date" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-autoclose="true">
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="completion_date" id="completion_date" value="{{ old('completion_date', $item->completion_date) }}"> <input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="completion_date" id="completion_date" value="{{ old('completion_date', $item->completion_date) }}">
<span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span> <span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span>
@ -107,7 +107,7 @@
{{ $snipeSettings->default_currency }} {{ $snipeSettings->default_currency }}
@endif @endif
</span> </span>
<input class="col-md-2 form-control" type="text" name="cost" id="cost" value="{{ old('cost', \App\Helpers\Helper::formatCurrencyOutput($item->cost)) }}" /> <input class="col-md-2 form-control" type="text" name="cost" id="cost" value="{{ old('cost', Helper::formatCurrencyOutput($item->cost)) }}" />
{!! $errors->first('cost', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!} {!! $errors->first('cost', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div> </div>
</div> </div>

View file

@ -128,7 +128,7 @@
<div class="col-md-12" style="padding-bottom: 5px;"><strong>{{ trans('admin/components/general.cost') }}:</strong> <div class="col-md-12" style="padding-bottom: 5px;"><strong>{{ trans('admin/components/general.cost') }}:</strong>
{{ $snipeSettings->default_currency }} {{ $snipeSettings->default_currency }}
{{ \App\Helpers\Helper::formatCurrencyOutput($component->purchase_cost) }} </div> {{ Helper::formatCurrencyOutput($component->purchase_cost) }} </div>
@endif @endif
@if ($component->order_number) @if ($component->order_number)

View file

@ -85,7 +85,7 @@
@if ($consumable->purchase_date) @if ($consumable->purchase_date)
<div class="col-md-12" style="padding-bottom: 15px;"> <div class="col-md-12" style="padding-bottom: 15px;">
<strong>{{ trans('general.purchase_date') }}: </strong> <strong>{{ trans('general.purchase_date') }}: </strong>
{{ \App\Helpers\Helper::getFormattedDateObject($consumable->purchase_date, 'date', false) }} {{ Helper::getFormattedDateObject($consumable->purchase_date, 'date', false) }}
</div> </div>
@endif @endif
@ -93,7 +93,7 @@
<div class="col-md-12" style="padding-bottom: 15px;"> <div class="col-md-12" style="padding-bottom: 15px;">
<strong>{{ trans('general.purchase_cost') }}:</strong> <strong>{{ trans('general.purchase_cost') }}:</strong>
{{ $snipeSettings->default_currency }} {{ $snipeSettings->default_currency }}
{{ \App\Helpers\Helper::formatCurrencyOutput($consumable->purchase_cost) }} {{ Helper::formatCurrencyOutput($consumable->purchase_cost) }}
</div> </div>
@endif @endif

View file

@ -75,7 +75,7 @@
{{ trans('admin/custom_fields/general.field_format') }} {{ trans('admin/custom_fields/general.field_format') }}
</label> </label>
<div class="col-md-6 required"> <div class="col-md-6 required">
{{ Form::select("format",\App\Helpers\Helper::predefined_formats(), $field->format, array('class'=>'format select2 form-control', 'aria-label'=>'format')) }} {{ Form::select("format",Helper::predefined_formats(), $field->format, array('class'=>'format select2 form-control', 'aria-label'=>'format')) }}
{!! $errors->first('format', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!} {!! $errors->first('format', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div> </div>
</div> </div>

View file

@ -15,7 +15,7 @@
<label for="months" class="col-md-3 control-label"> <label for="months" class="col-md-3 control-label">
{{ trans('admin/depreciations/general.number_of_months') }} {{ trans('admin/depreciations/general.number_of_months') }}
</label> </label>
<div class="col-md-7 col-sm-12 {{ (\App\Helpers\Helper::checkIfRequired($item, 'months')) ? ' required' : '' }}"> <div class="col-md-7 col-sm-12 {{ (Helper::checkIfRequired($item, 'months')) ? ' required' : '' }}">
<input class="form-control" type="text" name="months" aria-label="months" id="months" value="{{ Request::old('months', $item->months) }}" style="width: 80px;" /> <input class="form-control" type="text" name="months" aria-label="months" id="months" value="{{ Request::old('months', $item->months) }}" style="width: 80px;" />
{!! $errors->first('months', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!} {!! $errors->first('months', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div> </div>

View file

@ -22,14 +22,14 @@
<!-- we are editing an existing asset --> <!-- we are editing an existing asset -->
@if ($item->id) @if ($item->id)
<div class="col-md-7 col-sm-12{{ (\App\Helpers\Helper::checkIfRequired($item, 'asset_tag')) ? ' required' : '' }}"> <div class="col-md-7 col-sm-12{{ (Helper::checkIfRequired($item, 'asset_tag')) ? ' required' : '' }}">
<input class="form-control" type="text" name="asset_tags[1]" id="asset_tag" value="{{ Request::old('asset_tag', $item->asset_tag) }}" data-validation="required"> <input class="form-control" type="text" name="asset_tags[1]" id="asset_tag" value="{{ Request::old('asset_tag', $item->asset_tag) }}" data-validation="required">
{!! $errors->first('asset_tags', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!} {!! $errors->first('asset_tags', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}
{!! $errors->first('asset_tag', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!} {!! $errors->first('asset_tag', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}
</div> </div>
@else @else
<!-- we are creating a new asset - let people use more than one asset tag --> <!-- we are creating a new asset - let people use more than one asset tag -->
<div class="col-md-7 col-sm-12{{ (\App\Helpers\Helper::checkIfRequired($item, 'asset_tag')) ? ' required' : '' }}"> <div class="col-md-7 col-sm-12{{ (Helper::checkIfRequired($item, 'asset_tag')) ? ' required' : '' }}">
<input class="form-control" type="text" name="asset_tags[1]" id="asset_tag" value="{{ Request::old('asset_tag', \App\Models\Asset::autoincrement_asset()) }}" data-validation="required"> <input class="form-control" type="text" name="asset_tags[1]" id="asset_tag" value="{{ Request::old('asset_tag', \App\Models\Asset::autoincrement_asset()) }}" data-validation="required">
{!! $errors->first('asset_tags', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!} {!! $errors->first('asset_tags', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}
{!! $errors->first('asset_tag', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!} {!! $errors->first('asset_tag', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}

View file

@ -267,7 +267,7 @@
</strong> </strong>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
{{ \App\Helpers\Helper::getFormattedDateObject($audit_log->created_at, 'date', false) }} (by {{ link_to_route('users.show', $audit_log->user->present()->fullname(), [$audit_log->user->id]) }}) {{ Helper::getFormattedDateObject($audit_log->created_at, 'date', false) }} (by {{ link_to_route('users.show', $audit_log->user->present()->fullname(), [$audit_log->user->id]) }})
</div> </div>
</div> </div>
@endif @endif
@ -280,7 +280,7 @@
</strong> </strong>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
{{ \App\Helpers\Helper::getFormattedDateObject($asset->next_audit_date, 'date', false) }} {{ Helper::getFormattedDateObject($asset->next_audit_date, 'date', false) }}
</div> </div>
</div> </div>
@endif @endif
@ -419,9 +419,9 @@
@if ($field->isFieldDecryptable($asset->{$field->db_column_name()} )) @if ($field->isFieldDecryptable($asset->{$field->db_column_name()} ))
@can('superuser') @can('superuser')
@if (($field->format=='URL') && ($asset->{$field->db_column_name()}!='')) @if (($field->format=='URL') && ($asset->{$field->db_column_name()}!=''))
<a href="{{ \App\Helpers\Helper::gracefulDecrypt($field, $asset->{$field->db_column_name()}) }}" target="_new">{{ \App\Helpers\Helper::gracefulDecrypt($field, $asset->{$field->db_column_name()}) }}</a> <a href="{{ Helper::gracefulDecrypt($field, $asset->{$field->db_column_name()}) }}" target="_new">{{ Helper::gracefulDecrypt($field, $asset->{$field->db_column_name()}) }}</a>
@else @else
{{ \App\Helpers\Helper::gracefulDecrypt($field, $asset->{$field->db_column_name()}) }} {{ Helper::gracefulDecrypt($field, $asset->{$field->db_column_name()}) }}
@endif @endif
@else @else
{{ strtoupper(trans('admin/custom_fields/general.encrypted')) }} {{ strtoupper(trans('admin/custom_fields/general.encrypted')) }}
@ -448,7 +448,7 @@
</strong> </strong>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
{{ \App\Helpers\Helper::getFormattedDateObject($asset->purchase_date, 'date', false) }} {{ Helper::getFormattedDateObject($asset->purchase_date, 'date', false) }}
</div> </div>
</div> </div>
@endif @endif
@ -468,7 +468,7 @@
@else @else
{{ $snipeSettings->default_currency }} {{ $snipeSettings->default_currency }}
@endif @endif
{{ \App\Helpers\Helper::formatCurrencyOutput($asset->purchase_cost)}} {{ Helper::formatCurrencyOutput($asset->purchase_cost)}}
</div> </div>
</div> </div>
@ -489,7 +489,7 @@
@else @else
{{ $snipeSettings->default_currency }} {{ $snipeSettings->default_currency }}
@endif @endif
{{ \App\Helpers\Helper::formatCurrencyOutput($asset->getDepreciatedValue() )}} {{ Helper::formatCurrencyOutput($asset->getDepreciatedValue() )}}
</div> </div>
</div> </div>
@ -625,7 +625,7 @@
</strong> </strong>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
{{ \App\Helpers\Helper::getFormattedDateObject($asset->expected_checkin, 'date', false) }} {{ Helper::getFormattedDateObject($asset->expected_checkin, 'date', false) }}
</div> </div>
</div> </div>
@endif @endif
@ -687,7 +687,7 @@
</strong> </strong>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
{{ \App\Helpers\Helper::getFormattedDateObject($asset->created_at, 'datetime', false) }} {{ Helper::getFormattedDateObject($asset->created_at, 'datetime', false) }}
</div> </div>
</div> </div>
@endif @endif
@ -700,7 +700,7 @@
</strong> </strong>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
{{ \App\Helpers\Helper::getFormattedDateObject($asset->updated_at, 'datetime', false) }} {{ Helper::getFormattedDateObject($asset->updated_at, 'datetime', false) }}
</div> </div>
</div> </div>
@endif @endif
@ -712,7 +712,7 @@
</strong> </strong>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
{{ \App\Helpers\Helper::getFormattedDateObject($asset->last_checkout, 'datetime', false) }} {{ Helper::getFormattedDateObject($asset->last_checkout, 'datetime', false) }}
</div> </div>
</div> </div>
@endif @endif
@ -1112,15 +1112,15 @@
@foreach ($asset->uploads as $file) @foreach ($asset->uploads as $file)
<tr> <tr>
<td><i class="{{ \App\Helpers\Helper::filetype_icon($file->filename) }} icon-med" aria-hidden="true"></i></td> <td><i class="{{ Helper::filetype_icon($file->filename) }} icon-med" aria-hidden="true"></i></td>
<td> <td>
@if ($file->note) @if ($file->note)
{{ $file->note }} {{ $file->note }}
@endif @endif
</td> </td>
<td> <td>
@if ( \App\Helpers\Helper::checkUploadIsImage($file->get_src('assets'))) @if ( Helper::checkUploadIsImage($file->get_src('assets')))
<a href="{{ route('show/assetfile', ['assetId' => $asset->id, 'fileId' =>$file->id]) }}" data-toggle="lightbox" data-type="image" data-title="{{ $file->filename }}" data-footer="{{ \App\Helpers\Helper::getFormattedDateObject($asset->last_checkout, 'datetime', false) }}"> <a href="{{ route('show/assetfile', ['assetId' => $asset->id, 'fileId' =>$file->id]) }}" data-toggle="lightbox" data-type="image" data-title="{{ $file->filename }}" data-footer="{{ Helper::getFormattedDateObject($asset->last_checkout, 'datetime', false) }}">
<img src="{{ route('show/assetfile', ['assetId' => $asset->id, 'fileId' =>$file->id]) }}" style="max-width: 50px;"> <img src="{{ route('show/assetfile', ['assetId' => $asset->id, 'fileId' =>$file->id]) }}" style="max-width: 50px;">
</a> </a>
@endif @endif
@ -1138,7 +1138,7 @@
<td> <td>
@if ($file->created_at) @if ($file->created_at)
{{ \App\Helpers\Helper::getFormattedDateObject($file->created_at, 'datetime', false) }} {{ Helper::getFormattedDateObject($file->created_at, 'datetime', false) }}
@endif @endif
</td> </td>

View file

@ -253,7 +253,7 @@
@can('admin') @can('admin')
@if ($snipeSettings->show_alerts_in_menu=='1') @if ($snipeSettings->show_alerts_in_menu=='1')
<!-- Tasks: style can be found in dropdown.less --> <!-- Tasks: style can be found in dropdown.less -->
<?php $alert_items = \App\Helpers\Helper::checkLowInventory(); ?> <?php $alert_items = Helper::checkLowInventory(); ?>
<li class="dropdown tasks-menu"> <li class="dropdown tasks-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">

View file

@ -15,7 +15,7 @@
@can('viewKeys', $item) @can('viewKeys', $item)
<div class="form-group {{ $errors->has('serial') ? ' has-error' : '' }}"> <div class="form-group {{ $errors->has('serial') ? ' has-error' : '' }}">
<label for="serial" class="col-md-3 control-label">{{ trans('admin/licenses/form.license_key') }}</label> <label for="serial" class="col-md-3 control-label">{{ trans('admin/licenses/form.license_key') }}</label>
<div class="col-md-7{{ (\App\Helpers\Helper::checkIfRequired($item, 'serial')) ? ' required' : '' }}"> <div class="col-md-7{{ (Helper::checkIfRequired($item, 'serial')) ? ' required' : '' }}">
<textarea class="form-control" type="text" name="serial" id="serial">{{ old('serial', $item->serial) }}</textarea> <textarea class="form-control" type="text" name="serial" id="serial">{{ old('serial', $item->serial) }}</textarea>
{!! $errors->first('serial', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!} {!! $errors->first('serial', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div> </div>

View file

@ -222,7 +222,7 @@
</strong> </strong>
</div> </div>
<div class="col-md-9"> <div class="col-md-9">
{{ \App\Helpers\Helper::getFormattedDateObject($license->expiration_date, 'date', false) }} {{ Helper::getFormattedDateObject($license->expiration_date, 'date', false) }}
</div> </div>
</div> </div>
@endif @endif
@ -235,7 +235,7 @@
</strong> </strong>
</div> </div>
<div class="col-md-9"> <div class="col-md-9">
{{ \App\Helpers\Helper::getFormattedDateObject($license->termination_date, 'date', false) }} {{ Helper::getFormattedDateObject($license->termination_date, 'date', false) }}
</div> </div>
</div> </div>
@endif @endif
@ -263,7 +263,7 @@
</strong> </strong>
</div> </div>
<div class="col-md-9"> <div class="col-md-9">
{{ \App\Helpers\Helper::getFormattedDateObject($license->depreciated_date(), 'date', false) }} {{ Helper::getFormattedDateObject($license->depreciated_date(), 'date', false) }}
</div> </div>
</div> </div>
@ -305,7 +305,7 @@
<strong>{{ trans('general.purchase_date') }}</strong> <strong>{{ trans('general.purchase_date') }}</strong>
</div> </div>
<div class="col-md-9"> <div class="col-md-9">
{{ \App\Helpers\Helper::getFormattedDateObject($license->purchase_date, 'date', false) }} {{ Helper::getFormattedDateObject($license->purchase_date, 'date', false) }}
</div> </div>
</div> </div>
@ -320,7 +320,7 @@
</div> </div>
<div class="col-md-9"> <div class="col-md-9">
{{ $snipeSettings->default_currency }} {{ $snipeSettings->default_currency }}
{{ \App\Helpers\Helper::formatCurrencyOutput($license->purchase_cost) }} {{ Helper::formatCurrencyOutput($license->purchase_cost) }}
</div> </div>
</div> </div>
@endif @endif
@ -457,8 +457,8 @@
@foreach ($license->uploads as $file) @foreach ($license->uploads as $file)
<tr> <tr>
<td> <td>
<i class="{{ \App\Helpers\Helper::filetype_icon($file->filename) }} icon-med" aria-hidden="true"></i> <i class="{{ Helper::filetype_icon($file->filename) }} icon-med" aria-hidden="true"></i>
<span class="sr-only">{{ \App\Helpers\Helper::filetype_icon($file->filename) }}</span> <span class="sr-only">{{ Helper::filetype_icon($file->filename) }}</span>
</td> </td>
<td> <td>
@ -473,7 +473,7 @@
<td>{{ $file->created_at }}</td> <td>{{ $file->created_at }}</td>
<td> <td>
@if ($file->filename) @if ($file->filename)
@if ( \App\Helpers\Helper::checkUploadIsImage($file->get_src('licenses'))) @if ( Helper::checkUploadIsImage($file->get_src('licenses')))
<a href="{{ route('show.licensefile', ['licenseId' => $license->id, 'fileId' => $file->id, 'download' => 'false']) }}" data-toggle="lightbox" data-type="image"><img src="{{ route('show.licensefile', ['licenseId' => $license->id, 'fileId' => $file->id]) }}" class="img-thumbnail" style="max-width: 50px;"></a> <a href="{{ route('show.licensefile', ['licenseId' => $license->id, 'fileId' => $file->id, 'download' => 'false']) }}" data-toggle="lightbox" data-type="image"><img src="{{ route('show.licensefile', ['licenseId' => $license->id, 'fileId' => $file->id]) }}" class="img-thumbnail" style="max-width: 50px;"></a>
@endif @endif
@endif @endif

View file

@ -2,7 +2,7 @@
<div class="form-group{{ $errors->has('custom_fieldset') ? ' has-error' : '' }}"> <div class="form-group{{ $errors->has('custom_fieldset') ? ' has-error' : '' }}">
<label for="custom_fieldset" class="col-md-3 control-label">{{ trans('admin/models/general.fieldset') }}</label> <label for="custom_fieldset" class="col-md-3 control-label">{{ trans('admin/models/general.fieldset') }}</label>
<div class="col-md-9"> <div class="col-md-9">
{{ Form::select('custom_fieldset', \App\Helpers\Helper::customFieldsetList(),old('custom_fieldset', 0000 /*$item->fieldset_id*/), array('class'=>'select2 js-fieldset-field', 'style'=>'width:350px', 'aria-label'=>'custom_fieldset', 'wire:model' => 'fieldset_id')) }} {{ Form::select('custom_fieldset', Helper::customFieldsetList(),old('custom_fieldset', 0000 /*$item->fieldset_id*/), array('class'=>'select2 js-fieldset-field', 'style'=>'width:350px', 'aria-label'=>'custom_fieldset', 'wire:model' => 'fieldset_id')) }}
{!! $errors->first('custom_fieldset', '<span class="alert-msg" aria-hidden="true"><br><i class="fas fa-times"></i> :message</span>') !!} {!! $errors->first('custom_fieldset', '<span class="alert-msg" aria-hidden="true"><br><i class="fas fa-times"></i> :message</span>') !!}
<label class="m-l-xs"> <label class="m-l-xs">
{{-- {{ Form::checkbox('add_default_values', 1, Request::old('add_default_values'), ['class' => 'js-default-values-toggler']) }} --}} {{-- {{ Form::checkbox('add_default_values', 1, Request::old('add_default_values'), ['class' => 'js-default-values-toggler']) }} --}}

View file

@ -22,7 +22,7 @@
<label for="currency" class="col-md-3 control-label"> <label for="currency" class="col-md-3 control-label">
{{ trans('admin/locations/table.currency') }} {{ trans('admin/locations/table.currency') }}
</label> </label>
<div class="col-md-9{{ (\App\Helpers\Helper::checkIfRequired($item, 'currency')) ? ' required' : '' }}"> <div class="col-md-9{{ (Helper::checkIfRequired($item, 'currency')) ? ' required' : '' }}">
{{ Form::text('currency', old('currency', $item->currency), array('class' => 'form-control','placeholder' => 'USD', 'maxlength'=>'3', 'style'=>'width: 60px;', 'aria-label'=>'currency')) }} {{ Form::text('currency', old('currency', $item->currency), array('class' => 'form-control','placeholder' => 'USD', 'maxlength'=>'3', 'style'=>'width: 60px;', 'aria-label'=>'currency')) }}
{!! $errors->first('currency', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('currency', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div> </div>
@ -36,7 +36,7 @@
<label for="ldap_ou" class="col-md-3 control-label"> <label for="ldap_ou" class="col-md-3 control-label">
{{ trans('admin/locations/table.ldap_ou') }} {{ trans('admin/locations/table.ldap_ou') }}
</label> </label>
<div class="col-md-7{{ (\App\Helpers\Helper::checkIfRequired($item, 'ldap_ou')) ? ' required' : '' }}"> <div class="col-md-7{{ (Helper::checkIfRequired($item, 'ldap_ou')) ? ' required' : '' }}">
{{ Form::text('ldap_ou', old('ldap_ou', $item->ldap_ou), array('class' => 'form-control')) }} {{ Form::text('ldap_ou', old('ldap_ou', $item->ldap_ou), array('class' => 'form-control')) }}
{!! $errors->first('ldap_ou', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('ldap_ou', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div> </div>

View file

@ -37,7 +37,7 @@
<div class="dynamic-form-row"> <div class="dynamic-form-row">
<div class="col-md-4 col-xs-12"><label for="modal-fieldset_id">{{ trans('admin/models/general.fieldset') }}:</label></div> <div class="col-md-4 col-xs-12"><label for="modal-fieldset_id">{{ trans('admin/models/general.fieldset') }}:</label></div>
<div class="col-md-8 col-xs-12">{{ Form::select('fieldset_id', \App\Helpers\Helper::customFieldsetList(),Request::old('fieldset_id'), array('class'=>'select2', 'id'=>'modal-fieldset_id', 'style'=>'width:350px')) }}</div> <div class="col-md-8 col-xs-12">{{ Form::select('fieldset_id', Helper::customFieldsetList(),Request::old('fieldset_id'), array('class'=>'select2', 'id'=>'modal-fieldset_id', 'style'=>'width:350px')) }}</div>
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">

View file

@ -19,7 +19,7 @@
<label class="btn btn-default"> <label class="btn btn-default">
{{ trans('button.select_file') }} {{ trans('button.select_file') }}
<input type="file" name="file[]" multiple="true" class="js-uploadFile" id="uploadFile" data-maxsize="{{ \App\Helpers\Helper::file_upload_max_size() }}" accept="image/*,.csv,.zip,.rar,.doc,.docx,.xls,.xlsx,.xml,.lic,.xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel,text/plain,.pdf,application/rtf" style="display:none" required> <input type="file" name="file[]" multiple="true" class="js-uploadFile" id="uploadFile" data-maxsize="{{ Helper::file_upload_max_size() }}" accept="image/*,.csv,.zip,.rar,.doc,.docx,.xls,.xlsx,.xml,.lic,.xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel,text/plain,.pdf,application/rtf" style="display:none" required>
</label> </label>
</div> </div>
@ -27,7 +27,7 @@
<span id="uploadFile-info"></span> <span id="uploadFile-info"></span>
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<p class="help-block" id="uploadFile-status">{{ trans('general.upload_filetypes_help', ['size' => \App\Helpers\Helper::file_upload_max_size_readable()]) }}</p> <p class="help-block" id="uploadFile-status">{{ trans('general.upload_filetypes_help', ['size' => Helper::file_upload_max_size_readable()]) }}</p>
</div> </div>
<div class="col-md-12"> <div class="col-md-12">

View file

@ -9,7 +9,7 @@
<!-- Listbox --> <!-- Listbox -->
@if ($field->element=='listbox') @if ($field->element=='listbox')
{{ Form::select($field->db_column_name(), $field->formatFieldValuesAsArray(), {{ Form::select($field->db_column_name(), $field->formatFieldValuesAsArray(),
Request::old($field->db_column_name(),(isset($item) ? \App\Helpers\Helper::gracefulDecrypt($field, htmlspecialchars($item->{$field->db_column_name()}, ENT_QUOTES)) : $field->defaultValue($model->id))), ['class'=>'format select2 form-control']) }} Request::old($field->db_column_name(),(isset($item) ? Helper::gracefulDecrypt($field, htmlspecialchars($item->{$field->db_column_name()}, ENT_QUOTES)) : $field->defaultValue($model->id))), ['class'=>'format select2 form-control']) }}
@elseif ($field->element=='textarea') @elseif ($field->element=='textarea')
<textarea class="col-md-6 form-control" id="{{ $field->db_column_name() }}" name="{{ $field->db_column_name() }}">{{ Request::old($field->db_column_name(),(isset($item) ? $item->{$field->db_column_name()} : $field->defaultValue($model->id))) }}</textarea> <textarea class="col-md-6 form-control" id="{{ $field->db_column_name() }}" name="{{ $field->db_column_name() }}">{{ Request::old($field->db_column_name(),(isset($item) ? $item->{$field->db_column_name()} : $field->defaultValue($model->id))) }}</textarea>
@ -48,7 +48,7 @@
<div class="input-group col-md-4" style="padding-left: 0px;"> <div class="input-group col-md-4" style="padding-left: 0px;">
<div class="input-group date" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-autoclose="true"> <div class="input-group date" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-autoclose="true">
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="{{ $field->db_column_name() }}" id="{{ $field->db_column_name() }}" value="{{ old($field->db_column_name(),(isset($item) ? \App\Helpers\Helper::gracefulDecrypt($field, $item->{$field->db_column_name()}) : "")) }}"> <input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="{{ $field->db_column_name() }}" id="{{ $field->db_column_name() }}" value="{{ old($field->db_column_name(),(isset($item) ? Helper::gracefulDecrypt($field, $item->{$field->db_column_name()}) : "")) }}">
<span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span> <span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span>
</div> </div>
</div> </div>
@ -56,7 +56,7 @@
@else @else
@if (($field->field_encrypted=='0') || (Gate::allows('admin'))) @if (($field->field_encrypted=='0') || (Gate::allows('admin')))
<input type="text" value="{{ Request::old($field->db_column_name(),(isset($item) ? \App\Helpers\Helper::gracefulDecrypt($field, $item->{$field->db_column_name()}) : $field->defaultValue($model->id))) }}" id="{{ $field->db_column_name() }}" class="form-control" name="{{ $field->db_column_name() }}" placeholder="Enter {{ strtolower($field->format) }} text"> <input type="text" value="{{ Request::old($field->db_column_name(),(isset($item) ? Helper::gracefulDecrypt($field, $item->{$field->db_column_name()}) : $field->defaultValue($model->id))) }}" id="{{ $field->db_column_name() }}" class="form-control" name="{{ $field->db_column_name() }}" placeholder="Enter {{ strtolower($field->format) }} text">
@else @else
<input type="text" value="{{ strtoupper(trans('admin/custom_fields/general.encrypted')) }}" class="form-control disabled" disabled> <input type="text" value="{{ strtoupper(trans('admin/custom_fields/general.encrypted')) }}" class="form-control disabled" disabled>
@endif @endif

View file

@ -38,7 +38,7 @@
{{-- <div class="form-group {{ $errors->has('custom_fieldset') ? ' has-error' : '' }}"> {{-- <div class="form-group {{ $errors->has('custom_fieldset') ? ' has-error' : '' }}">
<label for="custom_fieldset" class="col-md-3 control-label">{{ trans('admin/models/general.fieldset') }}</label> <label for="custom_fieldset" class="col-md-3 control-label">{{ trans('admin/models/general.fieldset') }}</label>
<div class="col-md-7"> <div class="col-md-7">
{{ Form::select('custom_fieldset', \App\Helpers\Helper::customFieldsetList(),old('custom_fieldset', $item->fieldset_id), array('class'=>'select2 js-fieldset-field', 'style'=>'width:350px', 'aria-label'=>'custom_fieldset')) }} {{ Form::select('custom_fieldset', Helper::customFieldsetList(),old('custom_fieldset', $item->fieldset_id), array('class'=>'select2 js-fieldset-field', 'style'=>'width:350px', 'aria-label'=>'custom_fieldset')) }}
{!! $errors->first('custom_fieldset', '<span class="alert-msg" aria-hidden="true"><br><i class="fas fa-times"></i> :message</span>') !!} {!! $errors->first('custom_fieldset', '<span class="alert-msg" aria-hidden="true"><br><i class="fas fa-times"></i> :message</span>') !!}
<label class="m-l-xs"> <label class="m-l-xs">
{{-- {{ Form::checkbox('add_default_values', 1, Request::old('add_default_values'), ['class' => 'js-default-values-toggler']) }} --}} {{-- {{ Form::checkbox('add_default_values', 1, Request::old('add_default_values'), ['class' => 'js-default-values-toggler']) }} --}}

View file

@ -8,7 +8,7 @@ The following {{ $assets->count() }} items are due to be checked in soon:
| ------------- | ------------- | ------------- | | ------------- | ------------- | ------------- |
@foreach ($assets as $asset) @foreach ($assets as $asset)
@php @php
$checkin = \App\Helpers\Helper::getFormattedDateObject($asset->expected_checkin, 'date'); $checkin = Helper::getFormattedDateObject($asset->expected_checkin, 'date');
@endphp @endphp
| [{{ $asset->present()->name }}]({{ route('hardware.show', ['hardware' => $asset->id]) }}) | [{{ $asset->assigned->present()->fullName }}]({{ route('users.show', ['user'=>$asset->assigned->id]) }}) | {{ $checkin['formatted'] }} | [{{ $asset->present()->name }}]({{ route('hardware.show', ['hardware' => $asset->id]) }}) | [{{ $asset->assigned->present()->fullName }}]({{ route('users.show', ['user'=>$asset->assigned->id]) }}) | {{ $checkin['formatted'] }}
@endforeach @endforeach

View file

@ -6,7 +6,7 @@
<tr><td>&nbsp;</td><td>{{ trans('mail.name') }}</td><td>{{ trans('mail.Days') }}</td><td>{{ trans('mail.expires') }}</td><td>{{ trans('mail.supplier') }}</td><td>{{ trans('mail.assigned_to') }}</td></tr> <tr><td>&nbsp;</td><td>{{ trans('mail.name') }}</td><td>{{ trans('mail.Days') }}</td><td>{{ trans('mail.expires') }}</td><td>{{ trans('mail.supplier') }}</td><td>{{ trans('mail.assigned_to') }}</td></tr>
@foreach ($assets as $asset) @foreach ($assets as $asset)
@php @php
$expires = \App\Helpers\Helper::getFormattedDateObject($asset->present()->warrantee_expires, 'date'); $expires = Helper::getFormattedDateObject($asset->present()->warrantee_expires, 'date');
$diff = round(abs(strtotime($asset->present()->warrantee_expires) - strtotime(date('Y-m-d')))/86400); $diff = round(abs(strtotime($asset->present()->warrantee_expires) - strtotime(date('Y-m-d')))/86400);
$icon = ($diff <= ($threshold / 2)) ? '🚨' : (($diff <= $threshold) ? '⚠️' : ' '); $icon = ($diff <= ($threshold / 2)) ? '🚨' : (($diff <= $threshold) ? '⚠️' : ' ');
@endphp @endphp

View file

@ -6,7 +6,7 @@
<tr><td>&nbsp;</td><td>{{ trans('mail.name') }}</td><td>{{ trans('mail.Days') }}</td><td>{{ trans('mail.expires') }}</td></tr> <tr><td>&nbsp;</td><td>{{ trans('mail.name') }}</td><td>{{ trans('mail.Days') }}</td><td>{{ trans('mail.expires') }}</td></tr>
@foreach ($licenses as $license) @foreach ($licenses as $license)
@php @php
$expires = \App\Helpers\Helper::getFormattedDateObject($license->expiration_date, 'date'); $expires = Helper::getFormattedDateObject($license->expiration_date, 'date');
$diff = round(abs(strtotime($license->expiration_date->format('Y-m-d')) - strtotime(date('Y-m-d')))/86400); $diff = round(abs(strtotime($license->expiration_date->format('Y-m-d')) - strtotime(date('Y-m-d')))/86400);
$icon = ($diff <= ($threshold / 2)) ? '🚨' : (($diff <= $threshold) ? '⚠️' : ' '); $icon = ($diff <= ($threshold / 2)) ? '🚨' : (($diff <= $threshold) ? '⚠️' : ' ');
@endphp @endphp

View file

@ -7,8 +7,8 @@
| |:------------- |:-------------|:---------|:---------|:---------|:---------| | |:------------- |:-------------|:---------|:---------|:---------|:---------|
@foreach ($assets as $asset) @foreach ($assets as $asset)
@php @php
$next_audit_date = \App\Helpers\Helper::getFormattedDateObject($asset->next_audit_date, 'date', false); $next_audit_date = Helper::getFormattedDateObject($asset->next_audit_date, 'date', false);
$last_audit_date = \App\Helpers\Helper::getFormattedDateObject($asset->last_audit_date, 'date', false); $last_audit_date = Helper::getFormattedDateObject($asset->last_audit_date, 'date', false);
$diff = Carbon::parse(Carbon::now())->diffInDays($next_audit_date, false); $diff = Carbon::parse(Carbon::now())->diffInDays($next_audit_date, false);
$icon = ($diff <= 7) ? '🚨' : (($diff <= 14) ? '⚠️' : ' '); $icon = ($diff <= 7) ? '🚨' : (($diff <= 14) ? '⚠️' : ' ');
@endphp @endphp

View file

@ -4,7 +4,7 @@
{{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }} {{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }}
<div class="col-md-7{{ ((isset($required)) && ($required=='true')) ? ' required' : '' }}"> <div class="col-md-7{{ ((isset($required)) && ($required=='true')) ? ' required' : '' }}">
<select class="js-data-ajax" data-endpoint="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)) && (\App\Helpers\Helper::checkIfRequired($item, $fieldname))) ? ' data-validation="required" 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' : '' !!}>
@if ($category_id = old($fieldname, (isset($item)) ? $item->{$fieldname} : '')) @if ($category_id = old($fieldname, (isset($item)) ? $item->{$fieldname} : ''))
<option value="{{ $category_id }}" selected="selected" role="option" aria-selected="true" role="option"> <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 : '' }} {{ (\App\Models\Category::find($category_id)) ? \App\Models\Category::find($category_id)->name : '' }}

View file

@ -1,7 +1,7 @@
<!-- Category --> <!-- Category -->
<div class="form-group {{ $errors->has('category_id') ? ' has-error' : '' }}"> <div class="form-group {{ $errors->has('category_id') ? ' has-error' : '' }}">
<label for="category_id" class="col-md-3 control-label">{{ trans('general.category') }}</label> <label for="category_id" class="col-md-3 control-label">{{ trans('general.category') }}</label>
<div class="col-md-7 col-sm-12{{ (\App\Helpers\Helper::checkIfRequired($item, 'category_id')) ? ' required' : '' }}"> <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%')) }} {{ 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>') !!} {!! $errors->first('category_id', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div> </div>

View file

@ -3,7 +3,7 @@
<div class="col-md-3 control-label"> <div class="col-md-3 control-label">
{{ Form::label('company_id', trans('general.company'), array('class' => 'col-md-3 control-label', 'for' => 'company_id')) }} {{ Form::label('company_id', trans('general.company'), array('class' => 'col-md-3 control-label', 'for' => 'company_id')) }}
</div> </div>
<div class="col-md-7 col-sm-12{{ (\App\Helpers\Helper::checkIfRequired($item, 'company_id')) ? ' required' : '' }}"> <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%')) }} {{ 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>') !!} {!! $errors->first('company_id', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div> </div>

View file

@ -6,11 +6,11 @@
<label class="btn btn-default" aria-hidden="true"> <label class="btn btn-default" aria-hidden="true">
{{ trans('button.select_file') }} {{ trans('button.select_file') }}
<input type="file" name="{{ (isset($fieldname) ? $fieldname : 'image') }}" class="js-uploadFile" id="uploadFile" data-maxsize="{{ \App\Helpers\Helper::file_upload_max_size() }}" accept="image/gif,image/jpeg,image/webp,image/png,image/svg,image/svg+xml" style="display:none; max-width: 90%" aria-label="image" aria-hidden="true"> <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" style="display:none; max-width: 90%" aria-label="image" aria-hidden="true">
</label> </label>
<span class='label label-default' id="uploadFile-info"></span> <span class='label label-default' id="uploadFile-info"></span>
<p class="help-block" id="uploadFile-status">{{ trans('general.image_filetypes_help', ['size' => \App\Helpers\Helper::file_upload_max_size_readable()]) }}</p> <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>') !!} {!! $errors->first('image', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div> </div>
<div class="col-md-4 col-md-offset-3" aria-hidden="true"> <div class="col-md-4 col-md-offset-3" aria-hidden="true">

View file

@ -1,7 +1,7 @@
<!-- Item Number --> <!-- Item Number -->
<div class="form-group {{ $errors->has('item_no') ? ' has-error' : '' }}"> <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> <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{{ (\App\Helpers\Helper::checkIfRequired($item, 'item_no')) ? ' required' : '' }}"> <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) }}" /> <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>') !!} {!! $errors->first('item_no', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div> </div>

View file

@ -3,7 +3,7 @@
{{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }} {{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }}
<div class="col-md-6{{ ((isset($required) && ($required =='true'))) ? ' required' : '' }}"> <div class="col-md-6{{ ((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)) && (\App\Helpers\Helper::checkIfRequired($item, $fieldname))) ? ' data-validation="required" 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' : '' !!}>
@if ($location_id = old($fieldname, (isset($item)) ? $item->{$fieldname} : '')) @if ($location_id = old($fieldname, (isset($item)) ? $item->{$fieldname} : ''))
<option value="{{ $location_id }}" selected="selected" role="option" aria-selected="true" role="option"> <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 : '' }} {{ (\App\Models\Location::find($location_id)) ? \App\Models\Location::find($location_id)->name : '' }}

View file

@ -1,7 +1,7 @@
<!-- Location --> <!-- Location -->
<div class="form-group {{ $errors->has('location_id') ? ' has-error' : '' }}"> <div class="form-group {{ $errors->has('location_id') ? ' has-error' : '' }}">
<label for="location_id" class="col-md-3 control-label">{{ trans('general.location') }}</label> <label for="location_id" class="col-md-3 control-label">{{ trans('general.location') }}</label>
<div class="col-md-7 col-sm-12{{ (\App\Helpers\Helper::checkIfRequired($item, 'location_id')) ? ' required' : '' }}"> <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')) }} {{ 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>') !!} {!! $errors->first('location_id', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div> </div>

View file

@ -2,7 +2,7 @@
<div class="form-group {{ $errors->has('asset_maintenance_type') ? ' has-error' : '' }}"> <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 for="asset_maintenance_type" class="col-md-3 control-label">{{ trans('admin/asset_maintenances/form.asset_maintenance_type') }}
</label> </label>
<div class="col-md-7{{ (\App\Helpers\Helper::checkIfRequired($item, 'asset_maintenance_type')) ? ' required' : '' }}"> <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']) }} {{ 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>') !!} {!! $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>

View file

@ -4,7 +4,7 @@
{{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }} {{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }}
<div class="col-md-7{{ ((isset($required)) && ($required=='true')) ? ' required' : '' }}"> <div class="col-md-7{{ ((isset($required)) && ($required=='true')) ? ' required' : '' }}">
<select class="js-data-ajax" data-endpoint="manufacturers" data-placeholder="{{ trans('general.select_manufacturer') }}" name="{{ $fieldname }}" style="width: 100%" id="manufacturer_select_id" aria-label="{{ $fieldname }}" {!! ((isset($item)) && (\App\Helpers\Helper::checkIfRequired($item, $fieldname))) ? ' data-validation="required" 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' : '' !!}>
@if ($manufacturer_id = old($fieldname, (isset($item)) ? $item->{$fieldname} : '')) @if ($manufacturer_id = old($fieldname, (isset($item)) ? $item->{$fieldname} : ''))
<option value="{{ $manufacturer_id }}" selected="selected" role="option" aria-selected="true" role="option"> <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 : '' }} {{ (\App\Models\Manufacturer::find($manufacturer_id)) ? \App\Models\Manufacturer::find($manufacturer_id)->name : '' }}

View file

@ -1,7 +1,7 @@
<!-- Manufacturer --> <!-- Manufacturer -->
<div class="form-group {{ $errors->has('manufacturer_id') ? ' has-error' : '' }}"> <div class="form-group {{ $errors->has('manufacturer_id') ? ' has-error' : '' }}">
<label for="manufacturer_id" class="col-md-3 control-label">{{ trans('general.manufacturer') }}</label> <label for="manufacturer_id" class="col-md-3 control-label">{{ trans('general.manufacturer') }}</label>
<div class="col-md-7{{ (\App\Helpers\Helper::checkIfRequired($item, 'manufacturer_id')) ? ' required' : '' }}"> <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%')) }} {{ 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>') !!} {!! $errors->first('manufacturer_id', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div> </div>

View file

@ -1,7 +1,7 @@
<!-- Min QTY --> <!-- Min QTY -->
<div class="form-group{{ $errors->has('min_amt') ? ' has-error' : '' }}"> <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> <label for="min_amt" class="col-md-3 control-label">{{ trans('general.min_amt') }}</label>
<div class="col-md-9{{ (\App\Helpers\Helper::checkIfRequired($item, 'min_amt')) ? ' required' : '' }}"> <div class="col-md-9{{ (Helper::checkIfRequired($item, 'min_amt')) ? ' required' : '' }}">
<div class="col-md-2" style="padding-left:0px"> <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) }}" /> <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>

View file

@ -1,8 +1,8 @@
<!-- Name --> <!-- Name -->
<div class="form-group {{ $errors->has('name') ? ' has-error' : '' }}"> <div class="form-group {{ $errors->has('name') ? ' has-error' : '' }}">
<label for="name" class="col-md-3 control-label">{{ $translated_name }}</label> <label for="name" class="col-md-3 control-label">{{ $translated_name }}</label>
<div class="col-md-7 col-sm-12{{ (\App\Helpers\Helper::checkIfRequired($item, 'name')) ? ' required' : '' }}"> <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) }}"{!! (\App\Helpers\Helper::checkIfRequired($item, 'name')) ? ' data-validation="required" 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>') !!} {!! $errors->first('name', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div> </div>
</div> </div>

View file

@ -3,7 +3,7 @@
<label for="purchase_cost" class="col-md-3 control-label">{{ trans('general.purchase_cost') }}</label> <label for="purchase_cost" class="col-md-3 control-label">{{ trans('general.purchase_cost') }}</label>
<div class="col-md-9"> <div class="col-md-9">
<div class="input-group col-md-4" style="padding-left: 0px;"> <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', \App\Helpers\Helper::formatCurrencyOutput($item->purchase_cost)) }}" /> <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"> <span class="input-group-addon">
@if (isset($currency_type)) @if (isset($currency_type))
{{ $currency_type }} {{ $currency_type }}

View file

@ -2,9 +2,9 @@
<!-- QTY --> <!-- QTY -->
<div class="form-group {{ $errors->has('qty') ? ' has-error' : '' }}"> <div class="form-group {{ $errors->has('qty') ? ' has-error' : '' }}">
<label for="qty" class="col-md-3 control-label">{{ trans('general.quantity') }}</label> <label for="qty" class="col-md-3 control-label">{{ trans('general.quantity') }}</label>
<div class="col-md-7{{ (\App\Helpers\Helper::checkIfRequired($item, 'qty')) ? ' required' : '' }}"> <div class="col-md-7{{ (Helper::checkIfRequired($item, 'qty')) ? ' required' : '' }}">
<div class="col-md-2" style="padding-left:0px"> <div class="col-md-2" style="padding-left:0px">
<input class="form-control" type="text" name="qty" aria-label="qty" id="qty" value="{{ old('qty', $item->qty) }}" {!! (\App\Helpers\Helper::checkIfRequired($item, 'qty')) ? ' data-validation="required" required' : '' !!}/> <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> </div>
{!! $errors->first('qty', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!} {!! $errors->first('qty', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div> </div>

View file

@ -1,7 +1,7 @@
<!-- Serial --> <!-- Serial -->
<div class="form-group {{ $errors->has('serial') ? ' has-error' : '' }}"> <div class="form-group {{ $errors->has('serial') ? ' has-error' : '' }}">
<label for="{{ $fieldname }}" class="col-md-3 control-label">{{ trans('admin/hardware/form.serial') }} </label> <label for="{{ $fieldname }}" class="col-md-3 control-label">{{ trans('admin/hardware/form.serial') }} </label>
<div class="col-md-7 col-sm-12{{ (\App\Helpers\Helper::checkIfRequired($item, 'serial')) ? ' required' : '' }}"> <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('serial', $item->serial) }}" /> <input class="form-control" type="text" name="{{ $fieldname }}" id="{{ $fieldname }}" value="{{ old('serial', $item->serial) }}" />
{!! $errors->first('serial', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!} {!! $errors->first('serial', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div> </div>

View file

@ -1,7 +1,7 @@
<!-- Status --> <!-- Status -->
<div class="form-group {{ $errors->has('status_id') ? ' has-error' : '' }}"> <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> <label for="status_id" class="col-md-3 control-label">{{ trans('admin/hardware/form.status') }}</label>
<div class="col-md-7 col-sm-11{{ (\App\Helpers\Helper::checkIfRequired($item, 'status_id')) ? ' required' : '' }}"> <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")) }} {{ 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>') !!} {!! $errors->first('status_id', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div> </div>

View file

@ -1,7 +1,7 @@
<!-- Supplier --> <!-- Supplier -->
<div class="form-group {{ $errors->has('supplier_id') ? ' has-error' : '' }}"> <div class="form-group {{ $errors->has('supplier_id') ? ' has-error' : '' }}">
<label for="supplier_id" class="col-md-3 control-label">{{ trans('general.supplier') }}</label> <label for="supplier_id" class="col-md-3 control-label">{{ trans('general.supplier') }}</label>
<div class="col-md-7{{ (\App\Helpers\Helper::checkIfRequired($item, 'supplier_id')) ? ' required' : '' }}"> <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']) }} {{ 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>') !!} {!! $errors->first('supplier_id', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div> </div>

View file

@ -34,7 +34,7 @@
<label class="btn btn-default"> <label class="btn btn-default">
{{ trans('button.select_file') }} {{ trans('button.select_file') }}
<input type="file" name="{{ $logoVariable }}" class="js-uploadFile" id="{{ $logoId }}" <input type="file" name="{{ $logoVariable }}" class="js-uploadFile" id="{{ $logoId }}"
data-maxsize="{{ $maxSize ?? \App\Helpers\Helper::file_upload_max_size() }}" data-maxsize="{{ $maxSize ?? Helper::file_upload_max_size() }}"
accept="{{ $allowedTypes ?? 'image/gif,image/jpeg,image/png,image/svg,image/svg+xml'}}" style="display:none; max-width: 90%"> accept="{{ $allowedTypes ?? 'image/gif,image/jpeg,image/png,image/svg,image/svg+xml'}}" style="display:none; max-width: 90%">
</label> </label>
<span class='label label-default' id="{{ $logoId }}-info"></span> <span class='label label-default' id="{{ $logoId }}-info"></span>

View file

@ -273,7 +273,7 @@
<div class="form-group"> <div class="form-group">
<label for="by_status_id" class="col-md-3 control-label">{{ trans('admin/hardware/form.status') }}</label> <label for="by_status_id" class="col-md-3 control-label">{{ trans('admin/hardware/form.status') }}</label>
<div class="col-md-7 col-sm-11"> <div class="col-md-7 col-sm-11">
{{ Form::select('by_status_id', \App\Helpers\Helper::statusLabelList() , old('by_status_id'), array('class'=>'select2', 'style'=>'width:100%', 'aria-label'=>'by_status_id')) }} {{ Form::select('by_status_id', Helper::statusLabelList() , old('by_status_id'), array('class'=>'select2', 'style'=>'width:100%', 'aria-label'=>'by_status_id')) }}
</div> </div>
</div> </div>

View file

@ -66,7 +66,7 @@
@if ($asset->purchase_cost > 0) @if ($asset->purchase_cost > 0)
<td class="align-right"> <td class="align-right">
{{ $snipeSettings->default_currency }} {{ $snipeSettings->default_currency }}
{{ \App\Helpers\Helper::formatCurrencyOutput($asset->purchase_cost) }} {{ Helper::formatCurrencyOutput($asset->purchase_cost) }}
</td> </td>
<td class="align-right"> <td class="align-right">
{{ $snipeSettings->default_currency }} {{ $snipeSettings->default_currency }}

View file

@ -63,16 +63,16 @@
<td>{{ $license->expiration_date }}</td> <td>{{ $license->expiration_date }}</td>
<td>{{ $license->purchase_date }}</td> <td>{{ $license->purchase_date }}</td>
<td class="text-right"> <td class="text-right">
{{ $snipeSettings->default_currency }}{{ \App\Helpers\Helper::formatCurrencyOutput($license->purchase_cost) }} {{ $snipeSettings->default_currency }}{{ Helper::formatCurrencyOutput($license->purchase_cost) }}
</td> </td>
<td> <td>
{{ ($license->depreciation) ? e($license->depreciation->name).' ('.$license->depreciation->months.' '.trans('general.months').')' : '' }} {{ ($license->depreciation) ? e($license->depreciation->name).' ('.$license->depreciation->months.' '.trans('general.months').')' : '' }}
</td> </td>
<td class="text-right"> <td class="text-right">
{{ $snipeSettings->default_currency }}{{ \App\Helpers\Helper::formatCurrencyOutput($license->getDepreciatedValue()) }} {{ $snipeSettings->default_currency }}{{ Helper::formatCurrencyOutput($license->getDepreciatedValue()) }}
</td> </td>
<td class="text-right"> <td class="text-right">
-{{ $snipeSettings->default_currency }}{{ \App\Helpers\Helper::formatCurrencyOutput(($license->purchase_cost - $license->getDepreciatedValue())) }} -{{ $snipeSettings->default_currency }}{{ Helper::formatCurrencyOutput(($license->purchase_cost - $license->getDepreciatedValue())) }}
</td> </td>
</tr> </tr>
@endforeach @endforeach

View file

@ -77,7 +77,7 @@
"logoId" => "uploadLogo", "logoId" => "uploadLogo",
"logoLabel" => trans('admin/settings/general.logo'), "logoLabel" => trans('admin/settings/general.logo'),
"logoClearVariable" => "clear_logo", "logoClearVariable" => "clear_logo",
"helpBlock" => trans('general.logo_size') . trans('general.image_filetypes_help', ['size' => \App\Helpers\Helper::file_upload_max_size_readable()]), "helpBlock" => trans('general.logo_size') . trans('general.image_filetypes_help', ['size' => Helper::file_upload_max_size_readable()]),
]) ])
<!-- Email Logo --> <!-- Email Logo -->
@ -86,7 +86,7 @@
"logoId" => "uploadEmailLogo", "logoId" => "uploadEmailLogo",
"logoLabel" => trans('admin/settings/general.email_logo'), "logoLabel" => trans('admin/settings/general.email_logo'),
"logoClearVariable" => "clear_email_logo", "logoClearVariable" => "clear_email_logo",
"helpBlock" => trans('admin/settings/general.email_logo_size') . trans('general.image_filetypes_help', ['size' => \App\Helpers\Helper::file_upload_max_size_readable()]), "helpBlock" => trans('admin/settings/general.email_logo_size') . trans('general.image_filetypes_help', ['size' => Helper::file_upload_max_size_readable()]),
]) ])
<!-- Label Logo --> <!-- Label Logo -->
@ -95,7 +95,7 @@
"logoId" => "uploadLabelLogo", "logoId" => "uploadLabelLogo",
"logoLabel" => trans('admin/settings/general.label_logo'), "logoLabel" => trans('admin/settings/general.label_logo'),
"logoClearVariable" => "clear_label_logo", "logoClearVariable" => "clear_label_logo",
"helpBlock" => trans('admin/settings/general.label_logo_size') . trans('general.image_filetypes_help', ['size' => \App\Helpers\Helper::file_upload_max_size_readable()]), "helpBlock" => trans('admin/settings/general.label_logo_size') . trans('general.image_filetypes_help', ['size' => Helper::file_upload_max_size_readable()]),
]) ])
<!-- Favicon --> <!-- Favicon -->

View file

@ -105,7 +105,7 @@
{!! $errors->first('saml_idp_metadata', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}<br> {!! $errors->first('saml_idp_metadata', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}<br>
<button type="button" class="btn btn-default" id="saml_idp_metadata_upload_btn">{{ trans('button.select_file') }}</button> <button type="button" class="btn btn-default" id="saml_idp_metadata_upload_btn">{{ trans('button.select_file') }}</button>
<input type="file" class="js-uploadFile" id="saml_idp_metadata_upload" <input type="file" class="js-uploadFile" id="saml_idp_metadata_upload"
data-maxsize="{{ \App\Helpers\Helper::file_upload_max_size() }}" data-maxsize="{{ Helper::file_upload_max_size() }}"
accept="text/xml,application/xml" style="display:none; max-width: 90%"> accept="text/xml,application/xml" style="display:none; max-width: 90%">
<p class="help-block">{{ trans('admin/settings/general.saml_idp_metadata_help') }}</p> <p class="help-block">{{ trans('admin/settings/general.saml_idp_metadata_help') }}</p>

View file

@ -29,7 +29,7 @@ Create a User ::
<div class="row"> <div class="row">
<!-- Language --> <!-- Language -->
<div class="form-group col-lg-6{{ (\App\Helpers\Helper::checkIfRequired(\App\Models\User::class, 'default_language')) ? ' required' : '' }} {{$errors->has('default_language') ? 'error' : ''}}"> <div class="form-group col-lg-6{{ (Helper::checkIfRequired(\App\Models\User::class, 'default_language')) ? ' required' : '' }} {{$errors->has('default_language') ? 'error' : ''}}">
{{ Form::label('locale', trans('admin/settings/general.default_language')) }} {{ Form::label('locale', trans('admin/settings/general.default_language')) }}
{!! Form::locales('locale', Request::old('locale', "en"), 'select2') !!} {!! Form::locales('locale', Request::old('locale', "en"), 'select2') !!}
@ -37,7 +37,7 @@ Create a User ::
</div> </div>
<!-- Currency --> <!-- Currency -->
<div class="form-group col-lg-6{{ (\App\Helpers\Helper::checkIfRequired(\App\Models\User::class, 'default_currency')) ? ' required' : '' }} {{$errors->has('default_currency') ? 'error' : ''}}"> <div class="form-group col-lg-6{{ (Helper::checkIfRequired(\App\Models\User::class, 'default_currency')) ? ' required' : '' }} {{$errors->has('default_currency') ? 'error' : ''}}">
{{ Form::label('default_currency', trans('admin/settings/general.default_currency')) }} {{ Form::label('default_currency', trans('admin/settings/general.default_currency')) }}
{{ Form::text('default_currency', Request::old('default_currency'), array('class' => 'form-control','placeholder' => 'USD', 'maxlength'=>'3', 'style'=>'width: 60px;')) }} {{ Form::text('default_currency', Request::old('default_currency'), array('class' => 'form-control','placeholder' => 'USD', 'maxlength'=>'3', 'style'=>'width: 60px;')) }}
@ -72,14 +72,14 @@ Create a User ::
<div class="row"> <div class="row">
<div class="form-group col-lg-6{{ (\App\Helpers\Helper::checkIfRequired(\App\Models\User::class, 'auto_increment_prefix')) ? ' required' : '' }} {{ $errors->has('auto_increment_prefix') ? 'error' : '' }}"> <div class="form-group col-lg-6{{ (Helper::checkIfRequired(\App\Models\User::class, 'auto_increment_prefix')) ? ' required' : '' }} {{ $errors->has('auto_increment_prefix') ? 'error' : '' }}">
{{ Form::label('auto_increment_prefix', trans('admin/settings/general.auto_increment_prefix')) }} {{ Form::label('auto_increment_prefix', trans('admin/settings/general.auto_increment_prefix')) }}
{{ Form::text('auto_increment_prefix', Request::old('auto_increment_prefix'), array('class' => 'form-control')) }} {{ Form::text('auto_increment_prefix', Request::old('auto_increment_prefix'), array('class' => 'form-control')) }}
{!! $errors->first('auto_increment_prefix', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('auto_increment_prefix', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div> </div>
<div class="form-group col-lg-6{{ (\App\Helpers\Helper::checkIfRequired(\App\Models\User::class, 'zerofill_count')) ? ' required' : '' }} {{ $errors->has('zerofill_count') ? 'error' : '' }}"> <div class="form-group col-lg-6{{ (Helper::checkIfRequired(\App\Models\User::class, 'zerofill_count')) ? ' required' : '' }} {{ $errors->has('zerofill_count') ? 'error' : '' }}">
{{ Form::label('zerofill_count', trans('admin/settings/general.zerofill_count')) }} {{ Form::label('zerofill_count', trans('admin/settings/general.zerofill_count')) }}
{{ Form::text('zerofill_count', Request::old('zerofill_count', 5), array('class' => 'form-control')) }} {{ Form::text('zerofill_count', Request::old('zerofill_count', 5), array('class' => 'form-control')) }}
@ -99,7 +99,7 @@ Create a User ::
</div> </div>
<!-- email format --> <!-- email format -->
<div class="form-group col-lg-6{{ (\App\Helpers\Helper::checkIfRequired(\App\Models\User::class, 'email_format')) ? ' required' : '' }} {{ $errors->has('email_format') ? 'error' : '' }}"> <div class="form-group col-lg-6{{ (Helper::checkIfRequired(\App\Models\User::class, 'email_format')) ? ' required' : '' }} {{ $errors->has('email_format') ? 'error' : '' }}">
{{ Form::label('email_format', trans('general.email_format')) }} {{ Form::label('email_format', trans('general.email_format')) }}
{!! Form::username_format('email_format', old('email_format', 'filastname'), 'select2') !!} {!! Form::username_format('email_format', old('email_format', 'filastname'), 'select2') !!}
{!! $errors->first('email_format', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('email_format', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@ -109,7 +109,7 @@ Create a User ::
<!-- Name --> <!-- Name -->
<div class="row"> <div class="row">
<!-- first name --> <!-- first name -->
<div class="form-group col-lg-6{{ (\App\Helpers\Helper::checkIfRequired(\App\Models\User::class, 'first_name')) ? ' required' : '' }} {{ $errors->has('first_name') ? 'error' : '' }}"> <div class="form-group col-lg-6{{ (Helper::checkIfRequired(\App\Models\User::class, 'first_name')) ? ' required' : '' }} {{ $errors->has('first_name') ? 'error' : '' }}">
{{ Form::label('first_name', trans('general.first_name')) }} {{ Form::label('first_name', trans('general.first_name')) }}
{{ Form::text('first_name', old('first_name'), array('class' => 'form-control','placeholder' => 'Jane')) }} {{ Form::text('first_name', old('first_name'), array('class' => 'form-control','placeholder' => 'Jane')) }}
{!! $errors->first('first_name', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('first_name', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@ -125,14 +125,14 @@ Create a User ::
<div class="row"> <div class="row">
<!-- email--> <!-- email-->
<div class="form-group col-lg-6{{ (\App\Helpers\Helper::checkIfRequired(\App\Models\User::class, 'email')) ? ' required' : '' }} {{ $errors->has('email') ? 'error' : '' }}"> <div class="form-group col-lg-6{{ (Helper::checkIfRequired(\App\Models\User::class, 'email')) ? ' required' : '' }} {{ $errors->has('email') ? 'error' : '' }}">
{{ Form::label('email', trans('admin/users/table.email')) }} {{ Form::label('email', trans('admin/users/table.email')) }}
{{ Form::email('email', config('mail.from.address'), array('class' => 'form-control','placeholder' => 'you@example.com')) }} {{ Form::email('email', config('mail.from.address'), array('class' => 'form-control','placeholder' => 'you@example.com')) }}
{!! $errors->first('email', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('email', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div> </div>
<!-- username --> <!-- username -->
<div class="form-group col-lg-6{{ (\App\Helpers\Helper::checkIfRequired(\App\Models\User::class, 'username')) ? ' required' : '' }} {{ $errors->has('username') ? 'error' : '' }}"> <div class="form-group col-lg-6{{ (Helper::checkIfRequired(\App\Models\User::class, 'username')) ? ' required' : '' }} {{ $errors->has('username') ? 'error' : '' }}">
{{ Form::label('username', trans('admin/users/table.username')) }} {{ Form::label('username', trans('admin/users/table.username')) }}
{{ Form::text('username', old('username'), array('class' => 'form-control','placeholder' => 'jsmith')) }} {{ Form::text('username', old('username'), array('class' => 'form-control','placeholder' => 'jsmith')) }}
{!! $errors->first('username', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('username', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@ -141,14 +141,14 @@ Create a User ::
<div class="row"> <div class="row">
<!-- password --> <!-- password -->
<div class="form-group col-lg-6{{ (\App\Helpers\Helper::checkIfRequired(\App\Models\User::class, 'password')) ? ' required' : '' }} {{ $errors->has('password') ? 'error' : '' }}"> <div class="form-group col-lg-6{{ (Helper::checkIfRequired(\App\Models\User::class, 'password')) ? ' required' : '' }} {{ $errors->has('password') ? 'error' : '' }}">
{{ Form::label('password', trans('admin/users/table.password')) }} {{ Form::label('password', trans('admin/users/table.password')) }}
{{ Form::password('password', array('class' => 'form-control')) }} {{ Form::password('password', array('class' => 'form-control')) }}
{!! $errors->first('password', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('password', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div> </div>
<!-- password confirm --> <!-- password confirm -->
<div class="form-group col-lg-6{{ (\App\Helpers\Helper::checkIfRequired(\App\Models\User::class, 'password')) ? ' required' : '' }} {{ $errors->has('password_confirm') ? 'error' : '' }}"> <div class="form-group col-lg-6{{ (Helper::checkIfRequired(\App\Models\User::class, 'password')) ? ' required' : '' }} {{ $errors->has('password_confirm') ? 'error' : '' }}">
{{ Form::label('password_confirmation', trans('admin/users/table.password_confirm')) }} {{ Form::label('password_confirmation', trans('admin/users/table.password_confirm')) }}
{{ Form::password('password_confirmation', array('class' => 'form-control')) }} {{ Form::password('password_confirmation', array('class' => 'form-control')) }}
{!! $errors->first('password_confirmation', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('password_confirmation', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}

View file

@ -87,7 +87,7 @@
<!-- First Name --> <!-- First Name -->
<div class="form-group {{ $errors->has('first_name') ? 'has-error' : '' }}"> <div class="form-group {{ $errors->has('first_name') ? 'has-error' : '' }}">
<label class="col-md-3 control-label" for="first_name">{{ trans('general.first_name') }}</label> <label class="col-md-3 control-label" for="first_name">{{ trans('general.first_name') }}</label>
<div class="col-md-6{{ (\App\Helpers\Helper::checkIfRequired($user, 'first_name')) ? ' required' : '' }}"> <div class="col-md-6{{ (Helper::checkIfRequired($user, 'first_name')) ? ' required' : '' }}">
<input class="form-control" type="text" name="first_name" id="first_name" value="{{ old('first_name', $user->first_name) }}" /> <input class="form-control" type="text" name="first_name" id="first_name" value="{{ old('first_name', $user->first_name) }}" />
{!! $errors->first('first_name', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('first_name', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div> </div>
@ -96,7 +96,7 @@
<!-- Last Name --> <!-- Last Name -->
<div class="form-group {{ $errors->has('last_name') ? 'has-error' : '' }}"> <div class="form-group {{ $errors->has('last_name') ? 'has-error' : '' }}">
<label class="col-md-3 control-label" for="last_name">{{ trans('general.last_name') }} </label> <label class="col-md-3 control-label" for="last_name">{{ trans('general.last_name') }} </label>
<div class="col-md-6{{ (\App\Helpers\Helper::checkIfRequired($user, 'last_name')) ? ' required' : '' }}"> <div class="col-md-6{{ (Helper::checkIfRequired($user, 'last_name')) ? ' required' : '' }}">
<input class="form-control" type="text" name="last_name" id="last_name" value="{{ old('last_name', $user->last_name) }}" /> <input class="form-control" type="text" name="last_name" id="last_name" value="{{ old('last_name', $user->last_name) }}" />
{!! $errors->first('last_name', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('last_name', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div> </div>
@ -105,7 +105,7 @@
<!-- Username --> <!-- Username -->
<div class="form-group {{ $errors->has('username') ? 'has-error' : '' }}"> <div class="form-group {{ $errors->has('username') ? 'has-error' : '' }}">
<label class="col-md-3 control-label" for="username">{{ trans('admin/users/table.username') }}</label> <label class="col-md-3 control-label" for="username">{{ trans('admin/users/table.username') }}</label>
<div class="col-md-6{{ (\App\Helpers\Helper::checkIfRequired($user, 'username')) ? ' required' : '' }}"> <div class="col-md-6{{ (Helper::checkIfRequired($user, 'username')) ? ' required' : '' }}">
@if ($user->ldap_import!='1' || str_contains(Route::currentRouteName(), 'clone')) @if ($user->ldap_import!='1' || str_contains(Route::currentRouteName(), 'clone'))
<input <input
class="form-control" class="form-control"
@ -136,7 +136,7 @@
<label class="col-md-3 control-label" for="password"> <label class="col-md-3 control-label" for="password">
{{ trans('admin/users/table.password') }} {{ trans('admin/users/table.password') }}
</label> </label>
<div class="col-md-6{{ (\App\Helpers\Helper::checkIfRequired($user, 'password')) ? ' required' : '' }}"> <div class="col-md-6{{ (Helper::checkIfRequired($user, 'password')) ? ' required' : '' }}">
@if ($user->ldap_import!='1' || str_contains(Route::currentRouteName(), 'clone') ) @if ($user->ldap_import!='1' || str_contains(Route::currentRouteName(), 'clone') )
<input <input
type="password" type="password"
@ -167,7 +167,7 @@
<label class="col-md-3 control-label" for="password_confirmation"> <label class="col-md-3 control-label" for="password_confirmation">
{{ trans('admin/users/table.password_confirm') }} {{ trans('admin/users/table.password_confirm') }}
</label> </label>
<div class="col-md-6{{ ((\App\Helpers\Helper::checkIfRequired($user, 'first_name')) && (!$user->id)) ? ' required' : '' }}"> <div class="col-md-6{{ ((Helper::checkIfRequired($user, 'first_name')) && (!$user->id)) ? ' required' : '' }}">
<input <input
type="password" type="password"
name="password_confirmation" name="password_confirmation"
@ -230,7 +230,7 @@
<!-- Email --> <!-- Email -->
<div class="form-group {{ $errors->has('email') ? 'has-error' : '' }}"> <div class="form-group {{ $errors->has('email') ? 'has-error' : '' }}">
<label class="col-md-3 control-label" for="email">{{ trans('admin/users/table.email') }} </label> <label class="col-md-3 control-label" for="email">{{ trans('admin/users/table.email') }} </label>
<div class="col-md-6{{ (\App\Helpers\Helper::checkIfRequired($user, 'email')) ? ' required' : '' }}"> <div class="col-md-6{{ (Helper::checkIfRequired($user, 'email')) ? ' required' : '' }}">
<input <input
class="form-control" class="form-control"
type="text" type="text"

View file

@ -37,10 +37,10 @@ $I->dontSeeInSource('&lt;br&gt;&lt;');
$I->click(['name' => 'email']); $I->click(['name' => 'email']);
$I->click(['name' => 'username']); $I->click(['name' => 'username']);
$I->submitForm('#userForm', [ $I->submitForm('#userForm', [
'email' => \App\Helpers\Helper::generateRandomString(15).'@example.com', 'email' => Helper::generateRandomString(15).'@example.com',
'first_name' => 'Joe', 'first_name' => 'Joe',
'last_name' => 'Smith', 'last_name' => 'Smith',
'username' => \App\Helpers\Helper::generateRandomString(15), 'username' => Helper::generateRandomString(15),
]); ]);
$I->seeElement('.alert-danger'); $I->seeElement('.alert-danger');
@ -49,11 +49,11 @@ $I->dontSeeInSource('&lt;br&gt;&lt;');
/* Submit form and expect success */ /* Submit form and expect success */
$I->wantTo('submit the form successfully'); $I->wantTo('submit the form successfully');
$I->click(['name' => 'email']); $I->click(['name' => 'email']);
$I->fillField(['name' => 'email'], \App\Helpers\Helper::generateRandomString(15).'@example.com'); $I->fillField(['name' => 'email'], Helper::generateRandomString(15).'@example.com');
$I->fillField(['name' => 'first_name'], 'Joe'); $I->fillField(['name' => 'first_name'], 'Joe');
$I->fillField(['name' => 'last_name'], 'Smith'); $I->fillField(['name' => 'last_name'], 'Smith');
$I->click(['name' => 'username']); $I->click(['name' => 'username']);
$I->fillField(['name' => 'username'], \App\Helpers\Helper::generateRandomString(15)); $I->fillField(['name' => 'username'], Helper::generateRandomString(15));
$I->click(['name' => 'password']); $I->click(['name' => 'password']);
$I->fillField(['name' => 'password'], 'password'); $I->fillField(['name' => 'password'], 'password');
$I->click(['name' => 'password_confirmation']); $I->click(['name' => 'password_confirmation']);