1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-12 14:12:44 +01:00

Merge branch 'develop' of github.com:hillelcoren/invoice-ninja into develop

This commit is contained in:
Hillel Coren 2016-03-03 10:44:55 +02:00
commit ee8a01ff3a
2 changed files with 13 additions and 12 deletions

View File

@ -162,25 +162,26 @@ class AccountApiController extends BaseAPIController
$devices = json_decode($account->devices, TRUE);
if(count($devices)<1)
return $this->errorResponse(['message'=>'no devices exist'], 400);
if(count($devices) < 1)
return $this->errorResponse(['message'=>'No registered devices.'], 400);
for($x=0; $x<count($devices); $x++)
{
if($devices[$x]['email'] == Auth::user()->username)
{
unset($devices[$x]);
$newDevice = [
'token' => $request->token,
'email' => $request->email,
'device' => $request->device,
'token' => $devices[$x]['token'],
'email' => $devices[$x]['email'],
'device' => $devices[$x]['device'],
'notify_sent' => $request->notify_sent,
'notify_viewed' => $request->notify_viewed,
'notify_approved' => $request->notify_approved,
'notify_paid' => $request->notify_paid,
];
unset($devices[$x]);
$devices[] = $newDevice;
$account->devices = json_encode($devices);
$account->save();

View File

@ -129,9 +129,9 @@ class PushService
private function entitySentMessage($invoice)
{
if($invoice->is_quote)
return "Quote #{$invoice->invoice_number} sent!";
return trans("texts.notification_quote_sent_subject", ['invoice' => $invoice->invoice_number, 'client' => $invoice->client->name]);
else
return "Invoice #{$invoice->invoice_number} sent";
return trans("texts.notification_invoice_sent_subject", ['invoice' => $invoice->invoice_number, 'client' => $invoice->client->name]);
}
@ -141,7 +141,7 @@ class PushService
*/
private function invoicePaidMessage($invoice)
{
return "Invoice #{$invoice->invoice_number} paid!";
return trans("texts.notification_invoice_paid_subject", ['invoice' => $invoice->invoice_number, 'client' => $invoice->client->name]);
}
/**
@ -150,7 +150,7 @@ class PushService
*/
private function quoteApprovedMessage($invoice)
{
return "Quote #{$invoice->invoice_number} approved!";
return trans("texts.notification_quote_approved_subject", ['invoice' => $invoice->invoice_number, 'client' => $invoice->client->name]);
}
/**
@ -160,9 +160,9 @@ class PushService
private function entityViewedMessage($invoice)
{
if($invoice->is_quote)
return "Quote #{$invoice->invoice_number} viewed!";
return trans("texts.notification_quote_viewed_subject", ['invoice' => $invoice->invoice_number, 'client' => $invoice->client->name]);
else
return "Invoice #{$invoice->invoice_number} viewed!";
return trans("texts.notification_invoice_viewed_subject", ['invoice' => $invoice->invoice_number, 'client' => $invoice->client->name]);
}