mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-01-18 05:58:18 +01:00
Merge pull request #903 from cachethq/schedule-incident-times
Show the scheduled time if applicable. Closes #799
This commit is contained in:
commit
ee0899f5c3
@ -70,6 +70,7 @@ class SendMaintenanceEmailNotificationHandler
|
||||
'status' => $data->humanStatus,
|
||||
'htmlContent' => $data->formattedMessage,
|
||||
'textContent' => $data->message,
|
||||
'scheduled_at' => $data->scheduled_at_formatted,
|
||||
'token' => $subscriber->token,
|
||||
'unsubscribeLink' => route('subscribe.unsubscribe', ['code' => $subscriber->verify_code]),
|
||||
'appUrl' => env('APP_URL'),
|
||||
|
@ -109,7 +109,7 @@ class ScheduleController extends Controller
|
||||
$scheduleData['status'] = 0;
|
||||
|
||||
try {
|
||||
Incident::create($scheduleData);
|
||||
$incident = Incident::create($scheduleData);
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('dashboard.schedule.add')
|
||||
->withInput(Binput::all())
|
||||
|
@ -160,7 +160,7 @@ class IncidentPresenter extends AbstractPresenter
|
||||
public function toArray()
|
||||
{
|
||||
return array_merge($this->wrappedObject->toArray(), [
|
||||
'scheduled_at' => $this->created_at(),
|
||||
'scheduled_at' => $this->scheduled_at(),
|
||||
'created_at' => $this->created_at(),
|
||||
'updated_at' => $this->updated_at(),
|
||||
]);
|
||||
|
@ -26,6 +26,17 @@ trait TimestampsTrait
|
||||
->setTimezone($this->setting->get('app_timezone'))->toDateTimeString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Present formatted date time.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function scheduled_at()
|
||||
{
|
||||
return (new Date($this->wrappedObject->scheduled_at))
|
||||
->setTimezone($this->setting->get('app_timezone'))->toDateTimeString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Present formatted date time.
|
||||
*
|
||||
|
@ -7,6 +7,8 @@
|
||||
@section('content')
|
||||
{!! trans('cachet.subscriber.email.maintenance.html', ['app_name' => Setting::get('app_name')]) !!}
|
||||
|
||||
<p>{{ $scheduled_at }}</p>
|
||||
|
||||
<p>
|
||||
{!! $status !!}
|
||||
</p>
|
||||
|
@ -1,5 +1,7 @@
|
||||
{!! trans('cachet.subscriber.email.maintenance.text', ['app_name' => Setting::get('app_name')]) !!}
|
||||
|
||||
{{ $scheduled_at }}
|
||||
|
||||
{!! $status !!}
|
||||
|
||||
{!! $textContent !!}
|
||||
|
Loading…
x
Reference in New Issue
Block a user