mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-12 14:12:44 +01:00
commit
01ca591026
@ -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]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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!";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user