Skip to content

Commit

Permalink
Merge pull request #1974 from krayin/webform-issue
Browse files Browse the repository at this point in the history
🔧 fix: fixed #1932 webform issue
  • Loading branch information
devansh-webkul authored Jan 21, 2025
2 parents 8cef69f + 911c3c0 commit c454ca1
Show file tree
Hide file tree
Showing 112 changed files with 664 additions and 568 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('activities', function (Blueprint $table) {
$table->dropForeign('activities_user_id_foreign');

$table->unsignedInteger('user_id')->nullable()->change();
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('activities', function (Blueprint $table) {
// Disable foreign key checks temporarily.
DB::statement('SET FOREIGN_KEY_CHECKS=0');

// Drop the foreign key constraint using raw SQL.
DB::statement('ALTER TABLE activities DROP FOREIGN KEY activities_user_id_foreign');

// Drop the index.
DB::statement('ALTER TABLE activities DROP INDEX activities_user_id_foreign');

// Change the column to be non-nullable.
$table->unsignedInteger('user_id')->nullable(false)->change();
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');

// Re-enable foreign key checks.
DB::statement('SET FOREIGN_KEY_CHECKS=1');
});
}
};
4 changes: 3 additions & 1 deletion packages/Webkul/Activity/src/Traits/LogsActivity.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ protected static function booted(): void
'type' => 'system',
'title' => trans('admin::app.activities.created'),
'is_done' => 1,
'user_id' => auth()->id(),
'user_id' => auth()->check()
? auth()->id()
: null,
]);

$model->activities()->attach($activity->id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,9 @@ public function create(): View
$attributes = [];

foreach ($tempAttributes as $attribute) {
if ($attribute->entity_type == 'persons'
&& (
$attribute->code == 'name'
|| $attribute->code == 'emails'
|| $attribute->code == 'contact_numbers'
)
if (
$attribute->entity_type == 'persons'
&& in_array($attribute->code, ['name', 'emails', 'contact_numbers'])
) {
$attributes['default'][] = $attribute;
} else {
Expand Down Expand Up @@ -156,7 +153,7 @@ public function destroy(int $id): JsonResponse

return response()->json([
'message' => trans('admin::app.settings.webforms.index.delete-success'),
], 200);
]);
} catch (\Exception $exception) {
return response()->json([
'message' => trans('admin::app.settings.webforms.index.delete-failed'),
Expand Down
37 changes: 19 additions & 18 deletions packages/Webkul/Admin/src/Resources/lang/ar/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,30 +151,31 @@
],

'index' => [
'from' => 'من',
'to' => 'إلى',
'cc' => 'نسخة',
'bcc' => 'نسخة مخفية',
'all' => 'الكل',
'planned' => 'مخطط له',
'bcc' => 'نسخة مخفية',
'by-user' => 'بواسطة :user',
'calls' => 'المكالمات',
'meetings' => 'الاجتماعات',
'lunches' => 'الغداء',
'files' => 'الملفات',
'quotes' => 'الاقتباسات',
'notes' => 'الملاحظات',
'emails' => 'البريد الإلكتروني',
'cc' => 'نسخة',
'change-log' => 'سجلات التغيير',
'by-user' => 'بواسطة :user',
'scheduled-on' => 'مجدول في',
'location' => 'موقع',
'participants' => 'المشاركون',
'mark-as-done' => 'وضع علامة تم',
'delete' => 'حذف',
'edit' => 'تعديل',
'view' => 'عرض',
'unlink' => 'إلغاء الارتباط',
'emails' => 'البريد الإلكتروني',
'empty' => 'فارغ',
'files' => 'الملفات',
'from' => 'من',
'location' => 'موقع',
'lunches' => 'الغداء',
'mark-as-done' => 'وضع علامة تم',
'meetings' => 'الاجتماعات',
'notes' => 'الملاحظات',
'participants' => 'المشاركون',
'planned' => 'مخطط له',
'quotes' => 'الاقتباسات',
'scheduled-on' => 'مجدول في',
'system' => 'النظام',
'to' => 'إلى',
'unlink' => 'إلغاء الارتباط',
'view' => 'عرض',

'empty-placeholders' => [
'all' => [
Expand Down
37 changes: 19 additions & 18 deletions packages/Webkul/Admin/src/Resources/lang/en/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,30 +151,31 @@
],

'index' => [
'from' => 'From',
'to' => 'To',
'cc' => 'Cc',
'bcc' => 'Bcc',
'all' => 'All',
'planned' => 'Planned',
'bcc' => 'Bcc',
'by-user' => 'By :user',
'calls' => 'Calls',
'meetings' => 'Meetings',
'lunches' => 'Lunches',
'files' => 'Files',
'quotes' => 'Quotes',
'notes' => 'Notes',
'emails' => 'Emails',
'cc' => 'Cc',
'change-log' => 'Changelogs',
'by-user' => 'By :user',
'scheduled-on' => 'Scheduled on',
'location' => 'Location',
'participants' => 'Participants',
'mark-as-done' => 'Mark as Done',
'delete' => 'Delete',
'edit' => 'Edit',
'view' => 'View',
'unlink' => 'Unlink',
'emails' => 'Emails',
'empty' => 'Empty',
'files' => 'Files',
'from' => 'From',
'location' => 'Location',
'lunches' => 'Lunches',
'mark-as-done' => 'Mark as Done',
'meetings' => 'Meetings',
'notes' => 'Notes',
'participants' => 'Participants',
'planned' => 'Planned',
'quotes' => 'Quotes',
'scheduled-on' => 'Scheduled on',
'system' => 'System',
'to' => 'To',
'unlink' => 'Unlink',
'view' => 'View',

'empty-placeholders' => [
'all' => [
Expand Down
37 changes: 19 additions & 18 deletions packages/Webkul/Admin/src/Resources/lang/es/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,30 +151,31 @@
],

'index' => [
'from' => 'De',
'to' => 'A',
'cc' => 'CC',
'bcc' => 'CCO',
'all' => 'Todo',
'planned' => 'Planificado',
'bcc' => 'CCO',
'by-user' => 'Por :user',
'calls' => 'Llamadas',
'meetings' => 'Reuniones',
'lunches' => 'Almuerzos',
'files' => 'Archivos',
'quotes' => 'Cotizaciones',
'notes' => 'Notas',
'emails' => 'Correos electrónicos',
'cc' => 'CC',
'change-log' => 'Registros de cambios',
'by-user' => 'Por :user',
'scheduled-on' => 'Programado en',
'location' => 'Ubicación',
'participants' => 'Participantes',
'mark-as-done' => 'Marcar como hecho',
'delete' => 'Eliminar',
'edit' => 'Editar',
'view' => 'Ver',
'unlink' => 'Desvincular',
'emails' => 'Correos electrónicos',
'empty' => 'Vacío',
'files' => 'Archivos',
'from' => 'De',
'location' => 'Ubicación',
'lunches' => 'Almuerzos',
'mark-as-done' => 'Marcar como hecho',
'meetings' => 'Reuniones',
'notes' => 'Notas',
'participants' => 'Participantes',
'planned' => 'Planificado',
'quotes' => 'Cotizaciones',
'scheduled-on' => 'Programado en',
'system' => 'Sistema',
'to' => 'A',
'unlink' => 'Desvincular',
'view' => 'Ver',

'empty-placeholders' => [
'all' => [
Expand Down
37 changes: 19 additions & 18 deletions packages/Webkul/Admin/src/Resources/lang/fa/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,30 +151,31 @@
],

'index' => [
'from' => 'از',
'to' => 'تا',
'cc' => 'کپی',
'bcc' => 'کپی مخفی',
'all' => 'همه',
'planned' => 'برنامه‌ریزی شده',
'bcc' => 'کپی مخفی',
'by-user' => 'توسط :user',
'calls' => 'تماس‌ها',
'meetings' => 'جلسات',
'lunches' => 'ناهارها',
'files' => 'فایل‌ها',
'quotes' => 'نقل قول‌ها',
'notes' => 'یادداشت‌ها',
'emails' => 'ایمیل‌ها',
'cc' => 'کپی',
'change-log' => 'تغییرات',
'by-user' => 'توسط :user',
'scheduled-on' => 'برنامه‌ریزی شده در',
'location' => 'محل',
'participants' => 'شرکت‌کنندگان',
'mark-as-done' => 'علامت زدن به عنوان انجام شده',
'delete' => 'حذف',
'edit' => 'ویرایش',
'view' => 'مشاهده',
'unlink' => 'لغو پیوند',
'emails' => 'ایمیل‌ها',
'empty' => 'خالی',
'files' => 'فایل‌ها',
'from' => 'از',
'location' => 'محل',
'lunches' => 'ناهارها',
'mark-as-done' => 'علامت زدن به عنوان انجام شده',
'meetings' => 'جلسات',
'notes' => 'یادداشت‌ها',
'participants' => 'شرکت‌کنندگان',
'planned' => 'برنامه‌ریزی شده',
'quotes' => 'نقل قول‌ها',
'scheduled-on' => 'برنامه‌ریزی شده در',
'system' => 'سیستم',
'to' => 'تا',
'unlink' => 'لغو پیوند',
'view' => 'مشاهده',

'empty-placeholders' => [
'all' => [
Expand Down
37 changes: 19 additions & 18 deletions packages/Webkul/Admin/src/Resources/lang/pt_BR/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,30 +150,31 @@
],

'index' => [
'from' => 'De',
'to' => 'Para',
'cc' => 'CC',
'bcc' => 'BCC',
'all' => 'Todos',
'planned' => 'Planejado',
'bcc' => 'BCC',
'by-user' => 'Por :user',
'calls' => 'Chamadas',
'meetings' => 'Reuniões',
'lunches' => 'Almoços',
'files' => 'Arquivos',
'quotes' => 'Cotações',
'notes' => 'Notas',
'emails' => 'E-mails',
'cc' => 'CC',
'change-log' => 'Logs de Alterações',
'by-user' => 'Por :user',
'scheduled-on' => 'Agendado em',
'location' => 'Localização',
'participants' => 'Participantes',
'mark-as-done' => 'Marcar como Concluído',
'delete' => 'Excluir',
'edit' => 'Editar',
'view' => 'Visualizar',
'unlink' => 'Desvincular',
'emails' => 'E-mails',
'empty' => 'Vazio',
'files' => 'Arquivos',
'from' => 'De',
'location' => 'Localização',
'lunches' => 'Almoços',
'mark-as-done' => 'Marcar como Concluído',
'meetings' => 'Reuniões',
'notes' => 'Notas',
'participants' => 'Participantes',
'planned' => 'Planejado',
'quotes' => 'Cotações',
'scheduled-on' => 'Agendado em',
'system' => 'Sistema',
'to' => 'Para',
'unlink' => 'Desvincular',
'view' => 'Visualizar',

'empty-placeholders' => [
'all' => [
Expand Down
37 changes: 19 additions & 18 deletions packages/Webkul/Admin/src/Resources/lang/tr/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,30 +151,31 @@
],

'index' => [
'from' => 'Kimden',
'to' => 'Kime',
'cc' => 'Bilgi',
'bcc' => 'Gizli Bilgi',
'all' => 'Tümü',
'planned' => 'Planlanan',
'bcc' => 'Gizli Bilgi',
'by-user' => ':user tarafından',
'calls' => 'Aramalar',
'meetings' => 'Toplantılar',
'lunches' => 'Öğle Yemekleri',
'files' => 'Dosyalar',
'quotes' => 'Teklifler',
'notes' => 'Notlar',
'emails' => 'E-postalar',
'cc' => 'Bilgi',
'change-log' => 'Değişiklik Günlükleri',
'by-user' => ':user tarafından',
'scheduled-on' => 'Planlanan Tarih',
'location' => 'Konum',
'participants' => 'Katılımcılar',
'mark-as-done' => 'Tamamlandı olarak işaretle',
'delete' => 'Sil',
'edit' => 'Düzenle',
'view' => 'Görüntüle',
'unlink' => 'Bağlantıyı Kaldır',
'emails' => 'E-postalar',
'empty' => 'Boş',
'files' => 'Dosyalar',
'from' => 'Kimden',
'location' => 'Konum',
'lunches' => 'Öğle Yemekleri',
'mark-as-done' => 'Tamamlandı olarak işaretle',
'meetings' => 'Toplantılar',
'notes' => 'Notlar',
'participants' => 'Katılımcılar',
'planned' => 'Planlanan',
'quotes' => 'Teklifler',
'scheduled-on' => 'Planlanan Tarih',
'system' => 'Sistem',
'to' => 'Kime',
'unlink' => 'Bağlantıyı Kaldır',
'view' => 'Görüntüle',

'empty-placeholders' => [
'all' => [
Expand Down
Loading

0 comments on commit c454ca1

Please sign in to comment.