Compare commits
5 commits
6f0cc59162
...
5ba6404b84
Author | SHA1 | Date | |
---|---|---|---|
5ba6404b84 | |||
c8f0b46a3c | |||
de14ec8221 | |||
1600b9bef2 | |||
30552e58a5 |
13 changed files with 50 additions and 59 deletions
|
@ -1,3 +1,9 @@
|
|||
0.9.0
|
||||
|
||||
* Display a localized warning on Customers without a Mailbox.
|
||||
* Drop the (not working) ability to link a Customer to multiple Mailboxes.
|
||||
* Improve routes overrides.
|
||||
|
||||
0.8.1
|
||||
|
||||
* Fix filtering by Mailbox when getting Customers for a non-admin User.
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
<?php
|
||||
/*
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
SPDX-FileCopyrightText: © 2024 Millions Missing FRANCE <info@millionsmissing.fr>
|
||||
*/
|
||||
|
||||
return [
|
||||
'name' => 'MMFRestrictedCustomers'
|
||||
|
|
|
@ -68,7 +68,7 @@ class CrmController extends BaseCrmController {
|
|||
}
|
||||
|
||||
if ($fail || $validator->fails()) {
|
||||
return redirect()->route('mmfrestrictedcustomers.create_customer')
|
||||
return redirect()->route('crm.create_customer')
|
||||
->withErrors($validator)
|
||||
->withInput();
|
||||
}
|
||||
|
|
|
@ -14,10 +14,8 @@ Route::group(['middleware' => 'web', 'prefix' => \Helper::getSubdirectory(), 'na
|
|||
Route::post('/customers/ajax', ['uses' => CustomersController::class . '@ajax', 'laroute' => true])->name('customers.ajax');
|
||||
// Crm module
|
||||
Route::group([ 'roles' => ['user', 'admin'] ], function() {
|
||||
Route::get('/customers/new', CrmController::class . '@createCustomer')->name('mmfrestrictedcustomers.create_customer');
|
||||
Route::get('/customers/new', CrmController::class . '@createCustomer')->name('crm.create_customer');
|
||||
Route::post('/customers/new', CrmController::class . '@createCustomerSave');
|
||||
Route::get('/crm/ajax-html/{action}/{param?}', ['uses' => CrmController::class . '@ajaxHtml'])->name('crm.ajax_html');
|
||||
Route::get('/customers/fields/ajax-search', ['uses' => CrmController::class . '@ajaxSearch', 'laroute' => true])->name('crm.ajax_search');
|
||||
Route::post('/crm/ajax', ['uses' => CrmController::class . '@ajax', 'laroute' => true])->name('crm.ajax');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
<?php
|
||||
/*
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
SPDX-FileCopyrightText: © 2024 Millions Missing FRANCE <info@millionsmissing.fr>
|
||||
*/
|
||||
|
||||
namespace Modules\MMFRestrictedCustomers\Providers;
|
||||
|
||||
|
@ -24,7 +28,7 @@ class MMFRestrictedCustomersServiceProvider extends ServiceProvider {
|
|||
public function boot() {
|
||||
$this->registerConfig();
|
||||
$this->registerViews();
|
||||
$this->registerFactories();
|
||||
$this->registerTranslations();
|
||||
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
|
||||
$this->commands([
|
||||
FetchEmails::class,
|
||||
|
@ -116,7 +120,7 @@ class MMFRestrictedCustomersServiceProvider extends ServiceProvider {
|
|||
* @return void
|
||||
*/
|
||||
public function registerTranslations() {
|
||||
$this->loadJsonTranslationsFrom(__DIR__ .'/../Resources/lang');
|
||||
$this->loadTranslationsFrom(__DIR__ .'/../Resources/lang', 'mmfrestrictedcustomers');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
52
README.md
52
README.md
|
@ -37,11 +37,11 @@ You have been warned.
|
|||
|
||||
Download the [release tarball] and extract its content into `Modules/MMFRestrictedCustomers`.
|
||||
|
||||
[release tarball]: https://port.numenaute.org/MMF/freescout-restricted-customers/archive/0.8.1.tar.gz
|
||||
[release tarball]: https://port.numenaute.org/MMF/freescout-restricted-customers/archive/0.9.0.tar.gz
|
||||
|
||||
```
|
||||
wget https://port.numenaute.org/MMF/freescout-restricted-customers/archive/0.8.1.tar.gz -O freescout-restricted-customers-0.8.1.tar.gz
|
||||
tar xf freescout-restricted-customers-0.8.1.tar.gz -C Modules
|
||||
wget https://port.numenaute.org/MMF/freescout-restricted-customers/archive/0.9.0.tar.gz -O freescout-restricted-customers-0.9.0.tar.gz
|
||||
tar xf freescout-restricted-customers-0.9.0.tar.gz -C Modules
|
||||
mv Modules/freescout-restricted-customers Modules/MMFRestrictedCustomers
|
||||
```
|
||||
|
||||
|
@ -53,8 +53,8 @@ git clone https://port.numenaute.org/MMF/freescout-restricted-customers.git Modu
|
|||
|
||||
### Edit the application routes
|
||||
|
||||
Routes set in other modules or in Freescout itself can not be automatically overridden.
|
||||
Overriding them has to be done manually, in the three following files.
|
||||
Routes set in Freescout itself can not be automatically overridden.
|
||||
Overriding them has to be done manually, in the following file:
|
||||
|
||||
#### routes/web.php
|
||||
|
||||
|
@ -80,48 +80,6 @@ Route::get('/customers/ajax-search', ['uses' => '\Modules\MMFRestrictedCustomers
|
|||
Route::post('/customers/ajax', ['uses' => '\Modules\MMFRestrictedCustomers\Http\Controllers\CustomersController@ajax', 'laroute' => true])->name('customers.ajax');
|
||||
```
|
||||
|
||||
#### Modules/Crm/Http/routes.php
|
||||
|
||||
The following list of routes:
|
||||
|
||||
```php
|
||||
Route::group(['middleware' => ['web', 'auth', 'roles'], 'roles' => ['user', 'admin'], 'prefix' => \Helper::getSubdirectory(), 'namespace' => 'Modules\Crm\Http\Controllers'], function()
|
||||
{
|
||||
Route::get('/customers/new', 'CrmController@createCustomer')->name('crm.create_customer');
|
||||
Route::post('/customers/new', 'CrmController@createCustomerSave');
|
||||
Route::get('/crm/ajax-html/{action}/{param?}', ['uses' => 'CrmController@ajaxHtml'])->name('crm.ajax_html');
|
||||
Route::get('/customers/fields/ajax-search', ['uses' => 'CrmController@ajaxSearch', 'laroute' => true])->name('crm.ajax_search');
|
||||
Route::post('/crm/ajax', ['uses' => 'CrmController@ajax', 'laroute' => true])->name('crm.ajax');
|
||||
});
|
||||
```
|
||||
|
||||
should be replaced with:
|
||||
|
||||
```php
|
||||
Route::group(['middleware' => ['web', 'auth', 'roles'], 'roles' => ['user', 'admin'], 'prefix' => \Helper::getSubdirectory(), 'namespace' => 'Modules\MMFRestrictedCustomers\Http\Controllers'], function()
|
||||
{
|
||||
Route::get('/customers/new', 'CrmController@createCustomer')->name('mmfrestrictedcustomers.create_customer');
|
||||
Route::post('/customers/new', 'CrmController@createCustomerSave');
|
||||
Route::get('/crm/ajax-html/{action}/{param?}', ['uses' => '\Modules\Crm\Http\Controllers\CrmController@ajaxHtml'])->name('crm.ajax_html');
|
||||
Route::get('/customers/fields/ajax-search', ['uses' => 'CrmController@ajaxSearch', 'laroute' => true])->name('crm.ajax_search');
|
||||
Route::post('/crm/ajax', ['uses' => 'CrmController@ajax', 'laroute' => true])->name('crm.ajax');
|
||||
});
|
||||
```
|
||||
|
||||
#### Modules/Crm/Providers/CrmServiceProvider.php
|
||||
|
||||
At line 173, this route call:
|
||||
|
||||
```php
|
||||
$html = __('Customers').' <a href="#" data-trigger="modal" data-modal-title="'.__('Add Customer').'" data-modal-size="lg" data-modal-no-footer="true" data-modal-body=\'<iframe src="'.route('crm.create_customer', ['x_embed' => 1]).'" frameborder="0" class="modal-iframe"></iframe>\' class="btn btn-bordered btn-xs" style="position:relative;top:-1px;margin-left:4px;"><i class="glyphicon glyphicon-plus" title="'.__('Add Customer').'" data-toggle="tooltip"></i></a>';
|
||||
```
|
||||
|
||||
should be replaced with:
|
||||
|
||||
```php
|
||||
$html = __('Customers').' <a href="#" data-trigger="modal" data-modal-title="'.__('Add Customer').'" data-modal-size="lg" data-modal-no-footer="true" data-modal-body=\'<iframe src="'.route('mmfrestrictedcustomers.create_customer', ['x_embed' => 1]).'" frameborder="0" class="modal-iframe"></iframe>\' class="btn btn-bordered btn-xs" style="position:relative;top:-1px;margin-left:4px;"><i class="glyphicon glyphicon-plus" title="'.__('Add Customer').'" data-toggle="tooltip"></i></a>';
|
||||
```
|
||||
|
||||
### Edit the artisan commands
|
||||
|
||||
Console commands set in other modules or in Freescout itself can not be automatically overridden.
|
||||
|
|
9
Resources/lang/en/customers.php
Normal file
9
Resources/lang/en/customers.php
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
/*
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
SPDX-FileCopyrightText: © 2024 Millions Missing FRANCE <info@millionsmissing.fr>
|
||||
*/
|
||||
|
||||
return [
|
||||
'no-mailbox' => 'Warning: no mailbox.',
|
||||
];
|
9
Resources/lang/fr/customers.php
Normal file
9
Resources/lang/fr/customers.php
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
/*
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
SPDX-FileCopyrightText: © 2024 Millions Missing FRANCE <info@millionsmissing.fr>
|
||||
*/
|
||||
|
||||
return [
|
||||
'no-mailbox' => 'Attention: pas de boîte mail liée.',
|
||||
];
|
|
@ -6,7 +6,7 @@
|
|||
<a href="{{ Eventy::filter('customer.card.url', route('customers.update', ['id' => $customer->id]), $customer) }}" class="card hover-shade" @action('customer.card.link', $customer) >
|
||||
<img src="{{ $customer->getPhotoUrl() }}" />
|
||||
@if ($customer->mailbox_id == null)
|
||||
<p style="font-size:12px; color: red;">{{ __('Warning: no mailbox') }}</p>
|
||||
<p style="font-size:12px; color: red;">{{ __('mmfrestrictedcustomers::customers.no-mailbox') }}</p>
|
||||
@endif
|
||||
<h4 title="{{ $customer->first_name }} {{ $customer->last_name }}">{{ $customer->first_name }} {{ $customer->last_name }}</h4>
|
||||
<p class="text-truncate"><small>{{ $customer->getEmailOrPhone() }}</small></p>
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="block-help"><a href="#" class="multi-add" tabindex="-1">{{ __('Add a mailbox') }}</a></p>
|
||||
</div>
|
||||
@include('partials/field_error', ['field'=>'mailbox'])
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "millions-missing-france/freescout-restricted-customers",
|
||||
"description": "Freescout restricted customers - Restrict access to Freescout customers to specific mailboxes",
|
||||
"version": "0.8.1",
|
||||
"version": "0.9.0",
|
||||
"type": "library",
|
||||
"license": ["AGPL-3.0-only"],
|
||||
"authors": [
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"name": "MMFRestrictedCustomers",
|
||||
"alias": "mmfrestrictedcustomers",
|
||||
"description": "Freescout restricted customers - Restrict access to Freescout customers to specific mailboxes",
|
||||
"version": "0.8.1",
|
||||
"version": "0.9.0",
|
||||
"detailsUrl": "",
|
||||
"author": "Millions Missing FRANCE",
|
||||
"authorUrl": "info@millionsmissing.fr",
|
||||
|
@ -10,7 +10,7 @@
|
|||
"license": "AGPL-3.0-only",
|
||||
"keywords": [],
|
||||
"active": 0,
|
||||
"order": 0,
|
||||
"order": 1,
|
||||
"providers": [
|
||||
"Modules\\MMFRestrictedCustomers\\Providers\\MMFRestrictedCustomersServiceProvider"
|
||||
],
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
<?php
|
||||
/*
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
SPDX-FileCopyrightText: © 2024 Millions Missing FRANCE <info@millionsmissing.fr>
|
||||
*/
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue