mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
merge fixes
This commit is contained in:
parent
ddf5fa8938
commit
b169864510
@ -18,43 +18,28 @@ class SubscriptionListener
|
|||||||
{
|
{
|
||||||
public function createdClient(ClientWasCreated $event)
|
public function createdClient(ClientWasCreated $event)
|
||||||
{
|
{
|
||||||
if ( ! Auth::check()) {
|
$transformer = new ClientTransformer($event->client->account);
|
||||||
return;
|
|
||||||
}
|
|
||||||
$transformer = new ClientTransformer(Auth::user()->account);
|
|
||||||
$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_CLIENT, $event->client, $transformer);
|
$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_CLIENT, $event->client, $transformer);
|
||||||
}
|
}
|
||||||
public function createdQuote(QuoteWasCreated $event)
|
public function createdQuote(QuoteWasCreated $event)
|
||||||
{
|
{
|
||||||
if ( ! Auth::check()) {
|
$transformer = new InvoiceTransformer($event->quote->account);
|
||||||
return;
|
|
||||||
}
|
|
||||||
$transformer = new InvoiceTransformer(Auth::user()->account);
|
|
||||||
$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_QUOTE, $event->quote, $transformer, ENTITY_CLIENT);
|
$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_QUOTE, $event->quote, $transformer, ENTITY_CLIENT);
|
||||||
}
|
}
|
||||||
public function createdPayment(PaymentWasCreated $event)
|
public function createdPayment(PaymentWasCreated $event)
|
||||||
{
|
{
|
||||||
if ( ! Auth::check()) {
|
$transformer = new PaymentTransformer($event->payment->account);
|
||||||
return;
|
|
||||||
}
|
|
||||||
$transformer = new PaymentTransformer(Auth::user()->account);
|
|
||||||
$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_PAYMENT, $event->payment, $transformer, [ENTITY_CLIENT, ENTITY_INVOICE]);
|
$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_PAYMENT, $event->payment, $transformer, [ENTITY_CLIENT, ENTITY_INVOICE]);
|
||||||
}
|
}
|
||||||
public function createdCredit(CreditWasCreated $event)
|
|
||||||
{
|
|
||||||
if ( ! Auth::check()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_CREDIT, $event->credit);
|
|
||||||
}
|
|
||||||
public function createdInvoice(InvoiceWasCreated $event)
|
public function createdInvoice(InvoiceWasCreated $event)
|
||||||
{
|
{
|
||||||
if ( ! Auth::check()) {
|
$transformer = new InvoiceTransformer($event->invoice->account);
|
||||||
return;
|
|
||||||
}
|
|
||||||
$transformer = new InvoiceTransformer(Auth::user()->account);
|
|
||||||
$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_INVOICE, $event->invoice, $transformer, ENTITY_CLIENT);
|
$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_INVOICE, $event->invoice, $transformer, ENTITY_CLIENT);
|
||||||
}
|
}
|
||||||
|
public function createdCredit(CreditWasCreated $event)
|
||||||
|
{
|
||||||
|
//$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_CREDIT, $event->credit);
|
||||||
|
}
|
||||||
public function createdVendor(VendorWasCreated $event)
|
public function createdVendor(VendorWasCreated $event)
|
||||||
{
|
{
|
||||||
//$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_VENDOR, $event->vendor);
|
//$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_VENDOR, $event->vendor);
|
||||||
@ -72,6 +57,10 @@ class SubscriptionListener
|
|||||||
$manager->parseIncludes($include);
|
$manager->parseIncludes($include);
|
||||||
$resource = new Item($entity, $transformer, $entity->getEntityType());
|
$resource = new Item($entity, $transformer, $entity->getEntityType());
|
||||||
$data = $manager->createData($resource)->toArray();
|
$data = $manager->createData($resource)->toArray();
|
||||||
|
// For legacy Zapier support
|
||||||
|
if (isset($data['client_id'])) {
|
||||||
|
$data['client_name'] = $entity->client->getDisplayName();
|
||||||
|
}
|
||||||
Utils::notifyZapier($subscription, $data);
|
Utils::notifyZapier($subscription, $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user