mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 05:04:07 -08:00
Use Helper alias
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
9a83b90e44
commit
61f16f47a2
|
@ -21,7 +21,7 @@ class AssetFileRequest extends Request
|
|||
*/
|
||||
public function rules()
|
||||
{
|
||||
$max_file_size = \App\Helpers\Helper::file_upload_max_size();
|
||||
$max_file_size = Helper::file_upload_max_size();
|
||||
|
||||
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,
|
||||
|
|
|
@ -24,7 +24,7 @@ class ActionlogsTransformer
|
|||
{
|
||||
$icon = $actionlog->present()->icon();
|
||||
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
|
||||
|
@ -75,7 +75,7 @@ class ActionlogsTransformer
|
|||
[
|
||||
'url' => route('show/assetfile', ['assetId' => $actionlog->item->id, 'fileId' => $actionlog->id]),
|
||||
'filename' => $actionlog->filename,
|
||||
'inlineable' => (bool) \App\Helpers\Helper::show_file_inline($actionlog->filename),
|
||||
'inlineable' => (bool) Helper::show_file_inline($actionlog->filename),
|
||||
] : null,
|
||||
|
||||
'item' => ($actionlog->item) ? [
|
||||
|
|
|
@ -88,7 +88,7 @@ class AssetsTransformer
|
|||
|
||||
foreach ($asset->model->fieldset->fields as $field) {
|
||||
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'));
|
||||
|
||||
$fields_array[$field->name] = [
|
||||
|
|
|
@ -62,9 +62,9 @@ class DepreciationReportTransformer
|
|||
* Override the previously set null values if there is a valid model and associated depreciation
|
||||
*/
|
||||
if (($asset->model) && ($asset->model->depreciation)) {
|
||||
$depreciated_value = \App\Helpers\Helper::formatCurrencyOutput($asset->getDepreciatedValue());
|
||||
$monthly_depreciation = \App\Helpers\Helper::formatCurrencyOutput(($asset->model->eol > 0 ? ($asset->purchase_cost / $asset->model->eol) : 0));
|
||||
$diff = \App\Helpers\Helper::formatCurrencyOutput(($asset->purchase_cost - $asset->getDepreciatedValue()));
|
||||
$depreciated_value = Helper::formatCurrencyOutput($asset->getDepreciatedValue());
|
||||
$monthly_depreciation = Helper::formatCurrencyOutput(($asset->model->eol > 0 ? ($asset->purchase_cost / $asset->model->eol) : 0));
|
||||
$diff = Helper::formatCurrencyOutput(($asset->purchase_cost - $asset->getDepreciatedValue()));
|
||||
}
|
||||
|
||||
if ($asset->assigned) {
|
||||
|
|
|
@ -30,7 +30,7 @@ class CheckinAssetNotification extends Notification
|
|||
$this->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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,12 +33,12 @@ class CheckoutAssetNotification extends Notification
|
|||
$this->expected_checkin = '';
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -397,6 +397,7 @@ return [
|
|||
'Google2FA' => PragmaRX\Google2FALaravel\Facade::class,
|
||||
'Image' => Intervention\Image\ImageServiceProvider::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)
|
||||
|
||||
],
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
<label for="title" class="col-md-3 control-label">
|
||||
{{ trans('admin/asset_maintenances/form.title') }}
|
||||
</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) }}" />
|
||||
{!! $errors->first('title', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
|
@ -60,7 +60,7 @@
|
|||
<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>
|
||||
|
||||
<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">
|
||||
<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>
|
||||
|
@ -75,7 +75,7 @@
|
|||
<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>
|
||||
|
||||
<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">
|
||||
<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>
|
||||
|
@ -107,7 +107,7 @@
|
|||
{{ $snipeSettings->default_currency }}
|
||||
@endif
|
||||
</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>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -128,7 +128,7 @@
|
|||
<div class="col-md-12" style="padding-bottom: 5px;"><strong>{{ trans('admin/components/general.cost') }}:</strong>
|
||||
{{ $snipeSettings->default_currency }}
|
||||
|
||||
{{ \App\Helpers\Helper::formatCurrencyOutput($component->purchase_cost) }} </div>
|
||||
{{ Helper::formatCurrencyOutput($component->purchase_cost) }} </div>
|
||||
@endif
|
||||
|
||||
@if ($component->order_number)
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
@if ($consumable->purchase_date)
|
||||
<div class="col-md-12" style="padding-bottom: 15px;">
|
||||
<strong>{{ trans('general.purchase_date') }}: </strong>
|
||||
{{ \App\Helpers\Helper::getFormattedDateObject($consumable->purchase_date, 'date', false) }}
|
||||
{{ Helper::getFormattedDateObject($consumable->purchase_date, 'date', false) }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
@ -93,7 +93,7 @@
|
|||
<div class="col-md-12" style="padding-bottom: 15px;">
|
||||
<strong>{{ trans('general.purchase_cost') }}:</strong>
|
||||
{{ $snipeSettings->default_currency }}
|
||||
{{ \App\Helpers\Helper::formatCurrencyOutput($consumable->purchase_cost) }}
|
||||
{{ Helper::formatCurrencyOutput($consumable->purchase_cost) }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@
|
|||
{{ trans('admin/custom_fields/general.field_format') }}
|
||||
</label>
|
||||
<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>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<label for="months" class="col-md-3 control-label">
|
||||
{{ trans('admin/depreciations/general.number_of_months') }}
|
||||
</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;" />
|
||||
{!! $errors->first('months', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
|
|
|
@ -22,14 +22,14 @@
|
|||
|
||||
<!-- we are editing an existing asset -->
|
||||
@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">
|
||||
{!! $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>') !!}
|
||||
</div>
|
||||
@else
|
||||
<!-- 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">
|
||||
{!! $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>') !!}
|
||||
|
|
|
@ -267,7 +267,7 @@
|
|||
</strong>
|
||||
</div>
|
||||
<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>
|
||||
@endif
|
||||
|
@ -280,7 +280,7 @@
|
|||
</strong>
|
||||
</div>
|
||||
<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>
|
||||
@endif
|
||||
|
@ -419,9 +419,9 @@
|
|||
@if ($field->isFieldDecryptable($asset->{$field->db_column_name()} ))
|
||||
@can('superuser')
|
||||
@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
|
||||
{{ \App\Helpers\Helper::gracefulDecrypt($field, $asset->{$field->db_column_name()}) }}
|
||||
{{ Helper::gracefulDecrypt($field, $asset->{$field->db_column_name()}) }}
|
||||
@endif
|
||||
@else
|
||||
{{ strtoupper(trans('admin/custom_fields/general.encrypted')) }}
|
||||
|
@ -448,7 +448,7 @@
|
|||
</strong>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
{{ \App\Helpers\Helper::getFormattedDateObject($asset->purchase_date, 'date', false) }}
|
||||
{{ Helper::getFormattedDateObject($asset->purchase_date, 'date', false) }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
@ -468,7 +468,7 @@
|
|||
@else
|
||||
{{ $snipeSettings->default_currency }}
|
||||
@endif
|
||||
{{ \App\Helpers\Helper::formatCurrencyOutput($asset->purchase_cost)}}
|
||||
{{ Helper::formatCurrencyOutput($asset->purchase_cost)}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -489,7 +489,7 @@
|
|||
@else
|
||||
{{ $snipeSettings->default_currency }}
|
||||
@endif
|
||||
{{ \App\Helpers\Helper::formatCurrencyOutput($asset->getDepreciatedValue() )}}
|
||||
{{ Helper::formatCurrencyOutput($asset->getDepreciatedValue() )}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -625,7 +625,7 @@
|
|||
</strong>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
{{ \App\Helpers\Helper::getFormattedDateObject($asset->expected_checkin, 'date', false) }}
|
||||
{{ Helper::getFormattedDateObject($asset->expected_checkin, 'date', false) }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
@ -687,7 +687,7 @@
|
|||
</strong>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
{{ \App\Helpers\Helper::getFormattedDateObject($asset->created_at, 'datetime', false) }}
|
||||
{{ Helper::getFormattedDateObject($asset->created_at, 'datetime', false) }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
@ -700,7 +700,7 @@
|
|||
</strong>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
{{ \App\Helpers\Helper::getFormattedDateObject($asset->updated_at, 'datetime', false) }}
|
||||
{{ Helper::getFormattedDateObject($asset->updated_at, 'datetime', false) }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
@ -712,7 +712,7 @@
|
|||
</strong>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
{{ \App\Helpers\Helper::getFormattedDateObject($asset->last_checkout, 'datetime', false) }}
|
||||
{{ Helper::getFormattedDateObject($asset->last_checkout, 'datetime', false) }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
@ -1112,15 +1112,15 @@
|
|||
|
||||
@foreach ($asset->uploads as $file)
|
||||
<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>
|
||||
@if ($file->note)
|
||||
{{ $file->note }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ( \App\Helpers\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) }}">
|
||||
@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="{{ Helper::getFormattedDateObject($asset->last_checkout, 'datetime', false) }}">
|
||||
<img src="{{ route('show/assetfile', ['assetId' => $asset->id, 'fileId' =>$file->id]) }}" style="max-width: 50px;">
|
||||
</a>
|
||||
@endif
|
||||
|
@ -1138,7 +1138,7 @@
|
|||
|
||||
<td>
|
||||
@if ($file->created_at)
|
||||
{{ \App\Helpers\Helper::getFormattedDateObject($file->created_at, 'datetime', false) }}
|
||||
{{ Helper::getFormattedDateObject($file->created_at, 'datetime', false) }}
|
||||
@endif
|
||||
</td>
|
||||
|
||||
|
|
|
@ -253,7 +253,7 @@
|
|||
@can('admin')
|
||||
@if ($snipeSettings->show_alerts_in_menu=='1')
|
||||
<!-- 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">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
@can('viewKeys', $item)
|
||||
<div class="form-group {{ $errors->has('serial') ? ' has-error' : '' }}">
|
||||
<label for="serial" class="col-md-3 control-label">{{ trans('admin/licenses/form.license_key') }}</label>
|
||||
<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>
|
||||
{!! $errors->first('serial', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
|
|
|
@ -222,7 +222,7 @@
|
|||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ \App\Helpers\Helper::getFormattedDateObject($license->expiration_date, 'date', false) }}
|
||||
{{ Helper::getFormattedDateObject($license->expiration_date, 'date', false) }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
@ -235,7 +235,7 @@
|
|||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ \App\Helpers\Helper::getFormattedDateObject($license->termination_date, 'date', false) }}
|
||||
{{ Helper::getFormattedDateObject($license->termination_date, 'date', false) }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
@ -263,7 +263,7 @@
|
|||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ \App\Helpers\Helper::getFormattedDateObject($license->depreciated_date(), 'date', false) }}
|
||||
{{ Helper::getFormattedDateObject($license->depreciated_date(), 'date', false) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -305,7 +305,7 @@
|
|||
<strong>{{ trans('general.purchase_date') }}</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ \App\Helpers\Helper::getFormattedDateObject($license->purchase_date, 'date', false) }}
|
||||
{{ Helper::getFormattedDateObject($license->purchase_date, 'date', false) }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -320,7 +320,7 @@
|
|||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ $snipeSettings->default_currency }}
|
||||
{{ \App\Helpers\Helper::formatCurrencyOutput($license->purchase_cost) }}
|
||||
{{ Helper::formatCurrencyOutput($license->purchase_cost) }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
@ -457,8 +457,8 @@
|
|||
@foreach ($license->uploads as $file)
|
||||
<tr>
|
||||
<td>
|
||||
<i class="{{ \App\Helpers\Helper::filetype_icon($file->filename) }} icon-med" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ \App\Helpers\Helper::filetype_icon($file->filename) }}</span>
|
||||
<i class="{{ Helper::filetype_icon($file->filename) }} icon-med" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ Helper::filetype_icon($file->filename) }}</span>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
@ -473,7 +473,7 @@
|
|||
<td>{{ $file->created_at }}</td>
|
||||
<td>
|
||||
@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>
|
||||
@endif
|
||||
@endif
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<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>
|
||||
<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>') !!}
|
||||
<label class="m-l-xs">
|
||||
{{-- {{ Form::checkbox('add_default_values', 1, Request::old('add_default_values'), ['class' => 'js-default-values-toggler']) }} --}}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<label for="currency" class="col-md-3 control-label">
|
||||
{{ trans('admin/locations/table.currency') }}
|
||||
</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')) }}
|
||||
{!! $errors->first('currency', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
</div>
|
||||
|
@ -36,7 +36,7 @@
|
|||
<label for="ldap_ou" class="col-md-3 control-label">
|
||||
{{ trans('admin/locations/table.ldap_ou') }}
|
||||
</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')) }}
|
||||
{!! $errors->first('ldap_ou', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
</div>
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
<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-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 class="modal-footer">
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
<label class="btn btn-default">
|
||||
{{ 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>
|
||||
|
||||
</div>
|
||||
|
@ -27,7 +27,7 @@
|
|||
<span id="uploadFile-info"></span>
|
||||
</div>
|
||||
<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 class="col-md-12">
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<!-- Listbox -->
|
||||
@if ($field->element=='listbox')
|
||||
{{ 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')
|
||||
<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 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>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -56,7 +56,7 @@
|
|||
|
||||
@else
|
||||
@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
|
||||
<input type="text" value="{{ strtoupper(trans('admin/custom_fields/general.encrypted')) }}" class="form-control disabled" disabled>
|
||||
@endif
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
{{-- <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>
|
||||
<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>') !!}
|
||||
<label class="m-l-xs">
|
||||
{{-- {{ Form::checkbox('add_default_values', 1, Request::old('add_default_values'), ['class' => 'js-default-values-toggler']) }} --}}
|
||||
|
|
|
@ -8,7 +8,7 @@ The following {{ $assets->count() }} items are due to be checked in soon:
|
|||
| ------------- | ------------- | ------------- |
|
||||
@foreach ($assets as $asset)
|
||||
@php
|
||||
$checkin = \App\Helpers\Helper::getFormattedDateObject($asset->expected_checkin, 'date');
|
||||
$checkin = Helper::getFormattedDateObject($asset->expected_checkin, 'date');
|
||||
@endphp
|
||||
| [{{ $asset->present()->name }}]({{ route('hardware.show', ['hardware' => $asset->id]) }}) | [{{ $asset->assigned->present()->fullName }}]({{ route('users.show', ['user'=>$asset->assigned->id]) }}) | {{ $checkin['formatted'] }}
|
||||
@endforeach
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<tr><td> </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)
|
||||
@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);
|
||||
$icon = ($diff <= ($threshold / 2)) ? '🚨' : (($diff <= $threshold) ? '⚠️' : ' ');
|
||||
@endphp
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<tr><td> </td><td>{{ trans('mail.name') }}</td><td>{{ trans('mail.Days') }}</td><td>{{ trans('mail.expires') }}</td></tr>
|
||||
@foreach ($licenses as $license)
|
||||
@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);
|
||||
$icon = ($diff <= ($threshold / 2)) ? '🚨' : (($diff <= $threshold) ? '⚠️' : ' ');
|
||||
@endphp
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
| |:------------- |:-------------|:---------|:---------|:---------|:---------|
|
||||
@foreach ($assets as $asset)
|
||||
@php
|
||||
$next_audit_date = \App\Helpers\Helper::getFormattedDateObject($asset->next_audit_date, 'date', false);
|
||||
$last_audit_date = \App\Helpers\Helper::getFormattedDateObject($asset->last_audit_date, 'date', false);
|
||||
$next_audit_date = Helper::getFormattedDateObject($asset->next_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);
|
||||
$icon = ($diff <= 7) ? '🚨' : (($diff <= 14) ? '⚠️' : ' ');
|
||||
@endphp
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
{{ 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="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} : ''))
|
||||
<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 : '' }}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!-- 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{{ (\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%')) }}
|
||||
{!! $errors->first('category_id', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<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{{ (\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%')) }}
|
||||
{!! $errors->first('company_id', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
|
||||
<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="{{ \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>
|
||||
<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>') !!}
|
||||
</div>
|
||||
<div class="col-md-4 col-md-offset-3" aria-hidden="true">
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!-- 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{{ (\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) }}" />
|
||||
{!! $errors->first('item_no', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
{{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }}
|
||||
<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} : ''))
|
||||
<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 : '' }}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!-- 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{{ (\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')) }}
|
||||
{!! $errors->first('location_id', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<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{{ (\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']) }}
|
||||
{!! $errors->first('asset_maintenance_type', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
{{ 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)) && (\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} : ''))
|
||||
<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 : '' }}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!-- 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{{ (\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%')) }}
|
||||
{!! $errors->first('manufacturer_id', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!-- 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{{ (\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">
|
||||
<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>
|
||||
|
|
|
@ -1,8 +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{{ (\App\Helpers\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' : '' !!} />
|
||||
<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>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<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', \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">
|
||||
@if (isset($currency_type))
|
||||
{{ $currency_type }}
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
<!-- 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{{ (\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">
|
||||
<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>
|
||||
{!! $errors->first('qty', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!-- 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{{ (\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) }}" />
|
||||
{!! $errors->first('serial', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!-- 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{{ (\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")) }}
|
||||
{!! $errors->first('status_id', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!-- 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{{ (\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']) }}
|
||||
{!! $errors->first('supplier_id', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
<label class="btn btn-default">
|
||||
{{ trans('button.select_file') }}
|
||||
<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%">
|
||||
</label>
|
||||
<span class='label label-default' id="{{ $logoId }}-info"></span>
|
||||
|
|
|
@ -273,7 +273,7 @@
|
|||
<div class="form-group">
|
||||
<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">
|
||||
{{ 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>
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
@if ($asset->purchase_cost > 0)
|
||||
<td class="align-right">
|
||||
{{ $snipeSettings->default_currency }}
|
||||
{{ \App\Helpers\Helper::formatCurrencyOutput($asset->purchase_cost) }}
|
||||
{{ Helper::formatCurrencyOutput($asset->purchase_cost) }}
|
||||
</td>
|
||||
<td class="align-right">
|
||||
{{ $snipeSettings->default_currency }}
|
||||
|
|
|
@ -63,16 +63,16 @@
|
|||
<td>{{ $license->expiration_date }}</td>
|
||||
<td>{{ $license->purchase_date }}</td>
|
||||
<td class="text-right">
|
||||
{{ $snipeSettings->default_currency }}{{ \App\Helpers\Helper::formatCurrencyOutput($license->purchase_cost) }}
|
||||
{{ $snipeSettings->default_currency }}{{ Helper::formatCurrencyOutput($license->purchase_cost) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ ($license->depreciation) ? e($license->depreciation->name).' ('.$license->depreciation->months.' '.trans('general.months').')' : '' }}
|
||||
</td>
|
||||
<td class="text-right">
|
||||
{{ $snipeSettings->default_currency }}{{ \App\Helpers\Helper::formatCurrencyOutput($license->getDepreciatedValue()) }}
|
||||
{{ $snipeSettings->default_currency }}{{ Helper::formatCurrencyOutput($license->getDepreciatedValue()) }}
|
||||
</td>
|
||||
<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>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
"logoId" => "uploadLogo",
|
||||
"logoLabel" => trans('admin/settings/general.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 -->
|
||||
|
@ -86,7 +86,7 @@
|
|||
"logoId" => "uploadEmailLogo",
|
||||
"logoLabel" => trans('admin/settings/general.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 -->
|
||||
|
@ -95,7 +95,7 @@
|
|||
"logoId" => "uploadLabelLogo",
|
||||
"logoLabel" => trans('admin/settings/general.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 -->
|
||||
|
|
|
@ -105,7 +105,7 @@
|
|||
{!! $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>
|
||||
<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%">
|
||||
|
||||
<p class="help-block">{{ trans('admin/settings/general.saml_idp_metadata_help') }}</p>
|
||||
|
|
|
@ -29,7 +29,7 @@ Create a User ::
|
|||
<div class="row">
|
||||
|
||||
<!-- 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::locales('locale', Request::old('locale', "en"), 'select2') !!}
|
||||
|
||||
|
@ -37,7 +37,7 @@ Create a User ::
|
|||
</div>
|
||||
|
||||
<!-- 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::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="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::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>') !!}
|
||||
</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::text('zerofill_count', Request::old('zerofill_count', 5), array('class' => 'form-control')) }}
|
||||
|
||||
|
@ -99,7 +99,7 @@ Create a User ::
|
|||
</div>
|
||||
|
||||
<!-- 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::username_format('email_format', old('email_format', 'filastname'), 'select2') !!}
|
||||
{!! $errors->first('email_format', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
|
@ -109,7 +109,7 @@ Create a User ::
|
|||
<!-- Name -->
|
||||
<div class="row">
|
||||
<!-- 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::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>') !!}
|
||||
|
@ -125,14 +125,14 @@ Create a User ::
|
|||
|
||||
<div class="row">
|
||||
<!-- 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::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>') !!}
|
||||
</div>
|
||||
|
||||
<!-- 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::text('username', old('username'), array('class' => 'form-control','placeholder' => 'jsmith')) }}
|
||||
{!! $errors->first('username', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
|
@ -141,14 +141,14 @@ Create a User ::
|
|||
|
||||
<div class="row">
|
||||
<!-- 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::password('password', array('class' => 'form-control')) }}
|
||||
{!! $errors->first('password', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
</div>
|
||||
|
||||
<!-- 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::password('password_confirmation', array('class' => 'form-control')) }}
|
||||
{!! $errors->first('password_confirmation', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
|
|
|
@ -87,7 +87,7 @@
|
|||
<!-- First Name -->
|
||||
<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>
|
||||
<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) }}" />
|
||||
{!! $errors->first('first_name', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
</div>
|
||||
|
@ -96,7 +96,7 @@
|
|||
<!-- Last Name -->
|
||||
<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>
|
||||
<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) }}" />
|
||||
{!! $errors->first('last_name', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
</div>
|
||||
|
@ -105,7 +105,7 @@
|
|||
<!-- Username -->
|
||||
<div class="form-group {{ $errors->has('username') ? 'has-error' : '' }}">
|
||||
<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'))
|
||||
<input
|
||||
class="form-control"
|
||||
|
@ -136,7 +136,7 @@
|
|||
<label class="col-md-3 control-label" for="password">
|
||||
{{ trans('admin/users/table.password') }}
|
||||
</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') )
|
||||
<input
|
||||
type="password"
|
||||
|
@ -167,7 +167,7 @@
|
|||
<label class="col-md-3 control-label" for="password_confirmation">
|
||||
{{ trans('admin/users/table.password_confirm') }}
|
||||
</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
|
||||
type="password"
|
||||
name="password_confirmation"
|
||||
|
@ -230,7 +230,7 @@
|
|||
<!-- Email -->
|
||||
<div class="form-group {{ $errors->has('email') ? 'has-error' : '' }}">
|
||||
<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
|
||||
class="form-control"
|
||||
type="text"
|
||||
|
|
|
@ -37,10 +37,10 @@ $I->dontSeeInSource('<br><');
|
|||
$I->click(['name' => 'email']);
|
||||
$I->click(['name' => 'username']);
|
||||
$I->submitForm('#userForm', [
|
||||
'email' => \App\Helpers\Helper::generateRandomString(15).'@example.com',
|
||||
'email' => Helper::generateRandomString(15).'@example.com',
|
||||
'first_name' => 'Joe',
|
||||
'last_name' => 'Smith',
|
||||
'username' => \App\Helpers\Helper::generateRandomString(15),
|
||||
'username' => Helper::generateRandomString(15),
|
||||
]);
|
||||
|
||||
$I->seeElement('.alert-danger');
|
||||
|
@ -49,11 +49,11 @@ $I->dontSeeInSource('<br><');
|
|||
/* Submit form and expect success */
|
||||
$I->wantTo('submit the form successfully');
|
||||
$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' => 'last_name'], 'Smith');
|
||||
$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->fillField(['name' => 'password'], 'password');
|
||||
$I->click(['name' => 'password_confirmation']);
|
||||
|
|
Loading…
Reference in a new issue