Skip to content

Commit 8148b45

Browse files
authored
Merge branch 'krayin:2.1' into issue#2155-require-custom-attribute
2 parents fede3e4 + b03e64c commit 8148b45

File tree

28 files changed

+356
-131
lines changed

28 files changed

+356
-131
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ password:admin123
124124

125125
### License
126126

127-
Krayin CRM is a truly opensource CRM framework which will always be free under the [OSL-3.0 License](https://github.com/krayin/laravel-crm/blob/master/LICENSE).
127+
Krayin CRM is a fully open-source CRM framework which will always be free under the [MIT License](https://github.com/krayin/laravel-crm/blob/2.1/LICENSE).
128128

129129
### Security Vulnerabilities
130130

composer.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"barryvdh/laravel-dompdf": "^2.0.0",
1313
"diglactic/laravel-breadcrumbs": "^8.0",
1414
"doctrine/dbal": "^3.0",
15+
"enshrined/svg-sanitize": "^0.21.0",
1516
"guzzlehttp/guzzle": "^7.0.1",
1617
"khaled.alshamaa/ar-php": "^6.3",
1718
"konekt/concord": "^1.10",
@@ -82,13 +83,15 @@
8283
"Tests\\": "tests/"
8384
}
8485
},
85-
"repositories": [{
86-
"type": "path",
87-
"url": "packages/*/*",
88-
"options": {
89-
"symlink": true
86+
"repositories": [
87+
{
88+
"type": "path",
89+
"url": "packages/*/*",
90+
"options": {
91+
"symlink": true
92+
}
9093
}
91-
}],
94+
],
9295
"minimum-stability": "stable",
9396
"prefer-stable": true,
9497
"scripts": {

composer.lock

Lines changed: 46 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/Webkul/Activity/src/Database/Migrations/2025_01_17_151632_alter_activities_table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
public function up()
1616
{
1717
Schema::table('activities', function (Blueprint $table) {
18-
$table->dropForeign('activities_user_id_foreign');
18+
$table->dropForeign(['user_id']);
1919

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

packages/Webkul/Admin/src/Config/core_config.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@
240240
],
241241
],
242242
], [
243-
'key' => 'general.magic_ai.pdf_generation',
244-
'name' => 'admin::app.configuration.index.magic-ai.settings.pdf-generation',
245-
'info' => 'admin::app.configuration.index.magic-ai.settings.pdf-generation-info',
243+
'key' => 'general.magic_ai.doc_generation',
244+
'name' => 'admin::app.configuration.index.magic-ai.settings.doc-generation',
245+
'info' => 'admin::app.configuration.index.magic-ai.settings.doc-generation-info',
246246
'sort' => 2,
247247
'fields' => [
248248
[

packages/Webkul/Admin/src/Http/Controllers/TinyMCEController.php

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,24 @@
22

33
namespace Webkul\Admin\Http\Controllers;
44

5+
use Illuminate\Http\JsonResponse;
6+
use Illuminate\Http\UploadedFile;
57
use Illuminate\Support\Facades\Storage;
8+
use Webkul\Core\Traits\Sanitizer;
69

710
class TinyMCEController extends Controller
811
{
12+
use Sanitizer;
13+
914
/**
1015
* Storage folder path.
11-
*
12-
* @var string
1316
*/
14-
private $storagePath = 'tinymce';
17+
private string $storagePath = 'tinymce';
1518

1619
/**
1720
* Upload file from tinymce.
18-
*
19-
* @return void
2021
*/
21-
public function upload()
22+
public function upload(): JsonResponse
2223
{
2324
$media = $this->storeMedia();
2425

@@ -33,18 +34,28 @@ public function upload()
3334

3435
/**
3536
* Store media.
36-
*
37-
* @return array
3837
*/
39-
public function storeMedia()
38+
public function storeMedia(): array
4039
{
4140
if (! request()->hasFile('file')) {
4241
return [];
4342
}
4443

44+
$file = request()->file('file');
45+
46+
if (! $file instanceof UploadedFile) {
47+
return [];
48+
}
49+
50+
$filename = md5($file->getClientOriginalName().time()).'.'.$file->getClientOriginalExtension();
51+
52+
$path = $file->storeAs($this->storagePath, $filename);
53+
54+
$this->sanitizeSVG($path, $file);
55+
4556
return [
46-
'file' => $path = request()->file('file')->store($this->storagePath),
47-
'file_name' => request()->file('file')->getClientOriginalName(),
57+
'file' => $path,
58+
'file_name' => $file->getClientOriginalName(),
4859
'file_url' => Storage::url($path),
4960
];
5061
}

packages/Webkul/Admin/src/Resources/lang/ar/app.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
'data-transfer' => 'نقل البيانات',
4545
'imports' => 'الواردات',
4646
'import' => 'استيراد',
47+
'event' => 'حدث',
48+
'campaigns' => 'حملات',
4749
],
4850

4951
'users' => [
@@ -415,6 +417,12 @@
415417
'warning' => 'تحذير',
416418
'info' => 'معلومات',
417419
],
420+
421+
'tiny-mce' => [
422+
'http-error' => 'خطأ في HTTP',
423+
'invalid-json' => 'استجابة JSON غير صالحة من الخادم.',
424+
'upload-failed' => 'فشل تحميل الملف. يرجى المحاولة مرة أخرى.',
425+
],
418426
],
419427

420428
'quotes' => [
@@ -1957,7 +1965,6 @@
19571965
'file' => 'رفع ملف',
19581966
'file-info' => 'يتم قبول الملفات بتنسيق pdf, bmp, jpg, jpeg, png فقط.',
19591967
'file-required' => 'يرجى اختيار ملف صالح واحد على الأقل للمتابعة.',
1960-
'sample-pdf' => 'نموذج File',
19611968
'save-btn' => 'حفظ',
19621969
'upload-file' => 'رفع الملف',
19631970
],
@@ -2018,7 +2025,7 @@
20182025
'title' => 'حول الفرصة',
20192026
],
20202027

2021-
'quotes'=> [
2028+
'quotes' => [
20222029
'subject' => 'الموضوع',
20232030
'expired-at' => 'تنتهي في',
20242031
'sub-total' => 'المجموع الفرعي',
@@ -2135,8 +2142,8 @@
21352142
'info' => 'عزز تجربتك مع الذكاء الاصطناعي السحري باستخدام مفتاح API من OpenRouter. قم بدمجه الآن لتجربة ذكاء اصطناعي سلسة ومخصصة لك! قم بتخصيص الإعدادات بسهولة وتحكم في رحلتك مع الذكاء الاصطناعي.',
21362143
'other' => 'نموذج آخر',
21372144
'other-model' => 'بالنسبة للنماذج الأخرى، استخدم معرف النموذج من OpenRouter.',
2138-
'pdf-generation' => 'إنشاء ملفات PDF',
2139-
'pdf-generation-info' => 'قم بتمكين ميزة إنشاء ملفات PDF لاستخراج البيانات تلقائيًا من ملفات PDF وتحويلها إلى نص. عزز إنتاجيتك وكفاءتك بتمكين هذه الميزة لتبسيط سير العمل الخاص بك.',
2145+
'doc-generation' => 'توليد DOC',
2146+
'doc-generation-info' => 'قم بتمكين ميزة توليد DOC لاستخراج البيانات تلقائيًا من ملفات DOC وتحويلها إلى تنسيق نصي. عزز إنتاجيتك وكفاءتك من خلال تفعيل هذه الميزة لتبسيط سير عملك.',
21402147
'title' => 'الإعدادات العامة',
21412148

21422149
'models' => [

packages/Webkul/Admin/src/Resources/lang/en/app.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
'data-transfer' => 'Data Transfer',
4343
'imports' => 'Imports',
4444
'import' => 'Import',
45+
'event' => 'Event',
46+
'campaigns' => 'Campaigns',
4547
],
4648

4749
'users' => [
@@ -417,6 +419,12 @@
417419
'warning' => 'Warning',
418420
'info' => 'Info',
419421
],
422+
423+
'tiny-mce' => [
424+
'http-error' => 'HTTP Error',
425+
'invalid-json' => 'Invalid JSON response from the server.',
426+
'upload-failed' => 'File upload failed. Please try again.',
427+
],
420428
],
421429

422430
'quotes' => [
@@ -1959,7 +1967,6 @@
19591967
'file' => 'File Upload',
19601968
'file-info' => 'Only pdf,bmp,jpg,jpeg,png format files are accepted.',
19611969
'file-required' => 'Please select at least one valid file to proceed.',
1962-
'sample-pdf' => 'Sample PDF',
19631970
'save-btn' => 'Save',
19641971
'upload-file' => 'Upload File',
19651972
],
@@ -2174,8 +2181,8 @@
21742181
'info' => 'Enhance your Magic AI experience with your OpenRouter API Key. Integrate it now for a seamless, personalized AI adventure tailored just for you! Effortlessly customize settings and take control of your AI journey.',
21752182
'other' => 'Other Model',
21762183
'other-model' => 'For other models, use the Model ID from OpenRouter.',
2177-
'pdf-generation' => 'PDF Generation',
2178-
'pdf-generation-info' => 'Enable the PDF Generation feature to automatically extract data from PDF files and convert them into text format. Enhance your productivity and efficiency by enabling this feature to streamline your workflow.',
2184+
'doc-generation' => 'DOC Generation',
2185+
'doc-generation-info' => 'Enable the DOC Generation feature to automatically extract data from DOC files and convert them into text format. Enhance your productivity and efficiency by enabling this feature to streamline your workflow.',
21792186
'title' => 'General Settings',
21802187

21812188
'models' => [

packages/Webkul/Admin/src/Resources/lang/es/app.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
'data-transfer' => 'Transferencia de Datos',
4545
'imports' => 'Importaciones',
4646
'import' => 'Importar',
47+
'event' => 'Evento',
48+
'campaigns' => 'Campañas',
4749
],
4850

4951
'users' => [
@@ -419,6 +421,12 @@
419421
'warning' => 'Advertencia',
420422
'info' => 'Información',
421423
],
424+
425+
'tiny-mce' => [
426+
'http-error' => 'Error HTTP',
427+
'invalid-json' => 'Respuesta JSON no válida del servidor.',
428+
'upload-failed' => 'Error al subir el archivo. Por favor, inténtelo de nuevo.',
429+
],
422430
],
423431

424432
'quotes' => [
@@ -1960,7 +1968,6 @@
19601968
'file' => 'Carga de archivo',
19611969
'file-info' => 'Solo se aceptan archivos en formato pdf, bmp, jpg, jpeg, png.',
19621970
'file-required' => 'Por favor, selecciona al menos un archivo válido para continuar.',
1963-
'sample-pdf' => 'PDF de Muestra',
19641971
'save-btn' => 'Guardar',
19651972
'upload-file' => 'Subir archivo',
19661973
],
@@ -2021,7 +2028,7 @@
20212028
'title' => 'Sobre el Lead',
20222029
],
20232030

2024-
'quotes'=> [
2031+
'quotes' => [
20252032
'subject' => 'Asunto',
20262033
'expired-at' => 'Expirado En',
20272034
'sub-total' => 'Subtotal',
@@ -2177,8 +2184,8 @@
21772184
'info' => 'Mejora tu experiencia con Magic AI con tu clave API de OpenRouter. ¡Intégrala ahora para una aventura de IA personalizada y sin problemas, hecha a tu medida! Personaliza la configuración sin esfuerzo y toma el control de tu viaje de IA.',
21782185
'other' => 'Otro Modelo',
21792186
'other-model' => 'Para otros modelos, usa el ID del Modelo de OpenRouter.',
2180-
'pdf-generation' => 'Generación de PDF',
2181-
'pdf-generation-info' => 'Habilita la función de Generación de PDF para extraer automáticamente datos de archivos PDF y convertirlos en formato de texto. Mejora tu productividad y eficiencia habilitando esta función para optimizar tu flujo de trabajo.',
2187+
'doc-generation' => 'Generación de DOC',
2188+
'doc-generation-info' => 'Habilita la función de generación de DOC para extraer automáticamente datos de archivos DOC y convertirlos a formato de texto. Mejora tu productividad y eficiencia habilitando esta función para agilizar tu flujo de trabajo.',
21822189
'title' => 'Configuraciones Generales',
21832190

21842191
'models' => [

packages/Webkul/Admin/src/Resources/lang/fa/app.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
'data-transfer' => 'انتقال داده',
4545
'imports' => 'واردات',
4646
'import' => 'وارد کردن',
47+
'event' => 'رویداد',
48+
'campaigns' => 'کمپین‌ها',
4749
],
4850

4951
'users' => [
@@ -419,6 +421,12 @@
419421
'warning' => 'هشدار',
420422
'info' => 'اطلاعات',
421423
],
424+
425+
'tiny-mce' => [
426+
'http-error' => 'خطای HTTP',
427+
'invalid-json' => 'پاسخ JSON نامعتبر از سرور.',
428+
'upload-failed' => 'آپلود فایل ناموفق بود. لطفاً دوباره تلاش کنید.',
429+
],
422430
],
423431

424432
'quotes' => [
@@ -1961,7 +1969,6 @@
19611969
'file' => 'آپلود فایل',
19621970
'file-info' => 'فقط فایل‌های با فرمت pdf, bmp, jpg, jpeg, png پذیرفته می‌شوند.',
19631971
'file-required' => 'لطفاً حداقل یک فایل معتبر برای ادامه انتخاب کنید.',
1964-
'sample-pdf' => 'نمونه PDF',
19651972
'save-btn' => 'ذخیره',
19661973
'upload-file' => 'بارگذاری فایل',
19671974
],
@@ -2022,7 +2029,7 @@
20222029
'title' => 'درباره سرنخ',
20232030
],
20242031

2025-
'quotes'=> [
2032+
'quotes' => [
20262033
'subject' => 'موضوع',
20272034
'expired-at' => 'تاریخ انقضا',
20282035
'sub-total' => 'جمع جزئی',
@@ -2178,8 +2185,8 @@
21782185
'info' => 'تجربه هوش مصنوعی جادویی خود را با کلید API OpenRouter خود بهبود بخشید. اکنون آن را یکپارچه کنید تا یک ماجراجویی هوش مصنوعی شخصی‌سازی شده و بدون درز برای شما فراهم شود! به راحتی تنظیمات را سفارشی کنید و کنترل سفر هوش مصنوعی خود را به دست بگیرید.',
21792186
'other' => 'مدل دیگر',
21802187
'other-model' => 'برای مدل‌های دیگر، از شناسه مدل از OpenRouter استفاده کنید.',
2181-
'pdf-generation' => 'تولید PDF',
2182-
'pdf-generation-info' => 'ویژگی تولید PDF را فعال کنید تا به طور خودکار داده‌ها را از فایل‌های PDF استخراج کرده و به فرمت متنی تبدیل کنید. با فعال کردن این ویژگی، بهره‌وری و کارایی خود را افزایش دهید و جریان کاری خود را ساده کنید.',
2188+
'doc-generation' => 'تولید DOC',
2189+
'doc-generation-info' => 'ویژگی تولید DOC را فعال کنید تا به‌صورت خودکار داده‌ها را از فایل‌های DOC استخراج و به فرمت متنی تبدیل کند. با فعال‌سازی این ویژگی، بهره‌وری و کارایی خود را افزایش دهید و فرآیند کاری را ساده‌تر کنید.',
21832190
'title' => 'تنظیمات عمومی',
21842191

21852192
'models' => [

0 commit comments

Comments
 (0)