Skip to content

Commit 5fe5305

Browse files
committed
update
1 parent 513b699 commit 5fe5305

File tree

22 files changed

+272
-41
lines changed

22 files changed

+272
-41
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*/
12+
public function up(): void
13+
{
14+
Schema::table('persons', function (Blueprint $table) {
15+
$table->string('partner_2')->nullable()->after('name'); // or appropriate type
16+
$table->string('partner_3')->nullable()->after('partner_2');
17+
$table->string('local_agent')->nullable()->after('partner_3');
18+
sponsor
19+
});
20+
}
21+
22+
/**
23+
* Reverse the migrations.
24+
*/
25+
public function down(): void
26+
{
27+
Schema::table('persons', function (Blueprint $table) {
28+
$table->dropColumn(['partner_2', 'partner_3', 'local_agent']);
29+
});
30+
}
31+
};

packages/Webkul/Admin/src/DataGrids/Settings/AttributeDataGrid.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public function prepareQueryBuilder(): Builder
2828
$this->addFilter('id', 'attributes.id');
2929
$this->addFilter('type', 'attributes.type');
3030
$this->addFilter('attribute_type', 'attributes.is_user_defined');
31+
$queryBuilder->orderBy('attributes.sort_order', 'asc');
3132

3233
return $queryBuilder;
3334
}

packages/Webkul/Admin/src/Http/Controllers/Activity/ActivityController.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,12 @@ public function download(int $id): StreamedResponse
202202
{
203203
try {
204204
$file = $this->fileRepository->findOrFail($id);
205+
$extension = pathinfo($file->path, PATHINFO_EXTENSION);
206+
207+
if (!empty($file->name)) {
208+
$customName = $file->name . '_' . $file->activity->title . '.' . $extension;
209+
return Storage::download($file->path, $customName);
210+
}
205211

206212
return Storage::download($file->path);
207213
} catch (\Exception $exception) {

packages/Webkul/Admin/src/Resources/assets/images/logo.svg

Lines changed: 35 additions & 5 deletions
Loading

packages/Webkul/Admin/src/Resources/views/components/layouts/header/index.blade.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<header class="sticky top-0 z-[10001] flex items-center justify-between gap-1 border-b border-gray-200 bg-white px-4 py-2.5 transition-all dark:border-gray-800 dark:bg-gray-900">
1+
<header class="sticky top-0 z-[10001] flex items-center justify-between gap-1 border-b border-gray-200 bg-white px-4 py-2.5 transition-all dark:border-gray-800 dark:bg-gray-900">
22
<!-- logo -->
33
<div class="flex items-center gap-1.5">
44
<!-- Sidebar Menu -->
55
<x-admin::layouts.sidebar.mobile />
6-
6+
77
<a href="{{ route('admin.dashboard.index') }}">
88
@if ($logo = core()->getConfigData('general.general.admin_logo.logo_image'))
99
<img
@@ -42,7 +42,7 @@ class="h-10 sm:hidden"
4242
<!-- Mega Search Bar -->
4343
@include('admin::components.layouts.header.mobile.mega-search')
4444
</div>
45-
45+
4646
<!-- Dark mode -->
4747
<v-dark>
4848
<div class="flex">
@@ -56,7 +56,7 @@ class="{{ request()->cookie('dark_mode') ? 'icon-light' : 'icon-dark' }} p-1.5 r
5656
<!-- Quick Creation Bar -->
5757
@include('admin::components.layouts.header.quick-creation')
5858
</div>
59-
59+
6060
<!-- Admin profile -->
6161
<x-admin::dropdown position="bottom-{{ in_array(app()->getLocale(), ['fa', 'ar']) ? 'left' : 'right' }}">
6262
<x-slot:toggle>
@@ -80,7 +80,7 @@ class="h-full w-full object-cover"
8080
<x-slot:content class="mt-2 border-t-0 !p-0">
8181
<div class="flex items-center gap-1.5 border border-x-0 border-b-gray-300 px-5 py-2.5 dark:border-gray-800">
8282
<img
83-
src="{{ url('cache/logo.png') }}"
83+
src="{{ vite()->asset('images/logo.svg') }}"
8484
width="24"
8585
height="24"
8686
/>

packages/Webkul/Admin/src/Resources/views/contacts/persons/create.blade.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</x-slot>
66

77
{!! view_render_event('admin.persons.create.form.before') !!}
8-
8+
99
<!--Create Page Form -->
1010
<x-admin::form
1111
:action="route('admin.contacts.persons.store')"
@@ -26,7 +26,6 @@
2626
@lang('admin::app.contacts.persons.create.title')
2727
</div>
2828
</div>
29-
3029
<div class="flex items-center gap-x-2.5">
3130
<div class="flex items-center gap-x-2.5">
3231
{!! view_render_event('admin.persons.create.create_button.before') !!}
@@ -43,7 +42,7 @@ class="primary-button"
4342
</div>
4443
</div>
4544
</div>
46-
45+
4746
<!-- Form fields -->
4847
<div class="box-shadow rounded-lg border border-gray-200 bg-white p-4 dark:border-gray-800 dark:bg-gray-900">
4948
{!! view_render_event('admin.persons.create.form_controls.before') !!}
@@ -62,7 +61,7 @@ class="primary-button"
6261
],
6362
]"
6463
/>
65-
64+
6665
{!! view_render_event('admin.persons.create.form_controls.after') !!}
6766
</div>
6867
</div>

packages/Webkul/Admin/src/Resources/views/contacts/persons/edit.blade.php

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
<div class="flex flex-col gap-2">
1818
{!! view_render_event('admin.persons.edit.breadcrumbs.before') !!}
1919

20-
<x-admin::breadcrumbs
21-
name="contacts.persons.edit"
20+
<x-admin::breadcrumbs
21+
name="contacts.persons.edit"
2222
:entity="$person"
2323
/>
2424

@@ -49,10 +49,50 @@ class="primary-button"
4949
<div class="box-shadow rounded-lg border border-gray-200 bg-white p-4 dark:border-gray-800 dark:bg-gray-900">
5050
{!! view_render_event('admin.contacts.persons.edit.form_controls.before') !!}
5151

52+
@php
53+
$attributes = app('Webkul\Attribute\Repositories\AttributeRepository')->findWhere([
54+
'entity_type' => 'persons',
55+
]);
56+
57+
$should_remove_fields=[];
58+
59+
foreach ($attributes as $attribute){
60+
if($attribute->code==='person_type'){
61+
62+
$attributeValues = app('Webkul\Attribute\Repositories\AttributeValueRepository')->findWhere([
63+
'entity_type' => 'persons',
64+
'attribute_id'=>$attribute->id
65+
])->first();
66+
67+
68+
switch($attributeValues->integer_value){
69+
case 1:
70+
71+
break;
72+
case 2:
73+
74+
$should_remove_fields=['company_name_en','company_name_ar','license_no',
75+
'company_issue_date','company_expiry_date','partner_2','partner_3','local_agent'
76+
];
77+
78+
break;
79+
case 3:
80+
$should_remove_fields=['company_name_en','company_name_ar','license_no',
81+
'company_issue_date','company_expiry_date','partner_2','partner_3','local_agent'
82+
];
83+
84+
break;
85+
86+
}
87+
88+
}
89+
}
90+
$attributes = $attributes->reject(function ($attribute) use ($should_remove_fields) {
91+
return in_array($attribute->code, $should_remove_fields);
92+
});
93+
@endphp
5294
<x-admin::attributes
53-
:custom-attributes="app('Webkul\Attribute\Repositories\AttributeRepository')->findWhere([
54-
'entity_type' => 'persons',
55-
])"
95+
:custom-attributes="$attributes"
5696
:custom-validations="[
5797
'name' => [
5898
'min:2',
@@ -64,7 +104,7 @@ class="primary-button"
64104
]"
65105
:entity="$person"
66106
/>
67-
107+
68108
{!! view_render_event('admin.contacts.persons.edit.form_controls.after') !!}
69109
</div>
70110
</div>

packages/Webkul/Admin/src/Resources/views/contacts/persons/view/attributes.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
>
1919
<form @submit="handleSubmit($event, () => {})">
2020
{!! view_render_event('admin.contacts.persons.view.attributes.form_controls.attributes_view.before', ['person' => $person]) !!}
21-
21+
2222
<x-admin::attributes.view
2323
:custom-attributes="app('Webkul\Attribute\Repositories\AttributeRepository')->findWhere([
2424
'entity_type' => 'persons',
@@ -28,11 +28,11 @@
2828
:url="route('admin.contacts.persons.update', $person->id)"
2929
:allow-edit="true"
3030
/>
31-
31+
3232
{!! view_render_event('admin.contacts.persons.view.attributes.form_controls.attributes_view.after', ['person' => $person]) !!}
3333
</form>
3434
</x-admin::form>
35-
35+
3636
{!! view_render_event('admin.contacts.persons.view.attributes.form_controls.after', ['person' => $person]) !!}
3737
</x-slot>
3838
</x-admin::accordion>

packages/Webkul/Admin/src/Resources/views/leads/common/contact.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,4 @@
138138
}
139139
});
140140
</script>
141-
@endPushOnce
141+
@endPushOnce

packages/Webkul/Admin/src/Resources/views/sessions/login.blade.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
<!-- Logo -->
1010
@if ($logo = core()->getConfigData('general.design.admin_logo.logo_image'))
1111
<img
12-
class="h-10 w-[110px]"
12+
class="h-50 w-[150px]"
1313
src="{{ Storage::url($logo) }}"
1414
alt="{{ config('app.name') }}"
1515
/>
1616
@else
1717
<img
18-
class="w-max"
18+
class="h-50 w-[150px]"
1919
src="{{ vite()->asset('images/logo.svg') }}"
2020
alt="{{ config('app.name') }}"
2121
/>
@@ -103,12 +103,12 @@ class="primary-button"
103103
</div>
104104

105105
<!-- Powered By -->
106-
<div class="text-sm font-normal">
107-
@lang('admin::app.components.layouts.powered-by.description', [
108-
'krayin' => '<a class="text-brandColor hover:underline " href="https://krayincrm.com/">Krayin</a>',
109-
'webkul' => '<a class="text-brandColor hover:underline " href="https://webkul.com/">Webkul</a>',
110-
])
111-
</div>
106+
{{-- <div class="text-sm font-normal">--}}
107+
{{-- @lang('admin::app.components.layouts.powered-by.description', [--}}
108+
{{-- 'krayin' => '<a class="text-brandColor hover:underline " href="https://krayincrm.com/">Krayin</a>',--}}
109+
{{-- 'webkul' => '<a class="text-brandColor hover:underline " href="https://webkul.com/">Webkul</a>',--}}
110+
{{-- ])--}}
111+
{{-- </div>--}}
112112
</div>
113113

114114
@push('scripts')

packages/Webkul/Admin/src/Routes/Front/web.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@
66
/**
77
* Home routes.
88
*/
9-
Route::get('/', [Controller::class, 'redirectToLogin'])->name('krayin.home');
9+
//Route::get('/', [Controller::class, 'redirectToLogin'])->name('krayin.home');
10+
Route::get('/', function () {
11+
return view('landing');
12+
});

packages/Webkul/Attribute/src/Models/Attribute.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,11 @@ public function options()
3232
{
3333
return $this->hasMany(AttributeOptionProxy::modelClass());
3434
}
35+
36+
protected static function booted()
37+
{
38+
static::addGlobalScope('orderBySortOrder', function ($query) {
39+
$query->orderBy('sort_order');
40+
});
41+
}
3542
}

packages/Webkul/Contact/src/Repositories/PersonRepository.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ class PersonRepository extends Repository
2222
'organization.name',
2323
'user_id',
2424
'user.name',
25+
'partner_2', // add this
26+
'partner_3', // add this
27+
'local_agent', // add this
2528
];
2629

2730
/**

0 commit comments

Comments
 (0)