Switch back to “normal” url for support

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2023-04-26 16:48:38 -07:00
parent 54a766c4f9
commit 7974c172fd
4 changed files with 3 additions and 4 deletions

View file

@ -24,7 +24,7 @@ class Manufacturer extends SnipeModel
'name' => 'required|min:2|max:255|unique:manufacturers,name,NULL,id,deleted_at,NULL',
'url' => 'url|nullable',
'support_email' => 'email|nullable',
'support_url' => 'starts_with:http://,https://,afp://,facetime://,file://,irc://','nullable',
'support_url' => 'nullable|url',
'warranty_lookup_url' => 'starts_with:http://,https://,afp://,facetime://,file://,irc://','nullable'
];

View file

@ -538,7 +538,7 @@ class AssetPresenter extends Presenter
* Used to take user created warranty URL and dynamically fill in the needed values per asset
* @return string
*/
public function dynamicVariableUrl()
public function dynamicWarrantyUrl()
{
$warranty_lookup_url = $this->model->model->manufacturer->warranty_lookup_url;
$url = (str_replace('{LOCALE}',\App\Models\Setting::getSettings()->locale,$warranty_lookup_url));

View file

@ -596,7 +596,7 @@
{{ trans('admin/hardware/form.months') }}
@if (($asset->model->manufacturer) && ($asset->model->manufacturer->warranty_lookup_url!=''))
<a href="{{ $asset->present()->dynamicVariableUrl() }}" target="_blank">
<a href="{{ $asset->present()->dynamicWarrantyUrl() }}" target="_blank">
<i class="fa fa-external-link"><span class="sr-only">{{ trans('hardware/general.mfg_warranty_lookup') }}</span></i>
</a>
@endif

View file

@ -26,7 +26,6 @@
</label>
<div class="col-md-6">
<input class="form-control" type="text" name="support_url" id="support_url" value="{{ old('support_url', $item->support_url) }}" />
<p class="help-block">{!! trans('admin/manufacturers/message.support_url_help') !!}</p>
{!! $errors->first('support_url', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>