update_10.09.23

This commit is contained in:
NW
2023-09-21 15:01:58 +01:00
parent 4a9c23c4ea
commit 98a7d01134
24 changed files with 3084 additions and 14153 deletions

View File

@@ -50,34 +50,34 @@ class HomeController extends Controller
if (! empty($form->schema)) {
$action = '<a href="'.action([\App\Http\Controllers\FormController::class, 'show'], ['form' => $form->slug ?: $form->id]).'"'.'
target="_blank"
target="_blank"
class="btn btn-sm btn-info m-1" data-toggle="tooltip" title="'.__('messages.view').'">
<i class="fa fa-eye" aria-hidden="true"></i>
</a>';
}
$action .= '<a href="'.action([\App\Http\Controllers\FormController::class, 'edit'], ['form' => $form->id]).'"'.'
$action .= '<a href="'.action([\App\Http\Controllers\FormController::class, 'edit'], ['form' => $form->id]).'"'.'
class="btn btn-sm btn-warning m-1" data-toggle="tooltip" title="'.__('messages.edit').'">
<i class="fa fa-edit" aria-hidden="true"></i>
</a>';
$action .= '<button type="button" data-href="'.action([\App\Http\Controllers\FormController::class, 'destroy'], ['form' => $form->id]).'"'.' class="btn btn-sm btn-danger delete_form m-1" data-toggle="tooltip"
$action .= '<button type="button" data-href="'.action([\App\Http\Controllers\FormController::class, 'destroy'], ['form' => $form->id]).'"'.' class="btn btn-sm btn-danger delete_form m-1" data-toggle="tooltip"
title="'.__('messages.delete').'">
<i class="fa fa-trash" aria-hidden="true"></i>
</button>';
$action .= '<button type="button" data-href="'.action([\App\Http\Controllers\FormController::class, 'copyForm'], ['id' => $form->id]).'"'.' class="btn btn-sm btn-primary copy_form m-1" data-toggle="tooltip"
$action .= '<button type="button" data-href="'.action([\App\Http\Controllers\FormController::class, 'copyForm'], ['id' => $form->id]).'"'.' class="btn btn-sm btn-primary copy_form m-1" data-toggle="tooltip"
title="'.__('messages.copy_this_form').'">
<i class="fas fa-copy"></i>
</button>';
$action .= '<button type="button" data-href="'.action([\App\Http\Controllers\FormController::class, 'generateWidget'], ['id' => $form->id]).'"'.' class="btn btn-sm btn-info generate_widget m-1" data-toggle="tooltip"
$action .= '<button type="button" data-href="'.action([\App\Http\Controllers\FormController::class, 'generateWidget'], ['id' => $form->id]).'"'.' class="btn btn-sm btn-info generate_widget m-1" data-toggle="tooltip"
title="'.__('messages.widget').'">
<i class="fa fa-random" aria-hidden="true"></i>
</button>';
$action .= '<a href="'.action([\App\Http\Controllers\FormDataController::class, 'show'], ['id' => $form->id]).'"'.'"
target="_blank"
target="_blank"
class="btn btn-sm btn-success m-1" data-toggle="tooltip" title="'.__('messages.view_form_data').'">
<i class="fa fa-list" aria-hidden="true"></i>
</a>';
@@ -86,18 +86,12 @@ class HomeController extends Controller
$superadmin_emails = explode(',', $superadmins);
if (in_array($user->email, $superadmin_emails) ||
(is_saas_enabled() && (isset($subscription->package_details['is_form_downloadable']) && $subscription->package_details['is_form_downloadable'])) || ! is_saas_enabled()) {
$action .= '<a href="'.action([\App\Http\Controllers\FormController::class, 'downloadCode'], ['id' => $form->id]).'"'.'" class="btn btn-sm btn-dark m-1" data-toggle="tooltip"
$action .= '<a href="'.action([\App\Http\Controllers\FormController::class, 'downloadCode'], ['id' => $form->id]).'"'.'" class="btn btn-sm btn-dark m-1" data-toggle="tooltip"
title="'.__('messages.download_code').'">
<i class="fas fa-download" aria-hidden="true"></i>
</a>';
}
$action .= '<a href="'.action([\App\Http\Controllers\FormDataController::class, 'getReport'], ['id' => $form->id]).'"'.'"
target="_blank"
class="btn btn-sm btn-success m-1" data-toggle="tooltip" title="'.__('messages.report').'">
<i class="fas fa-chart-pie" aria-hidden="true"></i>
</a>';
$action .= '<a data-href="'.action([\App\Http\Controllers\FormController::class, 'getCollab'], ['id' => $form->id]).'"'.'class="btn btn-sm btn-primary m-1 collab_btn" data-toggle="tooltip" title="'.__('messages.collaborate').'">
<i class="fas fa-handshake text-white" aria-hidden="true"></i>
</a>';
@@ -174,17 +168,17 @@ class HomeController extends Controller
return DataTables::of($forms)
->addColumn('action', function ($row) {
$action = '<a href="'.action([\App\Http\Controllers\FormController::class, 'show'], ['form' => $row->slug ?: $row->id]).'"'.'
target="_blank"
target="_blank"
class="btn btn-sm btn-info m-1" data-toggle="tooltip" title="'.__('messages.view').'">
<i class="fa fa-eye" aria-hidden="true"></i>
</a>';
if (! $row->is_global_template || auth()->user()->can('superadmin')) {
$action .= '<a href="'.action([\App\Http\Controllers\FormController::class, 'edit'], ['form' => $row->id]).'"'.'
$action .= '<a href="'.action([\App\Http\Controllers\FormController::class, 'edit'], ['form' => $row->id]).'"'.'
class="btn btn-sm btn-warning m-1" data-toggle="tooltip" title="'.__('messages.edit').'">
<i class="fa fa-edit" aria-hidden="true"></i>
</a>
<button type="button" data-href="'.action([\App\Http\Controllers\FormController::class, 'destroy'], ['form' => $row->id]).'"'.' class="btn btn-sm btn-danger delete_template m-1" data-toggle="tooltip"
<button type="button" data-href="'.action([\App\Http\Controllers\FormController::class, 'destroy'], ['form' => $row->id]).'"'.' class="btn btn-sm btn-danger delete_template m-1" data-toggle="tooltip"
title="'.__('messages.delete').'">
<i class="fa fa-trash" aria-hidden="true"></i>
</button>';
@@ -265,31 +259,26 @@ class HomeController extends Controller
'action',
function ($row) {
$action = '';
if (! empty($row->permissions) && in_array('can_view_form', $row->permissions)) {
if (! empty($row->permissions) && in_array('can_view_form', $row->permissions) && auth()->user()->show_edit_buttons_form) {
$action = '<a href="'.action([\App\Http\Controllers\FormController::class, 'show'], ['form' => $row->slug ?: $row->form_id]).'"'.'
target="_blank"
target="_blank"
class="btn btn-sm btn-info m-1" data-toggle="tooltip" title="'.__('messages.view').'">
<i class="fa fa-eye" aria-hidden="true"></i>
</a>';
}
if (! empty($row->permissions) && in_array('can_design_form', $row->permissions)) {
$action .= '<a href="'.action([\App\Http\Controllers\FormController::class, 'edit'], ['form' => $row->form_id]).'"'.'
if (! empty($row->permissions) && in_array('can_design_form', $row->permissions) && auth()->user()->show_edit_buttons_form) {
$action .= '<a href="'.action([\App\Http\Controllers\FormController::class, 'edit'], ['form' => $row->form_id]).'"'.'
class="btn btn-sm btn-warning m-1" data-toggle="tooltip" title="'.__('messages.edit').'">
<i class="fa fa-edit" aria-hidden="true"></i>
</a>';
}
if (! empty($row->permissions) && in_array('can_view_data', $row->permissions)) {
if (! empty($row->permissions) && in_array('can_view_data', $row->permissions) && auth()->user()->show_edit_buttons_form) {
$action .= '<a href="'.action([\App\Http\Controllers\FormDataController::class, 'show'], ['id' => $row->form_id]).'"'.'"
target="_blank"
target="_blank"
class="btn btn-sm btn-success m-1" data-toggle="tooltip" title="'.__('messages.view_form_data').'">
<i class="fa fa-list" aria-hidden="true"></i>
</a>
<a href="'.action([\App\Http\Controllers\FormDataController::class, 'getReport'], ['id' => $row->form_id]).'"'.'"
target="_blank"
class="btn btn-sm btn-success m-1" data-toggle="tooltip" title="'.__('messages.report').'">
<i class="fas fa-chart-pie" aria-hidden="true"></i>
</a>';
}

View File

@@ -35,7 +35,7 @@ class ManageUsersController extends Controller
return DataTables::of($users)
->addColumn(
'action',
'
'
@if($is_active)
<span title="@lang("messages.mark_inactive")">
<a class="btn btn-link btn-icon btn-sm text-danger toggle_is_active pointer" data-href="{{ action([\App\Http\Controllers\Superadmin\ManageUsersController::class, "toggleUserActiveStatus"], [$id])}}">
@@ -126,7 +126,7 @@ class ManageUsersController extends Controller
return $this->notAllowedInDemo();
}
$input = $request->only('name', 'email', 'is_active', 'can_create_form');
$input = $request->only('name', 'email', 'is_active', 'can_create_form', 'show_form_response_user', 'show_edit_buttons_form');
if (! empty($request->input('password'))) {
$input['password'] = bcrypt($request->input('password'));
@@ -134,6 +134,8 @@ class ManageUsersController extends Controller
$input['is_active'] = ! empty($input['is_active']) ? 1 : 0;
$input['can_create_form'] = ! empty($input['can_create_form']) ? 1 : 0;
$input['show_form_response_user'] = ! empty($input['show_form_response_user']) ? 1 : 0;
$input['show_edit_buttons_form'] = ! empty($input['show_edit_buttons_form']) ? 1 : 0;
$user = User::create($input);
@@ -219,9 +221,11 @@ class ManageUsersController extends Controller
return $this->notAllowedInDemo();
}
$input = $request->only('name', 'email', 'is_active', 'can_create_form');
$input = $request->only('name', 'email', 'is_active', 'can_create_form', 'show_form_response_user', 'show_edit_buttons_form');
$input['is_active'] = ! empty($input['is_active']) ? 1 : 0;
$input['can_create_form'] = ! empty($input['can_create_form']) ? 1 : 0;
$input['show_form_response_user'] = ! empty($input['show_form_response_user']) ? 1 : 0;
$input['show_edit_buttons_form'] = ! empty($input['show_edit_buttons_form']) ? 1 : 0;
if (! empty($request->input('password'))) {
$input['password'] = bcrypt($request->input('password'));