mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge branch 'develop' of github.com:hillelcoren/invoice-ninja into develop
This commit is contained in:
commit
9efaada9f5
@ -132,7 +132,7 @@ class AccountApiController extends BaseAPIController
|
|||||||
$devices[$x]['token'] = $request->token; //update
|
$devices[$x]['token'] = $request->token; //update
|
||||||
$account->devices = json_encode($devices);
|
$account->devices = json_encode($devices);
|
||||||
$account->save();
|
$account->save();
|
||||||
return $this->response($account);
|
return $this->response($devices[$x]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,7 +152,7 @@ class AccountApiController extends BaseAPIController
|
|||||||
$account->devices = json_encode($devices);
|
$account->devices = json_encode($devices);
|
||||||
$account->save();
|
$account->save();
|
||||||
|
|
||||||
return $this->response($account);
|
return $this->response($newDevice);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,7 +185,7 @@ class AccountApiController extends BaseAPIController
|
|||||||
$account->devices = json_encode($devices);
|
$account->devices = json_encode($devices);
|
||||||
$account->save();
|
$account->save();
|
||||||
|
|
||||||
return $this->response($account);
|
return $this->response($newDevice);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ use App\Events\QuoteInvitationWasViewed;
|
|||||||
use App\Events\QuoteInvitationWasApproved;
|
use App\Events\QuoteInvitationWasApproved;
|
||||||
use App\Events\PaymentWasCreated;
|
use App\Events\PaymentWasCreated;
|
||||||
use App\Ninja\Notifications;
|
use App\Ninja\Notifications;
|
||||||
|
use App\Services\PushService;
|
||||||
|
|
||||||
class NotificationListener
|
class NotificationListener
|
||||||
{
|
{
|
||||||
@ -17,7 +18,7 @@ class NotificationListener
|
|||||||
protected $contactMailer;
|
protected $contactMailer;
|
||||||
protected $pushService;
|
protected $pushService;
|
||||||
|
|
||||||
public function __construct(UserMailer $userMailer, ContactMailer $contactMailer, Notifications\PushService $pushService)
|
public function __construct(UserMailer $userMailer, ContactMailer $contactMailer, PushService $pushService)
|
||||||
{
|
{
|
||||||
$this->userMailer = $userMailer;
|
$this->userMailer = $userMailer;
|
||||||
$this->contactMailer = $contactMailer;
|
$this->contactMailer = $contactMailer;
|
||||||
|
@ -194,7 +194,6 @@ class AccountRepository
|
|||||||
$account = $this->getNinjaAccount();
|
$account = $this->getNinjaAccount();
|
||||||
$lastInvoice = Invoice::withTrashed()->whereAccountId($account->id)->orderBy('public_id', 'DESC')->first();
|
$lastInvoice = Invoice::withTrashed()->whereAccountId($account->id)->orderBy('public_id', 'DESC')->first();
|
||||||
$publicId = $lastInvoice ? ($lastInvoice->public_id + 1) : 1;
|
$publicId = $lastInvoice ? ($lastInvoice->public_id + 1) : 1;
|
||||||
|
|
||||||
$invoice = new Invoice();
|
$invoice = new Invoice();
|
||||||
$invoice->account_id = $account->id;
|
$invoice->account_id = $account->id;
|
||||||
$invoice->user_id = $account->users()->first()->id;
|
$invoice->user_id = $account->users()->first()->id;
|
||||||
|
@ -51,7 +51,7 @@ class PushService
|
|||||||
foreach($devices as $device)
|
foreach($devices as $device)
|
||||||
{
|
{
|
||||||
if(($device["notify_{$type}"] == TRUE) && ($device['device'] == 'ios'))
|
if(($device["notify_{$type}"] == TRUE) && ($device['device'] == 'ios'))
|
||||||
$this->pushMessage($invoice, $device['token'], $device["notify_{$type}"]);
|
$this->pushMessage($invoice, $device['token'], $type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -104,19 +104,19 @@ class PushService
|
|||||||
{
|
{
|
||||||
switch($type)
|
switch($type)
|
||||||
{
|
{
|
||||||
case 'notify_sent':
|
case 'sent':
|
||||||
return $this->entitySentMessage($invoice);
|
return $this->entitySentMessage($invoice);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'notify_paid':
|
case 'paid':
|
||||||
return $this->invoicePaidMessage($invoice);
|
return $this->invoicePaidMessage($invoice);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'notify_approved':
|
case 'approved':
|
||||||
return $this->quoteApprovedMessage($invoice);
|
return $this->quoteApprovedMessage($invoice);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'notify_viewed':
|
case 'viewed':
|
||||||
return $this->entityViewedMessage($invoice);
|
return $this->entityViewedMessage($invoice);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -129,9 +129,9 @@ class PushService
|
|||||||
private function entitySentMessage($invoice)
|
private function entitySentMessage($invoice)
|
||||||
{
|
{
|
||||||
if($invoice->is_quote)
|
if($invoice->is_quote)
|
||||||
return 'Quote #{$invoice->invoice_number} sent!';
|
return "Quote #{$invoice->invoice_number} sent!";
|
||||||
else
|
else
|
||||||
return 'Invoice #{$invoice->invoice_number} sent!';
|
return "Invoice #{$invoice->invoice_number} sent";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ class PushService
|
|||||||
*/
|
*/
|
||||||
private function invoicePaidMessage($invoice)
|
private function invoicePaidMessage($invoice)
|
||||||
{
|
{
|
||||||
return 'Invoice #{$invoice->invoice_number} paid!';
|
return "Invoice #{$invoice->invoice_number} paid!";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -150,7 +150,7 @@ class PushService
|
|||||||
*/
|
*/
|
||||||
private function quoteApprovedMessage($invoice)
|
private function quoteApprovedMessage($invoice)
|
||||||
{
|
{
|
||||||
return 'Quote #{$invoice->invoice_number} approved!';
|
return "Quote #{$invoice->invoice_number} approved!";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -160,9 +160,9 @@ class PushService
|
|||||||
private function entityViewedMessage($invoice)
|
private function entityViewedMessage($invoice)
|
||||||
{
|
{
|
||||||
if($invoice->is_quote)
|
if($invoice->is_quote)
|
||||||
return 'Quote #{$invoice->invoice_number} viewed!';
|
return "Quote #{$invoice->invoice_number} viewed!";
|
||||||
else
|
else
|
||||||
return 'Invoice #{$invoice->invoice_number} viewed!';
|
return "Invoice #{$invoice->invoice_number} viewed!";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
* [Softaculous](https://www.softaculous.com/apps/ecommerce/Invoice_Ninja) - $30
|
* [Softaculous](https://www.softaculous.com/apps/ecommerce/Invoice_Ninja) - $30
|
||||||
|
|
||||||
### Requirements
|
### Requirements
|
||||||
|
|
||||||
* PHP >= 5.5.9
|
* PHP >= 5.5.9
|
||||||
* MCrypt PHP Extension
|
* MCrypt PHP Extension
|
||||||
* MySQL
|
* MySQL
|
||||||
@ -98,4 +99,4 @@ We're using the [Git-Flow](http://nvie.com/posts/a-successful-git-branching-mode
|
|||||||
* [ezyang/htmlpurifier](https://github.com/ezyang/htmlpurifier) - Standards compliant HTML filter written in PHP
|
* [ezyang/htmlpurifier](https://github.com/ezyang/htmlpurifier) - Standards compliant HTML filter written in PHP
|
||||||
* [cerdic/css-tidy](https://github.com/Cerdic/CSSTidy) - CSSTidy is a CSS minifier
|
* [cerdic/css-tidy](https://github.com/Cerdic/CSSTidy) - CSSTidy is a CSS minifier
|
||||||
* [asgrim/ofxparser](https://github.com/asgrim/ofxparser) - OFX File Parser
|
* [asgrim/ofxparser](https://github.com/asgrim/ofxparser) - OFX File Parser
|
||||||
* [stacktracejs/stacktrace.js](https://github.com/stacktracejs/stacktrace.js) - Framework-agnostic, micro-library for getting stack traces in all web browsers
|
* [stacktracejs/stacktrace.js](https://github.com/stacktracejs/stacktrace.js) - Framework-agnostic, micro-library for getting stack traces in all web browsers
|
||||||
|
Loading…
x
Reference in New Issue
Block a user