2017-10-26 16:37:41 -07:00
|
|
|
<!-- Company -->
|
2018-10-29 14:35:34 -07:00
|
|
|
@if (($snipeSettings->full_multiple_companies_support=='1') && (!Auth::user()->isSuperUser()))
|
2018-10-15 17:57:28 -07:00
|
|
|
<!-- full company support is enabled and this user isn't a superadmin -->
|
2018-10-05 07:30:42 -07:00
|
|
|
<div class="form-group">
|
2017-10-26 16:37:41 -07:00
|
|
|
{{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }}
|
2020-04-28 00:01:47 -07:00
|
|
|
<div class="col-md-6">
|
2023-05-10 13:16:59 -07:00
|
|
|
<select class="js-data-ajax" disabled="true" data-endpoint="companies" data-placeholder="{{ trans('general.select_company') }}" name="{{ $fieldname }}" style="width: 100%" id="company_select" aria-label="{{ $fieldname }}"{{ (isset($multiple) && ($multiple=='true')) ? " multiple='multiple'" : '' }}>
|
2020-04-21 06:15:31 -07:00
|
|
|
@if ($company_id = old($fieldname, (isset($item)) ? $item->{$fieldname} : ''))
|
|
|
|
<option value="{{ $company_id }}" selected="selected" role="option" aria-selected="true" role="option">
|
|
|
|
{{ (\App\Models\Company::find($company_id)) ? \App\Models\Company::find($company_id)->name : '' }}
|
|
|
|
</option>
|
|
|
|
@else
|
2024-08-29 10:31:34 -07:00
|
|
|
{!! (!isset($multiple) || ($multiple=='false')) ? '<option value="" role="option">'.trans('general.select_company').'</option>' : '' !!}
|
2020-04-21 06:15:31 -07:00
|
|
|
@endif
|
|
|
|
</select>
|
2018-10-05 07:30:42 -07:00
|
|
|
</div>
|
2017-10-26 16:37:41 -07:00
|
|
|
</div>
|
|
|
|
|
2018-10-15 17:57:28 -07:00
|
|
|
@else
|
|
|
|
<!-- full company support is enabled or this user is a superadmin -->
|
|
|
|
<div id="{{ $fieldname }}" class="form-group{{ $errors->has($fieldname) ? ' has-error' : '' }}">
|
|
|
|
{{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }}
|
2024-08-29 10:31:34 -07:00
|
|
|
<div class="col-md-7">
|
2023-05-10 13:15:22 -07:00
|
|
|
<select class="js-data-ajax" data-endpoint="companies" data-placeholder="{{ trans('general.select_company') }}" name="{{ $fieldname }}" style="width: 100%" id="company_select"{{ (isset($multiple) && ($multiple=='true')) ? " multiple='multiple'" : '' }}>
|
2024-06-27 07:05:47 -07:00
|
|
|
@if ($company_id = old($fieldname, (isset($item)) ? $item->{$fieldname} : ''))
|
2018-10-15 17:57:28 -07:00
|
|
|
<option value="{{ $company_id }}" selected="selected">
|
|
|
|
{{ (\App\Models\Company::find($company_id)) ? \App\Models\Company::find($company_id)->name : '' }}
|
|
|
|
</option>
|
|
|
|
@else
|
2024-08-29 10:31:34 -07:00
|
|
|
{!! (!isset($multiple) || ($multiple=='false')) ? '<option value="" role="option">'.trans('general.select_company').'</option>' : '' !!}
|
2018-10-15 17:57:28 -07:00
|
|
|
@endif
|
|
|
|
</select>
|
|
|
|
</div>
|
2024-07-08 09:39:38 -07:00
|
|
|
{!! $errors->first($fieldname, '<div class="col-md-8 col-md-offset-3"><span class="alert-msg"><i class="fas fa-times" aria-hidden="true"></i> :message</span></div>') !!}
|
2017-10-26 16:37:41 -07:00
|
|
|
|
2020-04-21 06:15:31 -07:00
|
|
|
</div>
|
2017-10-26 16:37:41 -07:00
|
|
|
|
2018-10-05 07:30:42 -07:00
|
|
|
@endif
|