This commit is contained in:
romankko2 committed 2023-07-21 16:23:38 +02:00
commit 2655ba1e7f
11 files changed
+57 -13

No files matched your search

+5 -1
View File
@@ -16,6 +16,7 @@ class MasterTaskEdited extends Mailable
public $mastertask; public $mastertask;
public $difference; public $difference;
public $creator;
/** /**
* Create a new message instance. * Create a new message instance.
@@ -24,8 +25,11 @@ class MasterTaskEdited extends Mailable
*/ */
public function __construct(MasterTask $mastertask, $difference) public function __construct(MasterTask $mastertask, $difference)
{ {
$creator = \App\Models\User::find($mastertask->created_by);
$this->mastertask = $mastertask; $this->mastertask = $mastertask;
$this->difference = $difference; $this->difference = $difference;
$this->creator = ($creator) ? $creator->firstname . ' ' . $creator->lastname : '';
} }
/** /**
@@ -36,7 +40,7 @@ class MasterTaskEdited extends Mailable
public function envelope() public function envelope()
{ {
return new Envelope( return new Envelope(
subject: 'Master Task Edited', subject: 'Bol editovaný Task ' . $this->mastertask->project->code . ' - ' . $this->mastertask->title,
); );
} }
+5 -1
View File
@@ -15,6 +15,7 @@ class MasterTaskReopened extends Mailable
use Queueable, SerializesModels; use Queueable, SerializesModels;
public $mastertask; public $mastertask;
public $creator;
/** /**
* Create a new message instance. * Create a new message instance.
@@ -23,7 +24,10 @@ class MasterTaskReopened extends Mailable
*/ */
public function __construct(MasterTask $mastertask) public function __construct(MasterTask $mastertask)
{ {
$creator = \App\Models\User::find($mastertask->created_by);
$this->mastertask = $mastertask; $this->mastertask = $mastertask;
$this->creator = ($creator) ? $creator->firstname . ' ' . $creator->lastname : '';
} }
/** /**
@@ -34,7 +38,7 @@ class MasterTaskReopened extends Mailable
public function envelope() public function envelope()
{ {
return new Envelope( return new Envelope(
subject: 'Master Task ' . $this->mastertask->title . ' was reopened', subject: 'Bol znovuotvorený Master Task ' . $this->mastertask->project->code . ' - ' . $this->mastertask->title,
); );
} }
+5 -1
View File
@@ -15,6 +15,7 @@ class NewTask extends Mailable
use Queueable, SerializesModels; use Queueable, SerializesModels;
public $subtask; public $subtask;
public $creator;
/** /**
* Create a new message instance. * Create a new message instance.
@@ -23,6 +24,9 @@ class NewTask extends Mailable
*/ */
public function __construct(Subtask $subtask) public function __construct(Subtask $subtask)
{ {
$creator = \App\Models\User::find($subtask->created_by);
$this->creator = ($creator) ? $creator->firstname . ' ' . $creator->lastname : '';
$this->subtask = $subtask; $this->subtask = $subtask;
} }
@@ -34,7 +38,7 @@ class NewTask extends Mailable
public function envelope() public function envelope()
{ {
return new Envelope( return new Envelope(
subject: 'New Task', subject: 'Bol vytvorený Sub Task ' . $this->subtask->mastertask->project->code . ' - ' . ($this->subtask->title) ?: $this->subtask->mastertask->title,
); );
} }
+5 -1
View File
@@ -15,6 +15,7 @@ class SubTaskDeleted extends Mailable
use Queueable, SerializesModels; use Queueable, SerializesModels;
public $subtask; public $subtask;
public $creator;
/** /**
* Create a new message instance. * Create a new message instance.
@@ -23,6 +24,9 @@ class SubTaskDeleted extends Mailable
*/ */
public function __construct(SubTask $subtask) public function __construct(SubTask $subtask)
{ {
$creator = \App\Models\User::find($subtask->created_by);
$this->creator = ($creator) ? $creator->firstname . ' ' . $creator->lastname : '';
$this->subtask = $subtask; $this->subtask = $subtask;
} }
@@ -34,7 +38,7 @@ class SubTaskDeleted extends Mailable
public function envelope() public function envelope()
{ {
return new Envelope( return new Envelope(
subject: 'Sub Task ' . $this->subtask->mastertask->title . ' was deleted', subject: 'Bol vytvorený Sub Task ' . $this->subtask->mastertask->project->code . ' - ' . ($this->subtask->title) ?: $this->subtask->mastertask->title,
); );
} }
+5 -1
View File
@@ -16,6 +16,7 @@ class SubTaskEdited extends Mailable
public $subtask; public $subtask;
public $difference; public $difference;
public $creator;
/** /**
* Create a new message instance. * Create a new message instance.
@@ -24,6 +25,9 @@ class SubTaskEdited extends Mailable
*/ */
public function __construct(SubTask $subtask, array $difference) public function __construct(SubTask $subtask, array $difference)
{ {
$creator = \App\Models\User::find($subtask->created_by);
$this->creator = ($creator) ? $creator->firstname . ' ' . $creator->lastname : '';
$this->subtask = $subtask; $this->subtask = $subtask;
$this->difference = $difference; $this->difference = $difference;
} }
@@ -36,7 +40,7 @@ class SubTaskEdited extends Mailable
public function envelope() public function envelope()
{ {
return new Envelope( return new Envelope(
subject: 'Sub Task Edited', subject: 'Bol editovaný Sub Task ' . $this->subtask->mastertask->project->code . ' - ' . ($this->subtask->title) ?: $this->subtask->mastertask->title,
); );
} }
+2
View File
@@ -153,6 +153,8 @@ class KaratService
$notSyncedTimesheets->each(function ($timesheet) { $notSyncedTimesheets->each(function ($timesheet) {
if ($timesheet->subtask && $timesheet->subtask->mastertask->project) if ($timesheet->subtask && $timesheet->subtask->mastertask->project)
$this->syncTimesheet($timesheet); $this->syncTimesheet($timesheet);
else
echo "Timesheet with id: " . $timesheet->id . " has no project, subtask or mastertask" . PHP_EOL;
}); });
} }
@@ -1,6 +1,11 @@
Master Task edited. <br><br> Task založil: {{$creator}} <br>
Job number: {{$mastertask->project->code}} <br>
Edited fields: <br> <br> Názov Tasku: {{$mastertask->title}} <br>
Deadline do: {{$mastertask->deadline}} <br>
Odkaz na Task: {{ url( env( 'APP_URL_FE' ) . '/#/app/dashboard/projects?mastertask=' . $mastertask->id) }} <br>
Čo sa stalo v tasku: <br>
@foreach($difference as $key => $diff) @foreach($difference as $key => $diff)
{{ $key }}: {{ $diff }} <br> {{ $key }}: {{ $diff }} <br>
@endforeach @endforeach
@@ -1 +1,6 @@
Master Task {{$mastertask->title}} was reopened. <br><br> Task založil: {{$creator}} <br>
Job number: {{$mastertask->project->code}} <br>
Názov Tasku: {{$mastertask->title}} <br>
Deadline do: {{$mastertask->deadline}} <br>
Odkaz na Task: {{ url( env( 'APP_URL_FE' ) . '/#/app/dashboard/projects?mastertask=' . $mastertask->id) }} <br>
@@ -1 +1,5 @@
New task created: {{ $subtask->mastertask->title }} Task založil: {{$creator}} <br>
Job number: {{$subtask->mastertask->project->code}} <br>
Názov Tasku: {{($subtask->title) ?: $subtask->mastertask->title}} <br>
Deadline do: {{$subtask->deadline}} <br>
Odkaz na Task: {{ url( env( 'APP_URL_FE' ) . '/#/app/dashboard/tasks?subtask=' . $subtask->id) }} <br>
@@ -1 +1,5 @@
Sub Task {{$subtask->mastertask->title}} was deleted. <br><br> Task založil: {{$creator}} <br>
Job number: {{$subtask->mastertask->project->code}} <br>
Názov Tasku: {{($subtask->title) ?: $subtask->mastertask->title}} <br>
Deadline do: {{$subtask->deadline}} <br>
Odkaz na Task: {{ url( env( 'APP_URL_FE' ) . '/#/app/dashboard/tasks?subtask=' . $subtask->id) }} <br>
@@ -1,6 +1,10 @@
Sub Task edited. <br><br> Task založil: {{$creator}} <br>
Job number: {{$subtask->mastertask->project->code}} <br>
Názov Tasku: {{($subtask->title) ?: $subtask->mastertask->title}} <br>
Deadline do: {{$subtask->deadline}} <br>
Odkaz na Task: {{ url( env( 'APP_URL_FE' ) . '/#/app/dashboard/tasks?subtask=' . $subtask->id) }} <br>
Edited fields: <br> <br> Čo sa stalo v tasku: <br>
@foreach($difference as $key => $diff) @foreach($difference as $key => $diff)
{{ $key }}: {{ $diff }} <br> {{ $key }}: {{ $diff }} <br>
@endforeach @endforeach