Merge pull request #903 from cachethq/schedule-incident-times

Show the scheduled time if applicable. Closes #799
This commit is contained in:
James Brooks 2015-08-14 08:29:50 +01:00
commit ee0899f5c3
6 changed files with 18 additions and 2 deletions

View File

@ -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'),

View File

@ -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())

View File

@ -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(),
]);

View File

@ -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.
*

View File

@ -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>

View File

@ -1,5 +1,7 @@
{!! trans('cachet.subscriber.email.maintenance.text', ['app_name' => Setting::get('app_name')]) !!}
{{ $scheduled_at }}
{!! $status !!}
{!! $textContent !!}