mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Improve notification filters
This commit is contained in:
parent
6eb85006da
commit
b6c0300775
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\DataMapper\CompanySettings;
|
||||||
use App\DataMapper\DefaultSettings;
|
use App\DataMapper\DefaultSettings;
|
||||||
use App\Http\Requests\Company\CreateCompanyRequest;
|
use App\Http\Requests\Company\CreateCompanyRequest;
|
||||||
use App\Http\Requests\Company\DestroyCompanyRequest;
|
use App\Http\Requests\Company\DestroyCompanyRequest;
|
||||||
@ -218,6 +219,7 @@ class CompanyController extends BaseController
|
|||||||
'is_locked' => 0,
|
'is_locked' => 0,
|
||||||
'permissions' => '',
|
'permissions' => '',
|
||||||
'settings' => null,
|
'settings' => null,
|
||||||
|
'notifications' => CompanySettings::notificationDefaults(),
|
||||||
//'settings' => DefaultSettings::userSettings(),
|
//'settings' => DefaultSettings::userSettings(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ class UpdatePaymentRequest extends Request
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'invoices' => ['required','array','min:1',new PaymentAppliedValidAmount,new ValidCreditsPresentRule],
|
'invoices' => ['required','array','min:1',new PaymentAppliedValidAmount,new ValidCreditsPresentRule],
|
||||||
|
'invoices.*.invoice_id' => 'distinct',
|
||||||
'documents' => 'mimes:png,ai,svg,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx',
|
'documents' => 'mimes:png,ai,svg,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@ -77,4 +78,11 @@ class UpdatePaymentRequest extends Request
|
|||||||
}
|
}
|
||||||
$this->replace($input);
|
$this->replace($input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function messages()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'distinct' => 'Attemping duplicate payment on the same invoice Invoice',
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,6 +50,9 @@ trait UserNotifies
|
|||||||
$notifiable_methods = [];
|
$notifiable_methods = [];
|
||||||
$notifications = $company_user->notifications;
|
$notifications = $company_user->notifications;
|
||||||
|
|
||||||
|
if(!$notifications)
|
||||||
|
return [];
|
||||||
|
|
||||||
if ($entity->user_id == $company_user->_user_id || $entity->assigned_user_id == $company_user->user_id) {
|
if ($entity->user_id == $company_user->_user_id || $entity->assigned_user_id == $company_user->user_id) {
|
||||||
array_push($required_permissions, "all_user_notifications");
|
array_push($required_permissions, "all_user_notifications");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user