Skip to content

Commit c454ca1

Browse files
Merge pull request krayin#1974 from krayin/webform-issue
🔧 fix: fixed krayin#1932 webform issue
2 parents 8cef69f + 911c3c0 commit c454ca1

File tree

112 files changed

+664
-568
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+664
-568
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\DB;
6+
use Illuminate\Support\Facades\Schema;
7+
8+
return new class extends Migration
9+
{
10+
/**
11+
* Run the migrations.
12+
*
13+
* @return void
14+
*/
15+
public function up()
16+
{
17+
Schema::table('activities', function (Blueprint $table) {
18+
$table->dropForeign('activities_user_id_foreign');
19+
20+
$table->unsignedInteger('user_id')->nullable()->change();
21+
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
22+
});
23+
}
24+
25+
/**
26+
* Reverse the migrations.
27+
*
28+
* @return void
29+
*/
30+
public function down()
31+
{
32+
Schema::table('activities', function (Blueprint $table) {
33+
// Disable foreign key checks temporarily.
34+
DB::statement('SET FOREIGN_KEY_CHECKS=0');
35+
36+
// Drop the foreign key constraint using raw SQL.
37+
DB::statement('ALTER TABLE activities DROP FOREIGN KEY activities_user_id_foreign');
38+
39+
// Drop the index.
40+
DB::statement('ALTER TABLE activities DROP INDEX activities_user_id_foreign');
41+
42+
// Change the column to be non-nullable.
43+
$table->unsignedInteger('user_id')->nullable(false)->change();
44+
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
45+
46+
// Re-enable foreign key checks.
47+
DB::statement('SET FOREIGN_KEY_CHECKS=1');
48+
});
49+
}
50+
};

Diff for: packages/Webkul/Activity/src/Traits/LogsActivity.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ protected static function booted(): void
2323
'type' => 'system',
2424
'title' => trans('admin::app.activities.created'),
2525
'is_done' => 1,
26-
'user_id' => auth()->id(),
26+
'user_id' => auth()->check()
27+
? auth()->id()
28+
: null,
2729
]);
2830

2931
$model->activities()->attach($activity->id);

Diff for: packages/Webkul/Admin/src/Http/Controllers/Settings/WebFormController.php

+4-7
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,9 @@ public function create(): View
5555
$attributes = [];
5656

5757
foreach ($tempAttributes as $attribute) {
58-
if ($attribute->entity_type == 'persons'
59-
&& (
60-
$attribute->code == 'name'
61-
|| $attribute->code == 'emails'
62-
|| $attribute->code == 'contact_numbers'
63-
)
58+
if (
59+
$attribute->entity_type == 'persons'
60+
&& in_array($attribute->code, ['name', 'emails', 'contact_numbers'])
6461
) {
6562
$attributes['default'][] = $attribute;
6663
} else {
@@ -156,7 +153,7 @@ public function destroy(int $id): JsonResponse
156153

157154
return response()->json([
158155
'message' => trans('admin::app.settings.webforms.index.delete-success'),
159-
], 200);
156+
]);
160157
} catch (\Exception $exception) {
161158
return response()->json([
162159
'message' => trans('admin::app.settings.webforms.index.delete-failed'),

Diff for: packages/Webkul/Admin/src/Resources/lang/ar/app.php

+19-18
Original file line numberDiff line numberDiff line change
@@ -151,30 +151,31 @@
151151
],
152152

153153
'index' => [
154-
'from' => 'من',
155-
'to' => 'إلى',
156-
'cc' => 'نسخة',
157-
'bcc' => 'نسخة مخفية',
158154
'all' => 'الكل',
159-
'planned' => 'مخطط له',
155+
'bcc' => 'نسخة مخفية',
156+
'by-user' => 'بواسطة :user',
160157
'calls' => 'المكالمات',
161-
'meetings' => 'الاجتماعات',
162-
'lunches' => 'الغداء',
163-
'files' => 'الملفات',
164-
'quotes' => 'الاقتباسات',
165-
'notes' => 'الملاحظات',
166-
'emails' => 'البريد الإلكتروني',
158+
'cc' => 'نسخة',
167159
'change-log' => 'سجلات التغيير',
168-
'by-user' => 'بواسطة :user',
169-
'scheduled-on' => 'مجدول في',
170-
'location' => 'موقع',
171-
'participants' => 'المشاركون',
172-
'mark-as-done' => 'وضع علامة تم',
173160
'delete' => 'حذف',
174161
'edit' => 'تعديل',
175-
'view' => 'عرض',
176-
'unlink' => 'إلغاء الارتباط',
162+
'emails' => 'البريد الإلكتروني',
177163
'empty' => 'فارغ',
164+
'files' => 'الملفات',
165+
'from' => 'من',
166+
'location' => 'موقع',
167+
'lunches' => 'الغداء',
168+
'mark-as-done' => 'وضع علامة تم',
169+
'meetings' => 'الاجتماعات',
170+
'notes' => 'الملاحظات',
171+
'participants' => 'المشاركون',
172+
'planned' => 'مخطط له',
173+
'quotes' => 'الاقتباسات',
174+
'scheduled-on' => 'مجدول في',
175+
'system' => 'النظام',
176+
'to' => 'إلى',
177+
'unlink' => 'إلغاء الارتباط',
178+
'view' => 'عرض',
178179

179180
'empty-placeholders' => [
180181
'all' => [

Diff for: packages/Webkul/Admin/src/Resources/lang/en/app.php

+19-18
Original file line numberDiff line numberDiff line change
@@ -151,30 +151,31 @@
151151
],
152152

153153
'index' => [
154-
'from' => 'From',
155-
'to' => 'To',
156-
'cc' => 'Cc',
157-
'bcc' => 'Bcc',
158154
'all' => 'All',
159-
'planned' => 'Planned',
155+
'bcc' => 'Bcc',
156+
'by-user' => 'By :user',
160157
'calls' => 'Calls',
161-
'meetings' => 'Meetings',
162-
'lunches' => 'Lunches',
163-
'files' => 'Files',
164-
'quotes' => 'Quotes',
165-
'notes' => 'Notes',
166-
'emails' => 'Emails',
158+
'cc' => 'Cc',
167159
'change-log' => 'Changelogs',
168-
'by-user' => 'By :user',
169-
'scheduled-on' => 'Scheduled on',
170-
'location' => 'Location',
171-
'participants' => 'Participants',
172-
'mark-as-done' => 'Mark as Done',
173160
'delete' => 'Delete',
174161
'edit' => 'Edit',
175-
'view' => 'View',
176-
'unlink' => 'Unlink',
162+
'emails' => 'Emails',
177163
'empty' => 'Empty',
164+
'files' => 'Files',
165+
'from' => 'From',
166+
'location' => 'Location',
167+
'lunches' => 'Lunches',
168+
'mark-as-done' => 'Mark as Done',
169+
'meetings' => 'Meetings',
170+
'notes' => 'Notes',
171+
'participants' => 'Participants',
172+
'planned' => 'Planned',
173+
'quotes' => 'Quotes',
174+
'scheduled-on' => 'Scheduled on',
175+
'system' => 'System',
176+
'to' => 'To',
177+
'unlink' => 'Unlink',
178+
'view' => 'View',
178179

179180
'empty-placeholders' => [
180181
'all' => [

Diff for: packages/Webkul/Admin/src/Resources/lang/es/app.php

+19-18
Original file line numberDiff line numberDiff line change
@@ -151,30 +151,31 @@
151151
],
152152

153153
'index' => [
154-
'from' => 'De',
155-
'to' => 'A',
156-
'cc' => 'CC',
157-
'bcc' => 'CCO',
158154
'all' => 'Todo',
159-
'planned' => 'Planificado',
155+
'bcc' => 'CCO',
156+
'by-user' => 'Por :user',
160157
'calls' => 'Llamadas',
161-
'meetings' => 'Reuniones',
162-
'lunches' => 'Almuerzos',
163-
'files' => 'Archivos',
164-
'quotes' => 'Cotizaciones',
165-
'notes' => 'Notas',
166-
'emails' => 'Correos electrónicos',
158+
'cc' => 'CC',
167159
'change-log' => 'Registros de cambios',
168-
'by-user' => 'Por :user',
169-
'scheduled-on' => 'Programado en',
170-
'location' => 'Ubicación',
171-
'participants' => 'Participantes',
172-
'mark-as-done' => 'Marcar como hecho',
173160
'delete' => 'Eliminar',
174161
'edit' => 'Editar',
175-
'view' => 'Ver',
176-
'unlink' => 'Desvincular',
162+
'emails' => 'Correos electrónicos',
177163
'empty' => 'Vacío',
164+
'files' => 'Archivos',
165+
'from' => 'De',
166+
'location' => 'Ubicación',
167+
'lunches' => 'Almuerzos',
168+
'mark-as-done' => 'Marcar como hecho',
169+
'meetings' => 'Reuniones',
170+
'notes' => 'Notas',
171+
'participants' => 'Participantes',
172+
'planned' => 'Planificado',
173+
'quotes' => 'Cotizaciones',
174+
'scheduled-on' => 'Programado en',
175+
'system' => 'Sistema',
176+
'to' => 'A',
177+
'unlink' => 'Desvincular',
178+
'view' => 'Ver',
178179

179180
'empty-placeholders' => [
180181
'all' => [

Diff for: packages/Webkul/Admin/src/Resources/lang/fa/app.php

+19-18
Original file line numberDiff line numberDiff line change
@@ -151,30 +151,31 @@
151151
],
152152

153153
'index' => [
154-
'from' => 'از',
155-
'to' => 'تا',
156-
'cc' => 'کپی',
157-
'bcc' => 'کپی مخفی',
158154
'all' => 'همه',
159-
'planned' => 'برنامه‌ریزی شده',
155+
'bcc' => 'کپی مخفی',
156+
'by-user' => 'توسط :user',
160157
'calls' => 'تماس‌ها',
161-
'meetings' => 'جلسات',
162-
'lunches' => 'ناهارها',
163-
'files' => 'فایل‌ها',
164-
'quotes' => 'نقل قول‌ها',
165-
'notes' => 'یادداشت‌ها',
166-
'emails' => 'ایمیل‌ها',
158+
'cc' => 'کپی',
167159
'change-log' => 'تغییرات',
168-
'by-user' => 'توسط :user',
169-
'scheduled-on' => 'برنامه‌ریزی شده در',
170-
'location' => 'محل',
171-
'participants' => 'شرکت‌کنندگان',
172-
'mark-as-done' => 'علامت زدن به عنوان انجام شده',
173160
'delete' => 'حذف',
174161
'edit' => 'ویرایش',
175-
'view' => 'مشاهده',
176-
'unlink' => 'لغو پیوند',
162+
'emails' => 'ایمیل‌ها',
177163
'empty' => 'خالی',
164+
'files' => 'فایل‌ها',
165+
'from' => 'از',
166+
'location' => 'محل',
167+
'lunches' => 'ناهارها',
168+
'mark-as-done' => 'علامت زدن به عنوان انجام شده',
169+
'meetings' => 'جلسات',
170+
'notes' => 'یادداشت‌ها',
171+
'participants' => 'شرکت‌کنندگان',
172+
'planned' => 'برنامه‌ریزی شده',
173+
'quotes' => 'نقل قول‌ها',
174+
'scheduled-on' => 'برنامه‌ریزی شده در',
175+
'system' => 'سیستم',
176+
'to' => 'تا',
177+
'unlink' => 'لغو پیوند',
178+
'view' => 'مشاهده',
178179

179180
'empty-placeholders' => [
180181
'all' => [

Diff for: packages/Webkul/Admin/src/Resources/lang/pt_BR/app.php

+19-18
Original file line numberDiff line numberDiff line change
@@ -150,30 +150,31 @@
150150
],
151151

152152
'index' => [
153-
'from' => 'De',
154-
'to' => 'Para',
155-
'cc' => 'CC',
156-
'bcc' => 'BCC',
157153
'all' => 'Todos',
158-
'planned' => 'Planejado',
154+
'bcc' => 'BCC',
155+
'by-user' => 'Por :user',
159156
'calls' => 'Chamadas',
160-
'meetings' => 'Reuniões',
161-
'lunches' => 'Almoços',
162-
'files' => 'Arquivos',
163-
'quotes' => 'Cotações',
164-
'notes' => 'Notas',
165-
'emails' => 'E-mails',
157+
'cc' => 'CC',
166158
'change-log' => 'Logs de Alterações',
167-
'by-user' => 'Por :user',
168-
'scheduled-on' => 'Agendado em',
169-
'location' => 'Localização',
170-
'participants' => 'Participantes',
171-
'mark-as-done' => 'Marcar como Concluído',
172159
'delete' => 'Excluir',
173160
'edit' => 'Editar',
174-
'view' => 'Visualizar',
175-
'unlink' => 'Desvincular',
161+
'emails' => 'E-mails',
176162
'empty' => 'Vazio',
163+
'files' => 'Arquivos',
164+
'from' => 'De',
165+
'location' => 'Localização',
166+
'lunches' => 'Almoços',
167+
'mark-as-done' => 'Marcar como Concluído',
168+
'meetings' => 'Reuniões',
169+
'notes' => 'Notas',
170+
'participants' => 'Participantes',
171+
'planned' => 'Planejado',
172+
'quotes' => 'Cotações',
173+
'scheduled-on' => 'Agendado em',
174+
'system' => 'Sistema',
175+
'to' => 'Para',
176+
'unlink' => 'Desvincular',
177+
'view' => 'Visualizar',
177178

178179
'empty-placeholders' => [
179180
'all' => [

Diff for: packages/Webkul/Admin/src/Resources/lang/tr/app.php

+19-18
Original file line numberDiff line numberDiff line change
@@ -151,30 +151,31 @@
151151
],
152152

153153
'index' => [
154-
'from' => 'Kimden',
155-
'to' => 'Kime',
156-
'cc' => 'Bilgi',
157-
'bcc' => 'Gizli Bilgi',
158154
'all' => 'Tümü',
159-
'planned' => 'Planlanan',
155+
'bcc' => 'Gizli Bilgi',
156+
'by-user' => ':user tarafından',
160157
'calls' => 'Aramalar',
161-
'meetings' => 'Toplantılar',
162-
'lunches' => 'Öğle Yemekleri',
163-
'files' => 'Dosyalar',
164-
'quotes' => 'Teklifler',
165-
'notes' => 'Notlar',
166-
'emails' => 'E-postalar',
158+
'cc' => 'Bilgi',
167159
'change-log' => 'Değişiklik Günlükleri',
168-
'by-user' => ':user tarafından',
169-
'scheduled-on' => 'Planlanan Tarih',
170-
'location' => 'Konum',
171-
'participants' => 'Katılımcılar',
172-
'mark-as-done' => 'Tamamlandı olarak işaretle',
173160
'delete' => 'Sil',
174161
'edit' => 'Düzenle',
175-
'view' => 'Görüntüle',
176-
'unlink' => 'Bağlantıyı Kaldır',
162+
'emails' => 'E-postalar',
177163
'empty' => 'Boş',
164+
'files' => 'Dosyalar',
165+
'from' => 'Kimden',
166+
'location' => 'Konum',
167+
'lunches' => 'Öğle Yemekleri',
168+
'mark-as-done' => 'Tamamlandı olarak işaretle',
169+
'meetings' => 'Toplantılar',
170+
'notes' => 'Notlar',
171+
'participants' => 'Katılımcılar',
172+
'planned' => 'Planlanan',
173+
'quotes' => 'Teklifler',
174+
'scheduled-on' => 'Planlanan Tarih',
175+
'system' => 'Sistem',
176+
'to' => 'Kime',
177+
'unlink' => 'Bağlantıyı Kaldır',
178+
'view' => 'Görüntüle',
178179

179180
'empty-placeholders' => [
180181
'all' => [

0 commit comments

Comments
 (0)