Merge pull request #458 from openclassify/dia

#1184 Sidebar scroll and search is not working in the admin panel
This commit is contained in:
Fatih Alp 2020-03-27 10:09:58 +03:00 committed by GitHub
commit 83368066d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 7 deletions

View File

@ -1,4 +1,4 @@
{% if app.auth.id == adv.created_by_id %}
{% if auth_user().id == adv.created_by_id or auth_user().hasPermission('visiosoft.module.advs::advs.write') %}
<div class="btn-group dropleft dropleft-edit position-fixed">
<button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{ trans('visiosoft.module.advs::field.ad_actions') }}

View File

@ -642,8 +642,8 @@ class AdvsController extends PublicController
$isActive = new AdvModel();
$adv = $advRepository->getAdvArray($id);
if ($adv['created_by_id'] != Auth::id() && !Auth::user()->hasRole('admin')) {
if ($adv['created_by_id'] != auth()->id()
&& !auth()->user()->hasPermission('visiosoft.module.advs::advs.write')) {
abort(403);
}
$cats_d = array();

View File

@ -27,10 +27,12 @@ function phoneMask(fields) {
function maskPhone(name) {
var currentMask = $("input[name='" + name + "']").attr('placeholder');
$("input[name='" + name + "']").mask(currentMask.replace(/[0-9+]/ig, '9'), {
autoclear: true,
clearIncomplete: true
});
if (currentMask) {
$("input[name='" + name + "']").mask(currentMask.replace(/[0-9+]/ig, '9'), {
autoclear: true,
clearIncomplete: true
});
}
}
}