mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-09 12:42:36 +01:00
Move new properties to account_email_settings
This commit is contained in:
parent
7dc4ecd209
commit
48cfe8cc6b
@ -71,7 +71,7 @@ class SendRecurringInvoices extends Command
|
||||
|
||||
foreach ($accounts as $account) {
|
||||
|
||||
if(!$account->is_disabled)
|
||||
if(!$account->account_email_settings->is_disabled)
|
||||
$account->checkCounterReset();
|
||||
}
|
||||
}
|
||||
@ -97,7 +97,7 @@ class SendRecurringInvoices extends Command
|
||||
|
||||
$account = $recurInvoice->account;
|
||||
|
||||
if($account->is_disabled){
|
||||
if($account->account_email_settings->is_disabled){
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -134,7 +134,7 @@ class SendRecurringInvoices extends Command
|
||||
foreach ($expenses as $expense) {
|
||||
$shouldSendToday = $expense->shouldSendToday();
|
||||
|
||||
if (! $shouldSendToday || $expense->account->is_disabled) {
|
||||
if (! $shouldSendToday || $expense->account->account_email_settings->is_disabled) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,7 @@ class SendReminders extends Command
|
||||
$this->info(date('r ') . $accounts->count() . ' accounts found with fees enabled');
|
||||
|
||||
foreach ($accounts as $account) {
|
||||
if (! $account->hasFeature(FEATURE_EMAIL_TEMPLATES_REMINDERS) || $account->is_disabled) {
|
||||
if (! $account->hasFeature(FEATURE_EMAIL_TEMPLATES_REMINDERS) || $account->account_email_settings->is_disabled) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -155,7 +155,7 @@ class SendReminders extends Command
|
||||
$this->info(date('r ') . count($accounts) . ' accounts found with reminders enabled');
|
||||
|
||||
foreach ($accounts as $account) {
|
||||
if (! $account->hasFeature(FEATURE_EMAIL_TEMPLATES_REMINDERS) || $account->is_disabled) {
|
||||
if (! $account->hasFeature(FEATURE_EMAIL_TEMPLATES_REMINDERS) || $account->account_email_settings->is_disabled) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -201,7 +201,7 @@ class SendReminders extends Command
|
||||
$account = $scheduledReport->account;
|
||||
$account->loadLocalizationSettings();
|
||||
|
||||
if (! $account->hasFeature(FEATURE_REPORTS) || $account->is_disabled) {
|
||||
if (! $account->hasFeature(FEATURE_REPORTS) || $account->account_email_settings->is_disabled) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -68,14 +68,14 @@ class ClientPortalController extends BaseController
|
||||
$account = $invoice->account;
|
||||
|
||||
/* Forward requests from V4 to V5 if the domain is set */
|
||||
if(strlen($account->forward_url_for_v5) >1){
|
||||
if(strlen($account->account_email_settings->forward_url_for_v5) >1){
|
||||
|
||||
if ($invoice->isType(INVOICE_TYPE_QUOTE))
|
||||
$entity = 'quote';
|
||||
else
|
||||
$entity = 'invoice';
|
||||
|
||||
return redirect($account->forward_url_for_v5."/client/".$entity."/".$invitationKey);
|
||||
return redirect($account->account_email_settings->forward_url_for_v5."/client/".$entity."/".$invitationKey);
|
||||
}
|
||||
|
||||
if (request()->silent) {
|
||||
|
@ -101,17 +101,17 @@ class StepsController extends BaseController
|
||||
->withInput();
|
||||
}
|
||||
|
||||
$account = \Auth::user()->account;
|
||||
$account_settings = \Auth::user()->account->account_email_settings;
|
||||
|
||||
if(strlen($request->input('url')) == 0) {
|
||||
$account->is_disabled = false;
|
||||
$account_settings->is_disabled = false;
|
||||
}
|
||||
else {
|
||||
$account->is_disabled = true;
|
||||
$account_settings->is_disabled = true;
|
||||
}
|
||||
|
||||
$account->forward_url_for_v5 = rtrim($request->input('url'),'/');
|
||||
$account->save();
|
||||
$account_settings->forward_url_for_v5 = rtrim($request->input('url'),'/');
|
||||
$account_settings->save();
|
||||
|
||||
return back();
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ class AddForwardUrlForV5 extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('accounts', function ($table) {
|
||||
Schema::table('account_email_settings', function ($table) {
|
||||
$table->text('forward_url_for_v5')->default('');
|
||||
$table->boolean('is_disabled')->default(false);
|
||||
});
|
||||
|
@ -285,7 +285,7 @@
|
||||
<div class="form-group">
|
||||
<label for="url" class="control-label col-lg-4 col-sm-4 text-right">{!! trans('texts.url') !!}</label>
|
||||
<div class="col-lg-8 col-sm-8">
|
||||
<input type="text" name="url" placeholder="https://subdomain.invoicing.co" class="form form-control" value="{{ $account->forward_url_for_v5}}">
|
||||
<input type="text" name="url" placeholder="https://subdomain.invoicing.co" class="form form-control" value="{{ $account->account_email_settings->forward_url_for_v5}}">
|
||||
@if($errors->has('url'))
|
||||
<div class="col-sm-5">
|
||||
@foreach ($errors->get('url') as $message)
|
||||
|
Loading…
Reference in New Issue
Block a user