mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 08:17:32 -05:00 
			
		
		
		
	Fixes for notifications (#3427)
* Fix for pdf_variables * Fixes for notification
This commit is contained in:
		
							parent
							
								
									804153b049
								
							
						
					
					
						commit
						ff5a850e8d
					
				@ -145,6 +145,7 @@ class PreviewController extends BaseController
 | 
				
			|||||||
                ]);
 | 
					                ]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            $invoice->setRelation('client', $client);
 | 
					            $invoice->setRelation('client', $client);
 | 
				
			||||||
 | 
					            $invoice->setRelation('company', auth()->user()->company());
 | 
				
			||||||
            $invoice->load('client');
 | 
					            $invoice->load('client');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            $invoice_design = new Custom((object)request()->input('body'));
 | 
					            $invoice_design = new Custom((object)request()->input('body'));
 | 
				
			||||||
 | 
				
			|||||||
@ -42,6 +42,8 @@ class EntityViewedNotification extends Notification implements ShouldQueue
 | 
				
			|||||||
        $this->company = $invitation->company;
 | 
					        $this->company = $invitation->company;
 | 
				
			||||||
        $this->settings = $this->entity->client->getMergedSettings();
 | 
					        $this->settings = $this->entity->client->getMergedSettings();
 | 
				
			||||||
        $this->is_system = $is_system;
 | 
					        $this->is_system = $is_system;
 | 
				
			||||||
 | 
					        $this->invitation = $invitation;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
@ -128,7 +130,7 @@ class EntityViewedNotification extends Notification implements ShouldQueue
 | 
				
			|||||||
        $amount = Number::formatMoney($this->entity->amount, $this->entity->client);
 | 
					        $amount = Number::formatMoney($this->entity->amount, $this->entity->client);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $data = [
 | 
					        $data = [
 | 
				
			||||||
            'title' => $subject,
 | 
					            'title' => $this->buildSubject(),
 | 
				
			||||||
            'message' => ctrans("texts.notification_{$this->entity_name}_viewed", 
 | 
					            'message' => ctrans("texts.notification_{$this->entity_name}_viewed", 
 | 
				
			||||||
                [
 | 
					                [
 | 
				
			||||||
                    'amount' => $amount, 
 | 
					                    'amount' => $amount, 
 | 
				
			||||||
 | 
				
			|||||||
@ -47,7 +47,7 @@ class ClientContactTransformer extends EntityTransformer
 | 
				
			|||||||
            'contact_key' => $contact->contact_key ?: '',
 | 
					            'contact_key' => $contact->contact_key ?: '',
 | 
				
			||||||
            'send_email' => (bool) $contact->send_email,
 | 
					            'send_email' => (bool) $contact->send_email,
 | 
				
			||||||
            'last_login' => (int)$contact->last_login,
 | 
					            'last_login' => (int)$contact->last_login,
 | 
				
			||||||
            'password' => isset($contact->password) ? '*****' : '',
 | 
					            'password' => empty($contact->password) ? '' : '**********',
 | 
				
			||||||
        ];
 | 
					        ];
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -66,6 +66,9 @@ trait SettingsSaver
 | 
				
			|||||||
        $settings = (object)$settings;
 | 
					        $settings = (object)$settings;
 | 
				
			||||||
        $casts = CompanySettings::$casts;
 | 
					        $casts = CompanySettings::$casts;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if(property_exists($settings, 'pdf_variables'))
 | 
				
			||||||
 | 
					            unset($settings->pdf_variables);
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
        ksort($casts);
 | 
					        ksort($casts);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        foreach ($casts as $key => $value) {
 | 
					        foreach ($casts as $key => $value) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user